-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkp/pkp-lib#7191 Adapt content creation tests for new submission wizard
- Loading branch information
Showing
19 changed files
with
1,125 additions
and
387 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,15 +25,6 @@ describe('Data suite tests', function() { | |
authorNames: ['Arthur Clark'], | ||
sectionId: 1, | ||
assignedAuthorNames: ['Arthur Clark'], | ||
authors: [ | ||
{ | ||
givenName: 'Arthur', | ||
familyName: 'Clark', | ||
email: '[email protected]', | ||
country: 'Canada', | ||
affiliation: 'University of Calgary' | ||
} | ||
], | ||
files: [ | ||
{ | ||
'file': 'dummy.pdf', | ||
|
@@ -84,19 +75,13 @@ describe('Data suite tests', function() { | |
'country': 'Canada' | ||
}); | ||
|
||
// Go to page where CSRF token is available | ||
cy.visit('/index.php/publicknowledge/user/profile'); | ||
|
||
let csrfToken = ''; | ||
cy.getCsrfToken(); | ||
cy.window() | ||
.then((win) => { | ||
csrfToken = win.pkp.currentUser.csrfToken; | ||
}) | ||
.then(() => { | ||
return cy.createSubmissionWithApi(submission, csrfToken); | ||
return cy.createSubmissionWithApi(submission, this.csrfToken); | ||
}) | ||
.then(xhr => { | ||
return cy.submitSubmissionWithApi(submission.id, csrfToken); | ||
return cy.submitSubmissionWithApi(submission.id, this.csrfToken); | ||
}); | ||
cy.logout(); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,19 +11,17 @@ | |
*/ | ||
|
||
describe('Data suite tests', function() { | ||
it('Create a submission', function() { | ||
cy.register({ | ||
'username': 'bbeaty', | ||
'givenName': 'Bart', | ||
'familyName': 'Beaty', | ||
'affiliation': 'University of British Columbia', | ||
'country': 'Canada' | ||
}); | ||
|
||
var submission = { | ||
let submission; | ||
before(function() { | ||
const title = 'How Canadians Communicate: Contexts of Canadian Popular Culture'; | ||
submission = { | ||
id: 0, | ||
prefix: '', | ||
title: title, | ||
subtitle: '', | ||
'type': 'editedVolume', | ||
'series': 'History', | ||
'title': 'How Canadians Communicate: Contexts of Canadian Popular Culture', | ||
'abstract': 'What does Canadian popular culture say about the construction and negotiation of Canadian national identity? This third volume of How Canadians Communicate describes the negotiation of popular culture across terrains where national identity is built by producers and audiences, government and industry, history and geography, ethnicities and citizenships.', | ||
'keywords': [ | ||
'Canadian Studies', | ||
|
@@ -32,55 +30,103 @@ describe('Data suite tests', function() { | |
'submitterRole': 'Volume editor', | ||
'additionalAuthors': [ | ||
{ | ||
'givenName': 'Toby', | ||
'familyName': 'Miller', | ||
'country': 'Canada', | ||
'affiliation': 'University of Alberta', | ||
'givenName': {en_US: 'Toby'}, | ||
'familyName': {en_US: 'Miller'}, | ||
'country': 'CA', | ||
'affiliation': {en_US: 'University of Alberta'}, | ||
'email': '[email protected]', | ||
'role': 'Author', | ||
userGroupId: Cypress.env('authorUserGroupId') | ||
}, | ||
{ | ||
'givenName': 'Ira', | ||
'familyName': 'Wagman', | ||
'country': 'Canada', | ||
'affiliation': 'Athabasca University', | ||
'givenName': {en_US: 'Ira'}, | ||
'familyName': {en_US: 'Wagman'}, | ||
'country': 'CA', | ||
'affiliation': {en_US: 'Athabasca University'}, | ||
'email': '[email protected]', | ||
'role': 'Author', | ||
userGroupId: Cypress.env('authorUserGroupId') | ||
}, | ||
{ | ||
'givenName': 'Will', | ||
'familyName': 'Straw', | ||
'country': 'Canada', | ||
'affiliation': 'University of Calgary', | ||
'givenName': {en_US: 'Will'}, | ||
'familyName': {en_US: 'Straw'}, | ||
'country': 'CA', | ||
'affiliation': {en_US: 'University of Calgary'}, | ||
'email': '[email protected]', | ||
'role': 'Author', | ||
userGroupId: Cypress.env('authorUserGroupId') | ||
}, | ||
], | ||
'chapters': [ | ||
{ | ||
'title': 'Introduction: Contexts of Popular Culture', | ||
'contributors': ['Bart Beaty'], | ||
files: ['intro.pdf'] | ||
}, | ||
{ | ||
'title': 'Chapter 1. A Future for Media Studies: Cultural Labour, Cultural Relations, Cultural Politics', | ||
'contributors': ['Toby Miller'], | ||
files: ['chapter1.pdf'] | ||
}, | ||
{ | ||
'title': 'Chapter 2. Log On, Goof Off, and Look Up: Facebook and the Rhythms of Canadian Internet Use', | ||
'contributors': ['Ira Wagman'], | ||
files: ['chapter2.pdf'] | ||
}, | ||
{ | ||
'title': 'Chapter 3. Hawkers and Public Space: Free Commuter Newspapers in Canada', | ||
'contributors': ['Will Straw'], | ||
files: ['chapter3.pdf'] | ||
}, | ||
], | ||
files: [ | ||
{ | ||
'file': 'dummy.pdf', | ||
'fileName': 'chapter1.pdf', | ||
'mimeType': 'application/pdf', | ||
'genre': Cypress.env('defaultGenre') | ||
}, | ||
{ | ||
'file': 'dummy.pdf', | ||
'fileName': 'chapter2.pdf', | ||
'mimeType': 'application/pdf', | ||
'genre': Cypress.env('defaultGenre') | ||
}, | ||
{ | ||
'file': 'dummy.pdf', | ||
'fileName': 'chapter3.pdf', | ||
'mimeType': 'application/pdf', | ||
'genre': Cypress.env('defaultGenre') | ||
}, | ||
] | ||
}; | ||
cy.createSubmission(submission); | ||
{ | ||
'file': 'dummy.pdf', | ||
'fileName': 'intro.pdf', | ||
'mimeType': 'application/pdf', | ||
'genre': Cypress.env('defaultGenre') | ||
} | ||
], | ||
} | ||
}); | ||
|
||
it('Create a submission', function() { | ||
cy.register({ | ||
'username': 'bbeaty', | ||
'givenName': 'Bart', | ||
'familyName': 'Beaty', | ||
'affiliation': 'University of British Columbia', | ||
'country': 'Canada' | ||
}); | ||
|
||
cy.getCsrfToken(); | ||
cy.window() | ||
.then(() => { | ||
return cy.createSubmissionWithApi(submission, this.csrfToken); | ||
}) | ||
.then(xhr => { | ||
return cy.submitSubmissionWithApi(submission.id, this.csrfToken); | ||
}); | ||
cy.logout(); | ||
|
||
cy.findSubmissionAsEditor('dbarnes', null, 'Beaty'); | ||
cy.clickDecision('Send to Internal Review'); | ||
cy.recordDecisionSendToReview('Send to Internal Review', ['Bart Beaty'], submission.chapters.map(chapter => chapter.title.substring(0, 35))); | ||
cy.recordDecisionSendToReview('Send to Internal Review', ['Bart Beaty'], submission.files.map(file => file.fileName)); | ||
cy.isActiveStageTab('Internal Review'); | ||
cy.assignReviewer('Aisla McCrae'); | ||
cy.clickDecision('Send to External Review'); | ||
|
Oops, something went wrong.