Skip to content

Commit

Permalink
Merge pull request #8876 from NateWr/i8346_wizard_tests
Browse files Browse the repository at this point in the history
#8346 Add tests for the submission wizard
  • Loading branch information
NateWr authored Apr 24, 2023
2 parents 563df19 + 8d8bd18 commit bd61fc9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cypress/support/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ class Api {
this.url = baseUrl;
}

contexts(id) {
return this.url + '/contexts' + (id ? '/' + id : '');
}

submissions(id) {
return this.url + '/submissions' + (id ? '/' + id : '');
}
Expand Down
10 changes: 9 additions & 1 deletion cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Cypress.Commands.add('dispatchTestQueueJobs', (times) => {

times = times || 1;
for (let index = 0; index < times; index++) {
cy.exec('php lib/pkp/tools/jobs.php test');
cy.exec('php lib/pkp/tools/jobs.php test');
}
});

Expand Down Expand Up @@ -866,3 +866,11 @@ Cypress.Commands.add('uploadSubmissionFiles', (files, options) => {
});
});
});

Cypress.Commands.add('changeLanguage', (language, contextPath) => {
contextPath = contextPath || 'publicknowledge';

cy.get('.app__userNav > button').click();
cy.get('.app__userNav a:contains("Français")').click();
cy.wait(2000);
});
7 changes: 7 additions & 0 deletions cypress/tests/integration/Multilingual.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,12 @@ describe('Multilingual configurations', function() {
cy.get('#titleAbstract-title-control-fr_CA').type("L'influence de la lactation sur la quantité et la qualité de la production de cachemire", {force: true});
cy.get('#titleAbstract button').contains('Save').click();
cy.get('#titleAbstract [role="status"]').contains('Saved');

// Re-enable French in UI
cy.visit('index.php/publicknowledge/management/settings/website');
cy.get('button').contains('Setup').eq(0).click();
cy.get('button').contains('Languages').click();
cy.get('input[id^="select-cell-fr_CA-uiLocale').check();
cy.contains('Locale settings saved.');
});
});

0 comments on commit bd61fc9

Please sign in to comment.