Skip to content

Commit

Permalink
pkp/pkp-lib#9890 Re-add {force:true} when clicking buttons in Submiss…
Browse files Browse the repository at this point in the history
…ionWizard cypress test
  • Loading branch information
blesildaramirez committed Sep 18, 2024
1 parent b6ad095 commit 075fb18
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions cypress/tests/integration/SubmissionWizard.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('Submission Wizard', function() {
cy.login('dbarnes', null, 'publicknowledge');
cy.get('nav').contains('Settings').click();
// Ensure submenu item click despite animation
cy.get('nav').contains('Journal').click();
cy.get('nav').contains('Journal').click({ force: true });
cy.get('.pkpTabs__buttons button:contains("Sections")').click();
cy.get('#sectionsGridContainer a.show_extras')
.each(($showExtras) => {
Expand All @@ -113,7 +113,7 @@ describe('Submission Wizard', function() {
cy.login('dbarnes', null, 'publicknowledge');
cy.get('nav').contains('Settings').click();
// Ensure submenu item click despite animation
cy.get('nav').contains('Journal').click();
cy.get('nav').contains('Journal').click({ force: true });
cy.get('.pkpTabs__buttons button:contains("Sections")').click();
cy.get('#sectionsGridContainer tr:contains("Articles") input').check();
cy.get('[role="dialog"] button:contains("OK")').click();
Expand All @@ -130,7 +130,7 @@ describe('Submission Wizard', function() {
cy.login('dbarnes', null, 'publicknowledge');
cy.get('nav').contains('Settings').click();
// Ensure submenu item click despite animation
cy.get('nav').contains('Journal').click();
cy.get('nav').contains('Journal').click({ force: true });
cy.get('.pkpTabs__buttons button:contains("Sections")').click();
cy.get('#sectionsGridContainer tr:contains("Reviews")')
.then(($tr) => {
Expand Down Expand Up @@ -158,7 +158,7 @@ describe('Submission Wizard', function() {
cy.login('dbarnes', null, 'publicknowledge');
cy.get('nav').contains('Settings').click();
// Ensure submenu item click despite animation
cy.get('nav').contains('Journal').click();
cy.get('nav').contains('Journal').click({ force: true });
cy.get('.pkpTabs__buttons button:contains("Sections")').click();
cy.get('#sectionsGridContainer tr:contains("Articles")')
.then(($tr) => {
Expand Down Expand Up @@ -380,15 +380,15 @@ describe('Submission Wizard', function() {
});

// Add missing data
cy.get('.pkpSteps button:contains("Details")').click();
cy.get('.pkpSteps button:contains("Details")').click({ force: true });
cy.setTinyMceContent('titleAbstract-title-control-en', submission.title);
cy.setTinyMceContent('titleAbstract-abstract-control-en', submission.abstract);
cy.get('#titleAbstract-keywords-control-en').type(submission.keywords, {delay: 0});
cy.get('li:contains("' + submission.keywords + '")');
cy.get('#titleAbstract-keywords-control-en').type('{downarrow}{enter}', {delay: 0});
cy.get('#citations-citationsRaw-control').type(submission.citations);

cy.get('.pkpSteps button:contains("Upload Files")').click();
cy.get('.pkpSteps button:contains("Upload Files")').click({ force: true });
cy.uploadSubmissionFiles([
{
'file': 'dummy.pdf',
Expand All @@ -398,7 +398,7 @@ describe('Submission Wizard', function() {
}
]);

cy.get('.pkpSteps button:contains("For the Editors")').click();
cy.get('.pkpSteps button:contains("For the Editors")').click({ force: true });
Object.keys(submission.metadata.autosuggest).forEach(field => {
cy.get('#forTheEditors-' + field + '-control-en').type(submission.metadata.autosuggest[field], {delay: 0});
cy.get('li:contains("' + submission.metadata.autosuggest[field] + '")');
Expand All @@ -412,7 +412,7 @@ describe('Submission Wizard', function() {
});

// All errors should be gone and submit should be allowed.
cy.get('.pkpSteps button:contains("Review")').click();
cy.get('.pkpSteps button:contains("Review")').click({ force: true });
cy.get('*:contains("There are one or more problems")').should('not.exist');
cy.get('button:contains("Submit")').should('be.enabled');
cy.get('*:contains("You must upload at least one Article Text file.")').should('not.exist');
Expand Down Expand Up @@ -585,23 +585,23 @@ describe('Submission Wizard', function() {
.contains('Social Sciences > Sociology');

// Add missing data
cy.get('.pkpSteps button:contains("Details")').click();
cy.get('.pkpSteps button:contains("Details")').click({ force: true });
cy.setTinyMceContent('titleAbstract-title-control-fr_CA', submission.title.fr_CA);
cy.get('.pkpSteps button:contains("Contributors")').click();
cy.get('.pkpSteps button:contains("Contributors")').click({ force: true });
cy.get('.listPanel__itemTitle:contains("Carlo Corino")')
.parents('.listPanel__item')
.find('button:contains("Edit")')
.click();
cy.get('input[name="givenName-fr_CA"]').type('Carlo', {delay: 0});
cy.get('input[name="familyName-fr_CA"]').type('Carlo', {delay: 0});
cy.get('[role=dialog]').find('button:contains("Save")').click();
cy.get('.pkpSteps button:contains("For the Editors")').click();
cy.get('.pkpSteps button:contains("For the Editors")').click({ force: true });
cy.get('#forTheEditors-subjects-control-fr_CA').type('Sociologie française', {delay: 0});
cy.get('li:contains("Sociologie française")');
cy.get('#forTheEditors-subjects-control-fr_CA').type('{downarrow}{enter}', {delay: 0});

// Should be able to submit!
cy.get('.pkpSteps button:contains("Review")').click();
cy.get('.pkpSteps button:contains("Review")').click({ force: true });
cy.get('button:contains("Submit")').click();
cy.contains('The submission, ' + submission.title.en + ', will be submitted to Journal of Public Knowledge for editorial review.');
// delay is needed so previous changes gets pushed, before the submit should be triggered
Expand Down

0 comments on commit 075fb18

Please sign in to comment.