From d11bdcffcf564468185e04a8f792b29a21d7ef2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jarda=20Kot=C4=9B=C5=A1ovec?= Date: Mon, 7 Oct 2024 17:53:59 +0200 Subject: [PATCH] =?UTF-8?q?pkp/pkp-lib#5502=20Migrate=20change=20language?= =?UTF-8?q?=20functionality=20to=20new=20workflo=E2=80=A6=20(#4463)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * pkp/pkp-lib#5502 Migrate change language functionality to new workflow page, migrate e2e test * Clean up comment --- .../ChangeSubmissionLanguage.cy.js | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/cypress/tests/integration/ChangeSubmissionLanguage.cy.js b/cypress/tests/integration/ChangeSubmissionLanguage.cy.js index f8e21cedb92..5d0593b79f3 100644 --- a/cypress/tests/integration/ChangeSubmissionLanguage.cy.js +++ b/cypress/tests/integration/ChangeSubmissionLanguage.cy.js @@ -6,8 +6,7 @@ * Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. */ -// FIX ME Temporarly disabled until the change language logic is moved legacy workflow page -describe.skip('Change Submission Language', function() { +describe('Change Submission Language', function() { let user; let author; let password; @@ -38,40 +37,39 @@ describe.skip('Change Submission Language', function() { it('Try to change submission language after publication', function() { cy.login(user, password, 'publicknowledge'); - cy.get('nav').contains('Active submissions').click(); - cy.openSubmission() - cy.contains('View ' + author.familyName).click({force: true}); - cy.get(`.pkpPublication__changeSubmissionLanguage > button`).should('not.exist'); + cy.get('nav').contains('Published').click(); + cy.openSubmission(author.familyName); + cy.get('[data-cy="workflow-controls-left"] button').contains('Change').should('not.exist'); }); it('Change submission language', function() { cy.login(user, password, 'publicknowledge'); - cy.get('button[id="archive-button"]').click(); - cy.contains('View ' + author.familyName).click({force: true}); + cy.get('nav').contains('Published').click(); + cy.openSubmission(author.familyName); // Unpublish - cy.get('button[id="publication-button"]').click(); - cy.get('#publication button:contains("Unpublish")').click(); - cy.get('#headlessui-dialog-panel-5 button:contains("Unpublish")').click(); + cy.openWorkflowMenu('Title & Abstract') + cy.get('button:contains("Unpublish")').click(); + cy.get('[data-cy="dialog"] button:contains("Unpublish")').click(); // Change language - cy.get(`.pkpPublication__changeSubmissionLanguage > button`).should('be.enabled').click(); + cy.get(`[data-cy="workflow-controls-left"] button`).contains("Change").should('be.enabled').click(); cy.get('#changeSubmissionLanguage').find(`input[value="${newLocaleKey}"]`).click(); cy.setTinyMceContent('changeSubmissionLanguageMetadata-title-control', title[newLocaleKey]); cy.setTinyMceContent('changeSubmissionLanguageMetadata-abstract-control', abstract[newLocaleKey]); cy.get('#changeSubmissionLanguage button[label="Confirm"]').click(); - cy.get(`.pkpPublication__changeSubmissionLanguage > span`).contains(`Current Submission Language: ${newLanguage}`); + cy.contains(`Current Submission Language: ${newLanguage}`); }); it('Change submission language back to the original', function() { cy.findSubmissionAsEditor(user, password, author.familyName); // Change language - cy.get('button[id="publication-button"]').click(); - cy.get(`.pkpPublication__changeSubmissionLanguage > button`).click(); + cy.openWorkflowMenu('Title & Abstract') + cy.get('[data-cy="workflow-controls-left"] button').contains('Change').click(); cy.get('#changeSubmissionLanguage').find(`input[value="${originalLocaleKey}"]`).click(); cy.get('#changeSubmissionLanguage button[label="Confirm"]').click(); // Publish - cy.get(`.pkpPublication__changeSubmissionLanguage > span`).contains(`Current Submission Language: ${originalLanguage}`); - cy.get('button[id="publication-button"]').click(); - cy.get('div#publication button:contains("Schedule For Publication")').click(); - cy.get('div.pkpWorkflow__publishModal button:contains("Publish")').click(); + cy.contains(`Current Submission Language: ${originalLanguage}`); + cy.openWorkflowMenu('Title & Abstract') + cy.get('button:contains("Schedule For Publication")').click(); + cy.get('[data-cy="active-modal"] button:contains("Publish")').click(); }); });