Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Kotahi
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Omo Oaiya
Kotahi
Commits
f2c8079f
Commit
f2c8079f
authored
4 years ago
by
sebastianrad
Browse files
Options
Downloads
Patches
Plain Diff
test: add tests for unsubmited articles and article title comlumn
parent
1d71485b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cypress/integration/elife/manuscripts_page_spec.js
+115
-6
115 additions, 6 deletions
cypress/integration/elife/manuscripts_page_spec.js
cypress/page-object/manuscripts-page.js
+15
-1
15 additions, 1 deletion
cypress/page-object/manuscripts-page.js
with
130 additions
and
7 deletions
cypress/integration/elife/manuscripts_page_spec.js
+
115
−
6
View file @
f2c8079f
...
@@ -2,6 +2,7 @@ import { ManuscriptsPage } from '../../page-object/manuscripts-page'
...
@@ -2,6 +2,7 @@ import { ManuscriptsPage } from '../../page-object/manuscripts-page'
import
{
NewSubmissionPage
}
from
'
../../page-object/new-submission-page
'
import
{
NewSubmissionPage
}
from
'
../../page-object/new-submission-page
'
import
{
SubmissionFormPage
}
from
'
../../page-object/submission-form-page
'
import
{
SubmissionFormPage
}
from
'
../../page-object/submission-form-page
'
import
{
manuscripts
}
from
'
../../support/routes
'
import
{
manuscripts
}
from
'
../../support/routes
'
import
{
Menu
}
from
'
../../page-object/page-component/menu
'
describe
(
'
Manuscripts page tests
'
,
()
=>
{
describe
(
'
Manuscripts page tests
'
,
()
=>
{
context
(
'
Elements visibility
'
,
()
=>
{
context
(
'
Elements visibility
'
,
()
=>
{
...
@@ -19,9 +20,92 @@ describe('Manuscripts page tests', () => {
...
@@ -19,9 +20,92 @@ describe('Manuscripts page tests', () => {
it
(
'
check Submit button is visible
'
,
()
=>
{
it
(
'
check Submit button is visible
'
,
()
=>
{
ManuscriptsPage
.
getSubmitButton
().
should
(
'
be.visible
'
)
ManuscriptsPage
.
getSubmitButton
().
should
(
'
be.visible
'
)
})
})
it
(
'
evaluation button is visible on unsubmited status article
'
,
()
=>
{
ManuscriptsPage
.
clickSubmit
()
NewSubmissionPage
.
clickSubmitURL
()
// fill the submit form and submit it
// eslint-disable-next-line jest/valid-expect-in-promise
cy
.
fixture
(
'
submission_form_data
'
).
then
(
data
=>
{
SubmissionFormPage
.
fillInArticleld
(
data
.
articleId
)
})
Menu
.
clickManuscripts
()
ManuscriptsPage
.
getEvaluationButton
().
should
(
'
be.visible
'
)
})
})
})
context
(
''
,
()
=>
{
context
(
'
unsubmitetd article tests
'
,
()
=>
{
beforeEach
(()
=>
{
// task to restore the database as per the dumps/initialState.sql
cy
.
task
(
'
restore
'
,
'
initialState
'
)
// login as admin
// eslint-disable-next-line jest/valid-expect-in-promise
cy
.
fixture
(
'
role_names
'
).
then
(
name
=>
{
cy
.
login
(
name
.
role
.
admin
,
manuscripts
)
})
ManuscriptsPage
.
clickSubmit
()
NewSubmissionPage
.
clickSubmitURL
()
// fill the submit form and submit it
// eslint-disable-next-line jest/valid-expect-in-promise
cy
.
fixture
(
'
submission_form_data
'
).
then
(
data
=>
{
SubmissionFormPage
.
fillInArticleld
(
data
.
articleId
)
})
Menu
.
clickManuscripts
()
})
it
(
'
unsubmited article is evaluated
'
,
()
=>
{
ManuscriptsPage
.
clickEvaluation
()
cy
.
url
().
should
(
'
contain
'
,
'
evaluation
'
)
// SubmissionFormPage.getArticleld().should('have.value', '')
SubmissionFormPage
.
getArticleUrl
().
should
(
'
have.value
'
,
''
)
// eslint-disable-next-line
SubmissionFormPage
.
getDescription
().
should
(
'
have.value
'
,
''
)
SubmissionFormPage
.
getEvaluationContent
()
.
find
(
'
p
'
)
.
should
(
'
have.value
'
,
''
)
// eslint-disable-next-line
SubmissionFormPage
.
getFormOptionValue
(
-
1
).
should
(
'
have.value
'
,
''
)
// eslint-disable-next-line jest/valid-expect-in-promise
cy
.
fixture
(
'
submission_form_data
'
).
then
(
data
=>
{
SubmissionFormPage
.
fillInArticleld
(
data
.
articleId
)
SubmissionFormPage
.
fillInArticleUrl
(
data
.
doi
)
SubmissionFormPage
.
fillInDescription
(
data
.
description
)
SubmissionFormPage
.
fillInEvaluationContent
(
data
.
evaluationContent
)
SubmissionFormPage
.
clickElementFromFormOptionList
(
4
)
SubmissionFormPage
.
selectDropdownOption
(
1
)
SubmissionFormPage
.
clickSubmitResearch
()
SubmissionFormPage
.
clickSubmitManuscript
()
})
ManuscriptsPage
.
getStatus
(
0
).
should
(
'
eq
'
,
'
evaluated
'
)
})
it
(
'
sort article after Article id
'
,
()
=>
{
ManuscriptsPage
.
clickSubmit
()
NewSubmissionPage
.
clickSubmitURL
()
SubmissionFormPage
.
fillInArticleld
(
'
456
'
)
Menu
.
clickManuscripts
()
ManuscriptsPage
.
clickSubmit
()
NewSubmissionPage
.
clickSubmitURL
()
SubmissionFormPage
.
fillInArticleld
(
'
abc
'
)
Menu
.
clickManuscripts
()
ManuscriptsPage
.
clickSubmit
()
NewSubmissionPage
.
clickSubmitURL
()
SubmissionFormPage
.
fillInArticleld
(
'
def
'
)
Menu
.
clickManuscripts
()
ManuscriptsPage
.
getArticleIdColumn
(
0
).
should
(
'
contain
'
,
'
def
'
)
ManuscriptsPage
.
getArticleIdColumn
(
1
).
should
(
'
contain
'
,
'
abc
'
)
ManuscriptsPage
.
getArticleIdColumn
(
2
).
should
(
'
contain
'
,
'
456
'
)
ManuscriptsPage
.
getArticleIdColumn
(
3
).
should
(
'
contain
'
,
'
123
'
)
ManuscriptsPage
.
clickArticleId
(
0
)
ManuscriptsPage
.
getArticleIdColumn
(
0
).
should
(
'
contain
'
,
'
123
'
)
ManuscriptsPage
.
getArticleIdColumn
(
1
).
should
(
'
contain
'
,
'
456
'
)
ManuscriptsPage
.
getArticleIdColumn
(
2
).
should
(
'
contain
'
,
'
abc
'
)
ManuscriptsPage
.
getArticleIdColumn
(
3
).
should
(
'
contain
'
,
'
def
'
)
})
})
context
(
'
Submited and evaluated article tests
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
// task to restore the database as per the dumps/initialState.sql
// task to restore the database as per the dumps/initialState.sql
cy
.
task
(
'
restore
'
,
'
initialState
'
)
cy
.
task
(
'
restore
'
,
'
initialState
'
)
...
@@ -56,11 +140,14 @@ describe('Manuscripts page tests', () => {
...
@@ -56,11 +140,14 @@ describe('Manuscripts page tests', () => {
ManuscriptsPage
.
getManuscriptsPageTitle
().
should
(
'
be.visible
'
)
ManuscriptsPage
.
getManuscriptsPageTitle
().
should
(
'
be.visible
'
)
ManuscriptsPage
.
getEvaluationButton
().
should
(
'
be.visible
'
)
ManuscriptsPage
.
getEvaluationButton
().
should
(
'
be.visible
'
)
ManuscriptsPage
.
getControlButton
().
should
(
'
not.exist
'
)
ManuscriptsPage
.
getControlButton
().
should
(
'
not.exist
'
)
ManuscriptsPage
.
getOptionWithText
(
'
Publish
'
).
should
(
'
be.visible
'
)
})
})
it
(
'
evaluate article and check status is changed
'
,
()
=>
{
it
(
'
evaluate article and check status is changed
'
,
()
=>
{
ManuscriptsPage
.
getStatus
(
0
).
should
(
'
eq
'
,
'
Submitted
'
)
ManuscriptsPage
.
getStatus
(
0
).
should
(
'
eq
'
,
'
Submitted
'
)
ManuscriptsPage
.
clickEvaluation
(
0
)
ManuscriptsPage
.
clickEvaluation
(
0
)
SubmissionFormPage
.
clickSubmitResearch
()
SubmissionFormPage
.
clickSubmitResearch
()
ManuscriptsPage
.
getStatus
(
0
).
should
(
'
eq
'
,
'
evaluated
'
)
ManuscriptsPage
.
getStatus
(
0
).
should
(
'
eq
'
,
'
evaluated
'
)
ManuscriptsPage
.
getEvaluationButton
().
should
(
'
be.visible
'
)
ManuscriptsPage
.
getEvaluationButton
().
should
(
'
be.visible
'
)
})
})
...
@@ -72,12 +159,18 @@ describe('Manuscripts page tests', () => {
...
@@ -72,12 +159,18 @@ describe('Manuscripts page tests', () => {
SubmissionFormPage
.
getArticleld
().
should
(
'
have.value
'
,
data
.
articleId
)
SubmissionFormPage
.
getArticleld
().
should
(
'
have.value
'
,
data
.
articleId
)
SubmissionFormPage
.
getArticleUrl
().
should
(
'
have.value
'
,
data
.
doi
)
SubmissionFormPage
.
getArticleUrl
().
should
(
'
have.value
'
,
data
.
doi
)
// eslint-disable-next-line
// eslint-disable-next-line
SubmissionFormPage
.
getDescription
().
should
(
'
have.value
'
,
data
.
description
)
SubmissionFormPage
.
getDescription
().
should
(
'
have.value
'
,
data
.
description
,
)
SubmissionFormPage
.
getEvaluationContent
()
SubmissionFormPage
.
getEvaluationContent
()
.
find
(
'
p
'
)
.
find
(
'
p
'
)
.
should
(
'
contain
'
,
data
.
evaluationContent
)
.
should
(
'
contain
'
,
data
.
evaluationContent
)
// eslint-disable-next-line
// eslint-disable-next-line
SubmissionFormPage
.
getFormOptionValue
(
-
1
).
should
(
'
contain
'
,
data
.
evaluationType
)
SubmissionFormPage
.
getFormOptionValue
(
-
1
).
should
(
'
contain
'
,
data
.
evaluationType
,
)
})
})
})
})
it
(
'
evaluation changes should be visible
'
,
()
=>
{
it
(
'
evaluation changes should be visible
'
,
()
=>
{
...
@@ -99,15 +192,31 @@ describe('Manuscripts page tests', () => {
...
@@ -99,15 +192,31 @@ describe('Manuscripts page tests', () => {
SubmissionFormPage
.
clickSubmitResearch
()
SubmissionFormPage
.
clickSubmitResearch
()
ManuscriptsPage
.
clickEvaluation
()
ManuscriptsPage
.
clickEvaluation
()
// eslint-disable-next-line
// eslint-disable-next-line
SubmissionFormPage
.
getArticleld
().
should
(
'
not.have.value
'
,
data
.
articleId
)
SubmissionFormPage
.
getArticleld
().
should
(
'
not.have.value
'
,
data
.
articleId
,
)
SubmissionFormPage
.
getArticleUrl
().
should
(
'
not.have.value
'
,
data
.
doi
)
SubmissionFormPage
.
getArticleUrl
().
should
(
'
not.have.value
'
,
data
.
doi
)
// eslint-disable-next-line
// eslint-disable-next-line
SubmissionFormPage
.
getDescription
().
should
(
'
not.have.value
'
,
data
.
description
)
SubmissionFormPage
.
getDescription
().
should
(
'
not.have.value
'
,
data
.
description
,
)
SubmissionFormPage
.
getEvaluationContent
()
SubmissionFormPage
.
getEvaluationContent
()
.
find
(
'
p
'
)
.
find
(
'
p
'
)
.
should
(
'
not.contain
'
,
data
.
evaluationContent
)
.
should
(
'
not.contain
'
,
data
.
evaluationContent
)
// eslint-disable-next-line
// eslint-disable-next-line
SubmissionFormPage
.
getFormOptionValue
(
-
1
).
should
(
'
not.contain
'
,
data
.
evaluationType
)
SubmissionFormPage
.
getFormOptionValue
(
-
1
).
should
(
'
not.contain
'
,
data
.
evaluationType
,
)
})
})
it
(
'
assert atricle id is the first table head and contains submitted atricle id title
'
,
()
=>
{
ManuscriptsPage
.
getTabelHead
(
0
).
should
(
'
contain
'
,
'
Article Id
'
)
// eslint-disable-next-line jest/valid-expect-in-promise
cy
.
fixture
(
'
submission_form_data
'
).
then
(
data
=>
{
ManuscriptsPage
.
getArticleIdColumn
(
0
).
should
(
'
contain
'
,
data
.
articleId
)
})
})
})
})
})
})
...
...
This diff is collapsed.
Click to expand it.
cypress/page-object/manuscripts-page.js
+
15
−
1
View file @
f2c8079f
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
* where users can see the list of submitted manuscripts & select Control,
* where users can see the list of submitted manuscripts & select Control,
* View or Delete.
* View or Delete.
*/
*/
const
MANUSCRIPTS_OPTIONS_LIST
=
'
[class*=
Tab
le__
LastCell] > a
'
const
MANUSCRIPTS_OPTIONS_LIST
=
'
[class*=
sty
le__
UserAction]
'
const
BUTTON
=
'
button
'
const
BUTTON
=
'
button
'
const
MANUSCRIPTS_PAGE_TITLE
=
'
[class*=General__Heading-sc]
'
const
MANUSCRIPTS_PAGE_TITLE
=
'
[class*=General__Heading-sc]
'
const
EVALUATION_BUTTON
=
'
[href*=evaluation]
'
const
EVALUATION_BUTTON
=
'
[href*=evaluation]
'
...
@@ -12,6 +12,8 @@ const CONTROL_BUTTON = '[href*=control]'
...
@@ -12,6 +12,8 @@ const CONTROL_BUTTON = '[href*=control]'
const
CREATED_CARET
=
'
Carets__Caret
'
const
CREATED_CARET
=
'
Carets__Caret
'
const
AUTHOR_FIELD
=
'
UserCombo__Primary
'
const
AUTHOR_FIELD
=
'
UserCombo__Primary
'
const
STATUS_FIELD
=
'
Badge__Status
'
const
STATUS_FIELD
=
'
Badge__Status
'
const
MANUSCRIPTS_TABLE_HEAD
=
'
[class*=Table__Header] > tr >th
'
const
ARTICLE_ID
=
'
[class*=Table__Row]>td:nth-child(1)
'
export
const
ManuscriptsPage
=
{
export
const
ManuscriptsPage
=
{
getManuscriptsOptionsList
()
{
getManuscriptsOptionsList
()
{
...
@@ -20,6 +22,9 @@ export const ManuscriptsPage = {
...
@@ -20,6 +22,9 @@ export const ManuscriptsPage = {
selectOptionWithText
(
text
)
{
selectOptionWithText
(
text
)
{
this
.
getManuscriptsOptionsList
().
contains
(
text
).
click
()
this
.
getManuscriptsOptionsList
().
contains
(
text
).
click
()
},
},
getOptionWithText
(
text
)
{
return
this
.
getManuscriptsOptionsList
().
contains
(
text
)
},
getSubmitButton
()
{
getSubmitButton
()
{
return
cy
.
get
(
BUTTON
).
contains
(
'
New submission
'
)
return
cy
.
get
(
BUTTON
).
contains
(
'
New submission
'
)
},
},
...
@@ -53,5 +58,14 @@ export const ManuscriptsPage = {
...
@@ -53,5 +58,14 @@ export const ManuscriptsPage = {
getStatus
(
nth
)
{
getStatus
(
nth
)
{
return
this
.
getStatusField
(
nth
).
invoke
(
'
text
'
)
return
this
.
getStatusField
(
nth
).
invoke
(
'
text
'
)
},
},
getTabelHead
(
nth
)
{
return
cy
.
get
(
MANUSCRIPTS_TABLE_HEAD
).
eq
(
nth
)
},
getArticleIdColumn
(
nth
)
{
return
cy
.
get
(
ARTICLE_ID
).
eq
(
nth
)
},
clickArticleId
()
{
cy
.
get
(
MANUSCRIPTS_TABLE_HEAD
).
eq
(
0
).
click
()
},
}
}
export
default
ManuscriptsPage
export
default
ManuscriptsPage
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment