diff --git a/cypress/support/api.js b/cypress/support/api.js index 4ee4c6281e2..d6b20702808 100644 --- a/cypress/support/api.js +++ b/cypress/support/api.js @@ -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 : ''); } diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 4a5e4c3d586..e56322ed2a4 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -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'); } }); @@ -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); +}); diff --git a/cypress/tests/integration/Multilingual.cy.js b/cypress/tests/integration/Multilingual.cy.js index 38a51849f12..9dcbe6f2f1a 100644 --- a/cypress/tests/integration/Multilingual.cy.js +++ b/cypress/tests/integration/Multilingual.cy.js @@ -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.'); }); });