Commit 31ce0de6 authored by Ana Ellis's avatar Ana Ellis
Browse files

feat: e2e test for revise decision

parent 3b659fe3
......@@ -34,10 +34,10 @@ test('Editor decision - Accept', async t => {
await t.click(dashboard.manuscriptControlPanel(1)).wait(1000)
await t.expect(await Selector(controlPanel.editorDecision).exists).ok()
await t.expect(await Selector(controlPanel.editorDecisionInput).exists).ok()
await t
.typeText(controlPanel.editorDecision, faker.lorem.words(3))
.typeText(controlPanel.editorDecisionInput, faker.lorem.words(3))
.pressKey('tab')
.wait(1000)
.click(controlPanel.accept)
......@@ -55,7 +55,7 @@ test('Editor decision - Accept', async t => {
await t
.click(dashboard.manuscriptDecisionAccept(1))
.wait(1000)
.expect(await Selector(controlPanel.editorDecision).exists)
.expect(await Selector(controlPanel.editorDecisionInput).exists)
.notOk()
})
......@@ -70,10 +70,10 @@ test('Editor decision - Reject', async t => {
await t.click(dashboard.manuscriptControlPanel(1)).wait(1000)
await t.expect(await Selector(controlPanel.editorDecision).exists).ok()
await t.expect(await Selector(controlPanel.editorDecisionInput).exists).ok()
await t
.typeText(controlPanel.editorDecision, faker.lorem.words(3))
.typeText(controlPanel.editorDecisionInput, faker.lorem.words(3))
.pressKey('tab')
.wait(1000)
.click(controlPanel.reject)
......@@ -91,6 +91,50 @@ test('Editor decision - Reject', async t => {
await t
.click(dashboard.manuscriptDecisionReject(1))
.wait(1000)
.expect(await Selector(controlPanel.editorDecision).exists)
.expect(await Selector(controlPanel.editorDecisionInput).exists)
.notOk()
})
test('Editor decision - Revise', async t => {
await t.expect(Selector(dashboard.manuscript(1)).exists).ok()
await t
.expect(dashboard.manuscriptStatus(1).innerText)
.contains('SUBMITTED')
.expect(await Selector(dashboard.manuscriptControlPanel(1)).exists)
.ok()
.expect(await Selector(dashboard.completedReview(1)).exists)
.ok()
await t.click(dashboard.manuscriptControlPanel(1)).wait(1000)
await t.expect(await Selector(controlPanel.editorDecisionInput).exists).ok()
await t
.typeText(controlPanel.editorDecisionInput, faker.lorem.words(3))
.pressKey('tab')
.wait(1000)
.click(controlPanel.revise)
.click(controlPanel.submit)
.wait(1000) // redirects to dashboard
await t
.expect(dashboard.manuscriptStatus(1).innerText)
.contains('BACK WITH AUTHOR FOR REVISION')
.expect(await Selector(dashboard.manuscriptDecisionAccept(1)).exists)
.notOk()
.expect(await Selector(dashboard.manuscriptDecisionReject(1)).exists)
.notOk()
.expect(dashboard.submissionStatus(1).innerText)
.contains('BACK WITH AUTHOR FOR REVISION')
await t
.click(dashboard.manuscriptDecisionRevise(1))
.wait(1000)
.expect(await Selector(controlPanel.recordedDecision).exists)
.ok()
.expect(controlPanel.recordedDecision.innerText)
.contains('revise')
.expect(await Selector(controlPanel.editorDecisionInput).exists)
.notOk()
})
......@@ -5,10 +5,14 @@ const controlPanel = {
url: `${config.get('pubsweet-server.baseUrl')}`,
collabraHome: Selector('nav a'),
editorDecision: Selector(
editorDecisionInput: Selector(
'div[name="note.content"] div[contenteditable=true]',
),
recordedDecision: Selector('div div div')
.withText('Decision')
.nextSibling(0),
accept: Selector('span').withText('Accept'),
revise: Selector('span').withText('Revise'),
reject: Selector('span').withText('Reject'),
......
......@@ -81,6 +81,11 @@ const dashboard = {
.child(n)
.child('a')
.withText('Decision: reject'),
manuscriptDecisionRevise: n =>
dashboard.myManuscripts
.child(n)
.child('a')
.withText('Decision: revise'),
manuscriptLink: Selector('div').withText('this is a test submission'),
invitedReviewsCount: Selector('span span')
.withText('invited')
......
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