Skip to content

Commit

Permalink
pkp/pkp-lib#7495 OPS e2e tests migration for new submission listing a…
Browse files Browse the repository at this point in the history
…nd workflow side modal
  • Loading branch information
jardakotesovec committed Nov 7, 2024
1 parent 3e7ef4b commit 50b0385
Show file tree
Hide file tree
Showing 23 changed files with 94 additions and 73 deletions.
2 changes: 1 addition & 1 deletion config.TEMPLATE.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -626,4 +626,4 @@

[features]

enable_new_submission_listing = Off
enable_new_submission_listing = On
2 changes: 1 addition & 1 deletion cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import Api from '../../lib/pkp/cypress/support/api.js';
import '../../lib/pkp/cypress/support/commands';
import '../../lib/pkp/cypress/support/commands_new_workflow.js';

Cypress.Commands.add('addCategory', (categoryName, categoryPath) => {
cy.get('div.pkp_grid_category a[id^=component-grid-settings-category-categorycategorygrid-addCategory-button-]').click();
Expand Down
6 changes: 3 additions & 3 deletions cypress/tests/data/60-content/CkwantesSubmission.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,13 @@ describe('Data suite: Ckwantes', function() {
cy.get('a').contains('Create a new submission');
cy.get('a').contains('Return to your dashboard');
cy.get('a').contains('Review this submission').click();
cy.get('h1:contains("' + submission.title + '")');
cy.get('p:contains("' + submission.title + '")');
});

it('Publish submission', function() {
cy.findSubmissionAsEditor('dbarnes', null, 'Kwantes');
cy.get('.pkp_workflow_decisions button:contains("Post the preprint")').click();
cy.get('div.pkpPublication button:contains("Post"):visible').click();
cy.get('button:contains("Post the preprint")').click();
cy.get('button:contains("Post"):visible').click();
cy.get('div:contains("Are you sure you want to post this?")');
cy.get('[id^="publish"] button:contains("Post")').click();
});
Expand Down
33 changes: 18 additions & 15 deletions cypress/tests/data/60-content/CmontgomerieSubmission.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,47 +75,50 @@ describe('Data suite: Cmontgomerie', function() {

cy.logout();
cy.findSubmissionAsEditor('dbarnes', null, 'Montgomerie');
cy.get('.pkp_workflow_decisions button:contains("Post the preprint")').click();
cy.get('div.pkpPublication button:contains("Post"):visible').click();
cy.get('button:contains("Post the preprint")').click();
cy.get('button:contains("Post")').should('be.visible').click();
cy.get('div:contains("All requirements have been met. Are you sure you want to post this?")');
cy.get('[id^="publish"] button:contains("Post")').click();
cy.logout();

// Unpost 1st version
cy.findSubmissionAsEditor('dbarnes', null, 'Montgomerie');
cy.get('#publication-button').click();
cy.get('div.pkpPublication button:contains("Unpost"):visible').click();
cy.findSubmissionAsEditor('dbarnes', null, 'Montgomerie', null, 'Published');
cy.openWorkflowMenu('Title & Abstract')
cy.get('button:contains("Unpost")').should('be.visible').click();
cy.get('div:contains("Are you sure you don\'t want this to be posted?")');
cy.get('[role=dialog] button').contains('Unpost').click();
cy.get('[data-cy=dialog] button').contains('Unpost').click();

// Edit metadata in 1st version
cy.get('#metadata-button').click();
cy.openWorkflowMenu('Metadata')
cy.get('#metadata-keywords-control-en').type('employees{enter}');
cy.wait(500);
cy.get('#metadata-keywords-control-en').type('{enter}', {delay: 0});
cy.get('#metadata button').contains('Save').click();
cy.get('#metadata [role="status"]').contains('Saved');
cy.get('button').contains('Save').click();
cy.get('[role="status"]').contains('Saved');
cy.get('#metadata-keywords-selected-en').contains('employees');
cy.wait(1500);

// Publish 1st version again
cy.get('div.pkpPublication button:contains("Post"):visible').click();
cy.get('button:contains("Post")').click();
cy.get('div:contains("All requirements have been met. Are you sure you want to post this?")');
cy.get('[id^="publish"] button:contains("Post")').click();

// Create 2nd version and change copyright holder
cy.get('div.pkpPublication button:contains("Create New Version"):visible').click();
cy.get('button:contains("Create New Version")').should('be.visible').click();
cy.get('div:contains("Are you sure you want to create a new version?")');
cy.get('[role=dialog] button').contains('Yes').click();
cy.get('#license-button').click();
// TODO can be removed once we implement progress bars
cy.wait(5000);

cy.openWorkflowMenu('Permissions & Disclosure');
cy.get('input[id^="publicationLicense-copyrightHolder-control-en"').clear()
cy.get('input[id^="publicationLicense-copyrightHolder-control-en"').type('Craig Montgomerie', {delay: 0});
cy.get('#license button').contains('Save').click();
cy.get('#license [role="status"]').contains('Saved');
cy.get('button').contains('Save').click();
cy.get('[role="status"]').contains('Saved');
cy.wait(1500);

// Publish 2nd version
cy.get('#publication button').contains('Post').click();
cy.get('button').contains('Post').click();
cy.contains('All requirements have been met.');
cy.get('.pkpWorkflow__publishModal button').contains('Post').click();
});
Expand Down
4 changes: 3 additions & 1 deletion cypress/tests/data/60-content/DdioufSubmission.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ describe('Data suite: Ddiouf', function() {
cy.findSubmissionAsEditor('dbarnes', null, 'Diouf');
cy.clickDecision('Decline Submission');
cy.recordDecisionDecline(['Diaga Diouf']);
cy.get('.pkp_workflow_last_decision').contains('Submission declined.');
// TODO re-add this check once its determined where to indicate it in new design
//cy.get('.pkp_workflow_last_decision').contains('Submission declined.');
cy.openWorkflowMenu('Production');
cy.get('button').contains('Change decision').click();
cy.clickDecision('Revert Decline');
cy.recordDecisionRevertDecline(['Diaga Diouf']);
Expand Down
12 changes: 6 additions & 6 deletions cypress/tests/data/60-content/DphillipsSubmission.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ describe('Data suite: Dphillips', function() {

cy.logout();
cy.findSubmissionAsEditor('dbarnes', null, 'Phillips');
cy.get('.pkp_workflow_decisions button:contains("Post the preprint")').click();
cy.get('div.pkpPublication button:contains("Post"):visible').click();
cy.get('button:contains("Post the preprint")').click();
cy.get('button:contains("Post")').click();
cy.get('div:contains("All requirements have been met. Are you sure you want to post this?")');
cy.get('[id^="publish"] button:contains("Post")').click();
});

it('Preprint is not available when unposted', function() {
cy.login('dbarnes');
cy.visit('/index.php/publicknowledge/en/workflow/access/' + submission.id);
cy.get('#publication-button').click();
cy.openWorkflowMenu('Title & Abstract')
cy.get('button').contains('Unpost').click();
cy.contains('Are you sure you don\'t want this to be posted?');
cy.get('div[role=dialog] button').contains('Unpost').click();
cy.get('[data-cy=dialog] button').contains('Unpost').click();
cy.wait(1000);
cy.visit('/index.php/publicknowledge/preprints');
cy.contains('Signalling Theory Dividends').should('not.exist');
Expand All @@ -82,8 +82,8 @@ describe('Data suite: Dphillips', function() {
// Re-post it
cy.login('dbarnes');
cy.visit('/index.php/publicknowledge/en/workflow/access/' + submission.id);
cy.get('#publication-button').click();
cy.get('.pkpPublication button').contains('Post').click();
cy.openWorkflowMenu('Title & Abstract')
cy.get('button').contains('Post').click();
cy.contains('All requirements have been met.');
cy.get('.pkpWorkflow__publishModal button').contains('Post').click();
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/tests/data/60-content/DsokoloffSubmission.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ describe('Data suite: Dsokoloff', function() {

cy.logout();
cy.findSubmissionAsEditor('dbarnes', null, 'Sokoloff');
cy.get('.pkp_workflow_decisions button:contains("Post the preprint")').click();
cy.get('div.pkpPublication button:contains("Post"):visible').click();
cy.get('button:contains("Post the preprint")').click();
cy.get('button:contains("Post"):visible').click();
cy.get('div:contains("All requirements have been met. Are you sure you want to post this?")');
cy.get('[id^="publish"] button:contains("Post")').click();
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/tests/data/60-content/EostromSubmission.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ describe('Data suite: Eostrom', function() {

cy.logout();
cy.findSubmissionAsEditor('dbarnes', null, 'Ostrom');
cy.get('.pkp_workflow_decisions button:contains("Post the preprint")').click();
cy.get('div.pkpPublication button:contains("Post"):visible').click();
cy.get('button:contains("Post the preprint")').click();
cy.get('button:contains("Post"):visible').click();
cy.get('div:contains("All requirements have been met. Are you sure you want to post this?")');
cy.get('[id^="publish"] button:contains("Post")').click();
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/tests/data/60-content/FpaglieriSubmission.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ describe('Data suite: Fpaglieri', function() {

cy.logout();
cy.findSubmissionAsEditor('dbarnes', null, 'Paglieri');
cy.get('.pkp_workflow_decisions button:contains("Post the preprint")').click();
cy.get('div.pkpPublication button:contains("Post"):visible').click();
cy.get('button:contains("Post the preprint")').click();
cy.get('button:contains("Post"):visible').click();
cy.get('div:contains("All requirements have been met. Are you sure you want to post this?")');
cy.get('[id^="publish"] button:contains("Post")').click();
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/tests/data/60-content/JmwandengaSubmission.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ describe('Data suite: Jmwandenga', function() {

cy.logout();
cy.findSubmissionAsEditor('dbarnes', null, 'Mwandenga');
cy.get('.pkp_workflow_decisions button:contains("Post the preprint")').click();
cy.get('div.pkpPublication button:contains("Post"):visible').click();
cy.get('button:contains("Post the preprint")').click();
cy.get('button:contains("Post"):visible').click();
cy.get('div:contains("All requirements have been met. Are you sure you want to post this?")');
cy.get('[id^="publish"] button:contains("Post")').click();
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/tests/data/60-content/JnovakSubmission.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ describe('Data suite: Jnovak', function() {

cy.logout();
cy.findSubmissionAsEditor('dbarnes', null, 'Novak');
cy.get('.pkp_workflow_decisions button:contains("Post the preprint")').click();
cy.get('div.pkpPublication button:contains("Post"):visible').click();
cy.get('button:contains("Post the preprint")').click();
cy.get('button:contains("Post"):visible').click();
cy.get('div:contains("All requirements have been met. Are you sure you want to post this?")');
cy.get('[id^="publish"] button:contains("Post")').click();
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/tests/data/60-content/KalkhafajiSubmission.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ describe('Data suite: Kalkhafaji', function() {

cy.logout();
cy.findSubmissionAsEditor('dbarnes', null, 'Al-Khafaji');
cy.get('.pkp_workflow_decisions button:contains("Post the preprint")').click();
cy.get('div.pkpPublication button:contains("Post"):visible').click();
cy.get('button:contains("Post the preprint")').click();
cy.get('button:contains("Post"):visible').click();
cy.get('div:contains("All requirements have been met. Are you sure you want to post this?")');
cy.get('[id^="publish"] button:contains("Post")').click();
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/tests/data/60-content/LchristopherSubmission.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ describe('Data suite: Lchristopher', function() {

cy.logout();
cy.findSubmissionAsEditor('dbarnes', null, 'Christopher');
cy.get('.pkp_workflow_decisions button:contains("Post the preprint")').click();
cy.get('div.pkpPublication button:contains("Post"):visible').click();
cy.get('button:contains("Post the preprint")').click();
cy.get('button:contains("Post"):visible').click();
cy.get('div:contains("All requirements have been met. Are you sure you want to post this?")');
cy.get('[id^="publish"] button:contains("Post")').click();
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/tests/data/60-content/LkumiegaSubmission.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ describe('Data suite: Lkumiega', function() {

cy.logout();
cy.findSubmissionAsEditor('dbarnes', null, 'Kumiega');
cy.get('.pkp_workflow_decisions button:contains("Post the preprint")').click();
cy.get('div.pkpPublication button:contains("Post"):visible').click();
cy.get('button:contains("Post the preprint")').click();
cy.get('button:contains("Post"):visible').click();
cy.get('div:contains("All requirements have been met. Are you sure you want to post this?")');
cy.get('[id^="publish"] button:contains("Post")').click();
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/tests/data/60-content/PdanielSubmission.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ describe('Data suite: Pdaniel', function() {

cy.logout();
cy.findSubmissionAsEditor('dbarnes', null, 'Daniel');
cy.get('.pkp_workflow_decisions button:contains("Post the preprint")').click();
cy.get('div.pkpPublication button:contains("Post"):visible').click();
cy.get('button:contains("Post the preprint")').click();
cy.get('button:contains("Post"):visible').click();
cy.get('div:contains("All requirements have been met. Are you sure you want to post this?")');
cy.get('[id^="publish"] button:contains("Post")').click();
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/tests/data/60-content/RbaiyewuSubmission.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ describe('Data suite: Rbaiyewu', function() {

cy.logout();
cy.findSubmissionAsEditor('dbarnes', null, 'Baiyewu');
cy.get('.pkp_workflow_decisions button:contains("Post the preprint")').click();
cy.get('div.pkpPublication button:contains("Post"):visible').click();
cy.get('button:contains("Post the preprint")').click();
cy.get('button:contains("Post"):visible').click();
cy.get('div:contains("All requirements have been met. Are you sure you want to post this?")');
cy.get('[id^="publish"] button:contains("Post")').click();
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/tests/data/60-content/RrossiSubmission.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ describe('Data suite: Rrossi', function() {

cy.logout();
cy.findSubmissionAsEditor('dbarnes', null, 'Rossi');
cy.get('.pkp_workflow_decisions button:contains("Post the preprint")').click();
cy.get('div.pkpPublication button:contains("Post"):visible').click();
cy.get('button:contains("Post the preprint")').click();
cy.get('button:contains("Post"):visible').click();
cy.get('div:contains("All requirements have been met. Are you sure you want to post this?")');
cy.get('[id^="publish"] button:contains("Post")').click();
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/tests/data/60-content/VkarbasizaedSubmission.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ describe('Data suite: Vkarbasizaed', function() {

cy.logout();
cy.findSubmissionAsEditor('dbarnes', null, 'Karbasizaed');
cy.get('.pkp_workflow_decisions button:contains("Post the preprint")').click();
cy.get('div.pkpPublication button:contains("Post"):visible').click();
cy.get('button:contains("Post the preprint")').click();
cy.get('button:contains("Post"):visible').click();
cy.get('div:contains("All requirements have been met. Are you sure you want to post this?")');
cy.get('[id^="publish"] button:contains("Post")').click();
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/tests/data/60-content/VwilliamsonSubmission.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ describe('Data suite: Vwilliamson', function() {

cy.logout();
cy.findSubmissionAsEditor('dbarnes', null, 'Williamson');
cy.get('.pkp_workflow_decisions button:contains("Post the preprint")').click();
cy.get('div.pkpPublication button:contains("Post"):visible').click();
cy.get('button:contains("Post the preprint")').click();
cy.get('button:contains("Post"):visible').click();
cy.get('div:contains("All requirements have been met. Are you sure you want to post this?")');
cy.get('[id^="publish"] button:contains("Post")').click();
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/tests/data/60-content/ZwoodsSubmission.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ describe('Data suite: Zwoods', function() {

cy.logout();
cy.findSubmissionAsEditor('dbarnes', null, 'Woods');
cy.get('.pkp_workflow_decisions button:contains("Post the preprint")').click();
cy.get('div.pkpPublication button:contains("Post"):visible').click();
cy.get('button:contains("Post the preprint")').click();
cy.get('button:contains("Post"):visible').click();
cy.get('div:contains("All requirements have been met. Are you sure you want to post this?")');
cy.get('[id^="publish"] button:contains("Post")').click();
});
Expand Down
41 changes: 24 additions & 17 deletions cypress/tests/integration/Doi.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,18 +304,21 @@ describe('DOI tests', function() {
cy.get('#doisSetup [role="status"]').contains('Saved');

//Go to publication and rollback to first publication being unpublished, then republish first publication
cy.get('nav').contains('Submissions').click();
cy.get('button:contains("Archived")').click();
cy.get(`div#archive .listPanel__item:contains("${articleTitle}") a:contains("View")`).click();
cy.get('nav').contains('Dashboards').click();
cy.get('nav').contains('Published').click();
cy.contains('table tr', articleTitle).within(() => {
cy.get('button').contains('View').click()
})

cy.get('button#publication-button').click();

cy.openWorkflowMenu('Title & Abstract')
cy.get('button:contains("Unpost")').click();
cy.get('div[role="dialog"] button:contains("Unpost")').click();
cy.get('[data-cy="dialog"] button:contains("Unpost")').click();

cy.get('button:contains("Unpost")').should('not.exist');

cy.get('button:contains("Post")').click();
cy.get('div.pkpWorkflow__publishModal button:contains("Post")').click();
cy.get('[data-cy="active-modal"] button:contains("Post")').click();

cy.get('div:contains("This version has been posted and can not be edited.")').should('exist');

Expand Down Expand Up @@ -349,14 +352,16 @@ describe('DOI tests', function() {
cy.log("Check DOI versioning off copies previous DOI for subsequent versions");

// Publish Version 2
cy.get('nav').contains('Submissions').click();
cy.get('button:contains("Archived")').click();
cy.get(`div#archive .listPanel__item:contains("${articleTitle}") a:contains("View")`).click();
cy.get('button#publication-button').click();
cy.get('nav').contains('Dashboards').click();
cy.get('nav').contains('Published').click();
cy.contains('table tr', articleTitle).within(() => {
cy.get('button').contains('View').click()
})
cy.openWorkflowMenu('Title & Abstract')

cy.get('button:contains("Create New Version")').click();
cy.get('div[role="dialog"]').contains('Create New Version');
cy.get('div[role="dialog"] button:contains("Yes")').click();
cy.get('[data-cy="active-modal"]').contains('Create New Version');
cy.get('[data-cy="dialog"] button:contains("Yes")').click();

cy.get('button:contains("Post")').click();
cy.get('div.pkpWorkflow__publishModal button:contains("Post")').click();
Expand Down Expand Up @@ -487,14 +492,16 @@ describe('DOI tests', function() {

// Check creates new version
// Go to publication and publish Version 2
cy.get('nav').contains('Submissions').click();
cy.get('button:contains("Archived")').click();
cy.get(`div#archive .listPanel__item:contains("${articleTitle}") a:contains("View")`).click();
cy.get('button#publication-button').click();
cy.get('nav').contains('Dashboards').click();
cy.get('nav').contains('Published').click();
cy.contains('table tr', articleTitle).within(() => {
cy.get('button').contains('View').click()
})
cy.openWorkflowMenu('Title & Abstract')

// We have to unpost it first
cy.get('button:contains("Unpost")').click();
cy.get('div[role="dialog"] button:contains("Unpost")').click();
cy.get('[data-cy="dialog"] button:contains("Unpost")').click();
cy.get('button:contains("Post")').should('not.exist');

cy.get('button:contains("Post")').click();
Expand Down
8 changes: 8 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,18 @@
*/

use APP\core\Application;
use PKP\config\Config;

// Initialize global environment
define('INDEX_FILE_LOCATION', __FILE__);
require_once './lib/pkp/includes/bootstrap.php';

// Temporarly enable enable_new_submission_listing for OJS, until OMP&OPS catch up
// Its still possible to disable it with explicitely setting it to 'Off'
if(Config::getVar('features', 'enable_new_submission_listing') === null) {
$configData = & Config::getData();
$configData['features']['enable_new_submission_listing'] = true;
}

// Serve the request
Application::get()->execute();
Loading

0 comments on commit 50b0385

Please sign in to comment.