Commit 97ad04e3 authored by Ana Ellis's avatar Ana Ellis

feat: new submission test, added tamlyns workaround for prosemirror

parent 9291dfc1
......@@ -3,6 +3,7 @@ import config from 'config'
import { addUser } from '@pubsweet/db-manager'
import { startServer, setup, setup2, teardown } from './helpers/setup'
import { login, dashboard, submission } from './pageObjects'
import { prepareEditor } from './helpers/prosemirror-helper'
import { Selector, t } from 'testcafe'
......@@ -100,28 +101,6 @@ test.skip('Manage submissions journey, create new submission', async t => {
//.expect(dashboard.unsubmittedManuscripts.length).eql(2) //are
//.expect(dashboard.unsubmittedManuscript(1)).contains('Unsubmitted') //wrong
})
// // create a submisison
// // const submissionTitle = faker.lorem.words(20)
// // await t
// // .typeText(submission.newPostInput, postTitle)
// // .click(manageSubmissions.newPostButton)
// // .expect(manageSubmissions.postTitle(0).innerText)
// // .eql(submissionTitle)
// // // publish it
// // await t
// // .click(managePosts.postPublish(0))
// // .expect(managePosts.postPublish(0).exists)
// // .notOk()
// // .expect(managePosts.postUnpublish(0).exists)
// // .ok()
// // // delete it
// // await t
// // .click(managePosts.postDelete(0))
// // .expect(managePosts.post(0).exists)
// // .notOk()
// })
test('Manage submissions journey, failed new submission', async t => {
await t
......
......@@ -4,7 +4,19 @@ import ReactSelector from 'testcafe-react-selectors'
const submission = {
title: Selector('div[id="metadata.title"] div[contenteditable=true]'),
abstract: Selector('div[id="metadata.abstract"] div[contenteditable=true]'),
authors: Selector('div[id="metadata.authors"] input'),
addAuthor: Selector('div[id="metadata.authors"] button[type=button]'),
authorFirstName: Selector(
'div[id="metadata.authors"] input[name="metadata.authors[0].firstName"]',
),
authorLastName: Selector(
'div[id="metadata.authors"] input[name="metadata.authors[0].lastName"]',
),
authorEmail: Selector(
'div[id="metadata.authors"] input[name="metadata.authors[0].email"]',
),
authorAffiliation: Selector(
'div[id="metadata.authors"] input[name="metadata.authors[0].affiliation"]',
),
keywords: Selector('div[id="metadata.keywords"] input'),
articleType: Selector('div[id="metadata.articleType"] button'),
articleTypeOptions: Selector(
......@@ -26,7 +38,7 @@ const submission = {
preregisteredOptions: Selector('div[id="declarations.preregistered"] label'),
fundingAcknowledgement: Selector(
'div[id="notes.fundingAcknowledgement"] div[contenteditable=true]',
'div[id="notes.fundingAcknowledgement"] div[contenteditable]',
),
submit: Selector('button[type=button]').withText('Submit your manuscript'),
......
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