diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 9b0c67774b4..ebaa4391b58 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -9,6 +9,7 @@ import Api from '../../lib/pkp/cypress/support/api.js'; import '../../lib/pkp/cypress/support/commands_new_workflow.js'; +import '../../lib/pkp/cypress/support/commands_orcid.js'; Cypress.Commands.add('addToCatalog', function() { cy.get('button:contains("Publish")').click(); diff --git a/cypress/tests/integration/orcid/Orcid.cy.js b/cypress/tests/integration/orcid/Orcid.cy.js new file mode 100644 index 00000000000..1e921b16986 --- /dev/null +++ b/cypress/tests/integration/orcid/Orcid.cy.js @@ -0,0 +1,44 @@ +/** + * @file cypress/tests/integration/Orcid.cy.js + * + * Copyright (c) 2014-2024 Simon Fraser University + * Copyright (c) 2000-2024 John Willinsky + * Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. + * + */ + +describe('ORCID tests', function() { + before(() => { + cy.enableOrcid(); + }); + + it('Sends ORCID verification request to author', function() { + cy.login('dbarnes'); + cy.visit( + 'index.php/publicknowledge/en/dashboard/editorial?currentViewId=assigned-to-me' + ); + + // Select a submission in submission list + cy.findSubmissionAsEditor('dbarnes', null, 'Bernnard'); + + cy.get('a').contains('Contributors').click(); + + cy.get('div.listPanel__itemActions') + .contains('Primary Contact') + .parents('div.listPanel__itemActions') + .within(() => { + cy.contains('button', 'Edit').click(); + }) + .then(() => { + // Ensure side modal is opened before continuing + cy.wait(10000); + + cy.get('[data-cy="sidemodal-header"]').should('be.visible'); + cy.contains('Request verification').click(); + cy.get('button').contains('Yes').click(); + cy.contains( + 'ORCID Verification has been requested! Resend Verification Email' + ).should('be.visible'); + }); + }); +});