Skip to content

Commit

Permalink
pkp#10127 Add e2e tests for ORCID
Browse files Browse the repository at this point in the history
  • Loading branch information
taslangraham committed Nov 27, 2024
1 parent 271d161 commit ae4b8cb
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
44 changes: 44 additions & 0 deletions cypress/tests/integration/orcid/Orcid.cy.js
Original file line number Diff line number Diff line change
@@ -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');
});
});
});

0 comments on commit ae4b8cb

Please sign in to comment.