From 3849fc5cf95db8cf865622f4efd30da28a56ed0c Mon Sep 17 00:00:00 2001 From: Russ Poetker Date: Thu, 5 Sep 2024 08:06:40 -0400 Subject: [PATCH] Verify DOI manuscripts on Files page --- tests/baseCaseTests.js | 3 +++ tests/journalTests.js | 1 + tests/noJournalTests.js | 1 + tests/page_model/SubmissionFiles.js | 12 ++++++++++++ tests/proxySubmissionTests.js | 3 +++ 5 files changed, 20 insertions(+) diff --git a/tests/baseCaseTests.js b/tests/baseCaseTests.js index f784053..dd0d441 100644 --- a/tests/baseCaseTests.js +++ b/tests/baseCaseTests.js @@ -68,6 +68,9 @@ test('can walk through an nih submission workflow and make a submission - base c await submissionMetadataPage.clickNextToFiles(); + await submissionFilesPage.verifyOAManuscriptUrl( + 'https://europepmc.org/articles/pmc6759371?pdf=render' + ); await submissionFilesPage.uploadFile('my-submission.pdf'); await submissionFilesPage.clickNextToReview(); diff --git a/tests/journalTests.js b/tests/journalTests.js index 5f97e20..d670899 100644 --- a/tests/journalTests.js +++ b/tests/journalTests.js @@ -68,6 +68,7 @@ test('can walk through an submission workflow and make a submission with journal await submissionMetadataPage.clickNextToFiles(); + await submissionFilesPage.verifyOAManuscriptsNotExists(); await submissionFilesPage.uploadFile('my-submission.pdf'); await submissionFilesPage.clickNextToReview(); diff --git a/tests/noJournalTests.js b/tests/noJournalTests.js index e5c2d92..8368e0a 100644 --- a/tests/noJournalTests.js +++ b/tests/noJournalTests.js @@ -63,6 +63,7 @@ test('can walk through a submission workflow and make a submission - without sel await submissionMetadataPage.inputAuthor('PASS_E2E_TEST_AUTHOR'); await submissionMetadataPage.clickNextToFiles(); + await submissionFilesPage.verifyOAManuscriptsNotExists(); await submissionFilesPage.uploadFile('my-submission.pdf'); await submissionFilesPage.clickNextToReview(); diff --git a/tests/page_model/SubmissionFiles.js b/tests/page_model/SubmissionFiles.js index 6c0c24f..a35c1b1 100644 --- a/tests/page_model/SubmissionFiles.js +++ b/tests/page_model/SubmissionFiles.js @@ -65,6 +65,18 @@ class SubmissionFiles { .expect(currLocation()) .eql(`${PASS_BASE_URL}/app/submissions/new/review`); } + + async verifyOAManuscriptUrl(expectedUrl) { + const manuscriptUrl = Selector('span.pl-2').withText(expectedUrl); + await t.expect(manuscriptUrl.innerText).contains(expectedUrl); + } + + async verifyOAManuscriptsNotExists() { + const oaManuFound = Selector('p.text-muted').withText( + 'We found the following OA copies of your manuscript/article.' + ); + await t.expect(oaManuFound.exists).notOk(); + } } export default new SubmissionFiles(); diff --git a/tests/proxySubmissionTests.js b/tests/proxySubmissionTests.js index 2ef3b7d..d3bfd58 100644 --- a/tests/proxySubmissionTests.js +++ b/tests/proxySubmissionTests.js @@ -156,6 +156,9 @@ async function walkThroughSubmissionFlow(t, hasAccount) { await submissionMetadataPage.verifyJournalTitle('The Analyst'); await submissionMetadataPage.clickNextToFiles(); + await submissionFilesPage.verifyOAManuscriptUrl( + 'https://europepmc.org/articles/pmc6759371?pdf=render' + ); // Upload no file here await submissionFilesPage.clickNextToReviewNoFiles();