From 097f5f0cc91c72eb73eb3ba6e34dde1fbde75eae Mon Sep 17 00:00:00 2001 From: Mark Patton Date: Tue, 26 Nov 2024 08:02:12 -0500 Subject: [PATCH] Handle publication date being required --- tests/baseCaseTests.js | 1 + tests/journalTests.js | 1 + tests/noJournalTests.js | 1 + tests/page_model/SubmissionMetadata.js | 15 +++++++++++++++ tests/proxySubmissionTests.js | 2 ++ 5 files changed, 20 insertions(+) diff --git a/tests/baseCaseTests.js b/tests/baseCaseTests.js index dd0d441..7924473 100644 --- a/tests/baseCaseTests.js +++ b/tests/baseCaseTests.js @@ -65,6 +65,7 @@ test('can walk through an nih submission workflow and make a submission - base c 'Quantitative profiling of carbonyl metabolites directly in crude biological extracts using chemoselective tagging and nanoESI-FTMS' ); await submissionMetadataPage.verifyJournalTitle('The Analyst'); + await submissionMetadataPage.inputPublicationDate('05/02/2010'); await submissionMetadataPage.clickNextToFiles(); diff --git a/tests/journalTests.js b/tests/journalTests.js index d670899..d0e1499 100644 --- a/tests/journalTests.js +++ b/tests/journalTests.js @@ -65,6 +65,7 @@ test('can walk through an submission workflow and make a submission with journal await submissionMetadataPage.verifyArticleTitle(submissionTitle); await submissionMetadataPage.verifyJournalTitle('PASS_E2E_TEST_JOURNAL'); await submissionMetadataPage.inputAuthor('PASS_E2E_TEST_AUTHOR'); + await submissionMetadataPage.inputPublicationDate('05/02/2010'); await submissionMetadataPage.clickNextToFiles(); diff --git a/tests/noJournalTests.js b/tests/noJournalTests.js index 8368e0a..d6d851a 100644 --- a/tests/noJournalTests.js +++ b/tests/noJournalTests.js @@ -61,6 +61,7 @@ test('can walk through a submission workflow and make a submission - without sel await submissionMetadataPage.verifyArticleTitle(submissionTitle); await submissionMetadataPage.verifyJournalTitle(''); await submissionMetadataPage.inputAuthor('PASS_E2E_TEST_AUTHOR'); + await submissionMetadataPage.inputPublicationDate('05/02/2010'); await submissionMetadataPage.clickNextToFiles(); await submissionFilesPage.verifyOAManuscriptsNotExists(); diff --git a/tests/page_model/SubmissionMetadata.js b/tests/page_model/SubmissionMetadata.js index 4855f50..7ba1a5f 100644 --- a/tests/page_model/SubmissionMetadata.js +++ b/tests/page_model/SubmissionMetadata.js @@ -43,6 +43,21 @@ class SubmissionMetadata { .typeText(authorInput, authorName, { paste: true, speed: 0.75 }); } + async inputPublicationDate(date) { + const publicationDateInput = Selector('input').withAttribute( + 'name', + 'publicationDate' + ); + await t + .expect(publicationDateInput.exists) + .ok() + .typeText(publicationDateInput, date, { + paste: false, + caretPos: 0, + speed: 0.1, + }); + } + async clickNextToFiles() { const goToFilesButton = Selector('.alpaca-form-button-Next'); await t.expect(goToFilesButton.exists).ok(); diff --git a/tests/proxySubmissionTests.js b/tests/proxySubmissionTests.js index d3bfd58..03b1d01 100644 --- a/tests/proxySubmissionTests.js +++ b/tests/proxySubmissionTests.js @@ -154,6 +154,8 @@ async function walkThroughSubmissionFlow(t, hasAccount) { 'Quantitative profiling of carbonyl metabolites directly in crude biological extracts using chemoselective tagging and nanoESI-FTMS' ); await submissionMetadataPage.verifyJournalTitle('The Analyst'); + await submissionMetadataPage.inputPublicationDate('05/02/2010'); + await submissionMetadataPage.clickNextToFiles(); await submissionFilesPage.verifyOAManuscriptUrl(