Commit 634867f4 authored by Ana Ellis's avatar Ana Ellis
Browse files

feat: swap selectors in test

parent eb88c546
Pipeline #7657 failed with stages
in 5 minutes and 50 seconds
......@@ -65,74 +65,69 @@ test
JSON.parse(JSON.stringify(config.get('pubsweet-component-ink-backend'))),
JSON.parse(JSON.stringify(config.get('pubsweet-component-ink-backend'))),
)
teardown()
})
test
.before(async t => {
await setupWithTwoUnsubmittedManuscripts()
await login.doLogin('john', 'johnjohn')
})('Author submits manuscript', async t => {
await t
.wait(1000)
.click(dashboard.submissionSummaryInfoLink(1))
.wait(1000)
.click(submission.submit.withText('SUBMIT YOUR MANUSCRIPT'))
.wait(1000)
.expect(confirmation.returnToSubmission.exists)
await t.wait(500).click(confirmation.returnToSubmission)
await t
.expect(
Selector(submission.submit.withText('SUBMIT YOUR MANUSCRIPT')).exists,
)
.ok()
await t.click(submission.submit.withText('SUBMIT YOUR MANUSCRIPT'))
await t
.wait(1000)
.click(submission.submit)
.expect(confirmation.submitManuscript.exists)
.ok()
await t.wait(1000).click(confirmation.submitManuscript)
await t
.expect(Selector(dashboard.myManuscriptsTitle).exists) // fails when admin user == false
.ok()
await t
.expect(Selector(dashboard.manuscript(1)).exists)
.ok()
.expect(Selector(dashboard.manuscriptStatus(1)).exists)
.ok()
.expect(dashboard.manuscriptStatus(1).innerText)
.contains('SUBMITTED')
.expect(Selector(dashboard.submissionStatus(1)).exists)
.ok()
.expect(dashboard.submissionStatus(1).innerText)
.contains('UNSUBMITTED')
await t
.expect(Selector(dashboard.submissionStatus(2)).exists)
.ok()
.expect(dashboard.submissionStatus(2).innerText)
.contains('SUBMITTED')
.wait(5000)
await t
.expect(Selector(dashboard.submissionSummaryInfoLink(2)).exists)
.ok()
.click(dashboard.submissionSummaryInfoLink(2))
.wait(5000)
.expect(
Selector(submission.submit.withText('SUBMIT YOUR MANUSCRIPT')).exists,
)
.notOk()
})
.after(async t => {
teardown()
})
test.before(async t => {
await setupWithTwoUnsubmittedManuscripts()
await login.doLogin('john', 'johnjohn')
})('Author submits manuscript', async t => {
await t
.wait(1000)
.click(dashboard.submissionSummaryInfoLink(1))
.wait(1000)
.click(submission.submit.withText('SUBMIT YOUR MANUSCRIPT'))
.wait(1000)
.expect(confirmation.returnToSubmission.exists)
await t.wait(500).click(confirmation.returnToSubmission)
await t
.expect(
Selector(submission.submit.withText('SUBMIT YOUR MANUSCRIPT')).exists,
)
.ok()
await t.click(submission.submit.withText('SUBMIT YOUR MANUSCRIPT'))
await t
.wait(1000)
.click(submission.submit)
.expect(confirmation.submitManuscript.exists)
.ok()
await t.wait(1000).click(confirmation.submitManuscript)
await t
.expect(Selector(dashboard.myManuscriptsTitle).exists) // fails when admin user == false
.ok()
await t
.expect(Selector(dashboard.manuscript(1)).exists)
.ok()
.expect(Selector(dashboard.manuscriptStatus(1)).exists)
.ok()
.expect(dashboard.manuscriptStatus(1).innerText)
.contains('SUBMITTED')
.expect(Selector(dashboard.submissionStatus(1)).exists)
.ok()
.expect(dashboard.submissionStatus(1).innerText)
.contains('UNSUBMITTED')
await t
.expect(Selector(dashboard.submissionStatus(2)).exists)
.ok()
.expect(dashboard.submissionStatus(2).innerText)
.contains('SUBMITTED')
.wait(5000)
await t
.expect(Selector(dashboard.submissionSummaryInfoLink(1)).exists)
.ok()
.click(dashboard.submissionSummaryInfoLink(1))
.wait(5000)
.expect(
Selector(submission.submit.withText('SUBMIT YOUR MANUSCRIPT')).exists,
)
.notOk()
})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment