diff --git a/CHANGELOG.md b/CHANGELOG.md index ed99f471c0..f073733e0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,33 @@ +## v2.52.4 - 2023-12-29 + +[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.52.3...v2.52.4) + +- [#2127](https://github.com/ORCID/orcid-angular/pull/2127): Fix logic to hide the "as" + +## v2.52.3 - 2023-12-28 + +[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.52.2...v2.52.3) + +- [#2126](https://github.com/ORCID/orcid-angular/pull/2126): fix/batch-fixes-dec-28 + +## v2.52.2 - 2023-12-15 + +[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.52.1...v2.52.2) + +- [#2124](https://github.com/ORCID/orcid-angular/pull/2124): Fix/8909 prod link to remove duplicate record section not working + +## v2.52.1 - 2023-12-15 + +[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.52.0...v2.52.1) + +## v2.52.0 - 2023-12-15 + +[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.51.14...v2.52.0) + +## v2.51.14 - 2023-12-14 + +[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.51.13...v2.51.14) + ## v2.51.13 - 2023-12-08 [Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.51.12...v2.51.13) diff --git a/angular.json b/angular.json index 54be1216e0..de733f46e4 100644 --- a/angular.json +++ b/angular.json @@ -211,6 +211,15 @@ } ] }, + "local-with-proxy-localize-ar": { + "localize": ["ar"], + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.local-with-proxy.ts" + } + ] + }, "local-with-proxy-localize-xx": { "localize": ["xx"], "fileReplacements": [ @@ -347,6 +356,10 @@ "browserTarget": "ng-orcid:build:local-with-proxy-localize-en", "proxyConfig": "src/proxy.conf.qa.mjs" }, + "local-qa-ar": { + "browserTarget": "ng-orcid:build:local-with-proxy-localize-ar", + "proxyConfig": "src/proxy.conf.qa.mjs" + }, "local-qa-fr": { "browserTarget": "ng-orcid:build:local-with-proxy-localize-fr", "proxyConfig": "src/proxy.conf.qa.mjs" diff --git a/cypress.config.ts b/cypress.config.ts deleted file mode 100644 index 9aea095610..0000000000 --- a/cypress.config.ts +++ /dev/null @@ -1,110 +0,0 @@ -import { defineConfig } from 'cypress' -require('dotenv').config({ debug: true }) - -export default defineConfig({ - blockHosts: ['*.crazyegg.com', '*.zendesk.com'], - env: { - infoSiteBaseUrl: 'https://info.qa.orcid.org', - duplicatedModalEndPoint: 'https://pub.qa.orcid.org/v3.0/expanded-search/**', - verifyEmailSubject: '[ORCID] Welcome to ORCID - verify your email address', - verifyEmailUrl: 'https://qa.orcid.org/verify-email/', - senderVerifyEmail: 'support@verify.orcid.org', - verifyEmailReminderSubject: - '[ORCID] Reminder to verify your primary email address', - senderResetPassword: 'reset@notify.orcid.org', - forgotPasswordSubject: '[ORCID] About your password reset request', - recoverOIDSubject: '[ORCID] Your ORCID iD', - resetPasswEmailURL: 'https://qa.orcid.org/reset-password-email/', - signInURL: 'https://qa.orcid.org/signin', - membersAPI_URL: 'https://api.qa.orcid.org/v3.0/', - membersAPI_websitesEndPoint: '/researcher-urls', - membersAPI_fundingsEndpoint: '/funding', - membersAPI_allFundingsEndpoint: '/fundings', - membersAPI_workEndpoint: '/work', - membersAPI_allWorksEndpoint: '/works', - membersAPI_peerReviewEndpoint: '/peer-review', - membersAPI_allPeerReviewsEndpoint: '/peer-reviews', - membersAPI_employmentEndpoint: '/employment', - membersAPI_allEmploymentsEndpoint: '/employments', - membersAPI_notifPermEndpoint: '/notification-permission', - membersAPI_researchEndpoint: '/research-resource', - membersAPI_allResearchEndpoint: '/research-resources', - registrationPage: 'https://qa.orcid.org/register', - membersAPI_revokeTokenEndPoint: 'https://qa.orcid.org/oauth/revoke', - reactivationEmailSubject: '[ORCID] Reactivating your ORCID record', - reactivationEmailSender: 'reset@notify.orcid.org', - reactivationEmailLink: 'https://qa.orcid.org/reactivation/', - deactivationEmailSubject: - '[ORCID] Confirm deactivation of your ORCID Account', - deactivationEmailSender: 'deactivate@notify.orcid.org', - deactivationEmailLink: - 'https://qa.orcid.org/account/confirm-deactivate-orcid', - deactivationBannerMessage: 'An account deactivation email has been sent to', - deactivatedRecordMessage: - 'A deactivated ORCID record is associated with this email address', - }, - video: false, - chromeWebSecurity: false, - viewportWidth: 1000, - viewportHeight: 1000, - reporter: 'cypress-multi-reporters', - reporterOptions: { - reporterEnabled: 'cypress-qase-reporter,cypress-mochawesome-reporter', - cypressMochawesomeReporterReporterOptions: { - charts: true, - overwrite: false, - quiet: true, - html: false, - json: true, - embeddedScreenshots: true, - inlineAssets: true, - saveAllAttempts: false, - reportDir: 'cypress/reports/mochawesome-report', - reportPageTitle: 'Orcid Automated Regression Test Results', - reportFileName: '[status]_[daytime]-[name]-report', - timestamp: 'longDate', - }, - cypressQaseReporterReporterOptions: { - apiToken: process.env.CY_QASE_TOKEN, - projectCode: process.env.CY_QASE_PROJECT_CODE, - logging: true, - basePath: 'https://api.qase.io/v1', - screenshotFolder: 'screenshots', - sendScreenshot: true, - runComplete: true, - environmentId: 1, - rootSuiteTitle: 'Cypress tests', - }, - }, - e2e: { - setupNodeEvents(on, config) { - require('cypress-mochawesome-reporter/plugin')(on) - require('./cypress/plugins/index.js')(on, config) - - // we can grab some process environment variables - // and stick it into config.env before returning the updated config - config.env = config.env || {} - config.env.cy_admin_oid = process.env.CY_ADMIN_OID - config.env.cy_admin_secret = process.env.CY_ADMIN_SECRET - config.env.cy_admin_password = process.env.CY_ADMIN_PASSWORD - - //if running headless then skip all-*.cy.js files - if (config.isTextTerminal) { - config.excludeSpecPattern = [ - '**/registry/all-registry.cy.js', - '**/my-orcid/all-add.cy.js', - '**/my-orcid/all-other-features.cy.js', - '**/oauth/all-oauth.cy.js', - ] - } - - //return the updated config - return config - }, - baseUrl: 'https://qa.orcid.org', - excludeSpecPattern: [ - '**/legacy_oldScripts/*', - '**/registry/gmail_check_test_ignore.js', - ], - }, -}) diff --git a/cypress/cypress.env.sample.js b/cypress/cypress.env.sample.js deleted file mode 100644 index 33dc1ae989..0000000000 --- a/cypress/cypress.env.sample.js +++ /dev/null @@ -1,42 +0,0 @@ -// The following file should work as it is on QA. -// Feel free to change it on your own environment file - -export const environment = { - // environment urls - baseUrl: 'https://qa.orcid.org', - infoSiteBaseUrl: 'https://info.qa.orcid.org', - - // weather the togglz for the new info site is enable - newInfoSiteEnable: false, - - // a regular user - testUser: { - name: 'cy-Nov-05-2020-02-37-PM-kí', - familyName: 'cy-Nov-05-2020-02-37-PM-qX', - displayName: 'cy-Nov-05-2020-02-37-PM-kí cy-Nov-05-2020-02-37-PM-qX', - email: 'cy-Nov-05-2020-02-37-PM+yS@gmail.com', - password: '12345678Aa', - id: '0000-0002-9255-6887', - defaultPrivacy: 'LIMITED', // IT IS REQUIRE THAT TEST USER HAS LIMITED AS THE DEFAULT PRIVACY SETTING - }, - - // a working application - // the `testUser` should not have authorized and neither will authorize this application during testing - validApp: { - id: 'APP-MLXS7JVFJS9FEIFJ', - redirectUrl: 'https://developers.google.com/oauthplayground', - name: 'Healthy client for e2e', - memberName: 'Healthy member for e2e', - }, - - // an app (client) own by a locked member - lockedApp: { id: 'APP-0X2R288COCXIA4UR' }, - - // user information that does not exists on the environment - // this should not be registered neither will be registered during testing \ - notYetRegisteredUser: { - familyNames: `adnasdjnoasijdnasdn asodkaps`, - givenNames: `saodasnnapsi asiiaiaia`, - email: `asdasd+asdasd+aasdasd@test.com`, - }, -} diff --git a/cypress/e2e/api/orcid_internal.cy.js b/cypress/e2e/api/orcid_internal.cy.js deleted file mode 100644 index 2d6f4b155d..0000000000 --- a/cypress/e2e/api/orcid_internal.cy.js +++ /dev/null @@ -1,26 +0,0 @@ -/// -import { qase } from 'cypress-qase-reporter/dist/mocha' -import userData from '../../fixtures/testing-users.fixture.json' - -describe('Scope /orcid-internal', async function () { - //test requires VPN connection - - const curlStatement = - "curl -i -L -k -H 'Accept: application/json' --data 'client_id=" + - userData.cyAPI_orcid_internal.clientId + - '&client_secret=' + - userData.cyAPI_orcid_internal.secret + - "&grant_type=client_credentials&redirect_uri=https://qa.orcid.org/&scope=/premium-notification /orcid-internal' http://reg-qa-appall-dfw-x1.int.orcid.org:13103/orcid-internal-api/oauth/token" - - qase( - '150', - it('Verify scope /orcid-internal returns an access token', function () { - cy.exec(curlStatement).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - expect(response.stdout).to.contain('HTTP/1.1 200') - expect(response.stdout).to.contain('access_token') - }) - }) - ) //qase -}) diff --git a/cypress/e2e/contributors/API-3.0-GET-work-added-manually-credit-role.cy.js b/cypress/e2e/contributors/API-3.0-GET-work-added-manually-credit-role.cy.js deleted file mode 100644 index e859a0064d..0000000000 --- a/cypress/e2e/contributors/API-3.0-GET-work-added-manually-credit-role.cy.js +++ /dev/null @@ -1,109 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('API 3.0 - GET work added manually', async function () { - const curlReadAllWorks = - "curl -i -H 'Accept: application/json' -H 'Authorization: Bearer " + - userData.cyRecordOwner.clientBearer + - "' -X GET '" + - Cypress.env('membersAPI_URL') + - userData.cyRecordOwner.oid + - Cypress.env('membersAPI_allWorksEndpoint') + - "'" - - const curlReadSingleWork = - "curl -i -H 'Accept: application/json' -H 'Authorization: Bearer " + - userData.cyRecordOwner.clientBearer + - "' -X GET '" + - Cypress.env('membersAPI_URL') + - userData.cyRecordOwner.oid + - Cypress.env('membersAPI_workEndpoint') + - '/' //here append "{PUTCODE}" + "'" - - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '35', - it('API 3.0 - GET work added manually - credit role', function () { - let putCode - const workType = 'Book' - const title = 'Cypress test contributors' - const otherContributorName = 'Michael Jordan' - const creditRole = 'Investigation' - - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - cy.get('#cy-work-types').click() - cy.get('#cy-work-types-panel').within(($myOptions) => { - cy.contains(workType).click() - }) - cy.get('#title-input').clear().type(title) - - //add someone else as contributor with credit role - cy.get('.cy-add-another-contributor').click() - cy.get('app-work-contributors').within(($section) => { - cy.get('[formcontrolname="creditName"]') - .clear() - .type(otherContributorName) - cy.get('[formcontrolname="role"]').click({ force: true }) - }) - //choose credit role - cy.get('[role="listbox"]').within(($list) => { - //to do REPLACE with id for the element next sprint - cy.contains(creditRole).click() - }) - - //save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - cy.wait(2000) - - //Verify work was added - cy.contains('app-panel-data', otherContributorName).within( - ($thisWork) => { - cy.contains('Show more detail').click() - } - ) - - //verify contributor is displayed in details section for this work - cy.get('app-display-attribute').contains(otherContributorName) - - //Read works to grab putcode - //There should only be one work - cy.exec(curlReadAllWorks).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 200 - expect(response.stdout).to.contain('HTTP/2 200') - //grab put code - const responseString = response.stdout - const putcodeIndex = responseString.indexOf('put-code":') - const putCodeStartPosition = putcodeIndex + 10 // +length - const putCodeEndPosition = responseString.indexOf(',"created-date') - putCode = responseString.substring( - putCodeStartPosition, - putCodeEndPosition - ) - cy.log('putCode found:' + putCode) - cy.exec(curlReadSingleWork + putCode + "'").then((singleWorkResp) => { - //verify curl was executed successfully - expect(singleWorkResp.code).to.eq(0) - //verify http response status is successful: 200 - expect(singleWorkResp.stdout).to.contain('HTTP/2 200') - }) - }) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/API-3.0-GET-work-added-manually-no-role.cy.js b/cypress/e2e/contributors/API-3.0-GET-work-added-manually-no-role.cy.js deleted file mode 100644 index 2954b15218..0000000000 --- a/cypress/e2e/contributors/API-3.0-GET-work-added-manually-no-role.cy.js +++ /dev/null @@ -1,102 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('API 3.0 - GET work added manually', async function () { - const curlReadAllWorks = - "curl -i -H 'Accept: application/json' -H 'Authorization: Bearer " + - userData.cyRecordOwner.clientBearer + - "' -X GET '" + - Cypress.env('membersAPI_URL') + - userData.cyRecordOwner.oid + - Cypress.env('membersAPI_allWorksEndpoint') + - "'" - - const curlReadSingleWork = - "curl -i -H 'Accept: application/json' -H 'Authorization: Bearer " + - userData.cyRecordOwner.clientBearer + - "' -X GET '" + - Cypress.env('membersAPI_URL') + - userData.cyRecordOwner.oid + - Cypress.env('membersAPI_workEndpoint') + - '/' //here append "{PUTCODE}" + "'" - - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '35', - it('API 3.0 - GET work added manually - no role', function () { - let putCode - const workType = 'Book' - const title = 'Cypress test contributors' - const otherContributorName = 'Michael Jordan' - - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - cy.get('#cy-work-types').click() - cy.get('#cy-work-types-panel').within(($myOptions) => { - cy.contains(workType).click() - }) - cy.get('#title-input').clear().type(title) - - //add someone else as contributor with credit role - cy.get('.cy-add-another-contributor').click() - cy.get('app-work-contributors').within(($section) => { - cy.get('[formcontrolname="creditName"]') - .clear() - .type(otherContributorName) - }) - - //save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - cy.wait(2000) - - //Verify work was added - cy.contains('app-panel-data', otherContributorName).within( - ($thisWork) => { - cy.contains('Show more detail').click() - } - ) - - //verify contributor is displayed in details section for this work - cy.get('app-display-attribute').contains(otherContributorName) - - //Read works to grab putcode - //There should only be one work - cy.exec(curlReadAllWorks).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 200 - expect(response.stdout).to.contain('HTTP/2 200') - //grab put code - const responseString = response.stdout - const putcodeIndex = responseString.indexOf('put-code":') - const putCodeStartPosition = putcodeIndex + 10 // +length - const putCodeEndPosition = responseString.indexOf(',"created-date') - putCode = responseString.substring( - putCodeStartPosition, - putCodeEndPosition - ) - cy.log('putCode found:' + putCode) - cy.exec(curlReadSingleWork + putCode + "'").then((singleWorkResp) => { - //verify curl was executed successfully - expect(singleWorkResp.code).to.eq(0) - //verify http response status is successful: 200 - expect(singleWorkResp.stdout).to.contain('HTTP/2 200') - }) - }) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/add-DOI-less-50-contrib-WITH-roles-AND-sequence.cy.js b/cypress/e2e/contributors/add-DOI-less-50-contrib-WITH-roles-AND-sequence.cy.js deleted file mode 100644 index 82eda718ab..0000000000 --- a/cypress/e2e/contributors/add-DOI-less-50-contrib-WITH-roles-AND-sequence.cy.js +++ /dev/null @@ -1,42 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Add DOI with less than 50 contributors WITH roles AND sequences', async function () { - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '41', - it('Add DOI with less than 50 contributors WITH roles AND sequences', function () { - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-doi').click({ force: true }) - cy.get('#external-id-input') - .clear() - .type(userData.cyRecordOwner.doi_qase41) - cy.get('[id^=cy-retrieve-work-details]').click() - cy.wait(4000) //need to wait for back end - - //save entry - cy.get('#save-work-button').click({ force: true }) - cy.wait(2000) - - //Verify work was added - cy.get('app-work-stack').should( - 'contain', - userData.cyRecordOwner.doi_qase41 - ) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/add-DOI-less-50-contrib-WITH-roles-NO-sequence.cy.js b/cypress/e2e/contributors/add-DOI-less-50-contrib-WITH-roles-NO-sequence.cy.js deleted file mode 100644 index dbca0c23a3..0000000000 --- a/cypress/e2e/contributors/add-DOI-less-50-contrib-WITH-roles-NO-sequence.cy.js +++ /dev/null @@ -1,44 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Add DOI with less than 50 contributors WITH roles NO sequences', async function () { - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '42', - it('Add DOI with less than 50 contributors WITH roles NO sequences', function () { - const workType = 'Book' - - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-doi').click({ force: true }) - cy.get('#external-id-input') - .clear() - .type(userData.cyRecordOwner.doi_qase42) - //retrieve data - cy.get('[id^=cy-retrieve-work-details]').click() - cy.wait(4000) - - //save entry - cy.get('#save-work-button').click({ force: true }) - cy.wait(2000) - //Verify work was added - cy.get('app-work-stack').should( - 'contain', - userData.cyRecordOwner.doi_qase42 - ) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/add-DOI-more-50-contrib-WITH-roles-AND-sequence.cy.js b/cypress/e2e/contributors/add-DOI-more-50-contrib-WITH-roles-AND-sequence.cy.js deleted file mode 100644 index d9fc866a8f..0000000000 --- a/cypress/e2e/contributors/add-DOI-more-50-contrib-WITH-roles-AND-sequence.cy.js +++ /dev/null @@ -1,49 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Add DOI with more than 50 contributors WITH roles AND sequences', async function () { - const noticeMessage = 'This work has a large number of contributors' - - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '43', - it('Add DOI with more than 50 contributors WITH roles AND sequences', function () { - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-doi').click({ force: true }) - cy.get('#external-id-input') - .clear() - .type(userData.cyRecordOwner.doi_qase43) - cy.get('[id^=cy-retrieve-work-details]').click() - cy.wait(4000) //need to wait for back end - - //verify link to add one more contrib is not displayed - cy.contains('Add another contributor').should('not.exist') - - //verify the panel is displayed - cy.contains('.notice-panel', noticeMessage).should('exist') - - //save entry - cy.get('#save-work-button').click({ force: true }) - cy.wait(2000) - - //Verify work was added - cy.get('app-work-stack').contains(userData.cyRecordOwner.doi_qase43, { - matchCase: false, - }) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/add-PUBMED-less-50-contrib.cy.js b/cypress/e2e/contributors/add-PUBMED-less-50-contrib.cy.js deleted file mode 100644 index 72e4383707..0000000000 --- a/cypress/e2e/contributors/add-PUBMED-less-50-contrib.cy.js +++ /dev/null @@ -1,44 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Add PUBMED ID with less than 50 contributors', async function () { - const pubmedURL = 'https://pubmed.ncbi.nlm.nih.gov/' - - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '44', - it('Add PUBMED ID with less than 50 contributors', function () { - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-pubmed').click({ force: true }) - cy.get('#external-id-input') - .clear() - .type(pubmedURL + userData.cyRecordOwner.pubmed_qase44 + '/') - cy.get('[id^=cy-retrieve-work-details]').click() - cy.wait(4000) //need to wait for back end - - //save entry - cy.get('#save-work-button').click({ force: true }) - cy.wait(2000) - - //Verify work was added - cy.get('app-work-stack').should( - 'contain', - userData.cyRecordOwner.pubmed_qase44 - ) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/add-PUBMED-more-50-contrib.cy.js b/cypress/e2e/contributors/add-PUBMED-more-50-contrib.cy.js deleted file mode 100644 index f76182f6c8..0000000000 --- a/cypress/e2e/contributors/add-PUBMED-more-50-contrib.cy.js +++ /dev/null @@ -1,51 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Add PUBMED ID with more than 50 contributors', async function () { - const pubmedURL = 'https://pubmed.ncbi.nlm.nih.gov/' - const noticeMessage = 'This work has a large number of contributors' - - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '45', - it('Add PUBMED ID with more than 50 contributors', function () { - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-pubmed').click({ force: true }) - cy.get('#external-id-input') - .clear() - .type(pubmedURL + userData.cyRecordOwner.pubmed_qase45 + '/') - cy.get('[id^=cy-retrieve-work-details]').click() - cy.wait(4000) //need to wait for back end - - //verify link to add one more contrib is not displayed - cy.contains('Add another contributor').should('not.exist') - - //verify the panel is displayed - cy.contains('.notice-panel', noticeMessage).should('exist') - - //save entry - cy.get('#save-work-button').click({ force: true }) - cy.wait(4000) //waiting for back end to complete - - //Verify work was added - cy.get('app-work-stack').should( - 'contain', - userData.cyRecordOwner.pubmed_qase45 - ) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/add-more-contrib-editing-work.cy.js b/cypress/e2e/contributors/add-more-contrib-editing-work.cy.js deleted file mode 100644 index edfcc994f3..0000000000 --- a/cypress/e2e/contributors/add-more-contrib-editing-work.cy.js +++ /dev/null @@ -1,71 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Add other contributor while editing work', async function () { - const workType = 'Book' - const title = 'Cypress test contributors 8' - const otherContributorName = 'Keanu Reeves' - const creditRole = 'Investigation' - - before(() => { - //add a work manually - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - cy.get('#cy-work-types').click() - cy.get('#cy-work-types-panel').within(($myOptions) => { - cy.contains(workType).click() - }) - cy.get('#title-input').clear().type(title) - //save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - cy.wait(2000) - }) - - qase( - '8', - it('Add other contributor while editing work', function () { - //edit work added - cy.contains('app-work-stack', title).within(($thisWork) => { - cy.get('button[aria-label*="Edit work"]').click() - }) - //add someone else as contributor with credit role - cy.get('.cy-add-another-contributor').click() - cy.get('app-work-contributors').within(($section) => { - cy.get('[formcontrolname="creditName"]') - .clear() - .type(otherContributorName) - cy.get('[formcontrolname="role"]').click({ force: true }) - }) - //choose credit role - cy.get('[role="listbox"]').within(($list) => { - cy.contains(creditRole).click() - }) - - //save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - cy.wait(2000) - - //Verify work was added - cy.contains('app-panel-data', otherContributorName).within( - ($thisWork) => { - cy.contains('Show more detail').click() - } - ) - - //verify contributor is displayed in details section for this work - cy.get('app-display-attribute').contains(otherContributorName) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/add-more-editing-work-50-contributors.cy.js b/cypress/e2e/contributors/add-more-editing-work-50-contributors.cy.js deleted file mode 100644 index 203d33a91a..0000000000 --- a/cypress/e2e/contributors/add-more-editing-work-50-contributors.cy.js +++ /dev/null @@ -1,36 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Add more contributors while editing a work with 50 contributors', async function () { - const workTitle = 'QASE19' - const noticeMessage = 'You cannot add any more contributors to this work' - - before(() => { - //log in with user that has 50 contrib - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cy50Contrib) - }) - - qase( - '19', - it('Add more contributors while editing a work with 50 contributors', function () { - //edit work added - cy.contains('app-work-stack', workTitle).within(($thisWork) => { - cy.get('button[aria-label*="Edit work"]').click() - }) - //verify link to add one more contrib is disabled - cy.contains('Add another contributor').should('have.class', 'disabled') - - //verify the panel is displayed - cy.contains('.notice-panel', noticeMessage) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/add-other-contributor-credit-role.cy.js b/cypress/e2e/contributors/add-other-contributor-credit-role.cy.js deleted file mode 100644 index 379ead2b12..0000000000 --- a/cypress/e2e/contributors/add-other-contributor-credit-role.cy.js +++ /dev/null @@ -1,65 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Other ppl contributions - add contributor with credit role', async function () { - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '3', - it('Add other contributor with credit role to a work added manually', function () { - const workType = 'Book' - const title = 'Cypress test contributors' - const otherContributorName = 'Michael Jordan' - const creditRole = 'Investigation' - - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - cy.get('#cy-work-types').click() - cy.get('#cy-work-types-panel').within(($myOptions) => { - cy.contains(workType).click() - }) - cy.get('#title-input').clear().type(title) - - //add someone else as contributor with credit role - cy.get('.cy-add-another-contributor').click() - cy.get('app-work-contributors').within(($section) => { - cy.get('[formcontrolname="creditName"]') - .clear() - .type(otherContributorName) - cy.get('[formcontrolname="role"]').click({ force: true }) - }) - //choose credit role - cy.get('[role="listbox"]').within(($list) => { - //to do REPLACE with id for the element next sprint - cy.contains(creditRole).click() - }) - - //save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - cy.wait(2000) - - //Verify work was added - cy.contains('app-panel-data', otherContributorName).within( - ($thisWork) => { - cy.contains('Show more detail').click() - } - ) - - //verify contributor is displayed in details section for this work - cy.get('app-display-attribute').contains(otherContributorName) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/add_other_contrib_duplicate_roles.cy.js b/cypress/e2e/contributors/add_other_contrib_duplicate_roles.cy.js deleted file mode 100644 index b689e5ac37..0000000000 --- a/cypress/e2e/contributors/add_other_contrib_duplicate_roles.cy.js +++ /dev/null @@ -1,95 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Add other contributor with duplicate roles - negative testing', async function () { - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '32', - it('Add other contributor with duplicate roles - negative testing', function () { - const workType = 'Book' - const title = 'Cypress test contributors 32' - const otherContributorName = 'Bryan Adams' - const creditRole = 'Conceptualization' - const fieldErrorMessage = 'Role cannot be duplicated' - const formErrorPopUp = 'Form validation error' - - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - cy.get('#cy-work-types').click() - cy.get('#cy-work-types-panel').within(($myOptions) => { - cy.contains(workType).click() - }) - cy.get('#title-input').clear().type(title) - - //add someone else as contributor with credit role - cy.get('.cy-add-another-contributor').click() - cy.get('app-work-contributors').within(($section) => { - cy.get('[formcontrolname="creditName"]') - .clear() - .type(otherContributorName) - cy.get('[formcontrolname="role"]').click({ force: true }) - }) - //choose credit role - cy.get('[role="listbox"]').within(($list) => { - cy.contains(creditRole).click() - cy.wait(1000) - }) - cy.get('app-work-contributors').within(($section) => { - cy.get('.cy-add-another-role').click() - cy.get('[formcontrolname="role"]') - .contains('No Specified Role') - .click({ force: true }) - cy.wait(2000) - }) - //choose credit role - cy.get('[role="listbox"]').within(($list) => { - cy.contains(creditRole).click() - cy.wait(1000) - }) - //form validation is displayed - cy.get('mat-error') - .contains(fieldErrorMessage, { matchCase: false }) - .should('be.visible') - - //try to save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - cy.wait(1000) - cy.get('snack-bar-container') - .contains(formErrorPopUp, { matchCase: false }) - .should('be.visible') - - //remove duplicate role - cy.get('app-work-contributors').within(($section) => { - cy.get('[id*="cy-remove-role"]').click() - }) - - //save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - - //Verify work was added - cy.contains('app-panel-data', otherContributorName).within( - ($thisWork) => { - cy.contains('Show more detail').click() - } - ) - //verify contributor is displayed in details section for this work - cy.get('app-display-attribute') - .contains(otherContributorName) - .contains(creditRole, { matchCase: false }) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/add_other_contrib_multiple_roles.cy.js b/cypress/e2e/contributors/add_other_contrib_multiple_roles.cy.js deleted file mode 100644 index 1a6f545204..0000000000 --- a/cypress/e2e/contributors/add_other_contrib_multiple_roles.cy.js +++ /dev/null @@ -1,81 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Other ppl contributions - add contributor with multiple credit roles', async function () { - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '31', - it('Add other contributor with multiple credit roles', function () { - const workType = 'Book' - const title = 'Cypress test contributors 31' - const otherContributorName = 'Tomas Edison' - const creditRole1 = 'Conceptualization' - const creditRole2 = 'Data Curation' - - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - cy.get('#cy-work-types').click() - cy.get('#cy-work-types-panel').within(($myOptions) => { - cy.contains(workType).click() - }) - cy.get('#title-input').clear().type(title) - - //add someone else as contributor with credit role - cy.get('.cy-add-another-contributor').click() - cy.get('app-work-contributors').within(($section) => { - cy.get('[formcontrolname="creditName"]') - .clear() - .type(otherContributorName) - cy.get('[formcontrolname="role"]').click({ force: true }) - }) - //choose credit role - cy.get('[role="listbox"]').within(($list) => { - cy.contains(creditRole1).click() - cy.wait(1000) - }) - cy.get('app-work-contributors').within(($section) => { - cy.get('.cy-add-another-role').click() - cy.get('[formcontrolname="role"]') - .contains('No Specified Role') - .click({ force: true }) - cy.wait(2000) - }) - //choose credit role - cy.get('[role="listbox"]').within(($list) => { - cy.contains(creditRole2).click() - cy.wait(1000) - }) - - //save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - cy.wait(2000) - - //Verify work was added - cy.contains('app-panel-data', otherContributorName).within( - ($thisWork) => { - cy.contains('Show more detail').click() - } - ) - - //verify contributor is displayed in details section for this work - cy.get('app-display-attribute') - .contains(otherContributorName) - .contains(creditRole1, { matchCase: false }) - .contains(creditRole2, { matchCase: false }) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/add_other_contrib_name_max_length.cy.js b/cypress/e2e/contributors/add_other_contrib_name_max_length.cy.js deleted file mode 100644 index 29065cafb5..0000000000 --- a/cypress/e2e/contributors/add_other_contrib_name_max_length.cy.js +++ /dev/null @@ -1,42 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Contributor name field max limit validation', async function () { - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '148', - it('Contributor name field max limit validation', function () { - const otherContributorName = userData.cyRecordOwner.contrib_name_100_chars - const errorMessage = 'Must be less than 100 characters' - - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - - //add someone else as contributor with credit role - cy.get('.cy-add-another-contributor').click() - cy.get('app-work-contributors').within(($section) => { - cy.get('[formcontrolname="creditName"]') - .clear() - .type(otherContributorName) - }) - //click outside input to check for error message - cy.get('.cy-add-another-role').click() - //verify contributor is displayed in details section for this work - cy.contains('mat-error', errorMessage).should('exist') - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/add_other_contrib_no_role.cy.js b/cypress/e2e/contributors/add_other_contrib_no_role.cy.js deleted file mode 100644 index 8ebd57b7c6..0000000000 --- a/cypress/e2e/contributors/add_other_contrib_no_role.cy.js +++ /dev/null @@ -1,58 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Other ppl contributions - add contributor with no specific credit role', async function () { - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '4', - it('Add other contributor with no specific credit role', function () { - const workType = 'Book' - const title = 'Cypress test contributors 4' - const otherContributorName = 'Charlie Chaplin' - - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - cy.get('#cy-work-types').click() - cy.get('#cy-work-types-panel').within(($myOptions) => { - cy.contains(workType).click() - }) - cy.get('#title-input').clear().type(title) - - //add someone else as contributor with credit role - cy.get('.cy-add-another-contributor').click() - cy.get('app-work-contributors').within(($section) => { - cy.get('[formcontrolname="creditName"]') - .clear() - .type(otherContributorName) - }) - - //save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - cy.wait(2000) - - //Verify work was added even when role was not selected - cy.contains('app-panel-data', otherContributorName).within( - ($thisWork) => { - cy.contains('Show more detail').click() - } - ) - - //verify contributor is displayed in details section for this work - cy.get('app-display-attribute').contains(otherContributorName) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/add_other_contrib_no_role_twice.cy.js b/cypress/e2e/contributors/add_other_contrib_no_role_twice.cy.js deleted file mode 100644 index 11150a1d0c..0000000000 --- a/cypress/e2e/contributors/add_other_contrib_no_role_twice.cy.js +++ /dev/null @@ -1,64 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Other ppl contributions - add contributor with no specific credit role twice', async function () { - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - cy.wait(2000) - }) - - qase( - '33', - it('Add other contributor with no specific credit role twice', function () { - const workType = 'Book' - const title = 'Cypress test contributors 33' - const otherContributorName = 'MacGyver' - - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - cy.get('#cy-work-types').click() - cy.get('#cy-work-types-panel').within(($myOptions) => { - cy.contains(workType).click() - }) - cy.get('#title-input').clear().type(title) - //add someone else as contributor with credit role - cy.get('.cy-add-another-contributor').click() - cy.get('app-work-contributors').within(($section) => { - cy.get('[formcontrolname="creditName"]') - .clear() - .type(otherContributorName) - //click to add another role but leave default value - cy.get('.cy-add-another-role').click() - }) - - //save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - cy.wait(2000) - - //Verify work was added even when role was not selected - cy.contains('app-work-stack', otherContributorName).within( - ($thisWork) => { - //open edit form - cy.get('button[aria-label*="Edit"]').click() - } - ) - cy.wait(2000) - //verify the contributor is displayed in the contributors section - cy.get('app-work-contributors') - .should('contain.text', otherContributorName) - //verify default role txt is NOT displayed - .and('not.contain.text', 'No Specified Role') - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/bibtex_contrib_and_ignored.cy.js b/cypress/e2e/contributors/bibtex_contrib_and_ignored.cy.js deleted file mode 100644 index 468c0697b4..0000000000 --- a/cypress/e2e/contributors/bibtex_contrib_and_ignored.cy.js +++ /dev/null @@ -1,52 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Add work using BibTeX citation where contributor list ends with "and"', async function () { - const bibtextFilePath = userData.cyRecordOwner.bibtex_qase73_path - const contribName = userData.cyRecordOwner.bibtex_qase73_contrib - - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '73', - it('Add work using BibTeX citation where contributor list ends with "and"', function () { - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-bibtext').click({ force: true }) - //use CYPRESS-UPLOAD-FILE package to bypass OS file picker modal - cy.get('[type="file"]').attachFile(bibtextFilePath) - cy.wait(2000) //need to wait for back end - - //select work - cy.get('[formcontrolname="checked"]').click() - cy.get('#cy-import-works').click() - cy.wait(2000) //load data - - //Verify work was added with contrib in summary - cy.get('app-work-stack').should('contain', contribName) - - //Summary view - 'and' is ignored - cy.contains('app-panel-data', contribName).within(($thisWork) => { - cy.contains('Contributors').parent().should('not.contain', 'and') - cy.contains('Show more detail').click() - }) - //Details section - 'and' is ignored - cy.contains('app-display-attribute', 'Contributors').should( - 'not.contain', - 'and' - ) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/bibtex_contrib_lastName_firstName.cy.js b/cypress/e2e/contributors/bibtex_contrib_lastName_firstName.cy.js deleted file mode 100644 index 18fcd20dd6..0000000000 --- a/cypress/e2e/contributors/bibtex_contrib_lastName_firstName.cy.js +++ /dev/null @@ -1,48 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Add work using BibTeX citation where accents in contributor names are escaped', async function () { - const bibtextFilePath = userData.cyRecordOwner.bibtex_qase74_path - const contribName = userData.cyRecordOwner.bibtex_qase74_contrib - - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '74', - it('Add work using BibTeX citation where accents in contributor names are escaped', function () { - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-bibtext').click({ force: true }) - //use CYPRESS-UPLOAD-FILE package to bypass OS file picker modal - cy.get('[type="file"]').attachFile(bibtextFilePath) - cy.wait(2000) //need to wait for back end - - //select work - cy.get('[formcontrolname="checked"]').click() - cy.get('#cy-import-works').click() - cy.wait(2000) //load data - - //Verify work was added with contrib in summary - cy.get('app-work-stack').should('contain', contribName) - - //Show more details - cy.contains('app-panel-data', contribName).within(($thisWork) => { - cy.contains('Show more detail').click() - }) - //verify contributor is displayed in details section for this work - cy.get('app-display-attribute').contains(contribName) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/bibtex_contrib_lastName_initial.cy.js b/cypress/e2e/contributors/bibtex_contrib_lastName_initial.cy.js deleted file mode 100644 index eda2e1b6e5..0000000000 --- a/cypress/e2e/contributors/bibtex_contrib_lastName_initial.cy.js +++ /dev/null @@ -1,48 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Add work using BibTeX citation where accents in contributor names are escaped', async function () { - const bibtextFilePath = userData.cyRecordOwner.bibtex_qase75_path - const contribName = userData.cyRecordOwner.bibtex_qase75_contrib - - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '75', - it('Add work using BibTeX citation where accents in contributor names are escaped', function () { - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-bibtext').click({ force: true }) - //use CYPRESS-UPLOAD-FILE package to bypass OS file picker modal - cy.get('[type="file"]').attachFile(bibtextFilePath) - cy.wait(2000) //need to wait for back end - - //select work - cy.get('[formcontrolname="checked"]').click() - cy.get('#cy-import-works').click() - cy.wait(2000) //load data - - //Verify work was added with contrib in summary - cy.get('app-work-stack').should('contain', contribName) - - //Show more details - cy.contains('app-panel-data', contribName).within(($thisWork) => { - cy.contains('Show more detail').click() - }) - //verify contributor is displayed in details section for this work - cy.get('app-display-attribute').contains(contribName) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/bibtex_contrib_name_escaped-accents.cy.js b/cypress/e2e/contributors/bibtex_contrib_name_escaped-accents.cy.js deleted file mode 100644 index d29c077609..0000000000 --- a/cypress/e2e/contributors/bibtex_contrib_name_escaped-accents.cy.js +++ /dev/null @@ -1,49 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Add work using BibTeX citation where accents in contributor names are escaped', async function () { - const bibtexFilePath = userData.cyRecordOwner.bibtex_qase68_path - const contribName = userData.cyRecordOwner.bibtex_qase68_contrib - - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '68', - it('Add work using BibTeX citation where accents in contributor names are escaped', function () { - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-bibtext').click({ force: true }) - cy.wait(2000) //need to wait for back end - //use CYPRESS-UPLOAD-FILE package to bypass OS file picker modal - cy.get('[type="file"]').attachFile(bibtexFilePath) - cy.wait(2000) //need to wait for back end - - //select work - cy.get('[formcontrolname="checked"]').click() - cy.get('#cy-import-works').click() - cy.wait(2000) //load data - - //Verify work was added with contrib in summary - cy.get('app-work-stack').should('contain', contribName) - - //Show more details - cy.contains('app-panel-data', contribName).within(($thisWork) => { - cy.contains('Show more detail').click() - }) - //verify contributor is displayed in details section for this work - cy.get('app-display-attribute').contains(contribName) - }) - ) //end of qase tag - - after(() => { - //log out - // cy.get('#cy-user-info').click({ force: true }) - // cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/bibtex_contrib_recordOwner_not_added_byDefault.cy.js b/cypress/e2e/contributors/bibtex_contrib_recordOwner_not_added_byDefault.cy.js deleted file mode 100644 index 2875c8a146..0000000000 --- a/cypress/e2e/contributors/bibtex_contrib_recordOwner_not_added_byDefault.cy.js +++ /dev/null @@ -1,54 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Record holder not added as default contributor to works imported from BibTeX', async function () { - const bibtextFilePath = userData.cyRecordOwner.bibtex_qase76_path - const contribName = userData.cyRecordOwner.bibtex_qase76_contrib - - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '76', - it('Record holder not added as default contributor to works imported from BibTeX', function () { - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-bibtext').click({ force: true }) - //use CYPRESS-UPLOAD-FILE package to bypass OS file picker modal - cy.get('[type="file"]').attachFile(bibtextFilePath) - cy.wait(2000) //need to wait for back end - - //select work - cy.get('[formcontrolname="checked"]').click() - cy.get('#cy-import-works').click() - cy.wait(2000) //load data - - //Verify work was added with contrib in summary - cy.get('app-work-stack').should('contain', contribName) - - //Summary view - record owner not added - cy.contains('app-panel-data', contribName).within(($thisWork) => { - cy.contains('Contributors') - .parent() - .should('not.contain', userData.cyRecordOwner.name) - cy.contains('Show more detail').click() - }) - //Details section - - record owner not added - cy.contains('app-display-attribute', 'Contributors').should( - 'not.contain', - userData.cyRecordOwner.name - ) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/bibtex_contrib_roles_displayed.cy.js b/cypress/e2e/contributors/bibtex_contrib_roles_displayed.cy.js deleted file mode 100644 index 8ef52cadf6..0000000000 --- a/cypress/e2e/contributors/bibtex_contrib_roles_displayed.cy.js +++ /dev/null @@ -1,49 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Contributor roles are imported from BibTeX citations', async function () { - const bibtextFilePath = userData.cyRecordOwner.bibtex_qase72_path - const contribName = userData.cyRecordOwner.bibtex_qase72_contrib - const contribRole = userData.cyRecordOwner.bibtex_qase72_contribRole - - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '72', - it('Contributor roles are imported from BibTeX citations', function () { - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-bibtext').click({ force: true }) - //use CYPRESS-UPLOAD-FILE package to bypass OS file picker modal - cy.get('[type="file"]').attachFile(bibtextFilePath) - cy.wait(2000) //need to wait for back end - - //select work - cy.get('[formcontrolname="checked"]').click() - cy.get('#cy-import-works').click() - cy.wait(2000) //load data - - //Verify work was added with contrib in summary - cy.get('app-work-stack').should('contain', contribName) - - //Show more details - cy.contains('app-panel-data', contribName).within(($thisWork) => { - cy.contains('Show more detail').click() - }) - //verify contributor is displayed in details section for this work - cy.get('app-display-attribute').contains(contribRole) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/bibtex_curly_brackets_contrib_name.cy.js b/cypress/e2e/contributors/bibtex_curly_brackets_contrib_name.cy.js deleted file mode 100644 index 31a2479382..0000000000 --- a/cypress/e2e/contributors/bibtex_curly_brackets_contrib_name.cy.js +++ /dev/null @@ -1,48 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Add work using BibTeX citation containing curly brackets around contributor names', async function () { - const bibtextFilePath = userData.cyRecordOwner.bibtex_qase67_path - const contribName = userData.cyRecordOwner.bibtex_qase67_contrib - - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '67', - it('Add work using BibTeX citation containing curly brackets around contributor names', function () { - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-bibtext').click({ force: true }) - //use CYPRESS-UPLOAD-FILE package to bypass OS file picker modal - cy.get('[type="file"]').attachFile(bibtextFilePath) - cy.wait(2000) //need to wait for back end - - //select work - cy.get('[formcontrolname="checked"]').click() - cy.get('#cy-import-works').click() - cy.wait(2000) //load data - - //Verify work was added with contrib in summary - cy.get('app-work-stack').should('contain', contribName) - - //Show more details - cy.contains('app-panel-data', contribName).within(($thisWork) => { - cy.contains('Show more detail').click() - }) - //verify contributor is displayed in details section for this work - cy.get('app-display-attribute').contains(contribName) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/bibtex_less_50_contrib.cy.js b/cypress/e2e/contributors/bibtex_less_50_contrib.cy.js deleted file mode 100644 index e3404691cb..0000000000 --- a/cypress/e2e/contributors/bibtex_less_50_contrib.cy.js +++ /dev/null @@ -1,48 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Add work using BibTeX citation containing multiple contributors (less than 50)', async function () { - const bibtextFilePath = userData.cyRecordOwner.bibtex_qase71_path - const contribName = userData.cyRecordOwner.bibtex_qase71_contrib - - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '71', - it('Add work using BibTeX citation containing multiple contributors (less than 50)', function () { - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-bibtext').click({ force: true }) - //use CYPRESS-UPLOAD-FILE package to bypass OS file picker modal - cy.get('[type="file"]').attachFile(bibtextFilePath) - cy.wait(2000) //need to wait for back end - - //select work - cy.get('[formcontrolname="checked"]').click() - cy.get('#cy-import-works').click() - cy.wait(2000) //load data - - //Verify work was added with contrib in summary - cy.get('app-work-stack').should('contain', contribName) - - //Show more details - cy.contains('app-panel-data', contribName).within(($thisWork) => { - cy.contains('Show more detail').click() - }) - //verify contributor is displayed in details section for this work - cy.get('app-display-attribute').contains(contribName) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/bibtex_more_50_contrib.cy.js b/cypress/e2e/contributors/bibtex_more_50_contrib.cy.js deleted file mode 100644 index 8631434550..0000000000 --- a/cypress/e2e/contributors/bibtex_more_50_contrib.cy.js +++ /dev/null @@ -1,50 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Add work using BibTeX citation containing more than 50 contributors', async function () { - const bibtextFilePath = userData.cyRecordOwner.bibtex_qase69_path - const contribName = userData.cyRecordOwner.bibtex_qase69_contrib - - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '69', - it('Add work using BibTeX citation containing more than 50 contributors', function () { - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-bibtext').click({ force: true }) - //use CYPRESS-UPLOAD-FILE package to bypass OS file picker modal - cy.get('[type="file"]').attachFile(bibtextFilePath) - cy.wait(2000) //need to wait for back end - - //select work - cy.get('[formcontrolname="checked"]').click() - cy.get('#cy-import-works').click() - cy.wait(2000) //load data - - //Verify work was added with contrib in summary - cy.get('app-work-stack').should('contain', contribName) - - //Show more details - cy.contains('app-panel-data', contribName).within(($thisWork) => { - cy.contains('Show more detail').click() - }) - //verify first 50 contrib are displayed - cy.get('app-display-attribute').contains('50') - //verify contributor is displayed in details section for this work - cy.get('app-display-attribute').contains(contribName) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/bibtex_single_contrib.cy.js b/cypress/e2e/contributors/bibtex_single_contrib.cy.js deleted file mode 100644 index 1ced1a0a03..0000000000 --- a/cypress/e2e/contributors/bibtex_single_contrib.cy.js +++ /dev/null @@ -1,48 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Add work using BibTeX citation containing a single contributor', async function () { - const bibtextFilePath = userData.cyRecordOwner.bibtex_qase70_path - const contribName = userData.cyRecordOwner.bibtex_qase70_contrib - - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '70', - it('Add work using BibTeX citation containing a single contributor', function () { - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-bibtext').click({ force: true }) - //use CYPRESS-UPLOAD-FILE package to bypass OS file picker modal - cy.get('[type="file"]').attachFile(bibtextFilePath) - cy.wait(2000) //need to wait for back end - - //select work - cy.get('[formcontrolname="checked"]').click() - cy.get('#cy-import-works').click() - cy.wait(2000) //load data - - //Verify work was added with contrib in summary - cy.get('app-work-stack').should('contain', contribName) - - //Show more details - cy.contains('app-panel-data', contribName).within(($thisWork) => { - cy.contains('Show more detail').click() - }) - //verify contributor is displayed in details section for this work - cy.get('app-display-attribute').contains(contribName) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/contrib-name-accented-characters.cy.js b/cypress/e2e/contributors/contrib-name-accented-characters.cy.js deleted file mode 100644 index f425871277..0000000000 --- a/cypress/e2e/contributors/contrib-name-accented-characters.cy.js +++ /dev/null @@ -1,52 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('contributor name - accented characters', async function () { - const workType = 'Book' - const title = 'Cypress test contributors 28' - const name = 'àáâãäåçèéêëìíîðñòôõöö' - - before(() => {}) - - qase( - '28', - it('contributor name - accented characters', function () { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - - //go to add work form - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - cy.wait(1000) - cy.get('[formcontrolname="workType"]').click() - cy.get('[role="listbox"], [aria-label="work-type-label"]') - .contains(workType) - .click() - cy.get('#title-input').clear().type(title) - cy.get('.cy-add-another-contributor').click() - cy.get('app-work-contributors').within(() => { - cy.get('[formcontrolname="creditName"]').clear().type(name) - //leave default role - }) - - //save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - - //Verify work was added - cy.get('#cy-works', { timeout: 10000 }).should('contain', title) - - //verify contributors name is displayed - cy.get('#cy-works').should('contain', name) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/contrib-name-languages-arabic.cy.js b/cypress/e2e/contributors/contrib-name-languages-arabic.cy.js deleted file mode 100644 index c6735677f1..0000000000 --- a/cypress/e2e/contributors/contrib-name-languages-arabic.cy.js +++ /dev/null @@ -1,51 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('contributor name - language - Arabic', async function () { - const workType = 'Book' - const title = 'Cypress test contributors 27' - const name = 'عبد الواحد آريسر' - - before(() => {}) - - qase( - '27', - it('contributor name - language - Arabic', function () { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - - //go to add work form - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - cy.wait(1000) - cy.get('[formcontrolname="workType"]').click() - cy.get('[role="listbox"], [aria-label="work-type-label"]') - .contains(workType) - .click() - cy.get('#title-input').clear().type(title) - cy.get('.cy-add-another-contributor').click() - cy.get('app-work-contributors').within(() => { - cy.get('[formcontrolname="creditName"]').clear().type(name) - //leave default role - }) - //save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - - //Verify work was added - cy.get('#cy-works', { timeout: 10000 }).should('contain', title) - - //verify contributors name is displayed - cy.get('#cy-works').should('contain', name) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/contrib-name-languages-chinese.cy.js b/cypress/e2e/contributors/contrib-name-languages-chinese.cy.js deleted file mode 100644 index 087bcf5f37..0000000000 --- a/cypress/e2e/contributors/contrib-name-languages-chinese.cy.js +++ /dev/null @@ -1,51 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('contributor name - language - Chinese', async function () { - const workType = 'Book' - const title = 'Cypress test contributors 26' - const name = '姚明' - - before(() => {}) - - qase( - '26', - it('contributor name - language - Chinese', function () { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - - //go to add work form - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - cy.wait(1000) - cy.get('[formcontrolname="workType"]').click() - cy.get('[role="listbox"], [aria-label="work-type-label"]') - .contains(workType) - .click() - cy.get('#title-input').clear().type(title) - cy.get('.cy-add-another-contributor').click() - cy.get('app-work-contributors').within(() => { - cy.get('[formcontrolname="creditName"]').clear().type(name) - //leave default role - }) - //save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - - //Verify work was added - cy.get('#cy-works', { timeout: 10000 }).should('contain', title) - - //verify contributors name is displayed - cy.get('#cy-works').should('contain', name) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/contrib-name-languages-russian.cy.js b/cypress/e2e/contributors/contrib-name-languages-russian.cy.js deleted file mode 100644 index 76fec50454..0000000000 --- a/cypress/e2e/contributors/contrib-name-languages-russian.cy.js +++ /dev/null @@ -1,51 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('contributor name - language - Russian', async function () { - const workType = 'Book' - const title = 'Cypress test contributors 25' - const name = 'Евгений Денисов' - - before(() => {}) - - qase( - '25', - it('contributor name - language - Russian', function () { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - - //go to add work form - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - cy.wait(1000) - cy.get('[formcontrolname="workType"]').click() - cy.get('[role="listbox"], [aria-label="work-type-label"]') - .contains(workType) - .click() - cy.get('#title-input').clear().type(title) - cy.get('.cy-add-another-contributor').click() - cy.get('app-work-contributors').within(() => { - cy.get('[formcontrolname="creditName"]').clear().type(name) - //leave default role - }) - //save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - - //Verify work was added - cy.get('#cy-works', { timeout: 10000 }).should('contain', title) - - //verify contributors name is displayed - cy.get('#cy-works').should('contain', name) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/contrib-name-required-field.cy.js b/cypress/e2e/contributors/contrib-name-required-field.cy.js deleted file mode 100644 index 3ef7516d97..0000000000 --- a/cypress/e2e/contributors/contrib-name-required-field.cy.js +++ /dev/null @@ -1,47 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('contributor name field is required', async function () { - const workType = 'Book' - const title = 'Cypress test contributors 29' - const errorTxt = 'Contributor name is required' - - before(() => {}) - - qase( - '29', - it('contributor name field is required', function () { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - - //go to add work form - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - cy.wait(1000) - cy.get('[formcontrolname="workType"]').click() - cy.get('[role="listbox"], [aria-label="work-type-label"]') - .contains(workType) - .click() - cy.get('#title-input').clear().type(title) - cy.get('.cy-add-another-contributor').click() - - //save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - - //Verify error message is displayed - cy.get('mat-error').contains(errorTxt).should('be.visible') - //cancel - cy.get('#cancel-work-button').click() - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/contributor-counter-automatically-updated.cy.js b/cypress/e2e/contributors/contributor-counter-automatically-updated.cy.js deleted file mode 100644 index 70ceb23faf..0000000000 --- a/cypress/e2e/contributors/contributor-counter-automatically-updated.cy.js +++ /dev/null @@ -1,57 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Counter in contributors section updates accordingly while adding a work', async function () { - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '6', - it('Counter in contributors section is updated accordingly while adding a work', function () { - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - - //only record owner listed - cy.get('app-work-contributors').contains('Contributors to this work (1)') - //add a second contributor - cy.get('.cy-add-another-contributor').click() - cy.get('#draggable-1').within(() => { - cy.get('[formcontrolname="creditName"]').clear().type('Name2') - }) - cy.get('app-work-contributors').contains('Contributors to this work (2)') - //add a third contributor - cy.get('.cy-add-another-contributor').click() - cy.get('#draggable-2').within(() => { - cy.get('[formcontrolname="creditName"]').clear().type('Name3') - }) - cy.get('app-work-contributors').contains('Contributors to this work (3)') - - //remove second contributor - cy.get('app-work-contributors').within(($contribSection) => { - cy.get('#cy-delete-button-1').click() - }) - cy.get('app-work-contributors').contains('Contributors to this work (2)') - - //remove third contributor - cy.get('app-work-contributors').within(($contribSection) => { - cy.get('#cy-delete-button-1').click() - }) - cy.get('app-work-contributors').contains('Contributors to this work (1)') - - //close form - cy.get('#cancel-work-button') - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/contributor-name-100-chars.cy.js b/cypress/e2e/contributors/contributor-name-100-chars.cy.js deleted file mode 100644 index 1892eccb35..0000000000 --- a/cypress/e2e/contributors/contributor-name-100-chars.cy.js +++ /dev/null @@ -1,52 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('contributor name with 100 characters', async function () { - const workType = 'Book' - const title = 'Cypress test contributors 23' - const name = - 'namehas100charsnamehas100charsnamehas100charsnamehas100charsnamehas100charsnamehas100charsnamehas100' - const errorTxt = 'Must be less than 100 characters' - - before(() => {}) - - qase( - '23', - it('contributor name with 100 characters (99)', function () { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - - //go to add work form - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - cy.wait(1000) - cy.get('[formcontrolname="workType"]').click() - cy.get('[role="listbox"], [aria-label="work-type-label"]') - .contains(workType) - .click() - cy.get('#title-input').clear().type(title) - cy.get('.cy-add-another-contributor').click() - cy.get('app-work-contributors').within(() => { - cy.get('[formcontrolname="creditName"]').clear().type(name) - //leave default role - }) - //save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - - //Verify error message is displayed - cy.get('mat-error').contains(errorTxt).should('be.visible') - //cancel - cy.get('#cancel-work-button').click() - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/contributor-name-99-chars.cy.js b/cypress/e2e/contributors/contributor-name-99-chars.cy.js deleted file mode 100644 index e74f6e4ed3..0000000000 --- a/cypress/e2e/contributors/contributor-name-99-chars.cy.js +++ /dev/null @@ -1,51 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('contributor name with less than 100 characters', async function () { - const workType = 'Book' - const title = 'Cypress test contributors 24' - const name = - 'namehas99charsnamehas99charsnamehas99charsnamehas99charsnamehas99charsnamehas99charsnamehas99chars!' - - before(() => {}) - - qase( - '24', - it('contributor name with less than 100 characters (99)', function () { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - - //go to add work form - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - cy.wait(1000) - cy.get('[formcontrolname="workType"]').click() - cy.get('[role="listbox"], [aria-label="work-type-label"]') - .contains(workType) - .click() - cy.get('#title-input').clear().type(title) - cy.get('.cy-add-another-contributor').click() - cy.get('app-work-contributors').within(() => { - cy.get('[formcontrolname="creditName"]').clear().type(name) - //leave default role - }) - //save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - - //Verify work was added - cy.get('#cy-works', { timeout: 10000 }).should('contain', title) - //Verify name is displayed - cy.get('#cy-works', { timeout: 10000 }).should('contain', name) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/contributor-name-over-100-chars.cy.js b/cypress/e2e/contributors/contributor-name-over-100-chars.cy.js deleted file mode 100644 index a2ce942dd2..0000000000 --- a/cypress/e2e/contributors/contributor-name-over-100-chars.cy.js +++ /dev/null @@ -1,52 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('contributor name over 100 characters', async function () { - const workType = 'Book' - const title = 'Cypress test contributors 22' - const name = - 'nameover100charnameover100charnameover100charnameover100charnameover100charnameover100charnameover100' - const errorTxt = 'Must be less than 100 characters' - - before(() => {}) - - qase( - '22', - it('contributor name over 100 characters (99)', function () { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - - //go to add work form - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - cy.wait(1000) - cy.get('[formcontrolname="workType"]').click() - cy.get('[role="listbox"], [aria-label="work-type-label"]') - .contains(workType) - .click() - cy.get('#title-input').clear().type(title) - cy.get('.cy-add-another-contributor').click() - cy.get('app-work-contributors').within(() => { - cy.get('[formcontrolname="creditName"]').clear().type(name) - //leave default role - }) - //save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - - //Verify error message is displayed - cy.get('mat-error').contains(errorTxt).should('be.visible') - //cancel - cy.get('#cancel-work-button').click() - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/delegate_adds_work.cy.js b/cypress/e2e/contributors/delegate_adds_work.cy.js deleted file mode 100644 index 91e950df0f..0000000000 --- a/cypress/e2e/contributors/delegate_adds_work.cy.js +++ /dev/null @@ -1,61 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Account delegate adds work with contributors', async function () { - before(() => { - cy.intercept('POST', '/switch-user?**').as('switchUser') - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyDelegate) - cy.wait(2000) - }) - - qase( - '34', - it('Account delegate adds work with contributors', function () { - const workType = 'Book' - const title = 'Cypress test contributors 34 - delegate' - - cy.contains('a', 'Switch to').click({ force: true }) - cy.contains(userData.cyRecordOwner.oid).click({ force: true }) - cy.wait('@switchUser') - //work around for cypress to aknowledge we switched users - cy.visit('/my-orcid') - //verify we switched to record owner account - cy.get('#status-bar').should('contain', userData.cyRecordOwner.oid) - - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - cy.get('#cy-work-types').click() - cy.get('#cy-work-types-panel').within(($myOptions) => { - cy.contains(workType).click() - }) - cy.get('#title-input').clear().type(title) - - //save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - cy.wait(2000) - - //Verify work was added for the record owner not the delegate - cy.contains('app-work-stack', title).within(($thisWork) => { - cy.contains('Show more detail').click() - cy.get('app-display-attribute').should( - 'contain', - userData.cyRecordOwner.name, - { - matchCase: false, - } - ) - }) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/delete-contrib-adding-work.cy.js b/cypress/e2e/contributors/delete-contrib-adding-work.cy.js deleted file mode 100644 index b64a762297..0000000000 --- a/cypress/e2e/contributors/delete-contrib-adding-work.cy.js +++ /dev/null @@ -1,52 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Delete contributor while adding a work', async function () { - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '7', - it('Delete contributor while adding a work', function () { - const workType = 'Book' - const title = 'Cypress test contributors 7' - - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - cy.get('#cy-work-types').click() - cy.get('#cy-work-types-panel').within(($myOptions) => { - cy.contains(workType).click() - }) - cy.get('#title-input').clear().type(title) - - //remove the record owner as contributor - cy.get('app-work-contributors').within(($contribSection) => { - cy.get('#cy-delete-button-0').click() - }) - - //save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - cy.wait(2000) - - //Verify work was added - cy.contains('app-work-stack', title).within(($thisWork) => { - cy.contains('Show more detail').click() - cy.get('app-panel-data').should('not.include.text', 'Contributors', { - matchCase: false, - }) - }) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/delete-contrib-editing-work.cy.js b/cypress/e2e/contributors/delete-contrib-editing-work.cy.js deleted file mode 100644 index da2f8df6c0..0000000000 --- a/cypress/e2e/contributors/delete-contrib-editing-work.cy.js +++ /dev/null @@ -1,60 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Delete contributor while editing a work', async function () { - const workType = 'Book' - const title = 'Cypress test contributors 9' - - before(() => { - //add a work manually - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - cy.get('#cy-work-types').click() - cy.get('#cy-work-types-panel').within(($myOptions) => { - cy.contains(workType).click() - }) - cy.get('#title-input').clear().type(title) - //save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - cy.wait(2000) - }) - - qase( - '9', - it('Delete contributor while editing a work', function () { - //edit work added - cy.contains('app-work-stack', title).within(($thisWork) => { - cy.get('button[aria-label*="Edit work"]').click() - }) - - //remove the record owner as contributor - cy.get('app-work-contributors').within(($contribSection) => { - cy.get('#cy-delete-button-0').click() - }) - - //save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - cy.wait(2000) - - //Verify work was edited - cy.contains('app-work-stack', title).within(($thisWork) => { - cy.contains('Show more detail').click() - cy.get('app-panel-data').should('not.include.text', 'Contributors', { - matchCase: false, - }) - }) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/doi_add_self_as_contrib.cy.js b/cypress/e2e/contributors/doi_add_self_as_contrib.cy.js deleted file mode 100644 index f4156e5b87..0000000000 --- a/cypress/e2e/contributors/doi_add_self_as_contrib.cy.js +++ /dev/null @@ -1,56 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Add self as contributor to work added from DOI', async function () { - const extId = userData.cyRecordOwner.doi_qase85_extId - - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '85', - it('Add self as contributor to work added from DOI', function () { - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-doi').click({ force: true }) - cy.get('#external-id-input').clear().type(extId) - cy.get('[id^="cy-retrieve-work-details"]').click() - cy.wait(2000) - - //add self as contributor - cy.get('#cy-add-record-holder-contributor').click() - cy.wait(2000) - //verify contributors loaded - cy.contains('.credit-name-and-roles', userData.cyRecordOwner.name).should( - 'exist' - ) - - cy.get('#save-work-button').click({ force: true }) - cy.wait(4000) //waiting for backend - - //Summary view - record owner not added - cy.contains('app-panel-data', extId).within(($thisWork) => { - cy.contains('Contributors') - .parent() - .should('include.text', userData.cyRecordOwner.name) - cy.contains('Show more detail').click() - }) - //Details section - - record owner not added - cy.contains('app-display-attribute', 'Contributors').should( - 'include.text', - userData.cyRecordOwner.name - ) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/doi_contrib_recordOwner_not_added_byDefault.cy.js b/cypress/e2e/contributors/doi_contrib_recordOwner_not_added_byDefault.cy.js deleted file mode 100644 index 560123ac1a..0000000000 --- a/cypress/e2e/contributors/doi_contrib_recordOwner_not_added_byDefault.cy.js +++ /dev/null @@ -1,54 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Record holder not added as default contributor to works imported from DOI', async function () { - const extId = userData.cyRecordOwner.doi_qase77_extId - const contribName = userData.cyRecordOwner.doi_qase77_contrib - - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '77', - it('Record holder not added as default contributor to works imported from DOI', function () { - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-doi').click({ force: true }) - cy.get('#external-id-input').clear().type(extId) - cy.get('[id^="cy-retrieve-work-details"]').click() - cy.wait(2000) - - //verify contributors loaded - cy.contains('.credit-name-and-roles', contribName).should('exist') - cy.get('#save-work-button').click() - cy.wait(2000) //waiting for backend - - //Verify work was added with contrib in summary - cy.get('app-work-stack').should('contain', contribName) - - //Summary view - record owner not added - cy.contains('app-panel-data', contribName).within(($thisWork) => { - cy.contains('Contributors') - .parent() - .should('not.contain', userData.cyRecordOwner.name) - cy.contains('Show more detail').click() - }) - //Details section - - record owner not added - cy.contains('app-display-attribute', 'Contributors').should( - 'not.contain', - userData.cyRecordOwner.name - ) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/manually-add-contributor-credit-role.cy.js b/cypress/e2e/contributors/manually-add-contributor-credit-role.cy.js deleted file mode 100644 index 7e6761658a..0000000000 --- a/cypress/e2e/contributors/manually-add-contributor-credit-role.cy.js +++ /dev/null @@ -1,52 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Manually add work with contributor credit role', async function () { - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - //manually adding a simple work entry - //choosing a contributor credit role for the record owner - qase( - '1', - it('Manually add work with contributor credit role', function () { - const workType = 'Book' - const title = 'Cypress test contributors 1' - const creditRole = 'Conceptualization' - - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - cy.get('#cy-work-types').click() - cy.get('#cy-work-types-panel').within(($myOptions) => { - cy.contains(workType).click() - }) - cy.get('#title-input').clear().type(title) - cy.get('[formcontrolname="role"]').click() //TO DO: replace locators with ids - cy.get('[role="listbox"][aria-label="Please select a role"]').within( - ($myOptions) => { - cy.contains(creditRole).click() - } - ) - //save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - cy.wait(1000) //wait for the page to refresh - //Verify work was added - cy.get('#cy-works', { timeout: 10000 }).should('contain', title) - - //verify contributors info is displayed - cy.get('#cy-works').should('contain', creditRole) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/pubMed_contrib_recordOwner_not_added_byDefault.cy.js b/cypress/e2e/contributors/pubMed_contrib_recordOwner_not_added_byDefault.cy.js deleted file mode 100644 index 97a7680707..0000000000 --- a/cypress/e2e/contributors/pubMed_contrib_recordOwner_not_added_byDefault.cy.js +++ /dev/null @@ -1,57 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Record holder not added as default contributor to works imported from PubMed', async function () { - const pubMediaUrl = 'https://pubmed.ncbi.nlm.nih.gov/' - const extId = userData.cyRecordOwner.pubMed_qase78_extId - const contribName = userData.cyRecordOwner.pubMed_qase78_contrib - - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '78', - it('Record holder not added as default contributor to works imported from PubMed', function () { - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-pubmed').click({ force: true }) - cy.get('#external-id-input') - .clear() - .type(pubMediaUrl + extId) - cy.get('[id^="cy-retrieve-work-details"]').click() - cy.wait(4000) //waiting for backend - - //verify contributors loaded - cy.contains('.credit-name-and-roles', contribName).should('exist') - cy.get('#save-work-button').click() - cy.wait(4000) //waiting for backend - - //Verify work was added with contrib in summary - cy.get('app-work-stack').should('contain', contribName) - - //Summary view - record owner not added - cy.contains('app-panel-data', contribName).within(($thisWork) => { - cy.contains('Contributors') - .parent() - .should('not.contain', userData.cyRecordOwner.name) - cy.contains('Show more detail').click() - }) - //Details section - - record owner not added - cy.contains('app-display-attribute', 'Contributors').should( - 'not.contain', - userData.cyRecordOwner.name - ) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/contributors/pubMedia_add_self_as_contrib.cy.js b/cypress/e2e/contributors/pubMedia_add_self_as_contrib.cy.js deleted file mode 100644 index b134a971cc..0000000000 --- a/cypress/e2e/contributors/pubMedia_add_self_as_contrib.cy.js +++ /dev/null @@ -1,59 +0,0 @@ -/// - -import userData from '../../fixtures/contributors-fixtures/contributors-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Add self as contributor to work added from PubMed ID', async function () { - const pubMediaUrl = 'https://pubmed.ncbi.nlm.nih.gov/' - const extId = userData.cyRecordOwner.pubMed_qase86_extId - - before(() => { - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyRecordOwner) - }) - - qase( - '86', - it('Add self as contributor to work added from PubMed ID', function () { - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-pubmed').click({ force: true }) - cy.get('#external-id-input') - .clear() - .type(pubMediaUrl + extId) - cy.get('[id^="cy-retrieve-work-details"]').click() - cy.wait(2000) - - //add self as contributor - cy.get('#cy-add-record-holder-contributor').click() - cy.wait(2000) - //verify contributors loaded - cy.contains('.credit-name-and-roles', userData.cyRecordOwner.name).should( - 'exist' - ) - - cy.get('#save-work-button').click({ force: true }) - cy.wait(4000) //waiting for backend - - //Summary view - record owner not added - cy.contains('app-panel-data', extId).within(($thisWork) => { - cy.contains('Contributors') - .parent() - .should('include.text', userData.cyRecordOwner.name) - cy.contains('Show more detail').click() - }) - //Details section - - record owner not added - cy.contains('app-display-attribute', 'Contributors').should( - 'include.text', - userData.cyRecordOwner.name - ) - }) - ) //end of qase tag - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/inbox_notifications/add-someone-trusted-individual.cy.js b/cypress/e2e/inbox_notifications/add-someone-trusted-individual.cy.js deleted file mode 100644 index a8b35fd335..0000000000 --- a/cypress/e2e/inbox_notifications/add-someone-trusted-individual.cy.js +++ /dev/null @@ -1,46 +0,0 @@ -/// - -import inboxNotifUsers from '../../fixtures/inboxNotif-users.fixture.json' -import testingUsers from '../../fixtures/testing-users.fixture.json' - -describe('Inbox: add someone as trusted individual', async function () { - before(() => { - //log in - cy.visit(Cypress.env('signInURL')) - cy.signin(inboxNotifUsers.cyNotifPerm) - }) - - it('Notification is received when user adds someone as trusted individual', function () { - //go to inbox - cy.get('#cy-user-info').click() - cy.get('#cy-trusted-parties-panel').wait(1000).click({ force: true }) - cy.get('app-settings-trusted-individuals-search').within(() => { - cy.get('input').clear().type(testingUsers.cyAcctSettVisibilityUser.oid) - cy.get('#cy-search-orcid-for-trusted-individuals').click() - }) - cy.wait(2000) //time to search and load modal - cy.get('#cy-add-as-trusted-individual').click({ force: true }) - //verify record was added under Trusted Individuals section - cy.get('app-settings-trusted-individuals').within(() => { - cy.get('td').contains(testingUsers.cyAcctSettVisibilityUser.oid) - }) - //go check the inbox has the corresponding notification - cy.get('#cy-user-info').click() - cy.get('#cy-inbox').wait(1000).click({ force: true }) - - cy.get('app-notification').contains('YOUR RECORD').click() - cy.contains('Trusted Individual').should('be.visible') - }) - - after(() => { - //CLEAN INBOX: archive all notifications - cy.get('[class="control-container"]').within(() => { - cy.get('mat-checkbox').click() - }) - cy.get('button').contains('Archive').click() - cy.wait(2000) //wait for back end to complete - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/inbox_notifications/added-trusted-individual-by-admin.cy.js b/cypress/e2e/inbox_notifications/added-trusted-individual-by-admin.cy.js deleted file mode 100644 index ab6e2337e6..0000000000 --- a/cypress/e2e/inbox_notifications/added-trusted-individual-by-admin.cy.js +++ /dev/null @@ -1,74 +0,0 @@ -/// - -import inboxNotifUsers from '../../fixtures/inboxNotif-users.fixture.json' -import otherUsers from '../../fixtures/testing-users.fixture.json' - -describe('Inbox: added as trusted individual by an admin user', async function () { - before(() => { - cy.visit(Cypress.env('signInURL')) - //admin logs in - cy.task('generateOTP', Cypress.env('cy_admin_secret')).then((token) => { - cy.signin2FA(token) - }) - //admin adds record as trusted party - cy.get('#cy-user-info').click() - cy.get('#cy-admin-actions').wait(1000).click({ force: true }) - cy.contains('Trusted Individuals').click() - cy.get('#managed').clear().type(otherUsers.cyAcctSettVisibilityUser.oid) - cy.get('#trusted').clear().type(inboxNotifUsers.cyNotifPerm.oid) - cy.get('#bottom-confirm-delegate-profile').click() - cy.wait(2000) - //FIX pending: ideally admin user logs out before next steps - }) - - it('Admin user adds X as trsuted individual for Y: Y receives notification and confirms, then X receives notification.', () => { - cy.visit(Cypress.env('signInURL')) - cy.contains('Not you?').click() //remove once the admin is able to log out in the before hook - cy.wait(2000) - //log in record owner - cy.signin(otherUsers.cyAcctSettVisibilityUser) - //go check the inbox has the corresponding notification - cy.get('#cy-user-info').click() - cy.get('#cy-inbox').wait(1000).click({ force: true }) - cy.get('app-notification').contains('YOUR RECORD').click() - cy.contains('https://qa.orcid.org/account/authorize-delegates?').should( - 'be.visible' - ) - cy.contains('https://qa.orcid.org/account/authorize-delegates?') - .should('have.attr', 'href') - .then((href) => { - cy.visit(href) - }) - //go check the inbox has the corresponding notification - cy.wait(3000).get('#cy-user-info').click({ force: true }) - cy.get('#cy-inbox').wait(1000).click({ force: true }) - cy.get('[class="control-container"]').within(() => { - cy.get('mat-checkbox').click() - }) - //log out record owner - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - - //sign in account delegate - cy.signin(inboxNotifUsers.cyNotifPerm) - //go check the inbox has the corresponding notification - cy.get('#cy-user-info').click() - cy.get('#cy-inbox').wait(1000).click({ force: true }) - cy.get('app-notification').contains('YOUR RECORD').click() - cy.contains('You have been made an Account Delegate by').should( - 'be.visible' - ) - }) - - after(() => { - //CLEAN INBOX: archive all notifications - cy.get('[class="control-container"]').within(() => { - cy.get('mat-checkbox').click() - }) - cy.get('button').contains('Archive').click() - cy.wait(2000) //wait for back end to complete - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/inbox_notifications/employment-inbox-notif.cy.js b/cypress/e2e/inbox_notifications/employment-inbox-notif.cy.js deleted file mode 100644 index afd128201d..0000000000 --- a/cypress/e2e/inbox_notifications/employment-inbox-notif.cy.js +++ /dev/null @@ -1,154 +0,0 @@ -/// - -import userData from '../../fixtures/inboxNotif-users.fixture.json' - -describe('Inbox: add/update/delete Employment via API', async function () { - const curlAddEmployment = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -d '" + - userData.cyNotifPerm.curlEmploymentPath + - "' -X POST '" + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_employmentEndpoint') + - "'" - - const curlReadAllEmployments = - "curl -i -H 'Accept: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -X GET '" + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_allEmploymentsEndpoint') + - "'" - - const curlReadSingleEmployment = - "curl -i -H 'Accept: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -X GET '" + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_employmentEndpoint') + - '/' //here append "{PUTCODE}" + "'" - - const curlPutEmployment = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -d '" + - userData.cyNotifPerm.curlEmploymentUpdatePath + - "' -X PUT '" + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_employmentEndpoint') + - '/' //here append "{PUTCODE}"+ "'" - - const curlDeleteEmployment = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -X DELETE '" + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_employmentEndpoint') + - '/' //here append "{PUTCODE}"+ "'" - - before(() => { - //log in - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyNotifPerm) - //go to inbox - cy.get('#cy-user-info').click() - cy.get('#cy-inbox').wait(1000).click({ force: true }) - }) - - it('Inbox notifications are received when Employment is added/updated/deleted via API', function () { - let putCode - let updatedContent - - //Client adds an employment - cy.exec(curlAddEmployment).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 201 - expect(response.stdout).to.contain('HTTP/2 201') - }) - - //#1 check inbox has the notification for adding - cy.reload() - cy.wait(2000) - cy.get('app-notification').contains('YOUR RECORD').click() - cy.contains('Added').should('be.visible') - cy.get('button').contains('Archive').click() - - //Read employments to grab putcode - //There should only be one employment - cy.exec(curlReadAllEmployments).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 200 - expect(response.stdout).to.contain('HTTP/2 200') - //grab put code - const responseString = response.stdout - const putcodeIndex = responseString.indexOf('put-code":') - const putCodeStartPosition = putcodeIndex + 10 // +length - const putCodeEndPosition = responseString.indexOf(',"department') - putCode = responseString.substring( - putCodeStartPosition, - putCodeEndPosition - ) - cy.exec(curlReadSingleEmployment + putCode + "'").then( - (singleEmploymentResp) => { - //remove non json header from string - const jsonStartIndex = - singleEmploymentResp.stdout.indexOf('{"created-date"') //where does the json start? - updatedContent = singleEmploymentResp.stdout.substring(jsonStartIndex) - //update the employment: make a change in the content - updatedContent = updatedContent.replace( - userData.cyNotifPerm.contentToBeReplaced, - userData.cyNotifPerm.replaceWith - ) - //write the file to use for the PUT - cy.writeFile(userData.cyNotifPerm.putWriteFilePath, updatedContent) - } - ) - - //Client Updates the employment - cy.exec(curlPutEmployment + putCode + "'").then((responsePUT) => { - //verify curl was executed successfully - expect(responsePUT.code).to.eq(0) - //verify http response status is successful: 200 - expect(responsePUT.stdout).to.contain('HTTP/2 200') - }) - //#2 verify the notification is received for updating - cy.reload() - cy.wait(2000) - cy.get('app-notification').contains('YOUR RECORD').click() - cy.contains('Updated').should('be.visible') - - //Client deletes employment with that put code - cy.exec(curlDeleteEmployment + putCode + "'").then((responseDelete) => { - //verify curl was executed successfully - expect(responseDelete.code).to.eq(0) - //verify http response status is successful: 204 - expect(responseDelete.stdout).to.contain('HTTP/2 204') - }) - //#3 verify the notification was received for deleting - cy.reload() - cy.wait(2000) - cy.get('app-notification').contains('YOUR RECORD').click() - cy.contains('Deleted').should('be.visible') - }) - }) - - after(() => { - //CLEAN INBOX: archive all notifications - cy.get('[class="control-container"]').within(() => { - cy.get('mat-checkbox').click() - }) - cy.get('button').contains('Archive').click() - cy.wait(2000) //wait for back end to complete - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/inbox_notifications/funding-inbox-notif.cy.js b/cypress/e2e/inbox_notifications/funding-inbox-notif.cy.js deleted file mode 100644 index 798fb77f48..0000000000 --- a/cypress/e2e/inbox_notifications/funding-inbox-notif.cy.js +++ /dev/null @@ -1,155 +0,0 @@ -/// - -import userData from '../../fixtures/inboxNotif-users.fixture.json' - -describe('Inbox: add/update/delete funding via API', async function () { - const curlAddFunding = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -d '" + - userData.cyNotifPerm.curlFundingPath + - "' -X POST '" + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_fundingsEndpoint') + - "'" - - const curlReadAllFundings = - "curl -i -H 'Accept: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -X GET '" + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_allFundingsEndpoint') + - "'" - - const curlReadSingleFunding = - "curl -i -H 'Accept: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -X GET '" + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_fundingsEndpoint') + - '/' //here append "{PUTCODE}" + "'" - - const curlPutFunding = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -d '" + - userData.cyNotifPerm.curlFundingUpdatePath + - "' -X PUT '" + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_fundingsEndpoint') + - '/' //here append "{PUTCODE}" - - const curlDeleteFunding = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -X DELETE '" + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_fundingsEndpoint') + - '/' //here append "{PUTCODE}" - - before(() => { - //log in - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyNotifPerm) - //go to inbox - cy.get('#cy-user-info').click() - cy.get('#cy-inbox').wait(1000).click({ force: true }) - }) - - it('Inbox notifications are received when funding is added/updated/deleted via API', function () { - let putCode - let updatedContent - - //Client adds funding - cy.exec(curlAddFunding).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 201 - expect(response.stdout).to.contain('HTTP/2 201') - }) - - //#1 check inbox has the notification for adding - cy.reload() - cy.wait(2000) - cy.get('app-notification').contains('YOUR RECORD').click() - cy.contains('Added').should('be.visible') - cy.get('button').contains('Archive').click() - - //Read works to grab putcode - //There should only be one funding - cy.exec(curlReadAllFundings).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 200 - expect(response.stdout).to.contain('HTTP/2 200') - //grab put code - const responseString = response.stdout - const putcodeIndex = responseString.indexOf('funding/') - const putCodeStartPosition = putcodeIndex + 8 // +length - const putCodeEndPosition = responseString.indexOf('","display-index') - putCode = responseString.substring( - putCodeStartPosition, - putCodeEndPosition - ) - cy.log(putCode) - cy.exec(curlReadSingleFunding + putCode + "'").then((singleFundResp) => { - //remove non json header from string - const jsonStartIndex = singleFundResp.stdout.indexOf('{"created-date"') //where does the json start? - updatedContent = singleFundResp.stdout.substring(jsonStartIndex) - //update the employment: make a change in the content - updatedContent = updatedContent.replace( - userData.cyNotifPerm.fundingToBeReplaced, - userData.cyNotifPerm.fundingReplaceWith - ) - //write the file to use for the PUT - cy.writeFile( - userData.cyNotifPerm.funding_putWriteFilePath, - updatedContent - ) - }) - - //Client Updates the work - cy.exec(curlPutFunding + putCode + "'").then((responsePUT) => { - //verify curl was executed successfully - expect(responsePUT.code).to.eq(0) - //verify http response status is successful: 200 - expect(responsePUT.stdout).to.contain('HTTP/2 200') - }) - //#2 verify the notification is received for updating - cy.reload() - cy.wait(2000) - cy.get('app-notification').contains('YOUR RECORD').click() - cy.contains('Updated').should('be.visible') - - //Client deletes work with that put code - cy.exec(curlDeleteFunding + putCode + "'").then((responseDelete) => { - //verify curl was executed successfully - expect(responseDelete.code).to.eq(0) - //verify http response status is successful: 204 - expect(responseDelete.stdout).to.contain('HTTP/2 204') - }) - //#3 verify the notification was received for deleting - cy.reload() - cy.wait(2000) - cy.get('app-notification').contains('YOUR RECORD').click() - cy.contains('Deleted').should('be.visible') - }) - }) - - after(() => { - //CLEAN INBOX: archive all notifications - cy.get('[class="control-container"]').within(() => { - cy.get('mat-checkbox').click() - }) - cy.get('button').contains('Archive').click() - cy.wait(2000) //wait for back end to complete - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/inbox_notifications/peer-review-inbox-notif.cy.js b/cypress/e2e/inbox_notifications/peer-review-inbox-notif.cy.js deleted file mode 100644 index d834f0397c..0000000000 --- a/cypress/e2e/inbox_notifications/peer-review-inbox-notif.cy.js +++ /dev/null @@ -1,155 +0,0 @@ -/// - -import userData from '../../fixtures/inboxNotif-users.fixture.json' - -describe('Inbox: add/update/delete peer reviews via API', async function () { - const curlAddPeerReview = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -d '" + - userData.cyNotifPerm.curlPeerReviewPath + - "' -X POST '" + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_peerReviewEndpoint') + - "'" - - const curlReadAllPeerReviews = - "curl -i -H 'Accept: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -X GET '" + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_allPeerReviewsEndpoint') + - "'" - - const curlReadSinglePeerReview = - "curl -i -H 'Accept: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -X GET '" + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_peerReviewEndpoint') + - '/' //here append "{PUTCODE}" + "'" - - const curlPutPeerReview = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -X PUT -d '" + - userData.cyNotifPerm.curlPeerReviewUpdatePath + - "' " + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_peerReviewEndpoint') + - '/' //here append "{PUTCODE}" - - const curlDeletePeerReview = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -X DELETE " + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_peerReviewEndpoint') + - '/' //here append "{PUTCODE}" - - before(() => { - //log in - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyNotifPerm) - //go to inbox - cy.get('#cy-user-info').click() - cy.get('#cy-inbox').wait(1000).click({ force: true }) - }) - - it('Inbox notifications are received when peer review is added/updated/deleted via API', function () { - let putCode - let updatedContent - - //Client adds an work - cy.exec(curlAddPeerReview).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 201 - expect(response.stdout).to.contain('HTTP/2 201') - }) - - //#1 check inbox has the notification for adding - cy.reload() - cy.wait(2000) - cy.get('app-notification').contains('YOUR RECORD').click() - cy.contains('Added').should('be.visible') - cy.get('button').contains('Archive').click() - - //Read works to grab putcode - //There should only be one work - cy.exec(curlReadAllPeerReviews).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 200 - expect(response.stdout).to.contain('HTTP/2 200') - //grab put code - const responseString = response.stdout - const putcodeIndex = responseString.indexOf('peer-review/') - const putCodeStartPosition = putcodeIndex + 12 // +length - const putCodeEndPosition = responseString.indexOf('","display-index') - putCode = responseString.substring( - putCodeStartPosition, - putCodeEndPosition - ) - cy.log(putCode) - cy.exec(curlReadSinglePeerReview + putCode + "'").then((singlePR) => { - //remove non json header from string - const jsonStartIndex = singlePR.stdout.indexOf('{"created-date"') //where does the json start? - updatedContent = singlePR.stdout.substring(jsonStartIndex) - //update the employment: make a change in the content - updatedContent = updatedContent.replace( - userData.cyNotifPerm.peerReviewToBeReplaced, - userData.cyNotifPerm.peerReviewReplaceWith - ) - //write the file to use for the PUT - cy.writeFile( - userData.cyNotifPerm.peerReview_putWriteFilePath, - updatedContent - ) - }) - - //Client Updates the work - cy.exec(curlPutPeerReview + putCode).then((responsePUT) => { - //verify curl was executed successfully - expect(responsePUT.code).to.eq(0) - //verify http response status is successful: 200 - expect(responsePUT.stdout).to.contain('HTTP/2 200') - }) - //#2 verify the notification is received for updating - cy.reload() - cy.wait(2000) - cy.get('app-notification').contains('YOUR RECORD').click() - cy.contains('Updated').should('be.visible') - - //Client deletes work with that put code - cy.exec(curlDeletePeerReview + putCode).then((responseDelete) => { - //verify curl was executed successfully - expect(responseDelete.code).to.eq(0) - //verify http response status is successful: 204 - expect(responseDelete.stdout).to.contain('HTTP/2 204') - }) - //#3 verify the notification was received for deleting - cy.reload() - cy.wait(2000) - cy.get('app-notification').contains('YOUR RECORD').click() - cy.contains('Deleted').should('be.visible') - }) - }) - - after(() => { - //CLEAN INBOX: archive all notifications - cy.get('[class="control-container"]').within(() => { - cy.get('mat-checkbox').click() - }) - cy.get('button').contains('Archive').click() - cy.wait(2000) //wait for back end to complete - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/inbox_notifications/permission_notif.cy.js b/cypress/e2e/inbox_notifications/permission_notif.cy.js deleted file mode 100644 index fb2b5ecebe..0000000000 --- a/cypress/e2e/inbox_notifications/permission_notif.cy.js +++ /dev/null @@ -1,48 +0,0 @@ -/// - -import userData from '../../fixtures/inboxNotif-users.fixture.json' - -describe('Inbox: Permission Notification', async function () { - before(() => { - //log in - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyNotifPerm) - }) - - it('Verify Permission Notification was received', function () { - const curlStatement = - "curl -k -i -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -H 'Content-type: application/json' -X POST -d '" + - userData.cyNotifPerm.curlPermissionNotifPath + - "' " + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_notifPermEndpoint') - - //trigger permission notification - cy.exec(curlStatement).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 201 - expect(response.stdout).to.contain('HTTP/2 201') - }) - //check inbox - cy.get('#cy-user-info').click() - cy.get('#cy-inbox').wait(1000).click({ force: true }) - cy.get('app-notification').contains('PERMISSIONS').click() - //check the button to grant permission is displayed - cy.get('button').contains('Grant permission').should('be.visible') - }) - - after(() => { - //CLEAN INBOX: archive notification - cy.get('app-notification').within(() => { - cy.get('button').contains('Archive').click() - }) - cy.wait(2000) //wait for back end to complete - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/inbox_notifications/research-resource-inbox-notif.cy.js b/cypress/e2e/inbox_notifications/research-resource-inbox-notif.cy.js deleted file mode 100644 index af698689a1..0000000000 --- a/cypress/e2e/inbox_notifications/research-resource-inbox-notif.cy.js +++ /dev/null @@ -1,155 +0,0 @@ -/// - -import userData from '../../fixtures/inboxNotif-users.fixture.json' - -describe('Inbox: add/update/delete research resource via API', async function () { - const curlAddResearch = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -d '" + - userData.cyNotifPerm.curlResearchPath + - "' -X POST '" + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_researchEndpoint') + - "'" - - const curlReadAllResearchResources = - "curl -i -H 'Accept: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -X GET '" + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_allResearchEndpoint') + - "'" - - const curlReadSingleResearch = - "curl -i -H 'Accept: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -X GET '" + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_researchEndpoint') + - '/' //here append "{PUTCODE}" + "'" - - const curlPutResearch = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -X PUT -d '" + - userData.cyNotifPerm.curlResearchUpdatePath + - "' " + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_researchEndpoint') + - '/' //here append "{PUTCODE}" - - const curlDeleteResearch = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -X DELETE " + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_researchEndpoint') + - '/' //here append "{PUTCODE}" - - before(() => { - //log in - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyNotifPerm) - //go to inbox - cy.get('#cy-user-info').click() - cy.get('#cy-inbox').wait(1000).click({ force: true }) - }) - - it('Inbox notifications are received when research resource is added/updated/deleted via API', function () { - let putCode - let updatedContent - - //Client adds an work - cy.exec(curlAddResearch).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 201 - expect(response.stdout).to.contain('HTTP/2 201') - }) - - //#1 check inbox has the notification for adding - cy.reload() - cy.wait(2000) - cy.get('app-notification').contains('YOUR RECORD').click() - cy.contains('Added').should('be.visible') - cy.get('button').contains('Archive').click() - - //Read works to grab putcode - //There should only be one work - cy.exec(curlReadAllResearchResources).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 200 - expect(response.stdout).to.contain('HTTP/2 200') - //grab put code - const responseString = response.stdout - const putcodeIndex = responseString.indexOf('research-resource/') - const putCodeStartPosition = putcodeIndex + 18 // +length - const putCodeEndPosition = responseString.indexOf('","display-index') - putCode = responseString.substring( - putCodeStartPosition, - putCodeEndPosition - ) - cy.log(putCode) - cy.exec(curlReadSingleResearch + putCode + "'").then((singleResearch) => { - //remove non json header from string - const jsonStartIndex = singleResearch.stdout.indexOf('{"created-date"') //where does the json start? - updatedContent = singleResearch.stdout.substring(jsonStartIndex) - //update the employment: make a change in the content - updatedContent = updatedContent.replace( - userData.cyNotifPerm.researchToBeReplaced, - userData.cyNotifPerm.researchReplaceWith - ) - //write the file to use for the PUT - cy.writeFile( - userData.cyNotifPerm.research_putWriteFilePath, - updatedContent - ) - }) - - //Client Updates the work - cy.exec(curlPutResearch + putCode).then((responsePUT) => { - //verify curl was executed successfully - expect(responsePUT.code).to.eq(0) - //verify http response status is successful: 200 - expect(responsePUT.stdout).to.contain('HTTP/2 200') - }) - //#2 verify the notification is received for updating - cy.reload() - cy.wait(2000) - cy.get('app-notification').contains('YOUR RECORD').click() - cy.contains('Updated').should('be.visible') - - //Client deletes work with that put code - cy.exec(curlDeleteResearch + putCode).then((responseDelete) => { - //verify curl was executed successfully - expect(responseDelete.code).to.eq(0) - //verify http response status is successful: 204 - expect(responseDelete.stdout).to.contain('HTTP/2 204') - }) - //#3 verify the notification was received for deleting - cy.reload() - cy.wait(2000) - cy.get('app-notification').contains('YOUR RECORD').click() - cy.contains('Deleted').should('be.visible') - }) - }) - - after(() => { - //CLEAN INBOX: archive all notifications - cy.get('[class="control-container"]').within(() => { - cy.get('mat-checkbox').click() - }) - cy.get('button').contains('Archive').click() - cy.wait(2000) //wait for back end to complete - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/inbox_notifications/work-inbox-notif.cy.js b/cypress/e2e/inbox_notifications/work-inbox-notif.cy.js deleted file mode 100644 index 1fba7f8778..0000000000 --- a/cypress/e2e/inbox_notifications/work-inbox-notif.cy.js +++ /dev/null @@ -1,151 +0,0 @@ -/// - -import userData from '../../fixtures/inboxNotif-users.fixture.json' - -describe('Inbox: add/update/delete work via API', async function () { - const curlAddWork = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -d '" + - userData.cyNotifPerm.curlWorkPath + - "' -X POST '" + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_workEndpoint') + - "'" - - const curlReadAllWorks = - "curl -i -H 'Accept: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -X GET '" + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_allWorksEndpoint') + - "'" - - const curlReadSingleWork = - "curl -i -H 'Accept: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -X GET '" + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_workEndpoint') + - '/' //here append "{PUTCODE}" + "'" - - const curlPutWork = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -X PUT -d '" + - userData.cyNotifPerm.curlWorkUpdatePath + - "' " + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_workEndpoint') + - '/' //here append "{PUTCODE}" - - const curlDeleteWork = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -X DELETE " + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_workEndpoint') + - '/' //here append "{PUTCODE}" - - before(() => { - //log in - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyNotifPerm) - //go to inbox - cy.get('#cy-user-info').click() - cy.get('#cy-inbox').wait(1000).click({ force: true }) - }) - - it('Inbox notifications are received when Work is added/updated/deleted via API', function () { - let putCode - let updatedContent - - //Client adds an work - cy.exec(curlAddWork).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 201 - expect(response.stdout).to.contain('HTTP/2 201') - }) - - //#1 check inbox has the notification for adding - cy.reload() - cy.wait(2000) - cy.get('app-notification').contains('YOUR RECORD').click() - cy.contains('Added').should('be.visible') - cy.get('button').contains('Archive').click() - - //Read works to grab putcode - //There should only be one work - cy.exec(curlReadAllWorks).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 200 - expect(response.stdout).to.contain('HTTP/2 200') - //grab put code - const responseString = response.stdout - const putcodeIndex = responseString.indexOf('put-code":') - const putCodeStartPosition = putcodeIndex + 10 // +length - const putCodeEndPosition = responseString.indexOf(',"created-date') - putCode = responseString.substring( - putCodeStartPosition, - putCodeEndPosition - ) - cy.exec(curlReadSingleWork + putCode + "'").then((singleWorkResp) => { - //remove non json header from string - const jsonStartIndex = singleWorkResp.stdout.indexOf('{"created-date"') //where does the json start? - updatedContent = singleWorkResp.stdout.substring(jsonStartIndex) - //update the employment: make a change in the content - updatedContent = updatedContent.replace( - userData.cyNotifPerm.workToBeReplaced, - userData.cyNotifPerm.workReplaceWith - ) - //write the file to use for the PUT - cy.writeFile(userData.cyNotifPerm.work_putWriteFilePath, updatedContent) - }) - - //Client Updates the work - cy.exec(curlPutWork + putCode).then((responsePUT) => { - //verify curl was executed successfully - expect(responsePUT.code).to.eq(0) - //verify http response status is successful: 200 - expect(responsePUT.stdout).to.contain('HTTP/2 200') - }) - //#2 verify the notification is received for updating - cy.reload() - cy.wait(2000) - cy.get('app-notification').contains('YOUR RECORD').click() - cy.contains('Updated').should('be.visible') - - //Client deletes work with that put code - cy.exec(curlDeleteWork + putCode).then((responseDelete) => { - //verify curl was executed successfully - expect(responseDelete.code).to.eq(0) - //verify http response status is successful: 204 - expect(responseDelete.stdout).to.contain('HTTP/2 204') - }) - //#3 verify the notification was received for deleting - cy.reload() - cy.wait(2000) - cy.get('app-notification').contains('YOUR RECORD').click() - cy.contains('Deleted').should('be.visible') - }) - }) - - after(() => { - //CLEAN INBOX: archive all notifications - cy.get('[class="control-container"]').within(() => { - cy.get('mat-checkbox').click() - }) - cy.get('button').contains('Archive').click() - cy.wait(2000) //wait for back end to complete - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/inbox_notifications/work-no-update-no-notif.cy.js b/cypress/e2e/inbox_notifications/work-no-update-no-notif.cy.js deleted file mode 100644 index 3a76d523e7..0000000000 --- a/cypress/e2e/inbox_notifications/work-no-update-no-notif.cy.js +++ /dev/null @@ -1,147 +0,0 @@ -/// - -import userData from '../../fixtures/inboxNotif-users.fixture.json' - -describe('Inbox: no notification sent when update has no changes', async function () { - const curlAddWork = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -d '" + - userData.cyNotifPerm.curlWorkPath + - "' -X POST '" + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_workEndpoint') + - "'" - - const curlReadAllWorks = - "curl -i -H 'Accept: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -X GET '" + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_allWorksEndpoint') + - "'" - - const curlReadSingleWork = - "curl -i -H 'Accept: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -X GET '" + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_workEndpoint') + - '/' //here append "{PUTCODE}" + "'" - - const curlPutWork = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -X PUT -d '" + - userData.cyNotifPerm.curlWorkUpdatePath + - "' " + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_workEndpoint') + - '/' //here append "{PUTCODE}" - - const curlDeleteWork = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyNotifPerm.clientBearer + - "' -X DELETE " + - Cypress.env('membersAPI_URL') + - userData.cyNotifPerm.oid + - Cypress.env('membersAPI_workEndpoint') + - '/' //here append "{PUTCODE}" - - before(() => { - //log in - cy.visit(Cypress.env('signInURL')) - cy.signin(userData.cyNotifPerm) - //go to inbox - cy.get('#cy-user-info').click() - cy.get('#cy-inbox').wait(1000).click({ force: true }) - }) - - it('Inbox notifications are not sent when update is sent with no actual changes', function () { - let putCode - let updatedContent - - //Client adds an work - cy.exec(curlAddWork).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 201 - expect(response.stdout).to.contain('HTTP/2 201') - }) - - //#1 check inbox has the notification for adding - cy.reload() - cy.wait(2000) - cy.get('app-notification').contains('YOUR RECORD').click() - cy.contains('Added').should('be.visible') - cy.get('button').contains('Archive').click() - - //Read works to grab putcode - //There should only be one work - cy.exec(curlReadAllWorks).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 200 - expect(response.stdout).to.contain('HTTP/2 200') - //grab put code - const responseString = response.stdout - const putcodeIndex = responseString.indexOf('put-code":') - const putCodeStartPosition = putcodeIndex + 10 // +length - const putCodeEndPosition = responseString.indexOf(',"created-date') - putCode = responseString.substring( - putCodeStartPosition, - putCodeEndPosition - ) - cy.exec(curlReadSingleWork + putCode + "'").then((singleWorkResp) => { - //remove non json header from string - const jsonStartIndex = singleWorkResp.stdout.indexOf('{"created-date"') //where does the json start? - updatedContent = singleWorkResp.stdout.substring(jsonStartIndex) - //do not make any changes - //write the file to use for the PUT - cy.writeFile(userData.cyNotifPerm.work_putWriteFilePath, updatedContent) - }) - - //Client Updates the work - cy.exec(curlPutWork + putCode).then((responsePUT) => { - //verify curl was executed successfully - expect(responsePUT.code).to.eq(0) - //verify http response status is successful: 200 - expect(responsePUT.stdout).to.contain('HTTP/2 200') - }) - //#2 verify no notification is received for the PUT - cy.reload() - cy.wait(2000) - cy.get('app-notification').contains('YOUR RECORD').click() - cy.contains('Updated').should('not.exist') - - //Client deletes work with that put code - cy.exec(curlDeleteWork + putCode).then((responseDelete) => { - //verify curl was executed successfully - expect(responseDelete.code).to.eq(0) - //verify http response status is successful: 204 - expect(responseDelete.stdout).to.contain('HTTP/2 204') - }) - //#3 verify the notification was received for deleting - cy.reload() - cy.wait(2000) - cy.get('app-notification').contains('YOUR RECORD').click() - cy.contains('Deleted').should('be.visible') - }) - }) - - after(() => { - //CLEAN INBOX: archive all notifications - cy.get('[class="control-container"]').within(() => { - cy.get('mat-checkbox').click() - }) - cy.get('button').contains('Archive').click() - cy.wait(2000) //wait for back end to complete - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/legacy_oldScripts/01. Release QA.cy.js b/cypress/e2e/legacy_oldScripts/01. Release QA.cy.js deleted file mode 100644 index 00446801e4..0000000000 --- a/cypress/e2e/legacy_oldScripts/01. Release QA.cy.js +++ /dev/null @@ -1,341 +0,0 @@ -const date = require('../../helpers/date') -let name - -describe('"Manual" QA Tests', () => { - beforeEach(() => { - Cypress.Cookies.preserveOnce('XSRF-TOKEN', 'JSESSIONID') - }) - - context('Check the cookies banner', () => { - it('Clear cookies', () => { - cy.clearCookies() - }) - - it('Visit https://qa.orcid.org/ and find the cookies banner', () => { - cy.visit('qa.orcid.org') - cy.get('app-banner').contains( - 'ORCID uses cookies to improve your experience and to help us understand how you use our websites. Learn more about how we use cookies.' - ) - cy.getIframeBody('#launcher').find('span').contains('Help').click() - }) - }) - - context('Registration', () => { - it('Access the registration page', () => { - cy.get('button[aria-label="sign in or register"]').click() - cy.get('app-sign-in').contains('Register now').click({ force: true }) - }) - - it('Generate name, write it down into a file for later use', () => { - name = date() - cy.writeFile('./cypress/integration/registry/data/name.txt', date()) - }) - - it('Registration step 1', () => { - // Bypass the duplicated research call to avoid getting the "Is this you modal" - cy.server() - cy.route({ - method: 'GET', - url: '/dupicateResearcher.json*', - response: {}, - }) - - // Only get items inside app-step-a - cy.get('app-step-a').within(() => { - cy.get('input[formcontrolname="givenNames"]') - .type('ma_test') - .should('have.value', 'ma_test') - cy.get('input[formcontrolname="familyNames"]') - .type(name) - .should('have.value', name) - cy.get('input[formcontrolname="email"]') - .type('ma_test_' + name + '@mailinator.com') - .should('have.value', 'ma_test_' + name + '@mailinator.com') - cy.get('input[formcontrolname="confirmEmail"]') - .type('ma_test_' + name + '@mailinator.com') - .should('have.value', 'ma_test_' + name + '@mailinator.com') - cy.get('input') - .last() - .type('00_ma_test_' + name + '@mailinator.com') - .should('have.value', '00_ma_test_' + name + '@mailinator.com') - cy.get('a[role="button"]').contains('addAdd another email').click() - cy.get('input') - .last() - .type('01_ma_test_' + name + '@mailinator.com') - .should('have.value', '01_ma_test_' + name + '@mailinator.com') - cy.get('button') - // Wait until the step is marked as validated - .filter('.ng-valid [type="submit"]') - .click() - }) - }) - - it('Registration step 2', () => { - cy.get('app-step-b').within(() => { - cy.get('.mat-card-header-text:visible').should( - 'have.text', - 'Create your ORCID iDThis is step 2 of 3' - ) - cy.get('input[formcontrolname="password"]') - .type('test1234') - .should('have.value', 'test1234') - .and('have.attr', 'type', 'password') - cy.get('input[formcontrolname="passwordConfirm"]') - .type('test1234') - .should('have.value', 'test1234') - .and('have.attr', 'type', 'password') - cy.get('input:visible') - .filter('[type="checkbox"]') - .check({ force: true }) - .should('be.checked') - cy.get('button:visible') - .filter('app-step-b.ng-valid [type="submit"]') - .click() - }) - }) - - it('Registration step 3', () => { - cy.get('app-step-c').within(() => { - cy.get('mat-radio-group[formcontrolname="activitiesVisibilityDefault"]') - .contains('Everyone') - .click() - .parent() - .should('have.class', 'mat-radio-checked') - cy.get('input:visible') - .filter('[type="checkbox"]') - .check({ force: true }) - .should('be.checked') - // Wrap iframe body into a cypress object and perform test within there - cy.getIframeBody('iframe').within(() => { - cy.get('.recaptcha-checkbox-border').click() - cy.get('#recaptcha-anchor', { timeout: 10000 }).should( - 'have.class', - 'recaptcha-checkbox-checked' - ) - }) - cy.get('button:visible').contains('REGISTER').click() - }) - }) - }) - - context('Verification 1: Request Verification Messages', () => { - it('Send 2nd verification message', () => { - cy.contains('Resend verification email', { timeout: 20000 }).click() - cy.wait(1000) - cy.get('button').filter('.btn-white-no-border').contains('Close').click() - }) - - it('Attempt to edit biography and send 3rd verification message', () => { - cy.get('.edit-biography', { timeout: 20000 }).click({ force: true }) - cy.get('#colorbox #modal-close') - .contains('Resend verification email') - .click() - cy.get('button').filter('.btn-white-no-border').contains('Close').click() - }) - - it('Sign out', () => { - cy.get('user-menu').click() - cy.get('a:visible') - .filter('[href="https://qa.orcid.org/signout"]') - .click() - }) - }) - - // Domain switch to mailinator.com - - context('Verification 2: Mailinator Tests', () => { - it('Visit Mailinator', () => { - cy.visit('https://mailinator.com') - }) - - it('Retrieve ORCID name', () => { - cy.readFile('./cypress/integration/registry/data/name.txt').then( - (content) => { - name = content - } - ) - }) - - it('Sign into Mailinator', () => { - cy.visit('https://mailinator.com') - cy.get('#addOverlay') - .type('ma_test_' + name) - .should('have.value', 'ma_test_' + name) - cy.get('#go-to-public').click() - }) - - it('Verify there are three emails present', () => { - cy.get('tbody:visible', { timeout: 120000 }) - .find('tr') - .should('have.length', 3) - }) - - it('Click the first message', () => { - cy.get('tbody').children().first().click(100, 15) - }) - it('Fetch the verification link', () => { - cy.getIframeBody('iframe') - .find('a') - .contains('Verify your email address') - .should('have.attr', 'href') - .then((href) => { - cy.writeFile('./cypress/integration/registry/data/link.txt', href) - }) - }) - }) - - context('Verification 3: Wrapping Up', () => { - it('Visit verification link', () => { - cy.readFile('./cypress/integration/registry/data/link.txt').then( - (href) => { - cy.visit(href) - } - ) - }) - - it('Retrieve ORCID name', () => { - cy.readFile('./cypress/integration/registry/data/name.txt').then( - (content) => { - name = content - } - ) - }) - - it('Sign in', () => { - cy.get('input[formcontrolname="username"]') - .type('ma_test_' + name + '@mailinator.com') - .should('have.value', 'ma_test_' + name + '@mailinator.com') - cy.get('input[formcontrolname="password"]') - .type('test1234') - .should('have.value', 'test1234') - .and('have.attr', 'type', 'password') - cy.get('button[type="submit"]').click() - }) - - it('Save ORCID iD into a file', () => { - cy.get('#orcid-id') - .invoke('text') - .then((orcid) => { - cy.writeFile('./cypress/integration/registry/data/orcid.txt', orcid) - }) - }) - - it('Sign out', () => { - cy.get('user-menu').click() - cy.get('a:visible') - .filter('[href="https://qa.orcid.org/signout"]') - .click() - }) - }) - - context('Password reset procedure 1: Request Link', () => { - it('Find and click the "Forgot your password or ORCID ID?" button', () => { - cy.get('a:visible').contains('Forgot your password or ORCID ID?').click() - cy.wait(1000) - }) - it('Request password reset link', () => { - cy.get('input:visible') - .filter('[formcontrolname="email"]') - .type('ma_test_' + name + '@mailinator.com') - .should('have.value', 'ma_test_' + name + '@mailinator.com') - cy.get('button:visible').filter('[type="submit"]').click() - }) - it('Reload', () => { - cy.reload() - }) - it('Request ORCID iD', () => { - cy.get('mat-chip:visible').filter('[value="remindOrcidId"]').click() - cy.get('input:visible') - .filter('[formcontrolname="email"]') - .type('ma_test_' + name + '@mailinator.com') - .should('have.value', 'ma_test_' + name + '@mailinator.com') - cy.get('button:visible').filter('[type="submit"]').click() - }) - }) - - context('Password reset procedure 2: Mailinator', () => { - it('Visit Mailinator', () => { - cy.visit('https://mailinator.com') - }) - - it('Retrieve ORCID name', () => { - cy.readFile('./cypress/integration/registry/data/name.txt').then( - (content) => { - name = content - } - ) - }) - - it('Sign into Mailinator', () => { - cy.get('#addOverlay') - .type('ma_test_' + name) - .should('have.value', 'ma_test_' + name) - cy.get('#go-to-public').click() - }) - - it('Check that the "About your ORCID iD" message is present', () => { - cy.get('tbody:visible') - .find('tr', { timeout: 120000 }) - .should('have.length', 5) - .contains('Your ORCID iD') - }) - - it('Open the reset password message', () => { - cy.get('tbody') - .children() - .contains('About your password reset request') - .click(100, 15) - }) - it('Fetch the password reset link', () => { - cy.getIframeBody('iframe') - .find('a') - .contains('qa.orcid.org/reset-password-email') - .should('have.attr', 'href') - .then((href) => { - cy.writeFile('./cypress/integration/registry/data/link.txt', href) - }) - }) - }) - - context('Password reset procedure 3: ', () => { - it('Retrieve ORCID name', () => { - cy.readFile('./cypress/integration/registry/data/link.txt').then( - (href) => { - cy.visit(href) - } - ) - }) - - it('Retrieve ORCID name', () => { - cy.readFile('./cypress/integration/registry/data/name.txt').then( - (content) => { - name = content - } - ) - }) - - it('Reset password', () => { - cy.get('#passwordField').type(name) - cy.get('#retypedPassword').type(name) - cy.get('button:visible').contains('Save changes').click() - }) - - it('Sign in using new credentials', () => { - cy.get('input[formcontrolname="username"]') - .type('ma_test_' + name + '@mailinator.com') - .should('have.value', 'ma_test_' + name + '@mailinator.com') - cy.get('input[formcontrolname="password"]') - .type(name) - .should('have.value', name) - .and('have.attr', 'type', 'password') - cy.get('button[type="submit"]').click() - }) - - it('Sign out', () => { - cy.get('user-menu').click() - cy.get('a:visible') - .filter('[href="https://qa.orcid.org/signout"]') - .click() - }) - }) -}) diff --git a/cypress/e2e/legacy_oldScripts/google-analytics.cy.js b/cypress/e2e/legacy_oldScripts/google-analytics.cy.js deleted file mode 100644 index 620d76f639..0000000000 --- a/cypress/e2e/legacy_oldScripts/google-analytics.cy.js +++ /dev/null @@ -1,55 +0,0 @@ -/// -import { env } from 'process' -import { environment } from '../cypress.env' -const oauthUrlBuilder = require('../helpers/oauthUrlBuilder') -const runInfo = require('../helpers/runInfo') - -describe(`Google Analytics${runInfo()}`, function () { - before(() => { - cy.clearCookies() - }) - beforeEach(function () {}) - - it(`Landing on the homepage and then navigate to the signin page`, function () { - cy.visit(`${environment.baseUrl}`) - cy.expectGtagInitialization(`/`) - cy.get(`#menu-signin-button `).click() - cy.expectGtagNavigation(`/signin`) - cy.get(`@ga`).then((value) => expect(value.callCount).to.be.eq(6)) - }) - - it(`Landing on sign in page and goes to the homepage`, function () { - cy.visit(`${environment.baseUrl}/signin`) - cy.expectGtagInitialization(`/signin`) - cy.get(`#home-logo`).click() - cy.expectGtagNavigation(`/`) - cy.get(`@ga`).then((value) => expect(value.callCount).to.be.eq(6)) - }) - - it(`Lands on home page and navigate to the register`, function () { - cy.visit(`${environment.baseUrl}`) - cy.expectGtagInitialization(`/`) - cy.get(`#menu-signin-button `).click() - cy.expectGtagNavigation(`/signin`) - cy.get(`#register-button`).click() - cy.expectGtagNavigation(`/register`) - cy.get(`@ga`).then((value) => expect(value.callCount).to.be.eq(8)) - }) - - it(`Lands on the Oauth page goes to the register page`, function () { - const oauthParams = oauthUrlBuilder({ - client_id: environment.validApp.id, - response_type: 'code', - scope: `/authenticate openid`, - redirect_uri: environment.validApp.redirectUrl, - }) - - cy.visit(`${environment.baseUrl}/oauth/authorize${oauthParams}`) - cy.expectGtagInitialization(`/signin` + oauthParams) - cy.get(`#register-button`).click() - cy.expectGtagNavigation(`/register` + oauthParams) - cy.get(`@ga`).then((value) => expect(value.callCount).to.be.eq(6)) - }) - - // TODO @leomendoza123 test register and Oauth events -}) diff --git a/cypress/e2e/legacy_oldScripts/homepage.cy.js b/cypress/e2e/legacy_oldScripts/homepage.cy.js deleted file mode 100644 index e748709084..0000000000 --- a/cypress/e2e/legacy_oldScripts/homepage.cy.js +++ /dev/null @@ -1,66 +0,0 @@ -/// -import { environment } from '../cypress.env' -const oauthUrlBuilder = require('../helpers/oauthUrlBuilder') -const runInfo = require('../helpers/runInfo') - -describe('Homepage' + runInfo(), () => { - // it('Has no detectable a11y critical violations', () => { - // cy.visit(`${environment.baseUrl}`) - // .injectAxe() //TODO: Angular 14 aupdate need me to remove this old axe lib for now - // .checkA11y(null, { - // includedImpacts: ['critical'], - // }) - // }) - - if (environment.newInfoSiteEnable) { - it(`has a header with working navigation buttons to the info site`, function () { - cy.visit(`${environment.baseUrl}`, { - onBeforeLoad(win) { - win.outOfRouterNavigation = () => {} - cy.stub(win, 'outOfRouterNavigation') - }, - }) - .get(`.button-wrapper:nth-child(1)`) - .click() - .window() - .its('outOfRouterNavigation') - .should('be.calledWith', environment.infoSiteBaseUrl + '/what-is-orcid') - - .get(`.button-wrapper:nth-child(2)`) - .click() - .window() - .its('outOfRouterNavigation') - .should( - 'be.calledWith', - environment.infoSiteBaseUrl + '/benefits-for-researchers' - ) - - .get(`.button-wrapper:nth-child(3)`) - .click() - .window() - .its('outOfRouterNavigation') - .should( - 'be.calledWith', - environment.infoSiteBaseUrl + '/about-membership' - ) - - .get(`.button-wrapper:nth-child(4)`) - .click() - .window() - .its('outOfRouterNavigation') - .should('be.calledWith', environment.infoSiteBaseUrl + '/documentation') - - .get(`.button-wrapper:nth-child(5)`) - .click() - .window() - .its('outOfRouterNavigation') - .should('be.calledWith', environment.infoSiteBaseUrl + '/resources') - - .get(`.button-wrapper:nth-child(6)`) - .click() - .window() - .its('outOfRouterNavigation') - .should('be.calledWith', environment.infoSiteBaseUrl + '/') - }) - } -}) diff --git a/cypress/e2e/legacy_oldScripts/my-orcid-affiliations.cy.js b/cypress/e2e/legacy_oldScripts/my-orcid-affiliations.cy.js deleted file mode 100644 index 48b12c0568..0000000000 --- a/cypress/e2e/legacy_oldScripts/my-orcid-affiliations.cy.js +++ /dev/null @@ -1,52 +0,0 @@ -/// -const runInfo = require('../../helpers/runInfo') - -describe('Affiliations' + runInfo(), () => { - describe('Employment' + runInfo(), () => { - it('show an option to add more items', () => {}) - it('show an option to edit items', () => {}) - it('display a user with no items', () => { - // TODO ?? - }) - - describe('display a user with an item added by the same user', () => { - it('show the number of works as 1', () => {}) - it('display the item privacy', () => {}) - it('show the item details', () => {}) - it('opens external URLs on a separate tab', () => {}) - it('show the item edit button', () => {}) - it('can be deleted', () => {}) - }) - - describe('display a user with an item added with the API', () => { - it('show the number of items on the title as 1', () => {}) - it('show the item source', () => {}) - it('show the item "make a copy and edit" button', () => {}) - it('can be deleted', () => {}) - }) - - describe('display a user with an item added with multiple sources', () => { - it('show the number of items on the title as 1', () => {}) - it('show the item multiple sources', () => {}) - it('expand and show the multiple sources of the same item', () => { - // TODO ?? - }) - }) - - describe('display a user with many items', () => { - // TODO ?? - it('show the number of items on the title as N', () => {}) - it('can sort the items by the end date', () => {}) - it('can sort the items by start date', () => {}) - it('can sort the items by start title', () => {}) - }) - }) - - // REPEAT ALL THE SAME TESTs for the following - describe('Distinction' + runInfo(), () => {}) - describe('Qualification' + runInfo(), () => {}) - describe('Membership' + runInfo(), () => {}) - describe('Service' + runInfo(), () => {}) - describe('Education' + runInfo(), () => {}) - describe('Invited Position' + runInfo(), () => {}) -}) diff --git a/cypress/e2e/legacy_oldScripts/my-orcid-funding.cy.js b/cypress/e2e/legacy_oldScripts/my-orcid-funding.cy.js deleted file mode 100644 index dbc7d00b7e..0000000000 --- a/cypress/e2e/legacy_oldScripts/my-orcid-funding.cy.js +++ /dev/null @@ -1,53 +0,0 @@ -/// -import { environment } from '../../cypress.env' -const randomUser = require('../../helpers/randomUser') -const runInfo = require('../../helpers/runInfo') - -describe('Funding' + runInfo(), () => { - before(() => { - cy.programmaticSignin('testUser') - }) - before(() => { - cy.visit(`${environment.baseUrl}/qa/my-orcid`) - }) - beforeEach(() => { - Cypress.Cookies.preserveOnce('XSRF-TOKEN', 'JSESSIONID') - }) - - it('display a user with no fundings', () => { - cy.get('app-fundings').within(() => { - cy.get('h2').should('not.exist') - }) - }) - - it('programatically add a funding and verify it displays correctly', () => { - cy.createFunding() - .reload(true) - .get('app-fundings') - .within(() => { - cy.get('h2').contains('Funding title') - cy.get('app-funding').within(() => { - cy.get('app-panel-data') - .eq(0) - .within(() => { - cy.get('.data-content').within(() => { - cy.contains('2000-01 to 2031-12 | Award') - cy.contains('http://qa.orcid.org') - cy.contains('grant_number:').contains('1234567890') - }) - cy.get('.align-end-content').find('a').click() - }) - cy.get('app-panel-data') - .eq(1) - .within(() => { - cy.get('.data-content').within(() => { - cy.contains('CRC 1,000,000') - cy.contains('(Spanish)') - cy.contains('Translated title') - cy.contains('This is the description') - }) - }) - }) - }) - }) -}) diff --git a/cypress/e2e/legacy_oldScripts/my-orcid-main-bar.cy.js b/cypress/e2e/legacy_oldScripts/my-orcid-main-bar.cy.js deleted file mode 100644 index 7ec852cc8c..0000000000 --- a/cypress/e2e/legacy_oldScripts/my-orcid-main-bar.cy.js +++ /dev/null @@ -1,53 +0,0 @@ -import { environment } from '../../cypress.env' -const randomUser = require('../../helpers/randomUser') -const runInfo = require('../../helpers/runInfo') - -Cypress.Commands.add( - 'dragTo', - { prevSubject: 'element' }, - (subject, droppableSelector) => { - const coords = Cypress.$(droppableSelector)[0].getBoundingClientRect() - cy.wrap(subject) - .trigger('mousedown', { which: 1 }) - .trigger('mousemove', { clientX: coords.x + 10, clientY: coords.y + 10 }) - .trigger('mouseup', { force: true }) - } -) -describe('My Orcid main bar' + runInfo(), () => { - before(() => { - cy.programmaticSignin('testUser') - }) - before(() => { - cy.visit(`${environment.baseUrl}/qa/my-orcid`) - }) - beforeEach(() => { - Cypress.Cookies.preserveOnce('XSRF-TOKEN', 'JSESSIONID') - }) - describe('Employment', () => { - it('display a user with no items', () => {}) - it('add items and display those with default privacy', () => { - // Expect changes to be display outside and inside of the modal - }) - }) - describe('Education and Qualifications', () => { - it('display a user with no items', () => {}) - }) - describe('Invited positions and Distinctions', () => { - it('display a user with no items', () => {}) - }) - describe('Membership and Service', () => { - it('display a user with no items', () => {}) - }) - describe('Funding', () => { - it('display a user with no items', () => {}) - }) - describe('Works', () => { - it('display a user with no items', () => {}) - }) - describe('Peer review', () => { - it('display a user with no items', () => {}) - }) - describe('Last modified date', () => { - it('display a user with no items', () => {}) - }) -}) diff --git a/cypress/e2e/legacy_oldScripts/my-orcid-research-resources.cy.js b/cypress/e2e/legacy_oldScripts/my-orcid-research-resources.cy.js deleted file mode 100644 index d74c7a7f5c..0000000000 --- a/cypress/e2e/legacy_oldScripts/my-orcid-research-resources.cy.js +++ /dev/null @@ -1,84 +0,0 @@ -import { environment } from '../../cypress.env' - -const randomUser = require('../../helpers/randomUser') -const runInfo = require('../../helpers/runInfo') - -Cypress.Commands.add( - 'dragTo', - { prevSubject: 'element' }, - (subject, droppableSelector) => { - const coords = Cypress.$(droppableSelector)[0].getBoundingClientRect() - cy.wrap(subject) - .trigger('mousedown', { which: 1 }) - .trigger('mousemove', { clientX: coords.x + 10, clientY: coords.y + 10 }) - .trigger('mouseup', { force: true }) - } -) - -describe('My Orcid research resources' + runInfo(), () => { - before(() => { - cy.programmaticSignin('testUser') - }) - before(() => { - cy.visit(`${environment.baseUrl}/qa/my-orcid`) - }) - beforeEach(() => { - Cypress.Cookies.preserveOnce('XSRF-TOKEN', 'JSESSIONID') - }) - describe('Research resources' + runInfo(), () => { - it('show research resources panel and hide nested panels', () => { - cy.get('#research-resources-panel') - .get( - '#research-resources-panel > .col > .header-container > .inline-initial-side > .text-container' - ) - .should('exist') - .get('#research-resources-panel') - .within(() => { - cy.get('#expand-content-button').click() - }) - .get('#panel-0') //TODO is tag attribute now, use cy.get('[panel-sequence="cy-research-resource-stack-panel-0"]') - .should('not.exist') - .get('#research-resources-panel') - .within(() => { - cy.get('#expand-content-button').click() - }) - }) - }) - describe('Research resources' + runInfo(), () => { - it('show research resources description', () => { - cy.get('#research-resources-panel') - .get('#panel-0') //TODO is tag attribute now, use cy.get('[panel-sequence="cy-research-resource-stack-panel-0"]') - .within(() => { - cy.get('#expand-more-button').click() - }) - .get('#panel-0') //TODO is tag attribute now, use cy.get('[panel-sequence="cy-research-resource-stack-panel-0"]') - .get('.description-container > .description') - .should('exist') - .get('#show-more-button') //TODO is a class now - .click() - .get('.organization-identifiers') - .should('exist') - .get('#research-detail-item-0') - .within(() => { - cy.get('#show-more-item-button').click() - }) - .get( - '.orc-font-body-small.ng-star-inserted > .panel-data-container > .data-content > app-panel-element > :nth-child(1) > .line > :nth-child(1)' - ) - .should('exist') - .get('#research-detail-item-0') - .within(() => { - cy.get('#show-less-item-button').click() - }) - .get( - '.orc-font-body-small.ng-star-inserted > .panel-data-container > .data-content > app-panel-element > :nth-child(1) > .line > :nth-child(1)' - ) - .should('not.exist') - .get('#panel-0') //TODO is tag attribute now, use cy.get('[panel-sequence="cy-research-resource-stack-panel-0"]') - .get('#show-less-button') - .click() - .get('.organization-identifiers') - .should('not.exist') - }) - }) -}) diff --git a/cypress/e2e/legacy_oldScripts/my-orcid-side-bar-keywords.cy.js b/cypress/e2e/legacy_oldScripts/my-orcid-side-bar-keywords.cy.js deleted file mode 100644 index 4c62e332ba..0000000000 --- a/cypress/e2e/legacy_oldScripts/my-orcid-side-bar-keywords.cy.js +++ /dev/null @@ -1,188 +0,0 @@ -/// -import { environment } from '../../cypress.env' -const randomUser = require('../../helpers/randomUser') -const runInfo = require('../../helpers/runInfo') - -const description = 'Website description' -const website = 'https://orcid.org' - -Cypress.Commands.add( - 'dragTo', - { prevSubject: 'element' }, - (subject, droppableSelector) => { - const coords = Cypress.$(droppableSelector)[0].getBoundingClientRect() - cy.wrap(subject) - .trigger('mousedown', { which: 1 }) - .trigger('mousemove', { clientX: coords.x + 10, clientY: coords.y + 10 }) - .trigger('mouseup', { force: true }) - } -) -describe('My Orcid sidebar - Keywords' + runInfo(), () => { - before(() => { - cy.programmaticSignin('testUser') - }) - before(() => { - cy.visit(`${environment.baseUrl}/qa/my-orcid`) - }) - beforeEach(() => { - Cypress.Cookies.preserveOnce('XSRF-TOKEN', 'JSESSIONID') - }) - describe('Keywords', () => { - before(() => { - cy.cleanKeywords() - }) - beforeEach(() => { - Cypress.Cookies.preserveOnce('XSRF-TOKEN', 'JSESSIONID') - }) - after(() => { - cy.cleanKeywords() - }) - it('display a user with no items', () => { - cy.get('#keywords-panel').within(() => { - cy.get('.body').get('.line').should('not.exist') - }) - }) - it('add item and display it with default privacy', () => { - // Expect changes to be display outside and inside of the modal - cy.get('#keywords-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .get('#add-keyword') - .click() - .get('#content-input') - .click() - .type('keyword1', { delay: 50 }) - .get('#save-keywords-button') - .click() - .wait(1000) - .get('#keywords-panel') - .within(() => { - cy.get('.body') - .children() - .should('have.length', 1) - .get('app-panel-privacy') - .should( - 'have.attr', - 'aria-label', - environment.testUser.defaultPrivacy - ) - }) - .get('#keywords-panel') - .within(() => { - cy.get('.body') - .children() - .should('have.length', 1) - .get('.line') - .contains('keyword1') - }) - }) - it('remove/delete', () => { - cy.get('#keywords-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .get('.delete-button') - .click() - .get('#save-keywords-button') - .click() - .wait(1000) - .get('#keywords-panel') - .within(() => { - cy.get('.body').get('.line').should('not.exist') - }) - }) - it('add multiple keywords', () => { - cy.get('#keywords-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .get('#add-keyword') - .click() - .get('.mat-form-field-flex') - .eq(0) - .click({ multiple: true }) - .type('Keyword1', { delay: 50 }) - .get('#add-keyword') - .click() - .get('.mat-form-field-flex') - .eq(1) - .click({ multiple: true }) - .type('Keyword2', { delay: 50 }) - .get('#add-keyword') - .click() - .get('.mat-form-field-flex') - .eq(2) - .click({ multiple: true }) - .type('Keyword3', { delay: 50 }) - .get('#save-keywords-button') - .click() - .wait(1000) - .get('#keywords-panel') - .within(() => { - cy.contains('Keyword1') - cy.contains('Keyword2') - cy.contains('Keyword3') - cy.get('.body') - .get('.line') - .should('have.length', 3) - .get('app-panel-privacy') - .should( - 'have.attr', - 'aria-label', - environment.testUser.defaultPrivacy - ) - }) - }) - it('Drag and drop to rearrange', () => { - // Expect changes to be display outside and inside of the modal - }) - it('change privacy', () => { - cy.get('#keywords-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .within(() => { - cy.get('.public-button') - .click({ multiple: true }) - .get('#save-keywords-button') - .click() - .wait(1000) - }) - .get('#keywords-panel') - .within(() => { - cy.get('.body') - .get('.line') - .should('have.length', 3) - .get('app-panel-privacy') - .should('have.attr', 'aria-label', 'PUBLIC') - }) - }) - it('make changes and cancel', () => { - cy.get('#keywords-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .within(() => { - cy.get('.private-button') - .click({ multiple: true }) - .get('#cancel-keywords-button') - .click() - .wait(1000) - }) - .get('#keywords-panel') - .within(() => { - cy.get('.body') - .get('.line') - .should('have.length', 3) - .get('app-panel-privacy') - .should('have.attr', 'aria-label', 'PUBLIC') - }) - }) - }) -}) diff --git a/cypress/e2e/legacy_oldScripts/my-orcid-side-bar.cy.js b/cypress/e2e/legacy_oldScripts/my-orcid-side-bar.cy.js deleted file mode 100644 index f1c6949665..0000000000 --- a/cypress/e2e/legacy_oldScripts/my-orcid-side-bar.cy.js +++ /dev/null @@ -1,571 +0,0 @@ -/// -import { environment } from '../../cypress.env' -const randomUser = require('../../helpers/randomUser') -const runInfo = require('../../helpers/runInfo') - -const description = 'Website description' -const website = 'https://orcid.org' - -Cypress.Commands.add( - 'dragTo', - { prevSubject: 'element' }, - (subject, droppableSelector) => { - const coords = Cypress.$(droppableSelector)[0].getBoundingClientRect() - cy.wrap(subject) - .trigger('mousedown', { which: 1 }) - .trigger('mousemove', { clientX: coords.x + 10, clientY: coords.y + 10 }) - .trigger('mouseup', { force: true }) - } -) -describe('My Orcid sidebar' + runInfo(), () => { - before(() => { - cy.programmaticSignin('testUser') - }) - before(() => { - cy.visit(`${environment.baseUrl}/qa/my-orcid`) - }) - beforeEach(() => { - Cypress.Cookies.preserveOnce('XSRF-TOKEN', 'JSESSIONID') - }) - describe('Orcid id', () => { - it('display the users Orcid', () => { - cy.get('app-side-bar-id ').within(() => { - cy.contains(`${environment.baseUrl}`) - cy.contains(environment.testUser.id) - }) - }) - it('display url to navigate to the public page view', () => {}) - }) - describe('Emails' + runInfo(), () => { - before(() => { - cy.cleanEmails() - cy.visit(`${environment.baseUrl}/qa/my-orcid`) - }) - beforeEach(() => { - Cypress.Cookies.preserveOnce('XSRF-TOKEN', 'JSESSIONID') - }) - after(() => { - cy.cleanEmails() - }) - - it('display a user with only a primary email "unverified"', () => { - cy.get('#emails-panel').within(() => { - cy.get('.body').get('.line').should('have.length', 1) - }) - }) - it('display a user with only a primary email "verified"', () => {}) - it('display multiple emails "unverified" and "verified"', () => { - // Expect changes to be display outside and inside of the modal - }) - describe('Emails edit modals' + runInfo(), () => { - //TODO we need to figure out how to verify emails to improve testing on those - - it('add additional emails and display those as "unverified" as private', () => { - const randomUserEmail = randomUser() - cy.get('#emails-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .get('#add-link') - .click() - .get('#emailInput-1') - .type(randomUserEmail.email) - .get('.verify-icon:not(.verified) #emailInput-1') - .get('#save-emails-button') - .click() - .get('#emails-panel') - .within(() => { - cy.get('.body') - .get('.line') - .should('have.length', 2) - .get('app-panel-privacy') - .eq(1) - .should('have.attr', 'aria-label', 'PRIVATE') - }) - }) - it('remove emails', () => { - cy.get('#emails-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .get('.delete-button') - .click() - .get('#save-emails-button') - .click() - .wait(2000) - .get('#emails-panel') - .within(() => { - cy.get('.body').get('.line').should('have.length', 1) - }) - }) - - it('add multiple emails', () => { - const randomUserEmail = randomUser() - const randomUserEmail2 = randomUser() - const randomUserEmail3 = randomUser() - const randomUserEmail4 = randomUser() - cy.get('#emails-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .get('#add-link') - .click() - .get('#emailInput-1') - .type(randomUserEmail.email) - .get('#add-link') - .click() - .get('#emailInput-2') - .type(randomUserEmail2.email) - .get('#add-link') - .click() - .get('#emailInput-3') - .type(randomUserEmail3.email) - .get('#add-link') - .click() - .get('#emailInput-4') - .type(randomUserEmail4.email) - .get('#save-emails-button') - .click() - .get('#emails-panel') - .within(() => { - cy.get('.body').get('.line').should('have.length', 5) - }) - }) - - it('change privacy', () => { - cy.get('#emails-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .get('.public-button') - .click({ multiple: true }) - .get('#save-emails-button') - .click() - .get('#emails-panel') - .within(() => { - cy.get('.body') - .get('.line') - .should('have.length', 5) - .get('app-panel-privacy') - .should('have.attr', 'aria-label', 'PUBLIC') - }) - - // Expect changes to be display outside and inside of the modal - }) - - it('edit a non-primary and display it as "unverified"', () => { - // Expect changes to be display outside and inside of the modal - }) - it('edit a primary email and display it as "verified"', () => { - // Expect changes to be display outside and inside of the modal - }) - it('display multiple emails "unverified" and "verified"', () => { - // Expect changes to be display outside and inside of the modal - }) - it('resend the email verification email', () => {}) - it('set a "verified" email as primary', () => { - // checks that a secondary email does not have the `make primary` button if not verified - // Expect changes to be display outside and inside of the modal - }) - it('make changes and cancel', () => { - cy.get('#emails-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .get('.private-button') - .click({ multiple: true }) - .get('#cancel-emails-button') - .click() - .get('#emails-panel') - .within(() => { - cy.get('.body') - .get('.line') - .should('have.length', 5) - .get('app-panel-privacy') - .should('have.attr', 'aria-label', 'PUBLIC') - }) - }) - it('open the terms of use on a separate window ', () => { - cy.get('#emails-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .within(() => { - cy.get('a ').should('have.attr', 'target', '_blank') - }) - .get('#cancel-emails-button') - .click() - }) - }) - }) - describe('Websites and socials links', () => { - before(() => { - cy.cleanWebsites() - }) - beforeEach(() => { - Cypress.Cookies.preserveOnce('XSRF-TOKEN', 'JSESSIONID') - }) - after(() => { - cy.cleanWebsites() - }) - it('display a user with no items', () => { - cy.get('#websites-panel').within(() => { - cy.get('.body').get('.line').should('not.exist') - }) - }) - it('add items and display those with default privacy', () => { - cy.get('#websites-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .within(() => { - cy.get('#add-link') - .click() - .get('#description-input') - .click() - .type(description, { delay: 0 }) - .get('#url-input') - .click() - .type(website, { delay: 0 }) - .get('#save-websites-button') - .click() - }) - .get('#websites-panel') - .within(() => { - cy.get('.body') - .get('.line') - .should('have.length', 1) - .get('app-panel-privacy') - .should( - 'have.attr', - 'aria-label', - environment.testUser.defaultPrivacy - ) - }) - }) - it('remove/delete', () => { - cy.get('#websites-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .within(() => { - cy.get('#delete-button') - .click() - .get('#save-websites-button') - .click() - .wait(2000) - }) - .get('#websites-panel') - .within(() => { - cy.get('.body').get('.line').should('not.exist') - }) - }) - it('add multiple websites', () => { - cy.get('#websites-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .within(() => { - cy.get('#add-link') - .click() - .get('.mat-form-field-flex') - .eq(0) - .click({ multiple: true }) - .type('Description Website 1', { delay: 0 }) - .get('.mat-form-field-flex') - .eq(1) - .click({ multiple: true }) - .type('https://orcid.org', { delay: 0 }) - .get('#add-link') - .click() - .get('.mat-form-field-flex') - .click({ multiple: true }) - .get('.mat-form-field-flex') - .eq(2) - .click() - .type('Description Website 2', { delay: 0 }) - .get('.mat-form-field-flex') - .eq(3) - .click({ multiple: true }) - .type('https://sandbox.orcid.org', { delay: 0 }) - .get('#add-link') - .click() - .get('.mat-form-field-flex') - .eq(4) - .click() - .type('Description Website 3', { delay: 0 }) - .get('.mat-form-field-flex') - .eq(5) - .click() - .type('https://qa.orcid.org', { delay: 0 }) - .get('#save-websites-button') - .click() - }) - .get('#websites-panel') - .within(() => { - cy.get('.body') - .get('.line') - .should('have.length', 3) - .get('app-panel-privacy') - .should( - 'have.attr', - 'aria-label', - environment.testUser.defaultPrivacy - ) - }) - }) - it('Drag and drop to rearrange', () => { - // Expect changes to be display outside and inside of the modal - }) - it('change privacy', () => { - cy.get('#websites-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .within(() => { - cy.get('.public-button') - .click({ multiple: true }) - .get('#save-websites-button') - .click() - }) - .get('#websites-panel') - .within(() => { - cy.get('.body') - .get('.line') - .should('have.length', 3) - .get('app-panel-privacy') - .should('have.attr', 'aria-label', 'PUBLIC') - }) - }) - it('make changes and cancel', () => { - cy.get('#websites-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .within(() => { - cy.get('.private-button') - .click({ multiple: true }) - .get('#cancel-websites-button') - .click() - }) - .get('#websites-panel') - .within(() => { - cy.get('.body') - .get('.line') - .should('have.length', 3) - .get('app-panel-privacy') - .should('have.attr', 'aria-label', 'PUBLIC') - }) - }) - it('clicks outside and DONT close the modal ', () => {}) - }) - describe('Countries', () => { - before(() => { - cy.cleanCountries() - }) - beforeEach(() => { - Cypress.Cookies.preserveOnce('XSRF-TOKEN', 'JSESSIONID') - }) - after(() => { - cy.cleanCountries() - }) - it('display a user with no items', () => { - cy.get('#countries-panel').within(() => { - cy.get('.body').get('.line').should('not.exist') - }) - }) - it('add items and display those with default privacy', () => { - cy.get('#countries-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .get('#add-link') - .click() - .get('.mat-form-field-flex') - .click() - .get('#mat-select-0-panel') - .click() - .get('#save-countries-button') - .click() - .get('#countries-panel') - .within(() => { - cy.get('.body') - .get('.line') - .should('have.length', 1) - .get('app-panel-privacy') - .should( - 'have.attr', - 'aria-label', - environment.testUser.defaultPrivacy - ) - }) - }) - it('remove/delete', () => { - cy.get('#countries-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .get('.delete-button') - .click() - .get('#save-countries-button') - .click() - .wait(2000) - .get('#countries-panel') - .within(() => { - cy.get('.body').get('.line').should('not.exist') - }) - - // Expect changes to be display outside and inside of the modal - }) - it('add multiple countries', () => { - cy.get('#countries-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .get('#add-link') - .click() - .get('.mat-form-field-flex') - .eq(0) - .click() - .get('.mat-option-text') - .eq(0) - .click() - .get('#add-link') - .click() - .get('.mat-form-field-flex') - .eq(1) - .click() - .get('.mat-option-text') - .eq(1) - .click() - .get('#add-link') - .click() - .get('.mat-form-field-flex') - .eq(2) - .click() - .get('.mat-option-text') - .eq(2) - .click() - .get('#save-countries-button') - .click() - .get('#countries-panel') - .within(() => { - cy.get('.body') - .get('.line') - .should('have.length', 3) - .get('app-panel-privacy') - .should( - 'have.attr', - 'aria-label', - environment.testUser.defaultPrivacy - ) - }) - }) - it('Drag and drop to rearrange', () => { - // TODO @leomendoza123 drag and drop with cypress and Material cdkDragHandle seems not to work - }) - it('change privacy', () => { - cy.get('#countries-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .get('.public-button') - .click({ multiple: true }) - .get('#save-countries-button') - .click() - .get('#countries-panel') - .within(() => { - cy.get('.body') - .get('.line') - .should('have.length', 3) - .get('app-panel-privacy') - .should('have.attr', 'aria-label', 'PUBLIC') - }) - - // Expect changes to be display outside and inside of the modal - }) - it('make changes and cancel', () => { - cy.get('#countries-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .get('.private-button') - .click({ multiple: true }) - .get('#cancel-countries-button') - .click() - .get('#countries-panel') - .within(() => { - cy.get('.body') - .get('.line') - .should('have.length', 3) - .get('app-panel-privacy') - .should('have.attr', 'aria-label', 'PUBLIC') - }) - }) - }) - describe('Personal identifiers', () => { - // TODO - // We need to create a mechanism to add keywords while e2e testing. - before(() => { - cy.cleanPersonalIdentifiers() - }) - beforeEach(() => { - Cypress.Cookies.preserveOnce('XSRF-TOKEN', 'JSESSIONID') - }) - after(() => { - cy.cleanPersonalIdentifiers() - }) - - it('display a user with no items', () => { - // Users with not personal ids should not show this panel - cy.get('#personal-identifiers-panel').should('not.exist') - }) - it('display a user with items and default privacy', () => {}) - it('remove/delete', () => { - // Expect changes to be display outside and inside of the modal - }) - it('Drag and drop to rearrange', () => { - // Expect changes to be display outside and inside of the modal - }) - it('change privacy', () => { - // Expect changes to be display outside and inside of the modal - }) - it('make changes and cancel', () => { - // Expect changes NOT to be display outside and inside of the modal - }) - }) - describe('Keywords', () => { - it('display a user with no items', () => {}) - it('add items and display those with default privacy', () => { - // Expect changes to be display outside and inside of the modal - }) - it('remove/delete', () => { - // Expect changes to be display outside and inside of the modal - }) - it('Drag and drop to rearrange', () => { - // Expect changes to be display outside and inside of the modal - }) - it('change privacy', () => { - // Expect changes to be display outside and inside of the modal - }) - it('make changes and cancel', () => { - // Expect changes NOT to be display outside and inside of the modal - }) - }) -}) diff --git a/cypress/e2e/legacy_oldScripts/my-orcid-top-bar.cy.js b/cypress/e2e/legacy_oldScripts/my-orcid-top-bar.cy.js deleted file mode 100644 index e4dc7e8fa3..0000000000 --- a/cypress/e2e/legacy_oldScripts/my-orcid-top-bar.cy.js +++ /dev/null @@ -1,239 +0,0 @@ -import { environment } from '../../cypress.env' - -const randomUser = require('../../helpers/randomUser') -const runInfo = require('../../helpers/runInfo') -const givenNames = 'My name' -const familyNames = 'My family names' -const publishedNames = 'My published name' -const biography = 'My biography' - -Cypress.Commands.add( - 'dragTo', - { prevSubject: 'element' }, - (subject, droppableSelector) => { - const coords = Cypress.$(droppableSelector)[0].getBoundingClientRect() - cy.wrap(subject) - .trigger('mousedown', { which: 1 }) - .trigger('mousemove', { clientX: coords.x + 10, clientY: coords.y + 10 }) - .trigger('mouseup', { force: true }) - } -) -describe('My Orcid top bar' + runInfo(), () => { - before(() => { - cy.programmaticSignin('testUser') - }) - before(() => { - cy.visit(`${environment.baseUrl}/qa/my-orcid`) - }) - beforeEach(() => { - Cypress.Cookies.preserveOnce('XSRF-TOKEN', 'JSESSIONID') - }) - describe('Top bar buttons', () => { - it('display `Printable version` button', () => {}) - it('display `Get a QR code for your ORCID iD` button', () => {}) - it('display `Display your iD on other sites` button', () => {}) - }) - describe('Names' + runInfo(), () => { - before(() => { - cy.cleanNames() - cy.cleanOtherNames() - }) - beforeEach(() => { - Cypress.Cookies.preserveOnce('XSRF-TOKEN', 'JSESSIONID') - }) - after(() => { - cy.cleanNames() - cy.cleanOtherNames() - }) - it('display user with names and no other names"', () => { - cy.get('#names-panel').within(() => { - cy.get('[body=""]') - .children() - .get('#publishedName') - .should('not.be.empty') - .get('#givenAndFamilyNames') - .should('not.be.empty') - .get('#other-names') //TODO is a class now - .should('not.exist') - }) - }) - it('edit user given names, family names and published name"', () => { - cy.get('#names-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .get('#given-names-input') - .click() - .clear() - .get('#given-names-input') - .click() - .type(givenNames, { delay: 0 }) - .get('#family-names-input') - .click() - .clear() - .get('#family-names-input') - .click() - .type(familyNames, { delay: 0 }) - .get('#published-names-input') - .click() - .clear() - .get('#published-names-input') - .click() - .type(publishedNames, { delay: 0 }) - .get('#save-names-button') - .click() - .get('#names-panel') - .within(() => { - cy.get('[body=""]') - .children() - .get('#publishedName') - .should('contain', publishedNames) - .get('#givenAndFamilyNames') - .should('contain', givenNames + ' ' + familyNames) - .get('#other-names') //TODO is a class now - .should('not.exist') - .get('app-panel-privacy') - .should( - 'have.attr', - 'aria-label', - environment.testUser.defaultPrivacy - ) - }) - }) - it('add other names with default privacy', () => { - cy.get('#names-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .get('#add-link') - .click() - .get('#alternative-names-input') - .click() - .type('Other Name 1', { delay: 0 }) - .get('#save-names-button') - .click() - .get('#names-panel') - .within(() => { - cy.get('[body=""]') - .children() - .should('have.length', 3) - .get('app-panel-privacy') - .should( - 'have.attr', - 'aria-label', - environment.testUser.defaultPrivacy - ) - }) - }) - it('remove/delete other names', () => { - cy.get('#names-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .get('#delete-button') - .click() - .get('#save-names-button') - .click() - .wait(2000) - .get('#names-panel') - .within(() => { - cy.get('[body=""]') - .children() - .get('#publishedName') - .should('not.be.empty') - }) - }) - it('Drag and drop to rearrange', () => { - // Expect changes to be display outside and inside of the modal - }) - it('change privacy', () => { - // Expect changes to be display outside and inside of the modal - }) - it('make changes and cancel', () => { - // Expect changes NOT to be display outside and inside of the modal - }) - }) - describe('Biography', () => { - before(() => { - cy.cleanBiography() - }) - beforeEach(() => { - Cypress.Cookies.preserveOnce('XSRF-TOKEN', 'JSESSIONID') - }) - after(() => { - cy.cleanBiography() - }) - it('display user biography if exists and privacy"', () => { - cy.get('#biography-panel').within(() => { - cy.get('[body=""]').should('not.exist') - }) - }) - it('edit user biography"', () => { - cy.get('#biography-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .get('#biography-input') - .click() - .type(biography, { delay: 0 }) - .get('#save-biography-button') - .click() - .get('#biography-panel') - .within(() => { - cy.get('[body=""]') - .children() - .get('#biography') - .should('contain', biography) - .get('app-panel-privacy') - .should( - 'have.attr', - 'aria-label', - environment.testUser.defaultPrivacy - ) - }) - }) - it('edit user biography privacy"', () => { - cy.get('#biography-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .get('.public-button') - .click({ multiple: true }) - .get('#save-biography-button') - .click() - .get('#biography-panel') - .within(() => { - cy.get('[body=""]') - .children() - .get('#biography') - .should('contain', biography) - .get('app-panel-privacy') - .should('have.attr', 'aria-label', 'PUBLIC') - }) - }) - it('make changes and cancel', () => { - cy.get('#biography-panel') - .within(() => { - cy.get('#edit-button').click() //TODO is a class now called cy-edit-button - }) - .get('#modal-container') - .get('.private-button') - .click({ multiple: true }) - .get('#cancel-biography-button') - .click() - .get('#biography-panel') - .within(() => { - cy.get('[body=""]') - .children() - .should('contain', biography) - .get('app-panel-privacy') - .should('have.attr', 'aria-label', 'PUBLIC') - }) - }) - }) -}) diff --git a/cypress/e2e/legacy_oldScripts/notifications.cy.js b/cypress/e2e/legacy_oldScripts/notifications.cy.js deleted file mode 100644 index a960e24de4..0000000000 --- a/cypress/e2e/legacy_oldScripts/notifications.cy.js +++ /dev/null @@ -1,54 +0,0 @@ -const { IterableDiffers } = require('@angular/core') -const runInfo = require('../helpers/runInfo') - -describe('Notifications' + runInfo(), () => { - it('Display a user with no-notifications', () => {}) - describe('Permission notifications', () => { - // Docs to trigger these notifications: - // https://github.com/ORCID/orcid-model/tree/master/src/main/resources/notification_3.0#notifications-permission-xml - }) - describe('Amended notifications', () => { - // It should report items added, deleted or update on each of the following sections - // | 'AFFILIATION' - // | 'BIO' - // | 'EDUCATION' - // | 'EMPLOYMENT' - // | 'EXTERNAL_IDENTIFIERS' - // | 'FUNDING' - // | 'PEER_REVIEW' - // | 'PREFERENCES' - // | 'UNKNOWN' - // | 'RESEARCH_RESOURCE' - // | 'WORK' - // | 'INVITED_POSITION' - // NOTE: Further description of what each item can contain is required - }) - describe('Institutional connect', () => { - // The environment should have defined an Oauth account with the IDP defined as https://samltest.id/saml/idp - // related know issues - // https://trello.com/c/la8Ptj3C/7146-institutional-connect-breaks-the-notifications - // https://trello.com/c/fMFBon2m/7147-institutional-connect-allows-multiples-apps-to-own-the-same-idp - // https://trello.com/c/4UcbCqOR/7148-institutional-connect-notifications-are-not-send-for-new-registrations - - // More info at `INSTITUTIONAL CONNECT VIA IDP WORKFLOW` on https://members.orcid.org/api/integrate/institutional-connect - it('Sends notifications after a user links a new account', () => {}) - it('Sends notifications after a user links a new account through an Oauth process', () => {}) - it('Sends notifications after a user links an existing account', () => {}) - it('Sends notifications after a user links an existing account through an Oauth process', () => {}) - }) - describe('HTML notifications', () => { - it('Sends a notifications on an account delegation', () => {}) - // Note: further description is required to test other HTML notifications - }) - it('The paginator can handle N notifications', () => {}) - it('can archived a notification', () => {}) - it('can select and archive multiple notifications', () => {}) - it('wont shown archived notifications by default', () => {}) - it('show archived notifications after the "Show archived" link is clicked', () => {}) - it('shows the application side bar') -}) - -// For all tests -// Expect unread notifications number to be displayed on the user menu -// Expect notifications titles dates and colors to be as expected -// check accessibility diff --git a/cypress/e2e/legacy_oldScripts/oauth-integrations-errors.cy.js b/cypress/e2e/legacy_oldScripts/oauth-integrations-errors.cy.js deleted file mode 100644 index eeeefb8080..0000000000 --- a/cypress/e2e/legacy_oldScripts/oauth-integrations-errors.cy.js +++ /dev/null @@ -1,251 +0,0 @@ -/// -import { environment } from '../cypress.env' -const oauthUrlBuilder = require('../helpers/oauthUrlBuilder') -const runInfo = require('../helpers/runInfo') - -describe('Oauth integrations errors' + runInfo(), () => { - before(() => { - cy.clearCookies() - cy.programmaticSignin('testUser') - }) - beforeEach(() => { - Cypress.Cookies.preserveOnce('XSRF-TOKEN', 'JSESSIONID') - }) - - after(() => { - cy.clearCookies() - }) - - it('Has no detectable a11y critical or serious violations', () => { - cy.visit( - `${environment.baseUrl}/oauth/authorize` + - oauthUrlBuilder({ - client_id: 'WRONG', - response_type: 'code', - scope: `/authenticate openid`, - redirect_uri: environment.validApp.redirectUrl, - }) - ) - // cy.injectAxe() //TODO: Angular 14 aupdate need me to remove this old axe lib for now - // .get('#error-message') - // .checkA11y(null, { - // includedImpacts: ['critical', 'serious'], - // }) - }) - - it('show error screen on INVALID client id', function () { - cy.visit( - `${environment.baseUrl}/oauth/authorize` + - oauthUrlBuilder({ - client_id: 'WRONG', - response_type: 'code', - scope: `/authenticate openid`, - redirect_uri: environment.validApp.redirectUrl, - }) - ) - cy.get('#error-message').contains( - 'Error: The provided client id WRONG is invalid.' - ) - cy.get('@ga').then((value) => expect(value.callCount).to.be.eq(5)) - cy.hasNoLayout() - cy.hasZendesk() - }) - - it('show error screen on MISSING client id', function () { - cy.visit( - `${environment.baseUrl}/oauth/authorize` + - oauthUrlBuilder({ - client_id: undefined, - response_type: 'code', - scope: `/authenticate openid`, - redirect_uri: environment.validApp.redirectUrl, - }) - ) - cy.get('#error-message').contains( - 'Error: Incorrect OAuth Link, missing client id parameter.' - ) - cy.get('@ga').then((value) => expect(value.callCount).to.be.eq(5)) - cy.hasNoLayout() - cy.hasZendesk() - }) - it('show error screen on DEACTIVATED client id', function () { - cy.visit( - `${environment.baseUrl}/oauth/authorize` + - oauthUrlBuilder({ - client_id: environment.deactivatedClientApp.id, - response_type: 'code', - scope: `/authenticate openid`, - redirect_uri: environment.deactivatedClientApp.redirectUrl, - }) - ) - cy.get('#error-message').contains( - `Error: The provided client id ${environment.deactivatedClientApp.id} is locked.` - ) - cy.get('@ga').then((value) => expect(value.callCount).to.be.eq(5)) - cy.hasNoLayout() - cy.hasZendesk() - }) - it('show error screen on LOCKED member', function () { - cy.visit( - `${environment.baseUrl}/oauth/authorize` + - oauthUrlBuilder({ - client_id: environment.lockedMemberApp.id, - response_type: 'code', - scope: `/authenticate openid`, - redirect_uri: environment.lockedMemberApp.redirectUrl, - }) - ) - cy.get('#error-message').contains( - `Error: The provided request couldn't be completed because the integration and hence, \ -the client ${environment.lockedMemberApp.id} is locked.` - ) - cy.get('@ga').then((value) => expect(value.callCount).to.be.eq(5)) - cy.hasNoLayout() - cy.hasZendesk() - }) - it('show error screen on INVALID response type', function () { - cy.visit( - `${environment.baseUrl}/oauth/authorize` + - oauthUrlBuilder({ - client_id: environment.validApp.id, - response_type: 'WRONG', - scope: `/authenticate openid`, - redirect_uri: environment.validApp.redirectUrl, - }), - { - onBeforeLoad(win) { - win.outOfRouterNavigation = () => {} - cy.stub(win, 'outOfRouterNavigation') - }, - } - ) - cy.window() - .its('outOfRouterNavigation') - .should( - 'be.calledWith', - `${environment.validApp.redirectUrl}` + - `#error=unsupported_response_type` - ) - cy.get('@ga').then((value) => expect(value.callCount).to.be.eq(2)) - }) - it('show error screen on MISSING response type', function () { - cy.visit( - `${environment.baseUrl}/oauth/authorize` + - oauthUrlBuilder({ - client_id: environment.validApp.id, - response_type: undefined, - scope: `/authenticate openid`, - redirect_uri: environment.validApp.redirectUrl, - }) - ) - cy.get('#error-message').contains( - `Error: Incorrect OAuth Link for client id ${environment.validApp.id}, missing response type parameter.` - ) - cy.get('@ga').then((value) => expect(value.callCount).to.be.eq(5)) - cy.hasNoLayout() - cy.hasZendesk() - }) - it('show error screen on INVALID redirect URL', function () { - cy.visit( - `${environment.baseUrl}/oauth/authorize` + - oauthUrlBuilder({ - client_id: environment.validApp.id, - response_type: 'code', - scope: `/authenticate openid`, - redirect_uri: 'WRONG', - }) - ) - cy.get('#error-message').contains( - `Error: The provided redirect URI WRONG does not match the redirect URIs registered by ${environment.validApp.name} (${environment.validApp.id}).` - ) - cy.get('@ga').then((value) => expect(value.callCount).to.be.eq(5)) - cy.hasNoLayout() - cy.hasZendesk() - }) - it('show error screen on MISSING redirect URL', function () { - cy.visit( - `${environment.baseUrl}/oauth/authorize` + - oauthUrlBuilder({ - client_id: environment.validApp.id, - response_type: 'code', - scope: `/authenticate openid`, - redirect_uri: undefined, - }) - ) - cy.get('#error-message').contains( - `Error: Incorrect OAuth Link for client id ${environment.validApp.id}, missing redirect uri parameter` - ) - cy.get('@ga').then((value) => expect(value.callCount).to.be.eq(5)) - cy.hasNoLayout() - cy.hasZendesk() - }) - it('show error screen on INVALID scope', function () { - cy.visit( - `${environment.baseUrl}/oauth/authorize` + - oauthUrlBuilder({ - client_id: environment.validApp.id, - response_type: 'code', - scope: `/WRONG`, - redirect_uri: environment.validApp.redirectUrl, - }), - { - onBeforeLoad(win) { - win.outOfRouterNavigation = () => {} - cy.stub(win, 'outOfRouterNavigation') - }, - } - ) - cy.window() - .its('outOfRouterNavigation') - .should( - 'be.calledWith', - `${environment.validApp.redirectUrl}` + `#error=invalid_scope` - ) - cy.get('@ga').then((value) => expect(value.callCount).to.be.eq(2)) - cy.hasNoLayout() - cy.hasZendesk() - }) - it('show error screen on UNAUTHORIZED scope', function () { - cy.visit( - `${environment.baseUrl}/oauth/authorize` + - oauthUrlBuilder({ - client_id: environment.validApp.id, - response_type: 'code', - scope: `/webhook`, - redirect_uri: environment.validApp.redirectUrl, - }), - { - onBeforeLoad(win) { - win.outOfRouterNavigation = () => {} - cy.stub(win, 'outOfRouterNavigation') - }, - } - ) - cy.window() - .its('outOfRouterNavigation') - .should( - 'be.calledWith', - `${environment.validApp.redirectUrl}` + `#error=invalid_scope` - ) - cy.get('@ga').then((value) => expect(value.callCount).to.be.eq(2)) - cy.hasNoLayout() - cy.hasZendesk() - }) - it('show error screen on MISSING scope', function () { - cy.visit( - `${environment.baseUrl}/oauth/authorize` + - oauthUrlBuilder({ - client_id: environment.validApp.id, - response_type: 'code', - scope: undefined, - redirect_uri: environment.validApp.redirectUrl, - }) - ) - cy.get('#error-message').contains( - `Error: Incorrect OAuth Link for client id ${environment.validApp.id}, missing scope parameter.` - ) - cy.get('@ga').then((value) => expect(value.callCount).to.be.eq(5)) - cy.hasNoLayout() - cy.hasZendesk() - }) -}) diff --git a/cypress/e2e/legacy_oldScripts/oauth-life-cycles.cy.js b/cypress/e2e/legacy_oldScripts/oauth-life-cycles.cy.js deleted file mode 100644 index 7c711db3cb..0000000000 --- a/cypress/e2e/legacy_oldScripts/oauth-life-cycles.cy.js +++ /dev/null @@ -1,604 +0,0 @@ -/// -import { environment } from '../cypress.env' -const randomUser = require('../helpers/randomUser') -const urlMatch = require('../helpers/urlMatch') -const oauthUrlBuilder = require('../helpers/oauthUrlBuilder') -const runInfo = require('../helpers/runInfo') - -describe('Oauth life cycles' + runInfo(), () => { - before(() => { - cy.clearCookies() - }) - describe('Register and authorize', () => { - beforeEach(() => { - cy.clearCookies() - }) - it('use an Oauth request that comes with an unregistered email and names', () => { - const userToRegister = randomUser() - let oauthParams = { - client_id: environment.validApp.id, - response_type: 'code', - scope: '/authenticate openid', - redirect_uri: environment.validApp.redirectUrl, - email: environment.notYetRegisteredUser.email, - family_names: environment.notYetRegisteredUser.familyNames, - given_names: environment.notYetRegisteredUser.givenNames, - } - - let oauthParamsUrl = oauthUrlBuilder(oauthParams) - - let expectedPreFillRegister = { - givenNames: environment.notYetRegisteredUser.givenNames, - familyNames: environment.notYetRegisteredUser.familyNames, - email: environment.notYetRegisteredUser.email, - } - - let expectedAuthorizationScreen = { - displayName: userToRegister.name + ' ' + userToRegister.familyName, - appName: environment.validApp.name, - scopes: ['openid'], - } - - let expectRegrowEvent = { - action: 'New-Registration', - memberName: environment.validApp.name, - clientName: environment.validApp.memberName, - } - - let expectRedirectUrl = { - url: environment.validApp.redirectUrl, - urlParameters: { code: Cypress.sinon.match.string }, - } - - cy.visit(`${environment.baseUrl}/oauth/authorize${oauthParamsUrl}`, { - onBeforeLoad: (win) => { - win.outOfRouterNavigation = () => {} - cy.stub(win, 'outOfRouterNavigation') - }, - }) - // TODO: test different entry points - .expectGtagInitialization(`/register${oauthParamsUrl}`) - .hasNoLayout() - .hasNoZendesk() - .expectPreFillRegister(expectedPreFillRegister) - .registerUser(userToRegister) - .expectAuthorizeScreen(expectedAuthorizationScreen) - .expectGtagNavigation(`/oauth/authorize${oauthParamsUrl}`) - .hasNoLayout() - .hasNoZendesk() - .expectGtagRegrow(expectRegrowEvent) - // TODO: test Gtag event to scope after the recently requested changes to those events are ready - // TODO: test deny access - .get('#authorize-button') - .click() - .get('#loading-bar') - .window() - .its('outOfRouterNavigation') - .should('be.calledWith', urlMatch(expectRedirectUrl)) - }) - - it('use an Oauth request that comes with no user data', () => { - const registeringUser = randomUser() - let oauthParams = { - client_id: environment.validApp.id, - response_type: 'code', - scope: '/authenticate openid', - redirect_uri: environment.validApp.redirectUrl, - } - - let oauthParamsUrl = oauthUrlBuilder(oauthParams) - - let expectedPreFillRegister = {} - - let expectedAuthorizationScreen = { - displayName: registeringUser.name + ' ' + registeringUser.familyName, - appName: environment.validApp.name, - scopes: ['openid'], - } - - let expectRegrowEvent = { - action: 'New-Registration', - memberName: environment.validApp.name, - clientName: environment.validApp.memberName, - } - - let expectRedirectUrl = { - url: environment.validApp.redirectUrl, - urlParameters: { code: Cypress.sinon.match.string }, - } - - cy.visit(`${environment.baseUrl}/oauth/authorize${oauthParamsUrl}`, { - onBeforeLoad: (win) => { - win.outOfRouterNavigation = () => {} - cy.stub(win, 'outOfRouterNavigation') - }, - }) - .expectGtagInitialization(`/signin${oauthParamsUrl}`) - .hasNoLayout() - .hasNoZendesk() - .get('#register-button') - .click() - .expectGtagNavigation(`/register${oauthParamsUrl}`) - .hasNoLayout() - .hasNoZendesk() - .expectPreFillRegister(expectedPreFillRegister) - .registerUser(registeringUser) - .expectAuthorizeScreen(expectedAuthorizationScreen) - .expectGtagNavigation(`/oauth/authorize${oauthParamsUrl}`) - .hasNoLayout() - .hasNoZendesk() - .expectGtagRegrow(expectRegrowEvent) - .get('#authorize-button') - .click() - .get('#loading-bar') - .window() - .its('outOfRouterNavigation') - .should('be.calledWith', urlMatch(expectRedirectUrl)) - }) - - it('while been signin and with `prompt=login` parameter register and authorize', () => { - const registeringUser = randomUser() - let oauthParams = { - client_id: environment.validApp.id, - response_type: 'code', - scope: '/authenticate openid', - redirect_uri: environment.validApp.redirectUrl, - prompt: 'login', - } - - let oauthParamsUrl = oauthUrlBuilder(oauthParams) - - let expectedPreFillRegister = {} - - let expectedAuthorizationScreen = { - displayName: registeringUser.name + ' ' + registeringUser.familyName, - appName: environment.validApp.name, - scopes: ['openid'], - } - - let expectRegrowEvent = { - action: 'New-Registration', - memberName: environment.validApp.name, - clientName: environment.validApp.memberName, - } - - let expectRedirectUrl = { - url: environment.validApp.redirectUrl, - urlParameters: { code: Cypress.sinon.match.string }, - } - - cy.programmaticSignin('testUser') - .visit( - `${environment.baseUrl}/oauth/authorize${oauthParamsUrl}&forceLogin=true`, - { - onBeforeLoad: (win) => { - win.outOfRouterNavigation = () => {} - cy.stub(win, 'outOfRouterNavigation') - }, - } - ) - .expectGtagInitialization(`/signin${oauthParamsUrl}&forceLogin=true`) - .hasNoLayout() - .hasNoZendesk() - .get('#register-button') - .click() - .expectGtagNavigation(`/register${oauthParamsUrl}&forceLogin=true`) - .hasNoLayout() - .hasNoZendesk() - .expectPreFillRegister(expectedPreFillRegister) - .registerUser(registeringUser) - .expectAuthorizeScreen(expectedAuthorizationScreen) - .expectGtagNavigation( - `/oauth/authorize${oauthParamsUrl}&forceLogin=true` - ) - .hasNoLayout() - .hasNoZendesk() - .expectGtagRegrow(expectRegrowEvent) - .get('#authorize-button') - .click() - .get('#loading-bar') - .window() - .its('outOfRouterNavigation') - .should('be.calledWith', urlMatch(expectRedirectUrl)) - }) - - it('use an Oauth request that comes with a redirect URL with client query parameters', () => { - const registeringUser = randomUser() - let oauthParams = { - client_id: environment.validApp.id, - response_type: 'code', - scope: '/authenticate openid', - redirect_uri: - environment.validApp.redirectUrl + - '?clientPartyAppState=code&clientPartyAppState2=code2', - email: environment.notYetRegisteredUser.email, - family_names: environment.notYetRegisteredUser.familyNames, - given_names: environment.notYetRegisteredUser.givenNames, - } - - let oauthParamsUrl = oauthUrlBuilder(oauthParams) - - let expectedPreFillRegister = { - givenNames: environment.notYetRegisteredUser.givenNames, - familyNames: environment.notYetRegisteredUser.familyNames, - email: environment.notYetRegisteredUser.email, - } - - let expectedAuthorizationScreen = { - displayName: registeringUser.name + ' ' + registeringUser.familyName, - appName: environment.validApp.name, - scopes: ['openid'], - } - - let expectRegrowEvent = { - action: 'New-Registration', - memberName: environment.validApp.name, - clientName: environment.validApp.memberName, - } - - let expectRedirectUrl = { - url: environment.validApp.redirectUrl, - urlParameters: { - code: Cypress.sinon.match.string, - clientPartyAppState: 'code', - clientPartyAppState2: `code2`, - }, - } - - cy.visit(`${environment.baseUrl}/oauth/authorize${oauthParamsUrl}`, { - onBeforeLoad: (win) => { - win.outOfRouterNavigation = () => {} - cy.stub(win, 'outOfRouterNavigation') - }, - }) - .expectGtagInitialization(`/register${oauthParamsUrl}`) - .hasNoLayout() - .hasNoZendesk() - .expectPreFillRegister(expectedPreFillRegister) - .registerUser(registeringUser) - .expectAuthorizeScreen(expectedAuthorizationScreen) - .expectGtagNavigation(`/oauth/authorize${oauthParamsUrl}`) - .hasNoLayout() - .hasNoZendesk() - .expectGtagRegrow(expectRegrowEvent) - .get('#authorize-button') - .click() - .get('#loading-bar') - .window() - .its('outOfRouterNavigation') - .should('be.calledWith', urlMatch(expectRedirectUrl)) - }) - }) - describe('Signin and authorize', () => { - beforeEach(() => { - cy.clearCookies() - }) - - it('use an Oauth request that comes with an register email', () => { - let oauthParams = { - client_id: environment.validApp.id, - response_type: 'code', - scope: '/authenticate openid', - redirect_uri: environment.validApp.redirectUrl, - email: environment.testUser.email, - family_names: environment.testUser.familyName, - given_names: environment.testUser.name, - } - - let expectedPreFilledSignin = { - username: environment.testUser.email, - } - - let expectedAuthorizationScreen = { - displayName: - environment.testUser.name + ' ' + environment.testUser.familyName, - appName: environment.validApp.name, - scopes: ['openid'], - } - - let expectRedirectUrl = { - url: environment.validApp.redirectUrl, - urlParameters: { code: Cypress.sinon.match.string }, - } - - let oauthParamsUrl = oauthUrlBuilder(oauthParams) - - cy.visit(`${environment.baseUrl}/oauth/authorize${oauthParamsUrl}`, { - onBeforeLoad: (win) => { - win.outOfRouterNavigation = () => {} - cy.stub(win, 'outOfRouterNavigation') - }, - }) - .expectGtagInitialization(`/signin${oauthParamsUrl}`) - .expectPreFillSignin(expectedPreFilledSignin) - .hasNoLayout() - .hasNoZendesk() - .signin(environment.testUser) - .expectAuthorizeScreen(expectedAuthorizationScreen) - .expectGtagNavigation(`/oauth/authorize${oauthParamsUrl}`) - .hasNoLayout() - .hasNoZendesk() - .get('#authorize-button') - .click() - .get('#loading-bar') - .window() - .its('outOfRouterNavigation') - .should('be.calledWith', urlMatch(expectRedirectUrl)) - }) - - it('use an Oauth request that comes with no user data', () => { - let oauthParams = { - client_id: environment.validApp.id, - response_type: 'code', - scope: '/authenticate openid', - redirect_uri: environment.validApp.redirectUrl, - } - - let expectedPreFilledSignin = {} - - let expectedAuthorizationScreen = { - displayName: - environment.testUser.name + ' ' + environment.testUser.familyName, - appName: environment.validApp.name, - scopes: ['openid'], - } - - let expectRedirectUrl = { - url: environment.validApp.redirectUrl, - urlParameters: { code: Cypress.sinon.match.string }, - } - - let oauthParamsUrl = oauthUrlBuilder(oauthParams) - - cy.visit(`${environment.baseUrl}/oauth/authorize${oauthParamsUrl}`, { - onBeforeLoad: (win) => { - win.outOfRouterNavigation = () => {} - cy.stub(win, 'outOfRouterNavigation') - }, - }) - .expectGtagInitialization(`/signin${oauthParamsUrl}`) - .expectPreFillSignin(expectedPreFilledSignin) - .hasNoLayout() - .hasNoZendesk() - .signin(environment.testUser) - .expectAuthorizeScreen(expectedAuthorizationScreen) - .expectGtagNavigation(`/oauth/authorize${oauthParamsUrl}`) - .hasNoLayout() - .hasNoZendesk() - .get('#authorize-button') - .click() - .get('#loading-bar') - .window() - .its('outOfRouterNavigation') - .should('be.calledWith', urlMatch(expectRedirectUrl)) - }) - }) - describe('Forgot password and authorize', () => { - beforeEach(() => { - cy.clearCookies() - }) - it('Goes into forgot password and comes back to finish a regular signin authorize', () => { - let oauthParams = { - client_id: environment.validApp.id, - response_type: 'code', - scope: '/authenticate openid', - redirect_uri: environment.validApp.redirectUrl, - } - - let expectedPreFilledSignin = {} - - let expectedAuthorizationScreen = { - displayName: - environment.testUser.name + ' ' + environment.testUser.familyName, - appName: environment.validApp.name, - scopes: ['openid'], - } - - let expectRedirectUrl = { - url: environment.validApp.redirectUrl, - urlParameters: { code: Cypress.sinon.match.string }, - } - - let oauthParamsUrl = oauthUrlBuilder(oauthParams) - - cy.visit(`${environment.baseUrl}/oauth/authorize${oauthParamsUrl}`, { - onBeforeLoad: (win) => { - win.outOfRouterNavigation = () => {} - cy.stub(win, 'outOfRouterNavigation') - }, - }) - .expectGtagInitialization(`/signin${oauthParamsUrl}`) - .expectPreFillSignin(expectedPreFilledSignin) - .hasNoLayout() - .hasNoZendesk() - .get('#forgot-password-button') - .click() - - .expectGtagNavigation(`/reset-password${oauthParamsUrl}`) - .hasNoLayout() - .hasNoZendesk() - .go('back') - - .expectGtagNavigation(`/signin${oauthParamsUrl}`) - .expectPreFillSignin(expectedPreFilledSignin) - .hasNoLayout() - .hasNoZendesk() - .signin(environment.testUser) - - .expectGtagNavigation(`/oauth/authorize${oauthParamsUrl}`) - .expectAuthorizeScreen(expectedAuthorizationScreen) - .hasNoLayout() - .hasNoZendesk() - .get('#authorize-button') - .click() - .get('#loading-bar') - - .window() - .its('outOfRouterNavigation') - .should('be.calledWith', urlMatch(expectRedirectUrl)) - }) - }) - describe('Social sign-in and authorize', () => { - //TODO links account and authorize - }) - describe('Institutional sign-in and authorize', () => { - before(() => { - cy.clearCookies() - }) - beforeEach(() => { - cy.clearCookies() - }) - it('Goes into institutional signin and comes back to finish a regular signin authorize', () => { - let oauthParams = { - client_id: environment.validApp.id, - response_type: 'code', - scope: '/authenticate openid', - redirect_uri: environment.validApp.redirectUrl, - } - - let expectedPreFilledSignin = {} - - let expectedAuthorizationScreen = { - displayName: - environment.testUser.name + ' ' + environment.testUser.familyName, - appName: environment.validApp.name, - scopes: ['openid'], - } - - let expectRedirectUrl = { - url: environment.validApp.redirectUrl, - urlParameters: { code: Cypress.sinon.match.string }, - } - - let oauthParamsUrl = oauthUrlBuilder(oauthParams) - - cy.visit(`${environment.baseUrl}/oauth/authorize${oauthParamsUrl}`, { - onBeforeLoad: (win) => { - win.outOfRouterNavigation = () => {} - cy.stub(win, 'outOfRouterNavigation') - }, - }) - .expectGtagInitialization(`/signin${oauthParamsUrl}`) - .expectPreFillSignin(expectedPreFilledSignin) - .hasNoLayout() - .hasNoZendesk() - .get('#access-through-your-institution-button') - .click() - - .expectGtagNavigation(`/institutional-signin${oauthParamsUrl}`) - .hasNoLayout() - .hasNoZendesk() - .get('#go-back-button') - .click() - - .expectGtagNavigation(`/signin${oauthParamsUrl}`) - .expectPreFillSignin(expectedPreFilledSignin) - .hasNoLayout() - .hasNoZendesk() - .signin(environment.testUser) - - .expectGtagNavigation(`/oauth/authorize${oauthParamsUrl}`) - .expectAuthorizeScreen(expectedAuthorizationScreen) - .hasNoLayout() - .hasNoZendesk() - .get('#authorize-button') - .click() - .get('#loading-bar') - - .window() - .its('outOfRouterNavigation') - .should('be.calledWith', urlMatch(expectRedirectUrl)) - }) - }) - describe('Open a Oauth url and then forget about it', () => { - beforeEach(() => { - cy.clearCookies() - }) - it('While NOT been signed in', function () { - const oauthParams = oauthUrlBuilder({ - client_id: environment.validApp.id, - response_type: 'code', - scope: '/authenticate openid', - redirect_uri: environment.validApp.redirectUrl, - family_names: environment.notYetRegisteredUser.familyNames, - given_names: environment.notYetRegisteredUser.givenNames, - }) - cy.visit(`${environment.baseUrl}/oauth/authorize${oauthParams}`) - .get('app-form-sign-in') - .hasNoLayout() - .hasZendesk() - .visit(`${environment.baseUrl}`) - .hasLayout() - .hasZendesk() - - .visit(`${environment.baseUrl}` + '/signin') - .hasLayout() - .hasZendesk() - - .visit(`${environment.baseUrl}` + '/register') - .hasLayout() - .hasZendesk() - .expectPreFillRegister({}) - - .visit(`${environment.baseUrl}` + '/reset-password') - .hasLayout() - .hasZendesk() - }) - it('While been signin in', function () { - const oauthParams = oauthUrlBuilder({ - client_id: environment.validApp.id, - response_type: 'code', - scope: '/authenticate openid', - redirect_uri: environment.validApp.redirectUrl, - family_names: environment.notYetRegisteredUser.familyNames, - given_names: environment.notYetRegisteredUser.givenNames, - }) - cy.programmaticSignin('testUser') - .visit(`${environment.baseUrl}/oauth/authorize${oauthParams}`) - .get('mat-card-title') - .contains('Authorize access') - - .get('@ga') - .then((value) => expect(value.callCount).to.be.eq(4)) - .hasNoLayout() - .hasZendesk() - - .visit(`${environment.baseUrl}`) - .hasLayout() - .hasZendesk() - - .visit(`${environment.baseUrl}` + '/signin') - .hasLayout() - .hasZendesk() - - .visit(`${environment.baseUrl}` + '/register') - .hasLayout() - .hasZendesk() - .expectPreFillRegister({}) - - .visit(`${environment.baseUrl}` + '/reset-password') - .hasLayout() - .hasZendesk() - }) - }) - describe('Handle server error', () => { - before(() => { - cy.clearCookies() - }) - it('oauth/custom/init.json endpoint', function () { - cy.server() - .route({ - method: 'POST', - url: '/oauth/custom/**', - response: 'badResponse', - status: 500, - }) - .visit( - `${environment.baseUrl}/oauth/authorize?client_id=${environment.validApp.id}&response_type=code&scope=%2Fauthenticate%20openid&redirect_uri=${environment.validApp.redirectUrl}` - ) - .contains(`Oh no! An error occurred`) - .get('@ga') - .then((value) => expect(value.callCount).to.be.eq(3)) - }) - }) -}) diff --git a/cypress/e2e/my-orcid/add-bio.cy.js b/cypress/e2e/my-orcid/add-bio.cy.js deleted file mode 100644 index f75521e3bf..0000000000 --- a/cypress/e2e/my-orcid/add-bio.cy.js +++ /dev/null @@ -1,32 +0,0 @@ -/// - -import userData from '../../fixtures/testing-users.fixture.json' - -describe('My orcid - users are able to add content to their record', async function () { - beforeEach(() => { - cy.visit(Cypress.env('signInURL')) - //clean up state - cy.cleanBiography() - }) - - it('User adds a biography content', function () { - const addBio = 'This is my new Bio.' - //sign in - cy.signin(userData.cyUserPrimaryEmaiVerified) //send user key from fixture file - cy.get('#biography-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - cy.get('#biography-input').clear().type(addBio) - cy.get('#save-biography-button').should('be.enabled').click({ force: true }) - cy.wait(2000) - - //verify the name is displayed - cy.get('#biography-value').should('contain', addBio) - - //sign out - cy.get('app-user-menu').click() - cy.get('#cdk-overlay-2').within(($menu) => { - cy.get('.mat-menu-item').contains('Logout').click() - }) - }) -}) diff --git a/cypress/e2e/my-orcid/add-education-education.cy.js b/cypress/e2e/my-orcid/add-education-education.cy.js deleted file mode 100644 index 9229d85b98..0000000000 --- a/cypress/e2e/my-orcid/add-education-education.cy.js +++ /dev/null @@ -1,123 +0,0 @@ -/// - -import testData from '../../fixtures/affiliations-testing-data.fixture.json' -const uniqueId = require('../../helpers/uniqueEntry') - -describe('My orcid - users are able to edit education info in their record', async function () { - before(() => { - cy.programmaticallySignin('cyUserPrimaryEmaiVerified') //send user key from fixture file - cy.visit(`/my-orcid`) - cy.get('#cy-affiliation-education-and-qualification') //wait for page to load - }) - - it('User adds education entry with new Organization', function () { - const testNewOrg = testData.affiliationNewOrg - const uniqueDegree = testNewOrg.degree + `${uniqueId()}` - - cy.get('#cy-affiliation-education-and-qualification').within(($myPanel) => { - cy.get('#cy-menu-add-education').click() - }) - cy.contains('Add Education').wait(1000).click({ force: true }) //TO DO: replace once element id is added - - cy.get('#organization-input').clear().type(testNewOrg.name) - cy.get('#city-input').clear().type(testNewOrg.city) - cy.get('#region-input').clear().type(testNewOrg.region) - cy.get('#country-input').click() - cy.get('[role="listbox"]').within(($countries) => { - //TO DO: replace with id for the element when we add it - cy.contains(testNewOrg.country).click() - }) - cy.get('#department-input').clear().type(testNewOrg.dept) - //NOTICE: a unique id is concatenated to the degree for verification purposes - cy.get('#title-input').clear().type(uniqueDegree) - //set start date - cy.get('#cy-start-date-year-sel').click() - cy.get('#cy-start-date-year-sel-panel').within(($date) => { - cy.contains(testNewOrg.startDate_year).click() - }) - cy.get('#cy-start-date-month-sel').click() - cy.get('#cy-start-date-month-sel-panel').within(($date) => { - cy.contains(testNewOrg.startDate_month).click() - }) - cy.get('#cy-start-date-day-sel').click() - cy.get('#cy-start-date-day-sel-panel').within(($date) => { - cy.contains(testNewOrg.startDate_day).click() - }) - //set end date - cy.get('#cy-end-date-year-sel').click() - cy.get('#cy-end-date-year-sel-panel').within(($date) => { - cy.contains(testNewOrg.endDate_year).click() - }) - cy.get('#cy-end-date-month-sel').click() - cy.get('#cy-end-date-month-sel-panel').within(($date) => { - cy.contains(testNewOrg.endDate_month).click() - }) - cy.get('#cy-end-date-day-sel').click() - cy.get('#cy-end-date-day-sel-panel').within(($date) => { - cy.contains(testNewOrg.endDate_day).click() - }) - cy.get('#url-input').clear().type(testNewOrg.link) - cy.get('#save-affiliation-button').click() - - //Verify education was added looking for the unique degree - cy.get('#cy-affiliation-education-and-qualification').should( - 'contain', - uniqueDegree - ) - }) - - /* THIS SCENARIO WILL BE INCLUDED IN THE FUTURE - it('User adds education entry with existing Organization', function () { - const testExistingOrg=testData.affiliationExistingOrg - - cy.get('app-affiliations').within(($myPanel) => { - cy.get('button[aria-label="Add Education"]').click() //TO DO: replace once element id is added - }) - cy.contains("Add Education").click() //TO DO: replace once element id is added - - cy.get('#organization-input').type(testExistingOrg.name) - cy.get('[role="listbox"]').within(($orgs) => { //replace with id for the element when we add it - cy.contains(testExistingOrg.name).click() - }) - //provide additional education details - cy.get('#department-input').clear().type(testExistingOrg.dept) - cy.get('#title-input').clear().type(testExistingOrg.degree) - //set start date - cy.get('#start-date-year-input').click() - cy.get('[role="listbox"]').within(($date) => { //replace with id for the element when we add it - cy.contains(testExistingOrg.startDate_year).click() - }) - cy.get('#start-date-month-input').click() - cy.get('[role="listbox"]').within(($date) => { //replace with id for the element when we add it - cy.contains(testExistingOrg.startDate_month).click() - }) - cy.get('#start-date-day-input').click() - cy.get('[role="listbox"]').within(($date) => { //replace with id for the element when we add it - cy.contains(testExistingOrg.startDate_day).click() - }) - //set end date - cy.get('#end-date-year-input').click() - cy.get('[role="listbox"]').within(($date) => { //replace with id for the element when we add it - cy.contains(testExistingOrg.endDate_year).click() - }) - cy.get('#end-date-month-input').click() - cy.get('[role="listbox"]').within(($date) => { //replace with id for the element when we add it - cy.contains(testExistingOrg.endDate_month).click() - }) - cy.get('#end-date-day-input').click() - cy.get('[role="listbox"]').within(($date) => { //replace with id for the element when we add it - cy.contains(testExistingOrg.endDate_day).click() - }) - cy.get('#url-input').clear().type(testExistingOrg.link) - cy.get('#save-affiliation-button').click() - - //Verify employment was added - cy.get('app-panel').should('contain',testExistingOrg.name) - }) -*/ - after(() => { - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/my-orcid/add-education-qualification.cy.js b/cypress/e2e/my-orcid/add-education-qualification.cy.js deleted file mode 100644 index fb356b1456..0000000000 --- a/cypress/e2e/my-orcid/add-education-qualification.cy.js +++ /dev/null @@ -1,123 +0,0 @@ -/// - -import testData from '../../fixtures/affiliations-testing-data.fixture.json' -const uniqueId = require('../../helpers/uniqueEntry') - -describe('My orcid - users are able to edit education info in their record', async function () { - before(() => { - cy.programmaticallySignin('cyUserPrimaryEmaiVerified') //send user key from fixture file - cy.visit(`/my-orcid`) - cy.get('#cy-affiliation-education-and-qualification') //wait for page to load - }) - - it('User adds qualification entry with new Organization', function () { - const testNewOrg = testData.affiliationNewOrg - const uniqueDegree = testNewOrg.degree + `${uniqueId()}` - - cy.get('#cy-affiliation-education-and-qualification').within(($myPanel) => { - cy.get('#cy-menu-add-education').click() - }) - cy.contains('Add Qualification').wait(1000).click({ force: true }) //TO DO: replace once element id is added - - cy.get('#organization-input').clear().type(testNewOrg.name) - cy.get('#city-input').clear().type(testNewOrg.city) - cy.get('#region-input').clear().type(testNewOrg.region) - cy.get('[formcontrolname="country"]').click() //replace with id for the element when we add it - cy.get('[role="listbox"]').within(($countries) => { - //replace with id for the element when we add it - cy.contains(testNewOrg.country).click() - }) - cy.get('#department-input').clear().type(testNewOrg.dept) - //NOTICE: a unique id is concatenated to the degree for verification purposes - cy.get('#title-input').clear().type(uniqueDegree) - //set start date - cy.get('#cy-start-date-year-sel').click() - cy.get('#cy-start-date-year-sel-panel').within(($date) => { - cy.contains(testNewOrg.startDate_year).click() - }) - cy.get('#cy-start-date-month-sel').click() - cy.get('#cy-start-date-month-sel-panel').within(($date) => { - cy.contains(testNewOrg.startDate_month).click() - }) - cy.get('#cy-start-date-day-sel').click() - cy.get('#cy-start-date-day-sel-panel').within(($date) => { - cy.contains(testNewOrg.startDate_day).click() - }) - //set end date - cy.get('#cy-end-date-year-sel').click() - cy.get('#cy-end-date-year-sel-panel').within(($date) => { - cy.contains(testNewOrg.endDate_year).click() - }) - cy.get('#cy-end-date-month-sel').click() - cy.get('#cy-end-date-month-sel-panel').within(($date) => { - cy.contains(testNewOrg.endDate_month).click() - }) - cy.get('#cy-end-date-day-sel').click() - cy.get('#cy-end-date-day-sel-panel').within(($date) => { - cy.contains(testNewOrg.endDate_day).click() - }) - cy.get('#url-input').clear().type(testNewOrg.link) - cy.get('#save-affiliation-button').click() - - //Verify employment was added - cy.get('#cy-affiliation-education-and-qualification').should( - 'contain', - testNewOrg.name - ) - }) - - /* THIS SCENARIO WILL BE INCLUDED IN THE FUTURE - it('User adds qualification entry with existing Organization', function () { - const testExistingOrg=testData.affiliationExistingOrg - - cy.get('app-affiliations').within(($myPanel) => { - cy.get('button[aria-label="Add Education"]').click() //TO DO: replace once element id is added - }) - cy.contains("Add Qualification").click() //TO DO: replace once element id is added - - cy.get('#organization-input').type(testExistingOrg.name) - cy.get('[role="listbox"]').within(($orgs) => { //replace with id for the element when we add it - cy.contains(testExistingOrg.name).click() - }) - //provide additional qualification details - cy.get('#department-input').clear().type(testExistingOrg.dept) - cy.get('#title-input').clear().type(testExistingOrg.degree) - //set start date - cy.get('#start-date-year-input').click() - cy.get('[role="listbox"]').within(($date) => { //replace with id for the element when we add it - cy.contains(testExistingOrg.startDate_year).click() - }) - cy.get('#start-date-month-input').click() - cy.get('[role="listbox"]').within(($date) => { //replace with id for the element when we add it - cy.contains(testExistingOrg.startDate_month).click() - }) - cy.get('#start-date-day-input').click() - cy.get('[role="listbox"]').within(($date) => { //replace with id for the element when we add it - cy.contains(testExistingOrg.startDate_day).click() - }) - //set end date - cy.get('#end-date-year-input').click() - cy.get('[role="listbox"]').within(($date) => { //replace with id for the element when we add it - cy.contains(testExistingOrg.endDate_year).click() - }) - cy.get('#end-date-month-input').click() - cy.get('[role="listbox"]').within(($date) => { //replace with id for the element when we add it - cy.contains(testExistingOrg.endDate_month).click() - }) - cy.get('#end-date-day-input').click() - cy.get('[role="listbox"]').within(($date) => { //replace with id for the element when we add it - cy.contains(testExistingOrg.endDate_day).click() - }) - cy.get('#url-input').clear().type(testExistingOrg.link) - cy.get('#save-affiliation-button').click() - - //Verify employment was added - cy.get('app-panel').should('contain',testExistingOrg.name) - })*/ - - after(() => { - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/my-orcid/add-employment.cy.js b/cypress/e2e/my-orcid/add-employment.cy.js deleted file mode 100644 index f8848e436a..0000000000 --- a/cypress/e2e/my-orcid/add-employment.cy.js +++ /dev/null @@ -1,118 +0,0 @@ -/// - -import testData from '../../fixtures/affiliations-testing-data.fixture.json' -const uniqueId = require('../../helpers/uniqueEntry') - -describe('My orcid - users are able to edit employment info in their record', async function () { - before(() => { - cy.programmaticallySignin('cyUserPrimaryEmaiVerified') //send user key from fixture file - cy.visit('/my-orcid') - cy.get('#cy-affiliation-employment') //wait for page to load - }) - - it('User adds employment with new Organization', function () { - const testNewOrg = testData.affiliationNewOrg - const uniqueRole = testNewOrg.role + `${uniqueId()}` - - cy.get('#cy-affiliation-employment').within(($myPanel) => { - cy.get('#cy-add-btn-employment').click() - }) - //user types org name - cy.get('#organization-input').clear().type(testNewOrg.name) - - cy.get('#city-input').clear().type(testNewOrg.city) - cy.get('#region-input').clear().type(testNewOrg.region) - cy.get('[formcontrolname="country"]').click() //REPLACE locator with id once it is added - cy.get('[role="listbox"]').within(($countries) => { - //REPLACE locator with id once it is added - cy.contains(testNewOrg.country).click() - }) - cy.get('#department-input').clear().type(testNewOrg.dept) - cy.get('#title-input').clear().type(uniqueRole) - //set start date - cy.get('#cy-start-date-year-sel').click() - cy.get('#cy-start-date-year-sel-panel').within(($date) => { - cy.contains(testNewOrg.startDate_year).click() - }) - cy.get('#cy-start-date-month-sel').click() - cy.get('#cy-start-date-month-sel-panel').within(($date) => { - cy.contains(testNewOrg.startDate_month).click() - }) - cy.get('#cy-start-date-day-sel').click() - cy.get('#cy-start-date-day-sel-panel').within(($date) => { - cy.contains(testNewOrg.startDate_day).click() - }) - //set end date - cy.get('#cy-end-date-year-sel').click() - cy.get('#cy-end-date-year-sel-panel').within(($date) => { - cy.contains(testNewOrg.endDate_year).click() - }) - cy.get('#cy-end-date-month-sel').click() - cy.get('#cy-end-date-month-sel-panel').within(($date) => { - cy.contains(testNewOrg.endDate_month).click() - }) - cy.get('#cy-end-date-day-sel').click() - cy.get('#cy-end-date-day-sel-panel').within(($date) => { - cy.contains(testNewOrg.endDate_day).click() - }) - cy.get('#url-input').clear().type(testNewOrg.link) - cy.get('#save-affiliation-button').click() - - //Verify employment was added - cy.get('#cy-affiliation-employment').should('contain', uniqueRole) - }) - - /* THIS SCENARIO WILL BE INCLUDED LATER ON - it('User adds employment with existing org from drop down list', function () { - const testExistingOrg=testData.affiliationExistingOrg - - cy.get('#cy-affiliation-employment').within(($myPanel) => { - cy.get('#cy-add-btn-employment').click() - }) - cy.get('#cy-org-dd-mat-form').type(testExistingOrg.name) - cy.get('[role="listbox"]').within(($orgs) => { //pending: REPLACE locator with id - cy.contains(testExistingOrg.name).click({force:true}) - }) - //provide additional employment details - cy.get('#department-input').clear().type(testExistingOrg.dept) - cy.get('#title-input').clear().type(testExistingOrg.role) - //set start date - cy.get('#cy-start-date-year-sel').click() - cy.get('#cy-start-date-year-sel-panel').within(($date) => { - cy.contains(testExistingOrg.startDate_year).click() - }) - cy.get('#cy-start-date-month-sel').click() - cy.get('#cy-start-date-month-sel-panel').within(($date) => { - cy.contains(testExistingOrg.startDate_month).click() - }) - cy.get('#cy-start-date-day-sel').click() - cy.get('#cy-start-date-day-sel-panel').within(($date) => { - cy.contains(testExistingOrg.startDate_day).click() - }) - //set end date - cy.get('#cy-end-date-year-sel').click() - cy.get('#cy-end-date-year-sel-panel').within(($date) => { - cy.contains(testExistingOrg.endDate_year).click() - }) - cy.get('#cy-end-date-month-sel').click() - cy.get('#cy-end-date-month-sel-panel').within(($date) => { - cy.contains(testExistingOrg.endDate_month).click() - }) - cy.get('#cy-end-date-day-sel').click() - cy.get('#cy-end-date-day-sel-panel').within(($date) => { - cy.contains(testExistingOrg.endDate_day).click() - }) - cy.get('#url-input').clear().type(testExistingOrg.link) - cy.get('#save-affiliation-button').click() - - //Verify employment was added - cy.get('#cy-affiliation-employment').should('contain',testExistingOrg.name) - }) -*/ - - after(() => { - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/my-orcid/add-funding-manually.cy.js b/cypress/e2e/my-orcid/add-funding-manually.cy.js deleted file mode 100644 index e76b73e923..0000000000 --- a/cypress/e2e/my-orcid/add-funding-manually.cy.js +++ /dev/null @@ -1,94 +0,0 @@ -/// - -import testData from '../../fixtures/affiliations-testing-data.fixture.json' -const uniqueId = require('../../helpers/uniqueEntry') - -describe('My orcid - users are able to add funding info in their record', async function () { - before(() => { - cy.programmaticallySignin('cyUserPrimaryEmaiVerified') //send user key from fixture file - cy.visit(Cypress.env('baseUrl') + `/my-orcid`) - cy.get('#cy-fundings').should('be.visible') //wait for page to load - }) - - it('User adds a funding entry', function () { - const fundingData = testData.affilliantionFunding - const uniqueIdentifier = fundingData.grantNumber + `${uniqueId()}` - - cy.get('#cy-fundings').within(($myPanel) => { - cy.get('#cy-menu-add-funding').click() - }) - cy.contains('Add manually').should('be.visible').click({ force: true }) //TO DO: replace once element id is added - cy.get('[formcontrolname="fundingType"]').click() - cy.get('[role="listbox"]').within(($types) => { - //TO DO: replace with id for the element when we add it - cy.contains(fundingData.fundingType).click() - }) - cy.get('#funding-subtype-input').clear().type(fundingData.fundingSubtype) - //NOTICE: a unique id is concatenated to the title for verification purposes - cy.get('#funding-project-title-input') - .clear() - .type(fundingData.fundedProjectTitle) - - cy.contains('Add a translated title').click() //TO DO: replace with id for the element when we add it - cy.get('#funding-project-translated-title-input') - .clear() - .type(fundingData.translatedTitle) - cy.get('#language-title-input').click() - cy.get('#language-title-input-panel').within(($languages) => { - cy.contains(fundingData.tranlationLanguage).click() - }) - cy.get('#funding-project-link-input').clear().type(fundingData.fundingLink) - cy.get('[formcontrolname="description"]') - .clear() - .type(fundingData.description) - cy.get('[formcontrolname="currencyCode"]').click() - cy.get('[role="listbox"]').within(($currency) => { - //TO DO: replace with id for the element when we add it - cy.contains(fundingData.amountCurrency).click() - }) - cy.get('#amount-input').clear().type(fundingData.amount) - - //set start date - cy.get('[formcontrolname="startDateYear"]').click() - cy.get('[role="listbox"]').within(($date) => { - cy.contains(fundingData.startYear).click() - }) - cy.get('[formcontrolname="startDateMonth"]').click() - cy.get('[role="listbox"]').within(($date) => { - cy.contains(fundingData.startMonth).click() - }) - //set end date - cy.get('[formcontrolname="endDateYear"]').click() - cy.get('[role="listbox"]').within(($date) => { - cy.contains(fundingData.endYear).click() - }) - cy.get('[formcontrolname="endDateMonth"]').click() - cy.get('[role="listbox"]').within(($date) => { - cy.contains(fundingData.endMonth).click() - }) - //add agency info - cy.get('#funding-agency-name-input').clear().type(fundingData.fundingAgency) - cy.get('#city-input').clear().type(fundingData.city) - cy.get('#region-input').clear().type(fundingData.region) - cy.get('[formcontrolname="country"]').click() - cy.get('[role="listbox"]').within(($country) => { - cy.contains(fundingData.country).click() - }) - //add identifier - cy.contains('Add an identifier').click() //TO DO: replace with id for the element when we add it - cy.get('[formcontrolname="grantNumber"]').clear().type(uniqueIdentifier) - cy.get('[formcontrolname="grantUrl"]').clear().type(fundingData.grantLink) - - //save entry - cy.get('#save-names-button').click() - - //Verify funding was added looking for the unique grant number - cy.get('#cy-fundings').should('contain', uniqueIdentifier) - }) - - after(() => { - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/my-orcid/add-funding-via-API-with-contributors.cy.js b/cypress/e2e/my-orcid/add-funding-via-API-with-contributors.cy.js deleted file mode 100644 index 4367bac29c..0000000000 --- a/cypress/e2e/my-orcid/add-funding-via-API-with-contributors.cy.js +++ /dev/null @@ -1,55 +0,0 @@ -/// - -import userData from '../../fixtures/testing-users.fixture.json' -const jsonfile = require('../../fixtures/funding-with-contributors.fixture.json') - -describe('My orcid - via API members can add fundings', async function () { - before(() => { - //add a new funding via API - const endpoint = - Cypress.env('membersAPI_URL') + - userData.cyFundingContributorsUser.oid + - Cypress.env('membersAPI_fundingsEndpoint') - - const curlStatement = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyFundingContributorsUser.bearer + - "' -d '" + - userData.cyFundingContributorsUser.curlPostFundingPath + - "' -X POST '" + - endpoint + - "'" - cy.exec(curlStatement).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 201 - expect(response.stdout).to.contain('HTTP/2 201') - }) - }) - - it('New funding with contributors added via API is displayed correctly', function () { - //grab grant number from funding json file - const grantNumber = - jsonfile['external-ids']['external-id']['external-id-value'] - - //Login - cy.programmaticallySignin('cyFundingContributorsUser') //send user key from fixture file - cy.visit(Cypress.env('baseUrl') + `/my-orcid`) - cy.get('#cy-fundings').should('be.visible') //wait for page to load - - //verify funding was added to the account - cy.get('#cy-fundings').should('contain', grantNumber) - - cy.get('#cy-fundings').within(() => { - cy.contains('Show more detail').click() //REPLACE locator with id - }) - //verify contributors info is displayed - cy.get('#cy-fundings').should('contain', 'Contributors') //REPLACE locator with id - }) - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/my-orcid/add-invited-positions-distinctions.cy.js b/cypress/e2e/my-orcid/add-invited-positions-distinctions.cy.js deleted file mode 100644 index efaa602115..0000000000 --- a/cypress/e2e/my-orcid/add-invited-positions-distinctions.cy.js +++ /dev/null @@ -1,63 +0,0 @@ -/// - -import testData from '../../fixtures/affiliations-testing-data.fixture.json' -const uniqueId = require('../../helpers/uniqueEntry') - -describe('My orcid - users are able to edit distinctions info in their record', async function () { - before(() => { - cy.programmaticallySignin('cyUserPrimaryEmaiVerified') //send user key from fixture file - cy.visit(Cypress.env('baseUrl') + `/my-orcid`) - cy.get('#cy-affiliation-invited-position-and-distinction') //wait for page to load - }) - - it('User adds distinctions entry with new Organization', function () { - const testNewOrg = testData.affiliationNewOrg - const uniqueDistinction = testNewOrg.degree + `${uniqueId()}` - - cy.get('#cy-affiliation-invited-position-and-distinction').within( - ($myPanel) => { - cy.get('#cy-menu-add-invited-position').click() - } - ) - cy.contains('Add Distinction').click({ force: true }) //TO DO: replace once element id is added - - cy.get('#organization-input').clear().type(testNewOrg.name) - cy.get('#city-input').clear().type(testNewOrg.city) - cy.get('#region-input').clear().type(testNewOrg.region) - cy.get('#country-input').click() - cy.get('[role="listbox"]').within(($countries) => { - //TO DO: replace with id for the element when we add it - cy.contains(testNewOrg.country).click() - }) - cy.get('#department-input').clear().type(testNewOrg.dept) - //NOTICE: a unique id is concatenated to the distinction for verification purposes - cy.get('#title-input').clear().type(uniqueDistinction) - //set award/distinction date - cy.get('#cy-start-date-year-sel').click() - cy.get('#cy-start-date-year-sel-panel').within(($date) => { - cy.contains(testNewOrg.startDate_year).click() - }) - cy.get('#cy-start-date-month-sel').click() - cy.get('#cy-start-date-month-sel-panel').within(($date) => { - cy.contains(testNewOrg.startDate_month).click() - }) - cy.get('#cy-start-date-day-sel').click() - cy.get('#cy-start-date-day-sel-panel').within(($date) => { - cy.contains(testNewOrg.startDate_day).click() - }) - cy.get('#url-input').clear().type(testNewOrg.link) - cy.get('#save-affiliation-button').click() - - //Verify education was added looking for the unique degree - cy.get('#cy-affiliation-invited-position-and-distinction').should( - 'contain', - uniqueDistinction - ) - }) - - after(() => { - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/my-orcid/add-invited-positions.cy.js b/cypress/e2e/my-orcid/add-invited-positions.cy.js deleted file mode 100644 index 597b26a607..0000000000 --- a/cypress/e2e/my-orcid/add-invited-positions.cy.js +++ /dev/null @@ -1,76 +0,0 @@ -/// - -import testData from '../../fixtures/affiliations-testing-data.fixture.json' -const uniqueId = require('../../helpers/uniqueEntry') - -describe('My orcid - users are able to edit invited positions info in their record', async function () { - before(() => { - cy.programmaticallySignin('cyUserPrimaryEmaiVerified') //send user key from fixture file - cy.visit(Cypress.env('baseUrl') + `/my-orcid`) - cy.get('#cy-affiliation-invited-position-and-distinction') //wait for page to load - }) - - it('User adds invited positions entry with new Organization', function () { - const testNewOrg = testData.affiliationNewOrg - const uniqueDegree = testNewOrg.degree + `${uniqueId()}` - - cy.get('#cy-affiliation-invited-position-and-distinction').within( - ($myPanel) => { - cy.get('#cy-menu-add-invited-position').click() - } - ) - cy.contains('Add Invited Position').click({ force: true }) //TO DO: replace once element id is added - - cy.get('#organization-input').clear().type(testNewOrg.name) - cy.get('#city-input').clear().type(testNewOrg.city) - cy.get('#region-input').clear().type(testNewOrg.region) - cy.get('#country-input').click() - cy.get('[role="listbox"]').within(($countries) => { - //TO DO: replace with id for the element when we add it - cy.contains(testNewOrg.country).click() - }) - cy.get('#department-input').clear().type(testNewOrg.dept) - //NOTICE: a unique id is concatenated to the title for verification purposes - cy.get('#title-input').clear().type(uniqueDegree) - //set start date - cy.get('#cy-start-date-year-sel').click() - cy.get('#cy-start-date-year-sel-panel').within(($date) => { - cy.contains(testNewOrg.startDate_year).click() - }) - cy.get('#cy-start-date-month-sel').click() - cy.get('#cy-start-date-month-sel-panel').within(($date) => { - cy.contains(testNewOrg.startDate_month).click() - }) - cy.get('#cy-start-date-day-sel').click() - cy.get('#cy-start-date-day-sel-panel').within(($date) => { - cy.contains(testNewOrg.startDate_day).click() - }) - //set end date - cy.get('#cy-end-date-year-sel').click() - cy.get('#cy-end-date-year-sel-panel').within(($date) => { - cy.contains(testNewOrg.endDate_year).click() - }) - cy.get('#cy-end-date-month-sel').click() - cy.get('#cy-end-date-month-sel-panel').within(($date) => { - cy.contains(testNewOrg.endDate_month).click() - }) - cy.get('#cy-end-date-day-sel').click() - cy.get('#cy-end-date-day-sel-panel').within(($date) => { - cy.contains(testNewOrg.endDate_day).click() - }) - cy.get('#url-input').clear().type(testNewOrg.link) - cy.get('#save-affiliation-button').click() - - //Verify education was added looking for the unique degree - cy.get('#cy-affiliation-invited-position-and-distinction').should( - 'contain', - uniqueDegree - ) - }) - - after(() => { - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/my-orcid/add-membership-service.cy.js b/cypress/e2e/my-orcid/add-membership-service.cy.js deleted file mode 100644 index 2dde6706b1..0000000000 --- a/cypress/e2e/my-orcid/add-membership-service.cy.js +++ /dev/null @@ -1,74 +0,0 @@ -/// - -import testData from '../../fixtures/affiliations-testing-data.fixture.json' -const uniqueId = require('../../helpers/uniqueEntry') - -describe('My orcid - users are able to edit service info in their record', async function () { - before(() => { - cy.programmaticallySignin('cyUserPrimaryEmaiVerified') //send user key from fixture file - cy.visit(Cypress.env('baseUrl') + `/my-orcid`) - cy.get('#cy-affiliation-membership-and-service').should('be.visible') //wait for page to load - }) - - it('User adds service entry with new Organization', function () { - const testNewOrg = testData.affiliationNewOrg - const uniqueRole = testNewOrg.degree + `${uniqueId()}` - - cy.get('#cy-affiliation-membership-and-service').within(($myPanel) => { - cy.get('#cy-menu-add-membership').click() - }) - cy.contains('Add Service').should('be.visible').click({ force: true }) //TO DO: replace once element id is added - - cy.get('#organization-input').clear().type(testNewOrg.name) - cy.get('#city-input').clear().type(testNewOrg.city) - cy.get('#region-input').clear().type(testNewOrg.region) - cy.get('#country-input').click() - cy.get('[role="listbox"]').within(($countries) => { - //TO DO: replace with id for the element when we add it - cy.contains(testNewOrg.country).click() - }) - cy.get('#department-input').clear().type(testNewOrg.dept) - //NOTICE: a unique id is concatenated to the service for verification purposes - cy.get('#title-input').clear().type(uniqueRole) - //set start date - cy.get('#cy-start-date-year-sel').click() - cy.get('#cy-start-date-year-sel-panel').within(($date) => { - cy.contains(testNewOrg.startDate_year).click() - }) - cy.get('#cy-start-date-month-sel').click() - cy.get('#cy-start-date-month-sel-panel').within(($date) => { - cy.contains(testNewOrg.startDate_month).click() - }) - cy.get('#cy-start-date-day-sel').click() - cy.get('#cy-start-date-day-sel-panel').within(($date) => { - cy.contains(testNewOrg.startDate_day).click() - }) - //set end date - cy.get('#cy-end-date-year-sel').click() - cy.get('#cy-end-date-year-sel-panel').within(($date) => { - cy.contains(testNewOrg.endDate_year).click() - }) - cy.get('#cy-end-date-month-sel').click() - cy.get('#cy-end-date-month-sel-panel').within(($date) => { - cy.contains(testNewOrg.endDate_month).click() - }) - cy.get('#cy-end-date-day-sel').click() - cy.get('#cy-end-date-day-sel-panel').within(($date) => { - cy.contains(testNewOrg.endDate_day).click() - }) - cy.get('#url-input').clear().type(testNewOrg.link) - cy.get('#save-affiliation-button').click() - - //Verify education was added looking for the unique role - cy.get('#cy-affiliation-membership-and-service').should( - 'contain', - uniqueRole - ) - }) - - after(() => { - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/my-orcid/add-membership.cy.js b/cypress/e2e/my-orcid/add-membership.cy.js deleted file mode 100644 index 3047cb4f9d..0000000000 --- a/cypress/e2e/my-orcid/add-membership.cy.js +++ /dev/null @@ -1,74 +0,0 @@ -/// - -import testData from '../../fixtures/affiliations-testing-data.fixture.json' -const uniqueId = require('../../helpers/uniqueEntry') - -describe('My orcid - users are able to edit memberships info in their record', async function () { - before(() => { - cy.programmaticallySignin('cyUserPrimaryEmaiVerified') //send user key from fixture file - cy.visit(Cypress.env('baseUrl') + `/my-orcid`) - cy.get('#cy-affiliation-membership-and-service').should('be.visible') //wait for page to load - }) - - it('User adds membership entry with new Organization', function () { - const testNewOrg = testData.affiliationNewOrg - const uniqueMembership = testNewOrg.degree + `${uniqueId()}` - - cy.get('#cy-affiliation-membership-and-service').within(($myPanel) => { - cy.get('#cy-menu-add-membership').should('be.visible').click() - }) - cy.contains('Add Membership').should('be.visible').click({ force: true }) //TO DO: replace once element id is added - - cy.get('#organization-input').clear().type(testNewOrg.name) - cy.get('#city-input').clear().type(testNewOrg.city) - cy.get('#region-input').clear().type(testNewOrg.region) - cy.get('#country-input').click() - cy.get('[role="listbox"]').within(($countries) => { - //TO DO: replace with id for the element when we add it - cy.contains(testNewOrg.country).click() - }) - cy.get('#department-input').clear().type(testNewOrg.dept) - //NOTICE: a unique id is concatenated to the membership for verification purposes - cy.get('#title-input').clear().type(uniqueMembership) - //set start date - cy.get('#cy-start-date-year-sel').click() - cy.get('#cy-start-date-year-sel-panel').within(($date) => { - cy.contains(testNewOrg.startDate_year).click() - }) - cy.get('#cy-start-date-month-sel').click() - cy.get('#cy-start-date-month-sel-panel').within(($date) => { - cy.contains(testNewOrg.startDate_month).click() - }) - cy.get('#cy-start-date-day-sel').click() - cy.get('#cy-start-date-day-sel-panel').within(($date) => { - cy.contains(testNewOrg.startDate_day).click() - }) - //set end date - cy.get('#cy-end-date-year-sel').click() - cy.get('#cy-end-date-year-sel-panel').within(($date) => { - cy.contains(testNewOrg.endDate_year).click() - }) - cy.get('#cy-end-date-month-sel').click() - cy.get('#cy-end-date-month-sel-panel').within(($date) => { - cy.contains(testNewOrg.endDate_month).click() - }) - cy.get('#cy-end-date-day-sel').click() - cy.get('#cy-end-date-day-sel-panel').within(($date) => { - cy.contains(testNewOrg.endDate_day).click() - }) - cy.get('#url-input').clear().type(testNewOrg.link) - cy.get('#save-affiliation-button').click() - - //Verify education was added looking for the unique membership - cy.get('#cy-affiliation-membership-and-service').should( - 'contain', - uniqueMembership - ) - }) - - after(() => { - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/my-orcid/add-peer-review.cy.js b/cypress/e2e/my-orcid/add-peer-review.cy.js deleted file mode 100644 index 2494b1c128..0000000000 --- a/cypress/e2e/my-orcid/add-peer-review.cy.js +++ /dev/null @@ -1,50 +0,0 @@ -/// - -import userData from '../../fixtures/testing-users.fixture.json' -const jsonfile = require('../../fixtures/peer-review.fixture.json') - -describe('My orcid - via API members can add Peer reviews', async function () { - before(() => { - //add a new peer review via API - const endpoint = - Cypress.env('membersAPI_URL') + - userData.cyUserPrimaryEmaiVerified.oid + - Cypress.env('membersAPI_peerReviewEndpoint') - - const curlStatement = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyUserMemmerAPI.bearer + - "' -d '" + - userData.cyUserMemmerAPI.curlPostPeerReviewPath + - "' -X POST '" + - endpoint + - "'" - cy.exec(curlStatement).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 201 - expect(response.stdout).to.contain('HTTP/2 201') - }) - }) - - it('New Peer Review added via API is displayed correctly', function () { - //grab review group id number - const groupId = jsonfile['review-group-id'] - - //Login - cy.programmaticallySignin('cyUserPrimaryEmaiVerified') //send user key from fixture file - cy.visit(Cypress.env('baseUrl') + `/my-orcid`) - cy.get('#cy-peer-reviews').should('be.visible') //wait for page to load - - //verify Peer Review was added to the record - cy.get('.cy-panel-component-expand-button').click() - //check for the correct review group id - cy.get('#cy-peer-reviews').should('contain', groupId.split(':')[1]) - }) - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/my-orcid/add-publish-name.cy.js b/cypress/e2e/my-orcid/add-publish-name.cy.js deleted file mode 100644 index 1daaeef223..0000000000 --- a/cypress/e2e/my-orcid/add-publish-name.cy.js +++ /dev/null @@ -1,36 +0,0 @@ -/// - -import userData from '../../fixtures/testing-users.fixture.json' - -describe('My orcid - users are able to add content to their record', async function () { - before(() => { - cy.visit(Cypress.env('signInURL')) - }) - - it('User adds a published name', function () { - const addPublishedName = 'QA Published Name' - //sign in - cy.signin(userData.cyUserPrimaryEmaiVerified) - cy.get('#names-panel').within(($namePanel) => { - cy.get('.cy-edit-button').click() - }) - //clear and type new input - cy.get('#published-names-input').wait(1000).clear().type(addPublishedName) - cy.get('#save-names-button').click() - - //verify the name is displayed - cy.get('#publishedName').then(($content) => { - let textFound = $content.text() - cy.log(textFound) - textFound = textFound.trim() - cy.log(textFound) - expect(textFound).equal(addPublishedName) - }) - - //sign out - cy.get('app-user-menu').click() - cy.get('#cdk-overlay-2').within(($menu) => { - cy.get('.mat-menu-item').contains('Logout').click() - }) - }) -}) diff --git a/cypress/e2e/my-orcid/add-work-doi.cy.js b/cypress/e2e/my-orcid/add-work-doi.cy.js deleted file mode 100644 index 0829a4e77a..0000000000 --- a/cypress/e2e/my-orcid/add-work-doi.cy.js +++ /dev/null @@ -1,36 +0,0 @@ -/// - -import testData from '../../fixtures/affiliations-testing-data.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('My orcid - users are able to edit work info in their record', async function () { - before(() => { - cy.programmaticallySignin('cyUserPrimaryEmaiVerified') //send user key from fixture file - cy.visit('/my-orcid') - }) - - qase( - '79', - it('User adds work by DOI and without modifying manually', function () { - const testWorks = testData.affilliantionWorks - - cy.get('#cy-works', { timeout: 6000 }).within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-doi').click({ force: true }) - cy.get('#external-id-input').clear().type(testWorks.DOI) - cy.get(`[id^='cy-retrieve-work-details']`).click() - cy.get('#save-work-button').wait(1000).click({ force: true }) //wait for modal to display - //Verify work was added - cy.get('#cy-works', { timeout: 6000 }).should( - 'contain', - testWorks.workTitleDOI - ) - }) - ) //end of qase tag - after(() => { - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/my-orcid/add-work-manually.cy.js b/cypress/e2e/my-orcid/add-work-manually.cy.js deleted file mode 100644 index 107db68071..0000000000 --- a/cypress/e2e/my-orcid/add-work-manually.cy.js +++ /dev/null @@ -1,109 +0,0 @@ -/// - -import testData from '../../fixtures/affiliations-testing-data.fixture.json' - -describe('My orcid - users are able to edit work info in their record', async function () { - before(() => { - cy.programmaticallySignin('cyUserPrimaryEmaiVerified') //send user key from fixture file - cy.visit('/my-orcid') - cy.get('#cy-works') //wait for page to load - }) - - it('User adds work manually', function () { - const testWorks = testData.affilliantionWorks - - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - cy.get('#cy-work-types').click() - cy.get('#cy-work-types-panel').within(($myOptions) => { - cy.contains(testWorks.manuallyType).click() - }) - cy.get('#title-input').clear().type(testWorks.manuallyTitle) - //add translated title - cy.get('#cy-translated-title-toggle-link').click() - cy.get('#cy-translated-title-content') - .clear() - .type(testWorks.manuallyTranslatedTitle) - cy.get('#language-of-title-input').click() - cy.get('#language-of-title-input-panel').within(($languages) => { - cy.contains(testWorks.manuallyLanguage).click() - }) - //add publication details - cy.get('#work-subtitle-input').clear().type(testWorks.manuallySubtitle) - cy.get('#cy-journal-title').clear().type(testWorks.manuallyJournalTitle) - cy.get('#cy-start-date-year-sel').click() - cy.get('#cy-start-date-year-sel-panel').within(($list) => { - cy.contains(testWorks.manuallyYear).click() - }) - cy.get('#cy-start-date-month-sel').click() - cy.get('#cy-start-date-month-sel-panel').within(($list) => { - cy.contains(testWorks.manuallyMonth).click() - }) - cy.get('#cy-start-date-day-sel').click() - cy.get('#cy-start-date-day-sel-panel').within(($list) => { - cy.contains(testWorks.manuallyDay).click() - }) - cy.get('#url-input').clear().type(testWorks.manuallyLink) - //add citation - cy.get('#cy-citation-type').click() - cy.get('#cy-citation-type-panel').within(($list) => { - cy.contains(testWorks.manuallyCitationType).click() - }) - cy.get('#citation-input').clear().type(testWorks.manuallyCitation) - cy.get('[formcontrolname="shortDescription"]') - .clear() - .type(testWorks.manuallyCitationDesc) - //add identifier - cy.get('#cy-add-an-work-external-id').click() - cy.get('[formcontrolname="externalIdentifierType"]').click() //to do REPLACE with id for the element next sprint - cy.get('[role="listbox"]').within(($list) => { - //to do REPLACE with id for the element next sprint - cy.contains(testWorks.manuallyIdentifierType).click() - }) - cy.get('[formcontrolname="externalIdentifierId"]') - .clear() - .type(testWorks.manuallyIdentifierId) - cy.get('[formcontrolname="externalIdentifierUrl"]') - .clear() - .type(testWorks.manuallyIdentifierLink) - //by default Self relationship is checked - //once IDs are added we can add logic to choose what fixture file indicates - - cy.get('#language-input').click() - cy.get('#language-input-panel').within(($list) => { - cy.contains(testWorks.manuallyFormLanguage).click() - }) - cy.get('#country-input').click() - cy.get('#country-input-panel').within(($list) => { - cy.contains(testWorks.manuallyFormCountry).click() - }) - - //by default visibility is set to public, - //change it in case test data indicates limited/private - cy.get('#modal-container').within(($modal) => { - if (testWorks.manuallyVisibility == 'limited') { - cy.get('#cy-visibility-limited').click() - } else { - if (testWorks.manuallyVisibility == 'private') { - cy.get('.cy-visibility-private').click() - } - } - }) - //save entry - cy.get('#save-work-button').wait(1000).click({ force: true }) - - //Verify work was added - cy.get('#cy-works', { timeout: 10000 }).should( - 'contain', - testWorks.manuallyTitle - ) - }) - - after(() => { - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/my-orcid/add-works-via-API-with-contributors.cy.js b/cypress/e2e/my-orcid/add-works-via-API-with-contributors.cy.js deleted file mode 100644 index 3b8437b217..0000000000 --- a/cypress/e2e/my-orcid/add-works-via-API-with-contributors.cy.js +++ /dev/null @@ -1,55 +0,0 @@ -/// - -import userData from '../../fixtures/testing-users.fixture.json' -const jsonfile = require('../../fixtures/work-with-contributors.fixture.json') - -describe('My orcid - via API members can add works', async function () { - before(() => { - //add a new funding via API - const endpoint = - Cypress.env('membersAPI_URL') + - userData.cyWorkContributorsUser.oid + - Cypress.env('membersAPI_workEndpoint') - - const curlStatement = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyWorkContributorsUser.bearer + - "' -d '" + - userData.cyWorkContributorsUser.curlPostWorkPath + - "' -X POST '" + - endpoint + - "'" - cy.exec(curlStatement).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 201 - expect(response.stdout).to.contain('HTTP/2 201') - }) - }) - - it('New work with contributors added via API is displayed correctly', function () { - //grab grant number from funding json file - const grantNumber = - jsonfile['external-ids']['external-id']['external-id-value'] - - //Login - cy.programmaticallySignin('cyWorkContributorsUser') //send user key from fixture file - cy.visit(Cypress.env('baseUrl') + `/my-orcid`) - cy.get('#cy-works').should('be.visible') //wait for page to load - - //verify funding was added to the account - cy.get('#cy-works').should('contain', grantNumber) - - cy.get('#cy-works').within(() => { - cy.contains('Show more detail').click() //REPLACE locator with id - }) - //verify contributors info is displayed - cy.get('#cy-works').should('contain', 'Contributors') //REPLACE locator with id - }) - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/my-orcid/funding-added-by-client-and-record-owner-grouping.cy.js b/cypress/e2e/my-orcid/funding-added-by-client-and-record-owner-grouping.cy.js deleted file mode 100644 index 3bb4c37723..0000000000 --- a/cypress/e2e/my-orcid/funding-added-by-client-and-record-owner-grouping.cy.js +++ /dev/null @@ -1,54 +0,0 @@ -/// - -import userData from '../../fixtures/testing-users.fixture.json' -const jsonfile = require('../../fixtures/funding-duplicate-grouping.fixture.json') - -describe('My orcid - funding duplicates grouping', async function () { - before(() => { - //member adds existing funding - const endpoint = - Cypress.env('membersAPI_URL') + - userData.cyFundingDuplicatesUser.oid + - Cypress.env('membersAPI_fundingsEndpoint') - - const curlStatement = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyFundingDuplicatesUser.bearer + - "' -d '" + - userData.cyFundingDuplicatesUser.curlPostFundingPath + - "' -X POST '" + - endpoint + - "'" - cy.exec(curlStatement).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 201 - expect(response.stdout).to.contain('HTTP/2 201') - }) - }) - - it('Funding added via API is grouped if record owner already has same funding', function () { - //grab grant number from funding json file - const grantNumber = - jsonfile['external-ids']['external-id']['external-id-value'] - const fundingTitle = jsonfile['title']['title'] - - //Login - cy.programmaticallySignin('cyFundingDuplicatesUser') //send user key from fixture file - cy.visit(Cypress.env('baseUrl') + `/my-orcid`) - cy.get('#cy-fundings').should('be.visible') //wait for page to load - - //verify entry was grouped - cy.contains('app-panel[type="funding"]', grantNumber).within(() => { - cy.contains('a', 'of 2').click() //REPLACE locator with id - }) - //verify member source entry is displayed - cy.contains('app-panel[type="funding"]', fundingTitle).should('be.visible') - }) - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/my-orcid/funding-added-by-different-clients-grouping.cy.js b/cypress/e2e/my-orcid/funding-added-by-different-clients-grouping.cy.js deleted file mode 100644 index 80397cee85..0000000000 --- a/cypress/e2e/my-orcid/funding-added-by-different-clients-grouping.cy.js +++ /dev/null @@ -1,69 +0,0 @@ -/// - -import userData from '../../fixtures/testing-users.fixture.json' -const jsonfile = require('../../fixtures/funding-two-sources-grouping.fixture.json') - -describe('My orcid - funding duplicates grouping', async function () { - before(() => { - const endpoint = - Cypress.env('membersAPI_URL') + - userData.cyFundingDuplicatesUser.oid + - Cypress.env('membersAPI_fundingsEndpoint') - - //add funding with source A - const curlStatement = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyFundingDuplicatesUser.bearer + - "' -d '" + - userData.cyFundingDuplicatesUser.curlPostTwoSourcesPath + - "' -X POST '" + - endpoint + - "'" - cy.exec(curlStatement).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 201 - expect(response.stdout).to.contain('HTTP/2 201') - }) - //add funding with source B - const curlStatementB = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyFundingDuplicatesUser.clientSource2bearer + - "' -d '" + - userData.cyFundingDuplicatesUser.curlPostTwoSourcesPath + - "' -X POST '" + - endpoint + - "'" - cy.exec(curlStatementB).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 201 - expect(response.stdout).to.contain('HTTP/2 201') - }) - }) - - it('Same funding added via API by different clients is grouped', function () { - //grab grant number from funding json file - const grantNumber = - jsonfile['external-ids']['external-id']['external-id-value'] - const fundingTitle = jsonfile['title']['title'] - - //Login - cy.programmaticallySignin('cyFundingDuplicatesUser') //send user key from fixture file - cy.visit(Cypress.env('baseUrl') + `/my-orcid`) - cy.get('#cy-fundings').should('be.visible') //wait for page to load - - //verify entry was grouped - cy.contains('app-panel[type="funding"]', grantNumber).within(() => { - cy.contains('a', 'of 2').click() //REPLACE locator with id - }) - //verify member source entry is displayed - cy.contains('app-panel[type="funding"]', fundingTitle).should('be.visible') - }) - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/my-orcid/not-verified-email-can-edit-emails.cy.js b/cypress/e2e/my-orcid/not-verified-email-can-edit-emails.cy.js deleted file mode 100644 index 648fbaaa2b..0000000000 --- a/cypress/e2e/my-orcid/not-verified-email-can-edit-emails.cy.js +++ /dev/null @@ -1,54 +0,0 @@ -/// - -import userData from '../../fixtures/testing-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('User without verified primary email address can edit emails section', async function () { - const addEmail = 'cypressusertesting@orcid.org' - - before(() => { - cy.visit('/') - }) - - qase( - '108', - it('User without verified primary email address can edit emails section', function () { - //click Sign in - cy.get('#menu-signin-button').click() - - //sign in with registered user - cy.get('#username') - .clear() - .type(userData.cyUserPrimaryEmailNotVerified.oid) - cy.get('#password') - .clear() - .type(userData.cyUserPrimaryEmailNotVerified.password) - cy.get('#signin-button').click() - - //click on edit pencil for Emails section - cy.get('#emails-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - - cy.get('#add-link').click() - - cy.get('#newEmailInput1').clear().type(addEmail) - cy.get('#save-emails-button').wait(1000).click() - - //verify the keyword is displayed - cy.get('#emails-panel') - .within(($section) => { - cy.get('[class="line"]') - }) - .should('contain', addEmail) - - //clean up state - cy.cleanEmails() - }) - ) //end of qase tag - after(() => { - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/my-orcid/not-verified-email-can-edit-names.cy.js b/cypress/e2e/my-orcid/not-verified-email-can-edit-names.cy.js deleted file mode 100644 index bbc70740f7..0000000000 --- a/cypress/e2e/my-orcid/not-verified-email-can-edit-names.cy.js +++ /dev/null @@ -1,50 +0,0 @@ -/// - -import userData from '../../fixtures/testing-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('User without verified primary email address can edit Names section', async function () { - const addPublishedName = 'Cypress Published Name' - - before(() => { - cy.visit('/') - }) - - qase( - '107', - it('User without verified primary email address can edit Names section', function () { - //click Sign in - cy.get('#menu-signin-button').click() - - //sign in with registered user - cy.get('#username') - .clear() - .type(userData.cyUserPrimaryEmailNotVerified.oid) - cy.get('#password') - .clear() - .type(userData.cyUserPrimaryEmailNotVerified.password) - cy.get('#signin-button').click() - - cy.get('#names-panel').within(($namePanel) => { - cy.get('.cy-edit-button').click() - }) - cy.get('#published-names-input').wait(1000).clear().type(addPublishedName) - cy.get('#save-names-button').click() - cy.wait(2000) //wait for back end to complete - - //verify the name is displayed - cy.get('#publishedName').then(($content) => { - let textFound = $content.text() - cy.log(textFound) - textFound = textFound.trim() - cy.log(textFound) - expect(textFound).equal(addPublishedName) - }) - }) - ) //end of qase tag - after(() => { - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/my-orcid/public-page-visibility-no-public-affiliations.cy.js b/cypress/e2e/my-orcid/public-page-visibility-no-public-affiliations.cy.js deleted file mode 100644 index 8fceae7a01..0000000000 --- a/cypress/e2e/my-orcid/public-page-visibility-no-public-affiliations.cy.js +++ /dev/null @@ -1,55 +0,0 @@ -/// - -import userData from '../../fixtures/testing-users.fixture.json' - -describe('Public record page: validate data limited or private is not displayed', async function () { - const testUser = userData.cyUserPublicPageNoAffiliations - - beforeEach(() => { - cy.visit('/' + testUser.oid) - }) - - it('Only public names are displayed', function () { - cy.get('#main') - .should('contain', testUser.username) - .and('contain', testUser.publicOtherName) - .and('not.contain', testUser.privateName) - .and('not.contain', testUser.limitedName) - }) - - it('Only public emails are displayed', function () { - cy.get('#emails-panel') - .should('contain', testUser.email) - .and('not.contain', testUser.privateEmail) - .and('not.contain', testUser.limitedEmail) - }) - - it('Only public websites are displayed', function () { - cy.get('#websites-panel') - .should('contain', testUser.publicLink) - .and('not.contain', testUser.privateLink) - .and('not.contain', testUser.limitedLink) - }) - - it('Only public keywords are displayed', function () { - cy.get('#keywords-panel') - .should('contain', testUser.publicKeyword) - .and('not.contain', testUser.privateKeyword) - .and('not.contain', testUser.limitedKeyword) - }) - - it('Only public countries are displayed', function () { - cy.get('#countries-panel') - .should('contain', testUser.publicCountry) - .and('not.contain', testUser.privateCountry) - .and('not.contain', testUser.limitedCountry) - }) - - it('Verify public biography is displayed', function () { - cy.get('#main').should('contain', testUser.publicBio) - }) - - it('Verify message is displayed for users with no public affiliations', function () { - cy.get('#main').should('contain', testUser.noInfoMessage) - }) -}) diff --git a/cypress/e2e/my-orcid/public-page-visibility-public-affiliations.cy.js b/cypress/e2e/my-orcid/public-page-visibility-public-affiliations.cy.js deleted file mode 100644 index 25e4c3c8ef..0000000000 --- a/cypress/e2e/my-orcid/public-page-visibility-public-affiliations.cy.js +++ /dev/null @@ -1,48 +0,0 @@ -/// - -import userData from '../../fixtures/testing-users.fixture.json' - -describe('Public record page: validate public affiliations are displayed', async function () { - var testUser = userData.cyUserPublicPagePublicAffiliations - - beforeEach(() => { - cy.visit('/' + testUser.oid) - }) - - it('Public employment data is displayed', function () { - cy.get('#cy-affiliation-employment').should( - 'contain', - testUser.publicEmployment - ) - }) - it('Public education data is displayed', function () { - cy.get('#cy-affiliation-education-and-qualification').should( - 'contain', - testUser.publicEducation - ) - }) - it('Public distintions data is displayed', function () { - cy.get('#cy-affiliation-invited-position-and-distinction').should( - 'contain', - testUser.publicDistinction - ) - }) - it('Public services data is displayed', function () { - cy.get('#cy-affiliation-membership-and-service').should( - 'contain', - testUser.publicService - ) - }) - it('Public works data is displayed', function () { - cy.get('#cy-works').should('contain', testUser.publicWork) - }) - it('Public fundings data is displayed', function () { - cy.get('#cy-fundings').should('contain', testUser.publicFunding) - }) - it('Public peer reviews data is displayed', function () { - cy.get('#cy-peer-reviews').within(() => { - cy.get('.cy-panel-component-expand-button').click() - cy.get('.cy-panel-component').should('contain', testUser.publicPRdate) - }) - }) -}) diff --git a/cypress/e2e/my-orcid/sidebar-add-country.cy.js b/cypress/e2e/my-orcid/sidebar-add-country.cy.js deleted file mode 100644 index aca9711a31..0000000000 --- a/cypress/e2e/my-orcid/sidebar-add-country.cy.js +++ /dev/null @@ -1,48 +0,0 @@ -/// - -import userData from '../../fixtures/testing-users.fixture.json' - -describe('My orcid - users are able to add content to their record', async function () { - before(() => { - cy.visit(Cypress.env('signInURL')) - //sign in - cy.signin(userData.cyUserPrimaryEmaiVerified) - cy.wait(1000) - }) - - it('User adds a country to their record', function () { - const countrySelected = 'Albania' - - cy.get('#countries-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - cy.get('#add-link').click() - - // simulate click event on the drop down - cy.get('mat-select').first().click() // opens the drop down - // simulate click event on the drop down item (mat-option) - cy.get('.mat-option-text') - .contains(countrySelected) - .then((option) => { - option[0].click() // this is jquery click() not cypress click() - }) - - cy.get('#save-countries-button').click() - - //verify the country is displayed - cy.get('#countries-panel') - .within(($section) => { - cy.get('[class="line"]') - }) - .should('contain', countrySelected) - - //clean up state - cy.cleanCountries() - - //sign out - cy.get('app-user-menu').click() - cy.get('#cdk-overlay-3').within(($menu) => { - cy.get('.mat-menu-item').contains('Logout').click() - }) - }) -}) diff --git a/cypress/e2e/my-orcid/sidebar-add-emails.cy.js b/cypress/e2e/my-orcid/sidebar-add-emails.cy.js deleted file mode 100644 index 39f4d50283..0000000000 --- a/cypress/e2e/my-orcid/sidebar-add-emails.cy.js +++ /dev/null @@ -1,39 +0,0 @@ -/// - -import userData from '../../fixtures/testing-users.fixture.json' - -describe('My orcid - users are able to add content to their record', async function () { - before(() => { - cy.visit(Cypress.env('signInURL')) - //sign in - cy.signin(userData.cyUserPrimaryEmaiVerified) - cy.wait(1000) - }) - - it('User adds secondary Email to their record', function () { - const addSecondaryEmail = 'qa@orcid.org' - //click on edit pencil for Emails section - cy.get('#emails-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - - cy.get('#add-link').click() - - cy.get('#newEmailInput1').clear().type(addSecondaryEmail) - cy.get('#save-emails-button').wait(1000).click() - - //verify the keyword is displayed - cy.get('#emails-panel') - .within(($section) => { - cy.get('[class="line"]') - }) - .should('contain', addSecondaryEmail) - - //clean up state - cy.cleanEmails() - - //sign out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/my-orcid/sidebar-add-keywords.cy.js b/cypress/e2e/my-orcid/sidebar-add-keywords.cy.js deleted file mode 100644 index 59ae0f9172..0000000000 --- a/cypress/e2e/my-orcid/sidebar-add-keywords.cy.js +++ /dev/null @@ -1,42 +0,0 @@ -/// - -import userData from '../../fixtures/testing-users.fixture.json' - -describe('My orcid - users are able to add content to their record', async function () { - before(() => { - cy.visit(Cypress.env('signInURL')) - //sign in - cy.signin(userData.cyUserPrimaryEmaiVerified) - cy.wait(1000) - }) - - it('User adds a keywords to their record', function () { - const addKeyword = 'Research' - //click on edit pencil for Keywords section - cy.get('#keywords-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - - cy.get('#add-keyword').click() - - cy.get('.content-input').clear().type(addKeyword) - cy.get('#save-keywords-button').click() - cy.wait(1000) - - //verify the keyword is displayed - cy.get('#keywords-panel') - .within(($section) => { - cy.get('[class="line"]') - }) - .should('contain', addKeyword) - - //clean up state - cy.cleanKeywords() - - //sign out - cy.get('app-user-menu').click() - cy.get('#cdk-overlay-2').within(($menu) => { - cy.get('.mat-menu-item').contains('Logout').click() - }) - }) -}) diff --git a/cypress/e2e/my-orcid/sidebar-add-websites-negative-testing.cy.js b/cypress/e2e/my-orcid/sidebar-add-websites-negative-testing.cy.js deleted file mode 100644 index 475932d2b3..0000000000 --- a/cypress/e2e/my-orcid/sidebar-add-websites-negative-testing.cy.js +++ /dev/null @@ -1,345 +0,0 @@ -/// - -import userData from '../../fixtures/testing-users.fixture.json' -import testingData from '../../fixtures/negative-testing-data.fixture.json' - -describe('App displays error messages when user inputs invalid data', async function () { - //caching user session for each test - const login = (user) => { - cy.session(user.oid, () => { - cy.visit(Cypress.env('signInURL')) - cy.signin(user) - cy.url().should('contain', '/my-orcid') - }) - cy.visit('/my-orcid?orcid=' + user.oid) - } - - beforeEach(() => { - login(userData.cyUserPrimaryEmaiVerified) - }) - - it('Title is not required', function () { - //click on edit pencil for websites section - cy.get('#websites-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - cy.get('#add-link').click() - cy.get('[formcontrolname="description"]').clear() //empty - cy.get('[formcontrolname="url"]') - .clear() - .type(testingData.sidebarWebsitesURL.duplicateURL) - cy.get('#save-websites-button').click({ force: true }) - - //verify the URL becomes the link title displayed in my-orcid - cy.get('#websites-panel') - .within(($section) => { - cy.get('[class="line"]') - }) - .should('contain', testingData.sidebarWebsitesURL.duplicateURL) - }) - - it('URL field is required', function () { - //click on edit pencil for websites section - cy.get('#websites-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - cy.get('#add-link').click() - cy.get('[formcontrolname="description"]') - .clear() - .type(testingData.sidebarWebsitesURL.titleURL) - cy.get('[formcontrolname="url"]').clear() //empty - //try to save - cy.get('#save-websites-button').click() - - //verify the URL field is required - cy.get('mat-error').should( - 'have.text', - testingData.errorMessages.requiredURL - ) - cy.get('#cancel-websites-button').click() - }) - - it('Boundary value analysis: URL max size allowed is 1999 characters', function () { - //click on edit pencil for websites section - cy.get('#websites-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - cy.get('#add-link').click() - cy.get('[formcontrolname="description"]') - .clear() - .type(testingData.sidebarWebsitesURL.titleURL) - cy.get('[formcontrolname="url"]') - .clear() - .type(testingData.sidebarWebsitesURL.maxSizeURL) - - //save - cy.get('#save-websites-button').click() - - //verify the title is displayed in my orcid - cy.get('#websites-panel') - .within(($section) => { - cy.get('[class="line"]') - }) - .should('contain', testingData.sidebarWebsitesURL.titleURL) - }) - - it('Boundary value analysis: Max size +1 (2000 characters) is invalid', function () { - //click on edit pencil for websites section - cy.get('#websites-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - cy.get('#add-link').click() - cy.get('[formcontrolname="description"]') - .clear() - .type(testingData.sidebarWebsitesURL.titleURL) - //type a valid url longer than 1999 characters - cy.get('[formcontrolname="url"]') - .clear() - .type(testingData.sidebarWebsitesURL.maxSizeURL + '/test') - //try to save - cy.get('#save-websites-button').click() - - //verify the link field was not added - cy.get('#websites-panel').within(($section) => { - cy.get('[class="line"]').should('not.exist') - }) - }) - - it('Duplicate URLs are not allowed', function () { - //The duplicate detection is case insensitive and irrelevant of which protocol is used - //click edit pencil for websites section - cy.get('#websites-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - //add valid title and url - cy.get('#add-link').click() - cy.get('[formcontrolname="description"]') - .clear() - .type(testingData.sidebarWebsitesURL.titleURL) - cy.get('[formcontrolname="url"]') - .clear() - .type(testingData.sidebarWebsitesURL.duplicateURL) - cy.get('#save-websites-button').click() - - //reload page to reflect changes - cy.reload() - - //click edit pencil for websites section - cy.get('#websites-panel').within(($myPanel1) => { - cy.get('.cy-edit-button').click() - }) - //try to add same url with all caps - cy.get('#add-link').click() - cy.get('#draggable-1').within(($row1) => { - cy.get('[formcontrolname="description"]') - .clear() - .type(testingData.sidebarWebsitesURL.duplicateTitle) - cy.get('[formcontrolname="url"]') - .clear() - .type(testingData.sidebarWebsitesURL.duplicateAllCapsURL) - }) - cy.get('#save-websites-button').trigger('click') - - //verify error message is displayed - cy.get('mat-error').should( - 'have.text', - testingData.errorMessages.duplicatedURL - ) - - cy.get('#cancel-websites-button').click() - }) - - it('Automatically prefix protocol if not provided by user', function () { - //click on edit pencil for websites section - cy.get('#websites-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - cy.get('#add-link').click() - cy.get('[formcontrolname="url"]') - .clear() - .type(testingData.sidebarWebsitesURL.noProtocolURL) - cy.get('#save-websites-button').click() - - //verify http is prefxed automatically - cy.get('#websites-panel') - .within(($section) => { - cy.get('[class="line"]') - }) - .should('contain', testingData.sidebarWebsitesURL.appendixedProtocolURL) - }) - - it('URLs in mixedcase are valid', function () { - //click on edit pencil for websites section - cy.get('#websites-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - cy.get('#add-link').click() - cy.get('[formcontrolname="url"]') - .clear() - .type(testingData.sidebarWebsitesURL.mixedCaseURL) - cy.get('#save-websites-button').click() - - //verify URL case was not modified by the system in any way - cy.get('#websites-panel') - .within(($section) => { - cy.get('[class="line"]') - }) - .should('contain', testingData.sidebarWebsitesURL.mixedCaseURL) - }) - - it('Internationalized (valid) URLs are not allowed', function () { - /* Business rule: valid internationalized URLs are NOT supported */ - //click on edit pencil for websites section - cy.get('#websites-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - cy.get('#add-link').click() - cy.get('.cy-description-input') - .clear() - .type(testingData.sidebarWebsitesURL.titleURL) - cy.get('[formcontrolname="url"]') - .clear() - .type(testingData.sidebarWebsitesURL.internationalURL1) - cy.get('#save-websites-button').click() - //verify error message is displayed - cy.get('mat-error').should( - 'have.text', - testingData.errorMessages.invalidURL - ) - - cy.get('[formcontrolname="url"]') - .clear() - .type(testingData.sidebarWebsitesURL.internationalURL2) - cy.get('#save-websites-button').click() - //verify error message is displayed - cy.get('mat-error').should( - 'have.text', - testingData.errorMessages.invalidURL - ) - - cy.get('[formcontrolname="url"]') - .clear() - .type(testingData.sidebarWebsitesURL.internationalURL3) - cy.get('#save-websites-button').click() - //verify error message is displayed - cy.get('mat-error').should( - 'have.text', - testingData.errorMessages.invalidURL - ) - - cy.get('[formcontrolname="url"]') - .clear() - .type(testingData.sidebarWebsitesURL.internationalURL4) - cy.get('#save-websites-button').click() - //verify error message is displayed - cy.get('mat-error').should( - 'have.text', - testingData.errorMessages.invalidURL - ) - - cy.get('#cancel-websites-button').click() - }) - - it('Error messages display according to the language selected', function () { - //switch to Spanish - cy.get('#cy-language-comp').click() - cy.get('[role="menu"]').within(($menuLanguage) => { - cy.get('button[role="menuitem"]') - .contains(testingData.errorMessages.displayLanguageSpanish) - .click() - }) - cy.get('[lang="es"]') //wait for language to refresh - //click on edit pencil for websites section - cy.get('#websites-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - cy.get('#add-link').click() - cy.get('[formcontrolname="description"]') - .clear() - .type(testingData.sidebarWebsitesURL.titleURL) - cy.get('[formcontrolname="url"]').clear() //empty - cy.get('#save-websites-button').click() - - //verify the URL field is required - cy.get('mat-error').should( - 'have.text', - testingData.errorMessages.requiredURLSpanish - ) - - cy.get('#cancel-websites-button').click() - - //switch back to English - cy.get('#cy-language-comp').click() - cy.get('[role="menu"]').within(($menuLanguage1) => { - cy.get('button[role="menuitem"]') - .contains(testingData.errorMessages.displayLanguageEnglish) - .click() - }) - cy.get('[lang="en"]') //wait for language to refresh before Log out - }) - - it('Duplicates added via API show error message', function () { - // if a user creates a URL and then an API client posts the same URL, - // or two different API clients add the same URL, - // the user will see the URLs marked as duplicates when they open the section - - //click on edit pencil for websites section - cy.get('#websites-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - cy.get('#add-link').click() - cy.get('[formcontrolname="description"]') - .clear() - .type(testingData.sidebarWebsitesURL.titleURL) - cy.get('[formcontrolname="url"]') - .clear() - .type(testingData.sidebarWebsitesURL.duplicateURL) - cy.get('#save-websites-button').click() - - //add same URL via API - const endpoint = - Cypress.env('membersAPI_URL') + - userData.cyUserPrimaryEmaiVerified.oid + - Cypress.env('membersAPI_websitesEndPoint') - const curlStatement = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyUserMemmerAPI.bearer + - "' -d '" + - userData.cyUserMemmerAPI.curlPostWebsitePath + - "' -X POST '" + - endpoint + - "'" - - cy.log(curlStatement) - cy.exec(curlStatement).then((response) => { - expect(response.code).to.eq(0) - }) - - //reload page to reflect changes - cy.reload() - - //verify both entries are displayed with error message - cy.get('#websites-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - cy.get('mat-error') - .eq(0) - .should('have.text', testingData.errorMessages.duplicatedURL) - cy.get('mat-error') - .eq(1) - .should('have.text', testingData.errorMessages.duplicatedURL) - - cy.get('#cancel-websites-button').click() - }) - - afterEach(() => { - //clean up state - cy.cleanWebsites() - }) - - after(() => { - //sign out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/my-orcid/sidebar-add-websites.cy.js b/cypress/e2e/my-orcid/sidebar-add-websites.cy.js deleted file mode 100644 index c87e36889f..0000000000 --- a/cypress/e2e/my-orcid/sidebar-add-websites.cy.js +++ /dev/null @@ -1,185 +0,0 @@ -/// - -import userData from '../../fixtures/testing-users.fixture.json' -import testingData from '../../fixtures/negative-testing-data.fixture.json' - -describe('My orcid - users are able to add content to their record', async function () { - //caching user session for each test - const login = (user) => { - cy.session(user.oid, () => { - cy.visit(Cypress.env('signInURL')) - cy.signin(user) - cy.url().should('contain', '/my-orcid') - }) - cy.visit('/my-orcid?orcid=' + user.oid) - } - - beforeEach(() => { - login(userData.cyUserPrimaryEmaiVerified) - }) - - it('User adds a website to their record', function () { - const addDesc = 'Testing new website' - const addUrl = 'https://www.nationalgeographic.com/' - - //click on edit pencil for Emails section - cy.get('#websites-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - - cy.get('#add-link').click() - - cy.get('[formcontrolname="description"]').clear().type(addDesc) - cy.get('[formcontrolname="url"]').clear().type(addUrl) - cy.get('#save-websites-button').click() - cy.wait(1000) - - //verify the keyword is displayed - cy.get('#websites-panel') - .within(($section) => { - cy.get('[class="line"]') - }) - .should('contain', addDesc) - }) - - it('Arabic characters in URL title field are allowed', function () { - //click on edit pencil for websites section - cy.get('#websites-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - cy.get('#add-link').click() - cy.get('[formcontrolname="description"]') - .clear() - .type(testingData.sidebarWebsitesURL.arabicTitle) - cy.get('[formcontrolname="url"]') - .clear() - .type(testingData.sidebarWebsitesURL.duplicateURL) - //try to save - cy.get('#save-websites-button').click() - - //verify the title is displayed correctly - cy.get('#websites-panel') - .within(($section) => { - cy.get('[class="line"]') - }) - .should('contain', testingData.sidebarWebsitesURL.arabicTitle) - }) - - it('Russian characters in URL title field are allowed', function () { - //click on edit pencil for websites section - cy.get('#websites-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - cy.get('#add-link').click() - cy.get('[formcontrolname="description"]') - .clear() - .type(testingData.sidebarWebsitesURL.russianTitle) - cy.get('[formcontrolname="url"]') - .clear() - .type(testingData.sidebarWebsitesURL.duplicateURL) - //try to save - cy.get('#save-websites-button').click() - - //verify the title is displayed correctly - cy.get('#websites-panel') - .within(($section) => { - cy.get('[class="line"]') - }) - .should('contain', testingData.sidebarWebsitesURL.russianTitle) - }) - - it('Chinese characters in URL title field are allowed', function () { - //click on edit pencil for websites section - cy.get('#websites-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - cy.get('#add-link').click() - cy.get('[formcontrolname="description"]') - .clear() - .type(testingData.sidebarWebsitesURL.chineseTitle) - cy.get('[formcontrolname="url"]') - .clear() - .type(testingData.sidebarWebsitesURL.duplicateURL) - //try to save - cy.get('#save-websites-button').click() - - //verify the title is displayed correctly - cy.get('#websites-panel') - .within(($section) => { - cy.get('[class="line"]') - }) - .should('contain', testingData.sidebarWebsitesURL.chineseTitle) - }) - - it('Leading whitespaces in URL are trimmed on save', function () { - //click on edit pencil for websites section - cy.get('#websites-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - cy.get('#add-link').click() - cy.get('[formcontrolname="description"]') - .clear() - .type(testingData.sidebarWebsitesURL.titleURL) - cy.get('[formcontrolname="url"]') - .clear() - .type(' ' + testingData.sidebarWebsitesURL.duplicateURL) - - //app should let you save, no errors displayed - cy.get('#save-websites-button').click() - - //verify the entry was added - cy.get('#websites-panel') - .within(($section) => { - cy.get('[class="line"]') - }) - .should('contain', testingData.sidebarWebsitesURL.titleURL) - - //verify url was trimmed - cy.get('#websites-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - cy.get('[formcontrolname="url"]').should('not.contain', ' ') - }) - - it('Trailing whitespaces in URL are trimmed on save', function () { - //click on edit pencil for websites section - cy.get('#websites-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - cy.get('#add-link').click() - cy.get('[formcontrolname="description"]') - .clear() - .type(testingData.sidebarWebsitesURL.titleURL) - cy.get('[formcontrolname="url"]') - .clear() - .type(testingData.sidebarWebsitesURL.duplicateURL + ' ') - - //app should let you save, no errors displayed - cy.get('#save-websites-button').click() - - //verify the entry was added - cy.get('#websites-panel') - .within(($section) => { - cy.get('[class="line"]') - }) - .should('contain', testingData.sidebarWebsitesURL.titleURL) - - //verify url was trimmed - cy.get('#websites-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - cy.get('[formcontrolname="url"]').should('not.contain', ' ') - cy.get('#cancel-websites-button').click() - }) - - afterEach(() => { - //clean up state - cy.cleanWebsites() - }) - - after(() => { - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/my-orcid/sidebar-change-visibility-primary-email.cy.js b/cypress/e2e/my-orcid/sidebar-change-visibility-primary-email.cy.js deleted file mode 100644 index 6a251b3fc2..0000000000 --- a/cypress/e2e/my-orcid/sidebar-change-visibility-primary-email.cy.js +++ /dev/null @@ -1,48 +0,0 @@ -/// - -import userData from '../../fixtures/testing-users.fixture.json' - -describe('My orcid - users are able to add content to their record', async function () { - before(() => { - cy.visit(Cypress.env('signInURL')) - //sign in - cy.signin(userData.cyUserPrimaryEmaiVerified) - cy.wait(1000) - }) - - it('User changes visibility to the primary email account', function () { - //click on edit pencil for Emails section - cy.get('#emails-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - - //set visibility to public - //TO DO: use id for public button instead of class - cy.get('#modal-container').within(($myModal) => { - cy.get('.cy-visibility-public').click() - }) - //save changes - cy.get('#save-emails-button').click() - //verify change - cy.get('app-panel-privacy').should('have.attr', 'aria-label', 'PUBLIC') - - //revert back to PRIVATE visibility - cy.get('#emails-panel').within(($myPanel1) => { - cy.get('.cy-edit-button').click() - }) - //TO DO: use id for private button instead of class - cy.get('#modal-container').within(($myModal1) => { - cy.get('.cy-visibility-private').click() - }) - //save changes - cy.get('#save-emails-button').click() - //verify change - cy.get('app-panel-privacy').should('have.attr', 'aria-label', 'PRIVATE') - - //sign out - cy.get('app-user-menu').click() - cy.get('#cdk-overlay-3').within(($menu) => { - cy.get('.mat-menu-item').contains('Logout').click() - }) - }) -}) diff --git a/cypress/e2e/my-orcid/verify-research-resources.cy.js b/cypress/e2e/my-orcid/verify-research-resources.cy.js deleted file mode 100644 index dd82091a24..0000000000 --- a/cypress/e2e/my-orcid/verify-research-resources.cy.js +++ /dev/null @@ -1,26 +0,0 @@ -/// -import userData from '../../fixtures/testing-users.fixture.json' - -describe('My orcid - users can have research resources data in their record', async function () { - before(() => { - cy.programmaticallySignin('cyResearchResourcesUser') //send user key from fixture file - cy.visit('/my-orcid') - cy.get('#cy-research-resources') //wait for page to load - }) - - it('Research resources section is displayed IF user has data for that section', function () { - //Verify the title of one of the entries for the research resources for the user - cy.get('#cy-research-resources').within(($myPanel) => { - cy.get('.cy-panel-component').should( - 'contain', - userData.cyResearchResourcesUser.researchResourceTitle - ) - }) - }) - - after(() => { - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/my-orcid/works-visibility-inconsistency-clientA-and-clientB.cy.js b/cypress/e2e/my-orcid/works-visibility-inconsistency-clientA-and-clientB.cy.js deleted file mode 100644 index 0a4a9c9713..0000000000 --- a/cypress/e2e/my-orcid/works-visibility-inconsistency-clientA-and-clientB.cy.js +++ /dev/null @@ -1,111 +0,0 @@ -/// - -import userData from '../../fixtures/testing-users.fixture.json' -const jsonfile = require('../../fixtures/work-visibility-different-clients.fixture.json') - -describe('My orcid - works - visibility inconsistency notification scenarios', async function () { - /* Scenario: - Precondition: record has visibility set to Private - Steps: - POST a work with client A which will take record Private visibility - Change record visibility setting to Public - POST same work with client B which will take record Public visibility - Inconsistency icon is displayed next to Visibility "buttons" - Select a visibility setting for the group of works - Inconsistency icon is not displayed anymore - */ - - before(() => { - //Set default visibility to PRIVATE(ONLY ME) - cy.programmaticallySignin('cyWorkVisibilityUser') //send user key from fixture file - cy.visit(`/my-orcid`) - cy.get('#cy-user-info').click() - cy.get('#cy-account-settings').wait(1000).click({ force: true }) - cy.get('#cy-visibility-panel-action-more').click() - cy.get('#cy-visibility-private-input').click() - //Log out to save changes - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) - - it('Work added different clients: Verify visibility inconsistency icon is displayed if visibility is different', function () { - //grab id from work json file - const externalId = - jsonfile['external-ids']['external-id']['external-id-value'] - - //add a new work with client A which will take PRIVATE default visibility - const endpoint = - Cypress.env('membersAPI_URL') + - userData.cyWorkVisibilityUser.oid + - Cypress.env('membersAPI_workEndpoint') - - const curlStatementA = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyWorkVisibilityUser.client1bearer + - "' -d '" + - userData.cyWorkVisibilityUser.curlPostWorkClientsPath + - "' -X POST '" + - endpoint + - "'" - cy.exec(curlStatementA).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 201 - expect(response.stdout).to.contain('HTTP/2 201') - }) - - //change visibility to Public - cy.programmaticallySignin('cyWorkVisibilityUser') //send user key from fixture file - cy.visit(`/my-orcid`) - cy.get('#cy-user-info').click() - cy.get('#cy-account-settings').wait(1000).click({ force: true }) - cy.get('#cy-visibility-panel-action-more').click() - cy.get('#cy-visibility-everyone-input').click() - //Log out to save changes - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - - //add a new work with client B which will take PUBLIC default visibility - const curlStatementB = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyWorkVisibilityUser.client2bearer + - "' -d '" + - userData.cyWorkVisibilityUser.curlPostWorkClientsPath + - "' -X POST '" + - endpoint + - "'" - cy.exec(curlStatementB).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 201 - expect(response.stdout).to.contain('HTTP/2 201') - }) - - //Sign in and got to my orcid page - cy.programmaticallySignin('cyWorkVisibilityUser') //send user key from fixture file - cy.visit(`/my-orcid`) - - //Verify work was added and grouped & inconsistency icon is displayed - cy.get('#cy-works', { timeout: 6000 }) //wait for page to load - cy.contains('app-work-stack', externalId).within(() => { - cy.contains('a', 'of 2') //REPLACE locator with id - //verify icon is displayed - cy.get('.cy-buttons-container').within(() => { - cy.get('.cy-inconsistency-issue').should('be.visible') - }) - //select group visibility & verify icon is not displayed - cy.get('mat-checkbox').click() - cy.get('.cy-visibility-limited').click() - cy.wait(3000) //wait for change to take effect - cy.get('.cy-buttons-container').within(() => { - cy.get('.cy-inconsistency-issue').should('not.exist') - }) - }) - }) - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/my-orcid/works-visibility-inconsistency-owner-and-clientA.cy.js b/cypress/e2e/my-orcid/works-visibility-inconsistency-owner-and-clientA.cy.js deleted file mode 100644 index 186b69da99..0000000000 --- a/cypress/e2e/my-orcid/works-visibility-inconsistency-owner-and-clientA.cy.js +++ /dev/null @@ -1,120 +0,0 @@ -/// - -import userData from '../../fixtures/testing-users.fixture.json' -const jsonfile = require('../../fixtures/work-visibility.fixture.json') - -describe('My orcid - works - visibility inconsistency notification scenario', async function () { - /* Scenario: - Precondition: record has visibility set to Public - Steps: - POST a work which will take default Public visibility - Add same work manually editing visibility to Private - Inconsistency icon is displayed next to Visibility "buttons" - Select a visibility setting for the group of works - Inconsistency icon is not displayed anymore - */ - - before(() => { - //Set default visibility for this record is set to Public - cy.programmaticallySignin('cyWorkVisibilityUser') //send user key from fixture file - cy.visit(`/my-orcid`) - cy.get('#cy-user-info').click() - cy.get('#cy-account-settings').wait(1000).click({ force: true }) - cy.get('#cy-visibility-panel-action-more').click() - cy.get('#cy-visibility-everyone-input').click() - //Log out to save changes - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) - - it('Work added by owner & client: Verify visibility inconsistency icon is displayed if visibility is different', function () { - //grab external id from json file - const externalId = - jsonfile['external-ids']['external-id']['external-id-value'] - - //add a new work with client A which will take PUBLIC default visibility for this record owner - const endpoint = - Cypress.env('membersAPI_URL') + - userData.cyWorkVisibilityUser.oid + - Cypress.env('membersAPI_workEndpoint') - - const curlStatement = - "curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " + - userData.cyWorkVisibilityUser.client1bearer + - "' -d '" + - userData.cyWorkVisibilityUser.curlPostWorkPath + - "' -X POST '" + - endpoint + - "'" - cy.exec(curlStatement).then((response) => { - //verify curl was executed successfully - expect(response.code).to.eq(0) - //verify http response status is successful: 201 - expect(response.stdout).to.contain('HTTP/2 201') - }) - - //Login - cy.programmaticallySignin('cyWorkVisibilityUser') //send user key from fixture file - cy.visit(`/my-orcid`) - cy.get('#cy-works').should('be.visible') //wait for page to load - - //verify work added by client is displayed - cy.get('#cy-works').should('contain', externalId) - - //add same work manually with PRIVATE visibility - cy.get('#cy-works').within(($myPanel) => { - cy.get('#cy-menu-add-works').click() - }) - cy.get('#cy-add-work-manually').click({ force: true }) - cy.get('#cy-work-types').click() - const strTypeJson = jsonfile['type'] - //valkues in UI start with capital letter - const strTypeOption = - strTypeJson.charAt(0).toUpperCase() + strTypeJson.slice(1) - cy.get('#cy-work-types-panel').within(($myOptions) => { - cy.contains(strTypeOption).click() - }) - cy.get('#title-input').clear().type(jsonfile['title']['title']['value']) - //add identifier - cy.get('#cy-add-an-work-external-id').click() - cy.get('[formcontrolname="externalIdentifierType"]').click() //to do REPLACE with id for the element next sprint - cy.get('[role="listbox"]').within(($list) => { - //to do REPLACE with id for the element next sprint - cy.contains( - jsonfile['external-ids']['external-id']['external-id-type'] - ).click() - }) - cy.get('[formcontrolname="externalIdentifierId"]') - .clear() - .type(jsonfile['external-ids']['external-id']['external-id-value']) - - //by default visibility is set to public, change it to Private - cy.get('#modal-container').within(($modal) => { - cy.get('.cy-visibility-private').click({ force: true }) - }) - //save entry - cy.get('#save-work-button').wait(4000).click({ force: true }) - - //Verify work was added and grouped & inconsistency icon is displayed - cy.wait(4000) //wait for page to load - timeout alternative didnt work - cy.contains('app-work-stack', externalId).within(() => { - cy.contains('a', 'of 2') //REPLACE locator with id - //verify icon is displayed - cy.get('.cy-buttons-container').within(() => { - cy.get('.cy-inconsistency-issue').should('be.visible') - }) - //select group visibility & verify icon is not displayed - cy.get('mat-checkbox').click() - cy.get('.cy-visibility-limited').click() - cy.get('.cy-buttons-container', { timeout: 6000 }).within(() => { - cy.get('.cy-inconsistency-issue').should('not.exist') - }) - }) - }) - - after(() => { - //log out - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/oauth/oauth-tc28.cy.js b/cypress/e2e/oauth/oauth-tc28.cy.js deleted file mode 100644 index 222a9c2bdd..0000000000 --- a/cypress/e2e/oauth/oauth-tc28.cy.js +++ /dev/null @@ -1,57 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* TC#28 -1 - visit authorization link -2 - navigate to https://qa.orcid.org/signin -3 - sign in with ORCID credentials -expected: user is taken to my-orcid page -4 - sign out -5 - sign in with ORCID credentials -expected: user is taken to my-orcid page -expected: OAuth session must not be revived at this stage -*/ - -describe('OAuth cypress tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC_Sessions - const scope = '/person/update' - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code&scope=' + - scope + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#28 OAuth session must end once user moves away from the session', function () { - cy.visit(authorizationLink) - cy.wait(2000) - //navigate directly to sign in page - cy.visit(Cypress.env('signInURL')) - cy.wait(2000) - cy.signin(recordOwner) - cy.wait(2000) - cy.url().then((urlString) => { - cy.url().should('include', 'my-orcid?orcid=') - }) - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - cy.wait(2000) //need to wait for the session to close - cy.signin(recordOwner) - cy.wait(2000) - //verify user taken to my orcid - cy.url().then((urlString) => { - cy.url().should('include', 'my-orcid?orcid=') - }) - }) - - after(() => { - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/oauth/oauth-tc29.cy.js b/cypress/e2e/oauth/oauth-tc29.cy.js deleted file mode 100644 index cd06fb8023..0000000000 --- a/cypress/e2e/oauth/oauth-tc29.cy.js +++ /dev/null @@ -1,55 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* TC#29 -1 - visit authorization link -2 - sign in with ORCID credentials -expected: user is taken to authorization screen -navigate to https://qa.orcid.org/my-orcid -3 - sign out -5 - sign in with ORCID credentials -expected: user is taken to my-orcid page -expected: OAuth session must not be revived at this stage -*/ - -describe('OAuth cypress tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC_Sessions - const scope = '/person/update' - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code&scope=' + - scope + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#29 OAuth session must end once user moves away from the session', function () { - cy.visit(authorizationLink) - cy.wait(2000) - cy.signin(recordOwner) - cy.url().then((urlString) => { - cy.url().should('contain', 'qa.orcid.org/oauth/authorize?') - }) - //navigate directly to sign in page - cy.visit('https://qa.orcid.org/my-orcid') - cy.wait(2000) - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - cy.wait(2000) //need to wait for the session to close - cy.signin(recordOwner) - cy.wait(2000) - cy.url().then((urlString) => { - cy.url().should('include', 'my-orcid?orcid=') - }) - }) - - after(() => { - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/oauth/oauth_tc1.cy.js b/cypress/e2e/oauth/oauth_tc1.cy.js deleted file mode 100644 index cace811505..0000000000 --- a/cypress/e2e/oauth/oauth_tc1.cy.js +++ /dev/null @@ -1,59 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* TC#1 -pre-condition: record without valid access token -1 - visit authorization link -2 - sign in with ORCID credentials -3 - click button to grant access -result: user is taken to redirect_uri appended with authorization code -4 - API client exchanges authorization code for access token -expected: 200 API response containing access token */ - -describe('OAuth cypress tests - TC#1', async function () { - const recordOwner = userData.cyOAuth_RecordOwner1 - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code&scope=/activities/update%20/person/update&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => { - cy.visit(authorizationLink) - }) - - it('TC#1 Client is able to exchange authorization code for access code', function () { - cy.get('#username').clear().type(recordOwner.oid) - cy.get('#password').clear().type(recordOwner.password) - cy.get('#signin-button').click() - cy.wait(2000) - - //grant access - cy.get('#authorize-button').click() - cy.wait(2000) - cy.url().should('include', userData.cyOAuth_MemberUser.redirect_uri) - - cy.url().then((urlString) => { - //grab appended code and exchange it for token - const codeToExchange = urlString.split('=')[1] - cy.log('codeToExchange: ' + codeToExchange) - - const curlGetAccessToken = - "curl -i -L -H 'Accept: application/json' --data 'client_id=" + - userData.cyOAuth_MemberUser.clientID + - '&client_secret=' + - userData.cyOAuth_MemberUser.clientSecret + - '&grant_type=authorization_code&code=' + - codeToExchange + - "' 'https://qa.orcid.org/oauth/token'" - - cy.log(curlGetAccessToken) - cy.exec(curlGetAccessToken).then((response) => { - expect(response.stdout).to.contain('HTTP/2 200') - }) - }) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc14.cy.js b/cypress/e2e/oauth/oauth_tc14.cy.js deleted file mode 100644 index e1335c69ad..0000000000 --- a/cypress/e2e/oauth/oauth_tc14.cy.js +++ /dev/null @@ -1,87 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#14 -pre-condition: record without valid access token -1 - visit authorization link -2 - click password reset link -3 - visit password reset link -4 - complete password reset form -5 - sign in with new password -expected: user is taken to authorization screen -6 - click button to grant access -result: user is taken to redirect_uri appended with authorization code - */ - -describe('OAuth cypress tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC14 - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code&scope=/activities/update%20/person/update&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - const newPassword = 'test1234' - - before(() => { - cy.visit(authorizationLink) - }) - - it('TC#14 reset password from auth link', function () { - cy.wait(2000) //intentional wait for page to fully load - cy.get('#forgot-password-button').click() - cy.get('[formcontrolname="email"]').clear().type(recordOwner.email) - cy.get('#cy-recover-acc-details').click() - cy.wait(2000) //intentional wait for page to fully load - - //use gmail api to check recovery email was sent - cy.task('checkInbox_from_to_subject', { - options: { - from: Cypress.env('senderResetPassword'), - to: recordOwner.email, - subject: Cypress.env('forgotPasswordSubject'), - include_body: true, - }, - }).then((email) => { - assert.isNotNull(email) - const emailBody = email.body.html - //convert string to DOM - const htmlDom = new DOMParser().parseFromString(emailBody, 'text/html') - cy.log(htmlDom.documentElement.innerHTML) - //find the link that starts pointing to the correct endpoint - const href = htmlDom.querySelector(`a[id*='cy-pwd-reset-url']`).href - //follow the link from the email - cy.visit(href) - }) - - //type new passw - cy.get('#cy-password-input').clear().type(newPassword) - //confirm new passw - cy.get('#cy-password-confirm-input').clear().type(newPassword) - //save - cy.get('#cy-save-password').click() - //verify user is redirected to Sign in page - cy.url().should('contain', Cypress.env('signInURL')) - - //Verify user can sign in with new passw - cy.get('#username').clear().type(recordOwner.oid) - cy.get('#password').clear().type(newPassword) - cy.get('#signin-button').click() - cy.wait(2000) - //verify user taken to authorization screen - cy.url().then((urlString) => { - cy.url().should('contain', 'qa.orcid.org/oauth/authorize?') - }) - //grant access - cy.get('#authorize-button').click() - cy.wait(2000) - //verify user is taken to redirect_uri with appended authorization code - cy.url().then((urlString) => { - cy.url().should('include', userData.cyOAuth_MemberUser.redirect_uri) - cy.url().should('include', '?code=') - }) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc16.cy.js b/cypress/e2e/oauth/oauth_tc16.cy.js deleted file mode 100644 index 970af10b70..0000000000 --- a/cypress/e2e/oauth/oauth_tc16.cy.js +++ /dev/null @@ -1,102 +0,0 @@ -// -import { type } from 'os' -import userData from '../../fixtures/oauth-users.fixture.json' - -/* TC#16 -pre-condition: deactivated account -1 - visit authorization link -2 - sign in with deactivated account -3 - click button to send reactivation link -4 - visit reactivation link -5 - complete form to reactivate account -expected: user is taken to authorization screen after completing reactivation process -6 - click button to grant access */ - -describe('OAuth deactivation test case', async function () { - const scope = '/person/update' - const recordOwner = userData.cyOAuth_RecordDeactivate - - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code' + - '&scope=' + - scope + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#16 deactivated record', function () { - cy.visit(authorizationLink) - cy.url({ timeout: 20000 }).should('include', Cypress.env('signInURL')) - cy.get('#username').clear().type(recordOwner.oid) - cy.get('#password').clear().type(recordOwner.password) - cy.get('#signin-button', { timeout: 20000 }).click() - cy.get('input[formcontrolname="email"]').clear().type(recordOwner.email) - cy.contains('button', 'SUBMIT').click() - - //use gmail api to check reactivatoin link was sent - cy.task('checkInbox_from_to_subject', { - options: { - from: Cypress.env('reactivationEmailSender'), - to: recordOwner.email, - subject: Cypress.env('reactivationEmailSubject'), - include_body: true, - }, - }).then((email) => { - assert.isNotNull(email) - const emailBody = email.body.html - //convert string to DOM - const htmlDom = new DOMParser().parseFromString(emailBody, 'text/html') - //find the link that points to the correct endpoint - const href = htmlDom.querySelector( - `a[href*="https://qa.orcid.org/reactivation/"]` - ).href - //follow the link from the email - cy.visit(href) - }) - - cy.url().should('include', Cypress.env('reactivationEmailLink')) - cy.get('#given-names-input').clear().type(recordOwner.name) - cy.get('#email-input').should('have.value', recordOwner.email) - //step to make sure backend validation on the form is complete - cy.get('app-step-a').within(($appForm) => { - cy.get('form').should('have.class', 'ng-untouched ng-dirty ng-valid') - }) - cy.get('#step-a-next-button').click({ force: true }) - cy.get('#password-input').clear().type(recordOwner.password) - cy.get('#password-confirm-input').clear().type(recordOwner.password) - //step to make sure backend validation on the form is complete - cy.get('app-step-b').within(($appForm) => { - cy.get('form').should('have.class', 'ng-untouched ng-dirty ng-valid') - }) - cy.get('#step-b-next').click({ force: true }) - - cy.get('#visibility-everyone-input-input').click({ force: true }) - cy.get('#privacy-input-input').check({ force: true }).should('be.checked') - cy.get('#data-processed-input-input') - .check({ force: true }) - .should('be.checked') - - //CAPTCHA - // Wrap iframe body into a cypress object and perform test within there - cy.getIframeBody('iframe[title="reCAPTCHA"]').within(() => { - cy.get('.recaptcha-checkbox-border').click() - cy.get('#recaptcha-anchor', { timeout: 10000 }).should( - 'have.class', - 'recaptcha-checkbox-checked' - ) - }) - //REACTIVATE button - cy.get('#step-c-register-button').click() - //user taken to auth screen, grant access - cy.get('#authorize-button', { timeout: 20000 }).click() - cy.url().should( - 'include', - userData.cyOAuth_MemberUser.redirect_uri + '/?code=' - ) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc18.cy.js b/cypress/e2e/oauth/oauth_tc18.cy.js deleted file mode 100644 index d6a34d40dc..0000000000 --- a/cypress/e2e/oauth/oauth_tc18.cy.js +++ /dev/null @@ -1,42 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* TC#18 -pre-condition: record with valid access token (same scopes) -pre-condition: authorization link only includes scopes already authorized -1 - visit authorization link -2 - sign in with ORCID credentials -result: user is taken to redirect_uri appended with authorization code -*/ - -describe('OAuth cypress tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC18 - const scope = '/person/update' //matches authorized scopes in fixture file - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code&scope=' + - scope + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => { - cy.visit(authorizationLink) - }) - - it('TC#18 Client signs in with authorized scopes', function () { - cy.get('#username').clear().type(recordOwner.oid) - cy.get('#password').clear().type(recordOwner.password) - cy.get('#signin-button').click() - cy.wait(3000) //need to wait for the redirect to take effect - - //verify user is taken to redirect_uri with appended authorization code - cy.url().then((urlString) => { - cy.url().should('include', userData.cyOAuth_MemberUser.redirect_uri) - cy.url().should('include', '?code=') - }) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc19.cy.js b/cypress/e2e/oauth/oauth_tc19.cy.js deleted file mode 100644 index 511ca64778..0000000000 --- a/cypress/e2e/oauth/oauth_tc19.cy.js +++ /dev/null @@ -1,51 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#19 -pre-condition: record with valid access token -pre-condition: authorization link includes scopes not yet authorized -1 - visit authorization link -2 - sign in with ORCID credentials -expected: user is taken to authorization link -4 - click button to grant access -result: user is taken to redirect_uri appended with authorization code -*/ - -describe('OAuth cypress tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC19 - const scope = '/read-limited%20/person/update' //does NOT match authorized scopes in fixture file - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code&scope=' + - scope + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => { - cy.visit(authorizationLink) - }) - - it('TC#19 Client signs in with not authorized scopes', function () { - cy.get('#username').clear().type(recordOwner.oid) - cy.get('#password').clear().type(recordOwner.password) - cy.get('#signin-button').click() - cy.wait(3000) //need to wait for the redirect to take effect - //user is taken to authorization link - cy.url().then((urlString) => { - cy.url().should('contain', 'qa.orcid.org/oauth/authorize?') - }) - //click button to grant access - cy.get('#authorize-button').click() - cy.wait(2000) - //verify user is taken to redirect_uri with appended authorization code - cy.url().then((urlString) => { - cy.url().should('include', userData.cyOAuth_MemberUser.redirect_uri) - cy.url().should('include', '?code=') - }) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc2.cy.js b/cypress/e2e/oauth/oauth_tc2.cy.js deleted file mode 100644 index 9d49892233..0000000000 --- a/cypress/e2e/oauth/oauth_tc2.cy.js +++ /dev/null @@ -1,87 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' -const randomUser = require('../../helpers/randomUser') - -/*TC#2 -1 - visit authorization link -2 - click button to register new account -3 - complete registration process -expected: user is taken to authorization screen after completing registration process -4 - click button to grant access -result: user is taken to redirect_uri appended with authorization code*/ - -describe('OAuth cypress tests', async function () { - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code&scope=/activities/update%20/person/update&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => { - cy.visit(authorizationLink) - }) - - it('TC#2 Authorizing client during registration', function () { - //Bypass the duplicated research call to avoid getting the "Is this you modal" - cy.intercept('GET', Cypress.env('duplicatedModalEndPoint'), []) - cy.get('#register-button').click() - - //generate a new (random) user - const userToRegister = randomUser() - //convert email to lower case as gmail uses it this way - userToRegister.email = userToRegister.email.toLowerCase() - - //verify user is redirected to the register page - cy.url().should('include', '/register') - - //STEP 1/3 populate form - cy.get('#given-names-input').clear().type(userToRegister.name) - cy.get('#family-names-input').clear().type(userToRegister.familyName) - cy.get('#email-input').clear().type(userToRegister.email) - cy.get('#confirm-email-input').clear().type(userToRegister.email) - cy.get('#step-a-next-button').click() - - //STEP 2/3 create OID - cy.get('.mat-card-title').contains('Create your ORCID iD') - cy.get('#password-input').clear().type(userToRegister.password) - cy.get('#password-confirm-input').clear().type(userToRegister.password) - cy.get('.ng-valid #step-b-next').click() - - //STEP 3/3 - cy.get('#visibility-everyone-input-input').click({ force: true }) - cy.get('#privacy-input-input').check({ force: true }).should('be.checked') - cy.get('#data-processed-input-input') - .check({ force: true }) - .should('be.checked') - - //CAPTCHA - // Wrap iframe body into a cypress object and perform test within there - cy.getIframeBody('iframe[title="reCAPTCHA"]').within(() => { - cy.get('.recaptcha-checkbox-border').click() - cy.get('#recaptcha-anchor', { timeout: 10000 }).should( - 'have.class', - 'recaptcha-checkbox-checked' - ) - }) - - cy.get('#step-c-register-button').click() - cy.wait(2000) //wait for page to load - //user taken to auth screen, grant access - cy.get('#authorize-button').click() - cy.wait(2000) //wait to be redirected to uri - cy.url().then((urlString) => { - cy.url().should('include', userData.cyOAuth_MemberUser.redirect_uri) - //verify url has appended authorization code - const codeToExchange = urlString.split('=')[1] - cy.log('codeToExchange: ' + codeToExchange) - expect(codeToExchange).to.not.be.undefined - }) - }) - - after(() => { - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/oauth/oauth_tc20.cy.js b/cypress/e2e/oauth/oauth_tc20.cy.js deleted file mode 100644 index edcf2b7328..0000000000 --- a/cypress/e2e/oauth/oauth_tc20.cy.js +++ /dev/null @@ -1,96 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#20 -pre-condition: record without valid access token -pre-condition: user is signed in -pre-condition: authorization link includes openid scope + prompt=login parameter -1 - visit authorization link -expected: user is prompted to sign in -2 - sign in with ORCID credentials -expected: user is taken to authorization screen -3 - click button to grant access -expected: user is taken to redirect_uri appended with authorization code -4 - API client exchanges authorization code for access token -expected: 200 API response containing access token -5 - visit authorization link again -expected: user is prompted to sign in -6 - sign in with ORCID credentials -expected: user is taken to redirect_uri appended with authorization code -*/ - -describe('OAuth cypress tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC20 - //scope includes openid + prompt=login parameter - const scope = - '/read-limited%20/activities/update%20/person/update%20openid&prompt=login' - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code&scope=' + - scope + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => { - //sign in - cy.visit(Cypress.env('signInURL')) - cy.signin(recordOwner) - cy.wait(2000) //need to wait for the redirect to take effect - }) - - it('TC#20 Authorization link with openid and prompt params', function () { - cy.visit(authorizationLink) - cy.wait(2000) //need to wait for the redirect to take effect - //verify user is prompted to sign in - cy.signin(recordOwner) - cy.wait(2000) //need to wait for the redirect to take effect - //verify user is taken to authorization link - cy.url().then((urlString) => { - cy.url().should('contain', 'qa.orcid.org/oauth/authorize?') - }) - //click button to grant access - cy.get('#authorize-button').click() - cy.wait(2000) - - //expected: user is taken to redirect_uri appended with authorization code - cy.url().then((urlString) => { - //grab appended code and exchange it for token - const codeToExchange = urlString.split('=')[1] - cy.log('codeToExchange: ' + codeToExchange) - - const curlGetAccessToken = - "curl -i -L -H 'Accept: application/json' --data 'client_id=" + - userData.cyOAuth_MemberUser.clientID + - '&client_secret=' + - userData.cyOAuth_MemberUser.clientSecret + - '&grant_type=authorization_code&code=' + - codeToExchange + - "' 'https://qa.orcid.org/oauth/token'" - - cy.exec(curlGetAccessToken).then((response) => { - expect(response.stdout).to.contain('HTTP/2 200') - }) - }) - - //visit authorization link again - cy.visit(authorizationLink) - cy.wait(2000) //need to wait for the redirect to take effect - //user is prompted to sign in with ORCID credentials - cy.signin(recordOwner) - cy.wait(2000) - //verify user is taken to redirect_uri appended with authorization code - cy.url().then((urlString) => { - cy.url().should('include', userData.cyOAuth_MemberUser.redirect_uri) - cy.url().should('include', '?code=') - }) - }) - - after(() => { - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/oauth/oauth_tc21.cy.js b/cypress/e2e/oauth/oauth_tc21.cy.js deleted file mode 100644 index 655b4c132f..0000000000 --- a/cypress/e2e/oauth/oauth_tc21.cy.js +++ /dev/null @@ -1,89 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#21 - replaced by Qase #63 and #65 -pre-condition: client ID with registered redirect URI "https://example.com" -pre-condition: user without valid access token -pre-condition: user is signed in -*/ - -describe('Redirect URI validation', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC21 - const scope = '/read-limited' - //NOTE: partial auth link to append different uris - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code&scope=' + - scope + - '&redirect_uri=' - - beforeEach(() => { - //sign in - cy.visit(Cypress.env('signInURL')) - cy.signin(recordOwner) - cy.wait(2000) //need to wait for the redirect to take effect - }) - - it('QASE#63_positive_1', function () { - //visit authorization link with redirect URI https://example.com - //expected: user taken to authorization screen - cy.visit(authorizationLink + 'https://example.com') - cy.wait(2000) //need to wait for the redirect to take effect - cy.url().should('contain', 'qa.orcid.org/oauth/authorize?') - cy.get('#authorize-button').should('be.visible') - }) - - it('QASE#63_positive_2', function () { - //visit authorization link with redirect URI https://example.com/subpath - //expected: user taken to authorization screen - cy.visit(authorizationLink + 'https://example.com/subpath') - cy.wait(2000) //need to wait for the redirect to take effect - cy.url().should('contain', 'qa.orcid.org/oauth/authorize?') - cy.get('#authorize-button').should('be.visible') - }) - - it('QASE#65_negative_1', function () { - //visit authorization link with redirect URI https://www.example.com - //expected: user taken to oauth error page - cy.visit(authorizationLink + 'https://www.example.com') - cy.wait(2000) //need to wait for the redirect to take effect - cy.contains( - `Redirect URI doesn't match your registered redirect URIs.` - ).should('be.visible') - }) - - it('QASE#65_negative_2', function () { - //visit authorization link with redirect URI https://subdomain1.example.com - //expected: user taken to oauth error page - cy.visit(authorizationLink + 'https://subdomain1.example.com') - cy.wait(2000) //need to wait for the redirect to take effect - cy.contains( - `Redirect URI doesn't match your registered redirect URIs.` - ).should('be.visible') - }) - - it('QASE#65_negative_3', function () { - //visit authorization link with redirect URI https://subdomain1.example.com/subpath - //expected: user taken to oauth error page - cy.visit(authorizationLink + 'https://subdomain1.example.com/subpath') - cy.wait(2000) //need to wait for the redirect to take effect - cy.contains( - `Redirect URI doesn't match your registered redirect URIs.` - ).should('be.visible') - }) - - it('QASE#65_negative_4', function () { - //visit authorization link with redirect URI https://www.example.com/subpath - //expected: user taken to oauth error page - cy.visit(authorizationLink + 'https://www.example.com/subpath') - cy.wait(2000) //need to wait for the redirect to take effect - cy.contains( - `Redirect URI doesn't match your registered redirect URIs.` - ).should('be.visible') - }) - - this.afterEach(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc22.cy.js b/cypress/e2e/oauth/oauth_tc22.cy.js deleted file mode 100644 index ef0ce737b4..0000000000 --- a/cypress/e2e/oauth/oauth_tc22.cy.js +++ /dev/null @@ -1,46 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/*TC#22 -pre-condition: client ID with registered redirect URI "https://example.com" -pre-condition: user without valid access token -1 - visit authorization link with redirect URI "https://example.com/subpath#page-section" -2 - sign in with ORCID credentials -expected: user taken to authorization screen -3 - click button to grant access -expected: user taken to redirect uri appended with authorization code, but anchor link "#page-section" is ignored and removed from the URI -*/ - -describe('OAuth cypress tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC22 - const scope = '/read-limited' - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code&scope=' + - scope + - '&redirect_uri=https://example.com/subpath#page-section' - - before(() => { - cy.visit(authorizationLink) - cy.wait(2000) //need to wait for the redirect to take effect - }) - - it('TC#22 Authorization link with anchor link', function () { - //sign in - cy.signin(recordOwner) - cy.wait(2000) //need to wait for the redirect to take effect - cy.url().then((urlString) => { - cy.url().should('contain', 'qa.orcid.org/oauth/authorize?') - }) - cy.get('#authorize-button').click() - cy.wait(2000) //wait to be redirected - cy.url().then((urlString) => { - cy.url().should('include', userData.cyOAuth_MemberUser.redirect_uri_tc22) - cy.url().should('not.include', '#page-section') - }) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc23.cy.js b/cypress/e2e/oauth/oauth_tc23.cy.js deleted file mode 100644 index 53c5812d88..0000000000 --- a/cypress/e2e/oauth/oauth_tc23.cy.js +++ /dev/null @@ -1,47 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/*TC#23 -pre-condition: client ID with registered redirect URI "https://example.com" -pre-condition: user without valid access token -1 - visit authorization link with redirect URI "https://example.com/subpath¶meter=true" -2 - sign in with ORCID credentials -expected: user taken to authorization screen -3 - click button to grant access -expected: user taken to redirect uri appended with authorization code, -but "¶meter=true" is ignored and removed from the URI -*/ - -describe('OAuth cypress tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC23 - const scope = '/read-limited' - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code&scope=' + - scope + - '&redirect_uri=https://example.com/subpath¶meter=true' - - before(() => { - cy.visit(authorizationLink) - cy.wait(2000) //need to wait for the redirect to take effect - }) - - it('TC#23 Authorization link with parameter', function () { - //sign in - cy.signin(recordOwner) - cy.wait(2000) //need to wait for the redirect to take effect - cy.url().then((urlString) => { - cy.url().should('contain', 'qa.orcid.org/oauth/authorize?') - }) - cy.get('#authorize-button').click() - cy.wait(2000) //wait to be redirected - cy.url().then((urlString) => { - cy.url().should('include', userData.cyOAuth_MemberUser.redirect_uri_tc22) - cy.url().should('not.include', '¶meter=true') - }) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc24.cy.js b/cypress/e2e/oauth/oauth_tc24.cy.js deleted file mode 100644 index cde421ee7b..0000000000 --- a/cypress/e2e/oauth/oauth_tc24.cy.js +++ /dev/null @@ -1,44 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/*TC#24 -pre-condition: user without valid access token -1 - visit authorization link -2 - sign in with ORCID credentials -3 - click button in authorization screen to sign out -4 - sign into another account using ORCID credentials -expected: user is taken to authorization screen -*/ - -describe('OAuth cypress tests', async function () { - const scope = '/read-limited' - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code&scope=/activities/update%20/person/update&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#24 sign out from authorization screen and sign in with different account', function () { - cy.visit(authorizationLink) - cy.wait(2000) //need to wait for the redirect to complete - //sign in - cy.signin(userData.cyOAuth_RecordOwnerTC21) - cy.wait(2000) //need to wait for the redirect to complete - cy.url().then((urlString) => { - cy.url().should('contain', 'qa.orcid.org/oauth/authorize?') - }) - cy.get('[role=button]').contains('Sign out').click() - cy.wait(2000) //wait to be redirected - //sign in with different account - cy.signin(userData.cyOAuth_RecordOwnerTC31) - cy.wait(2000) //need to wait for the redirect to complete - cy.url().then((urlString) => { - cy.url().should('contain', 'qa.orcid.org/oauth/authorize?') - }) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc26.cy.js b/cypress/e2e/oauth/oauth_tc26.cy.js deleted file mode 100644 index 6a56c57c80..0000000000 --- a/cypress/e2e/oauth/oauth_tc26.cy.js +++ /dev/null @@ -1,61 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* TC#26 -1 - visit authorization link -2 - sign in with ORCID credentials -expected: user is taken to authorization screen -3 - click button to grant access -expected: user is taken to redirect URI appended with authorization code -4 - navigate to https://qa.orcid.org/signout -expected: user is taken to signin page -5 - sign in with ORCID credentials -expected: user is taken to my orcid page -expected: OAuth session must not be revived at this stage -*/ - -describe('OAuth cypress tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC_Sessions - const scope = '/person/update' - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code&scope=' + - scope + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#26 OAuth session must end once user grants access, denies access, or moves away from the session', function () { - cy.visit(authorizationLink) - cy.signin(recordOwner) - cy.wait(2000) //need to wait for the redirect to complete - cy.url().then((urlString) => { - cy.url().should('contain', 'qa.orcid.org/oauth/authorize?') - }) - cy.get('#authorize-button').click() - cy.wait(2000) //wait to be redirected - //verify user is taken to redirect_uri with appended authorization code - cy.url().then((urlString) => { - cy.url().should('include', userData.cyOAuth_MemberUser.redirect_uri) - cy.url().should('include', '?code=') - }) - cy.visit('https://qa.orcid.org/signout') - //verify user is redirected to Sign in page - cy.url().should('contain', Cypress.env('signInURL')) - cy.signin(recordOwner) - cy.wait(2000) //need to wait for the redirect to complete - //verify user taken to my orcid - cy.url().then((urlString) => { - cy.url().should('include', 'my-orcid?orcid=') - }) - }) - - after(() => { - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/oauth/oauth_tc27.cy.js b/cypress/e2e/oauth/oauth_tc27.cy.js deleted file mode 100644 index 08696c9dee..0000000000 --- a/cypress/e2e/oauth/oauth_tc27.cy.js +++ /dev/null @@ -1,63 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* TC#27 -1 - visit authorization link -2 - sign in with ORCID credentials -expected: user is taken to authorization screen -3 - click button to deny access -expected: user is taken to redirect URI appended with "?error=access_denied&error_description=User%20denied%20access" -4 - navigate to https://qa.orcid.org/signout -expected: user is taken to signin page -5 - sign in with ORCID credentials -expected: user is taken to my orcid page -expected: OAuth session must not be revived at this stage -*/ - -describe('OAuth cypress tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC_Sessions - const scope = '/person/update' - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code&scope=' + - scope + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#27 OAuth session must end once user denies access', function () { - cy.visit(authorizationLink) - cy.signin(recordOwner) - cy.wait(2000) //need to wait for the redirect to complete - cy.url().then((urlString) => { - cy.url().should('contain', 'qa.orcid.org/oauth/authorize?') - }) - cy.get('#deny-button').click() - cy.wait(2000) //wait to be redirected - //verify user is taken to redirect_uri with appended authorization code - cy.url().then((urlString) => { - cy.url().should( - 'include', - '?error=access_denied&error_description=User%20denied%20access' - ) - }) - cy.visit('https://qa.orcid.org/signout') - //verify user is redirected to Sign in page - cy.url().should('contain', Cypress.env('signInURL')) - cy.signin(recordOwner) - cy.wait(2000) //need to wait for the redirect to complete - //verify user taken to my orcid - cy.url().then((urlString) => { - cy.url().should('include', 'my-orcid?orcid=') - }) - }) - - after(() => { - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/oauth/oauth_tc3.cy.js b/cypress/e2e/oauth/oauth_tc3.cy.js deleted file mode 100644 index 84c06e3e03..0000000000 --- a/cypress/e2e/oauth/oauth_tc3.cy.js +++ /dev/null @@ -1,50 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#3 -1 - visit authorization link -2 - navigate to signin page in the browser -3 - sign in with ORCID credentials -result: user is taken to my-orcid and not to authorization screen - */ - -describe('OAuth cypress tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwner1 - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code&scope=/activities/update%20/person/update&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => { - cy.visit(authorizationLink) - }) - - it('TC#3 Navigating to sign in instead of signing in from auth link', function () { - cy.url().then((urlString) => { - cy.url().should('eq', authorizationLink) - }) - - //navigate directly to sign in page - cy.visit(Cypress.env('signInURL')) - cy.wait(2000) - - cy.get('#username').clear().type(recordOwner.oid) - cy.get('#password').clear().type(recordOwner.password) - cy.get('#signin-button').click() - cy.wait(2000) - - //verify user taken to my orcid instead of authorization screen - cy.url().then((urlString) => { - cy.url().should('include', 'my-orcid?orcid=') - }) - }) - - after(() => { - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/oauth/oauth_tc30.cy.js b/cypress/e2e/oauth/oauth_tc30.cy.js deleted file mode 100644 index 2e1ecdc0c2..0000000000 --- a/cypress/e2e/oauth/oauth_tc30.cy.js +++ /dev/null @@ -1,86 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#30 replaced by Qase #64 and #66 -pre-condition: client id with registered redirect URI -containing trailing whitespace e.g. ``https://example.com `` -*/ - -describe('Registered redirect uri contains trailing whitespaces', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC30 - const scope = '/read-limited' - //NOTE: partial auth link to append different uris - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberTC30.clientID + - '&response_type=code&scope=' + - scope + - '&redirect_uri=' - - beforeEach(() => { - //sign in - cy.visit(Cypress.env('signInURL')) - cy.signin(recordOwner) - cy.wait(2000) //need to wait for the redirect to take effect - }) - - it('QASE#64_positive_1', function () { - //visit authorization link with redirect URI https://example.com/subpath - //expected: user taken to authorization screen - cy.visit(authorizationLink + 'https://example.com/subpath') - cy.wait(2000) //need to wait for the redirect to take effect - cy.url().should('contain', 'qa.orcid.org/oauth/authorize?') - cy.get('#authorize-button').should('be.visible') - }) - - it('QASE#64_positive_2', function () { - //visit authorization link with redirect URI https://example.com - //expected: user taken to authorization screen - cy.visit(authorizationLink + 'https://example.com') - cy.wait(2000) //need to wait for the redirect to take effect - cy.url().should('contain', 'qa.orcid.org/oauth/authorize?') - cy.get('#authorize-button').should('be.visible') - }) - - it('QASE#66_negative_1', function () { - //visit authorization link with redirect URI https://subdomain1.example.com - //expected: user taken to oauth error page - cy.visit(authorizationLink + 'https://subdomain1.example.com') - cy.wait(2000) //need to wait for the redirect to take effect - cy.contains( - `Redirect URI doesn't match your registered redirect URIs.` - ).should('be.visible') - }) - - it('QASE#66_negative_2', function () { - //visit authorization link with redirect URI https://subdomain1.example.com/subpath - //expected: user taken to oauth error page - cy.visit(authorizationLink + 'https://subdomain1.example.com/subpath') - cy.wait(2000) //need to wait for the redirect to take effect - cy.contains( - `Redirect URI doesn't match your registered redirect URIs.` - ).should('be.visible') - }) - it('QASE#66_negative_3', function () { - //visit authorization link with redirect URI https://www.example.com - //expected: user taken to oauth error page - cy.visit(authorizationLink + 'https://www.example.com') - cy.wait(2000) //need to wait for the redirect to take effect - cy.contains( - `Redirect URI doesn't match your registered redirect URIs.` - ).should('be.visible') - }) - it('QASE#66_negative_4', function () { - //visit authorization link with redirect URI - //expected: user taken to oauth error page https://www.example.com/subpath - cy.visit(authorizationLink + 'https://www.example.com/subpath') - cy.wait(2000) //need to wait for the redirect to take effect - cy.contains( - `Redirect URI doesn't match your registered redirect URIs.` - ).should('be.visible') - }) - - this.afterEach(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc31.cy.js b/cypress/e2e/oauth/oauth_tc31.cy.js deleted file mode 100644 index c6a3de5029..0000000000 --- a/cypress/e2e/oauth/oauth_tc31.cy.js +++ /dev/null @@ -1,37 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/*TC#31 -1 - visit authorization link with redirect URI "https://not-my-redirect-uri.com" -2 - sign in with ORCID credentials -expected: user is taken to OAuth error page "invalid_grant / Redirect URI doesn't match your registered redirect URIs" -*/ - -describe('OAuth cypress tests', async function () { - const errorMessage_unregistered_uri = - 'does not match the redirect URIs registered by' - - const recordOwner = userData.cyOAuth_RecordOwnerTC31 - const scope = '/read-limited' - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code&scope=' + - scope + - '&redirect_uri=https://not-my-redirect-uri.com' - - before(() => { - cy.visit(authorizationLink) - cy.wait(2000) //need to wait for the redirect to take effect - }) - - it('TC#31 Unregistered authorization link', function () { - //sign in - cy.signin(recordOwner) - cy.wait(2000) //need to wait for the redirect to take effect - cy.get('#error-message').contains(errorMessage_unregistered_uri) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc32.cy.js b/cypress/e2e/oauth/oauth_tc32.cy.js deleted file mode 100644 index 227824e7f0..0000000000 --- a/cypress/e2e/oauth/oauth_tc32.cy.js +++ /dev/null @@ -1,44 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#32 - deny access -1 - visit authorization link -2 - sign in with ORCID credentials -expected: user is taken to authorization screen -3 - click button to deny access -expected: user is taken to redirect URI appended with "?error=access_denied&error_description=User%20denied%20access" -*/ - -describe('OAuth cypress tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC_Sessions - const scope = '/person/update' - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code&scope=' + - scope + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#32 OAuth session must end once user denies permission', function () { - cy.visit(authorizationLink) - cy.wait(2000) - cy.signin(recordOwner) - cy.url().then((urlString) => { - cy.url().should('contain', 'qa.orcid.org/oauth/authorize?') - }) - cy.get('#deny-button').click() - cy.url().then((urlString) => { - cy.url().should( - 'include', - '?error=access_denied&error_description=User%20denied%20access' - ) - }) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc33.cy.js b/cypress/e2e/oauth/oauth_tc33.cy.js deleted file mode 100644 index d0a321acb8..0000000000 --- a/cypress/e2e/oauth/oauth_tc33.cy.js +++ /dev/null @@ -1,33 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#33 invalid client ID -pre-condition: authorization link contains invalid client ID e.g. "APP-0W6BNW12C2OOLJ3E-invalid" -1 - visit authorization link -expected: user is taken to OAuth error page " is invalid" -*/ - -describe('OAuth cypress tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC_Sessions - const scope = '/person/update' - const invalid_client_id = 'APP-0W6BNW12C2OOLJ3E-invalid' - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - invalid_client_id + - '&response_type=code&scope=' + - scope + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#32 authorization link with invalid client id results in error message', function () { - cy.visit(authorizationLink) - cy.wait(2000) - cy.get('#error-message').contains(invalid_client_id + ' is invalid') - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc34.cy.js b/cypress/e2e/oauth/oauth_tc34.cy.js deleted file mode 100644 index 5f55c354ed..0000000000 --- a/cypress/e2e/oauth/oauth_tc34.cy.js +++ /dev/null @@ -1,44 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#34 - missing client_id parameter -pre-condition: authorization link doesn't contain client_id parameter -1 - visit authorization link -expected: user is taken to OAuth error page "oauth_error / Please specify a client id" -*/ - -describe('OAuth cypress tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC_Sessions - const scope = '/person/update' - const authorizationLinkNoClient = - 'https://qa.orcid.org/oauth/authorize?' + - '&response_type=code&scope=' + - scope + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - const authorizationLinkEmptyClient = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - '&response_type=code&scope=' + - scope + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - before(() => {}) - - it('TC#34 empty client id in authorization link results in error message', function () { - cy.visit(authorizationLinkEmptyClient) - cy.wait(2000) - cy.get('.oauth-error').contains('The provided client id is invalid') - }) - - it('TC#34 missing client id in authorization link results in error message', function () { - cy.visit(authorizationLinkNoClient) - cy.wait(2000) - cy.get('.oauth-error').contains( - 'Incorrect OAuth Link, missing client id parameter' - ) - }) - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc35.cy.js b/cypress/e2e/oauth/oauth_tc35.cy.js deleted file mode 100644 index f3f92ebb58..0000000000 --- a/cypress/e2e/oauth/oauth_tc35.cy.js +++ /dev/null @@ -1,35 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#35 - invalid scope -pre-condition: authorization link contains invalid scope e.g. "scope=invalid_scope" -1 - visit authorization link -expected: user is taken to redirect URI appended with "#error=invalid_scope" -*/ - -describe('OAuth cypress tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC_Sessions - const scope = 'invalid_scope' - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code' + - '&scope=' + - scope + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#35 invalid scope in authorization takes user to redirect uri with error appended', function () { - cy.visit(authorizationLink) - cy.wait(2000) - cy.signin(recordOwner) - cy.url().then((urlString) => { - cy.url().should('include', '#error=invalid_scope') - }) - }) - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc36.cy.js b/cypress/e2e/oauth/oauth_tc36.cy.js deleted file mode 100644 index 1b26c9b583..0000000000 --- a/cypress/e2e/oauth/oauth_tc36.cy.js +++ /dev/null @@ -1,30 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#36 - missing scope parameter -pre-condition: authorization link doesn't contain scope parameter -1 - visit authorization link -expected: user is taken to OAuth error page "oauth_error / Please specify the desired scopes" -*/ - -describe('OAuth cypress tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC_Sessions - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code' + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#36 missing scope in authorization takes user to oauth error page', function () { - cy.visit(authorizationLink) - cy.wait(2000) - cy.get('.oauth-error').contains('Please specify the desired scopes') - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc37.cy.js b/cypress/e2e/oauth/oauth_tc37.cy.js deleted file mode 100644 index c75c5f3bb6..0000000000 --- a/cypress/e2e/oauth/oauth_tc37.cy.js +++ /dev/null @@ -1,31 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#37 - missing redirect_uri parameter -pre-condition: authorization link doesn't contain redirect_uri parameter -1 - visit authorization link -expected: user is taken to redirect URI appended with "oauth_error / Please specify a redirect URL" -*/ - -describe('OAuth cypress tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC_Sessions - const scope = '/person/update' - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code' + - '&scope=' + - scope - - before(() => {}) - - it('TC#37 missing redirect_uri in authorization takes user to oauth error page', function () { - cy.visit(authorizationLink) - cy.wait(2000) - cy.get('.oauth-error').contains('Please specify a redirect URL') - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc38.cy.js b/cypress/e2e/oauth/oauth_tc38.cy.js deleted file mode 100644 index 3f32523537..0000000000 --- a/cypress/e2e/oauth/oauth_tc38.cy.js +++ /dev/null @@ -1,36 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/*TC#38 - invalid response_type -pre-condition: authorization link contains invalid response_type e.g. "response_type=invalid_response" -1 - visit authorization link -expected: user is taken to redirect URI appended with "#error=unsupported_response_type" - -*/ - -describe('OAuth cypress tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC_Sessions - const scope = '/person/update' - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=invalid_response' + - '&scope=' + - scope + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#38 invalid response type in authorization takes user to redirect uri with error appended', function () { - cy.visit(authorizationLink) - cy.wait(2000) - cy.signin(recordOwner) - cy.url().then((urlString) => { - cy.url().should('include', '#error=unsupported_response_type') - }) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc39.cy.js b/cypress/e2e/oauth/oauth_tc39.cy.js deleted file mode 100644 index 0a29355c3d..0000000000 --- a/cypress/e2e/oauth/oauth_tc39.cy.js +++ /dev/null @@ -1,31 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/*TC#39 - missing response_type parameter -pre-condition: authorization link doesn't contain response_type parameter -1 - visit authorization link -expected: user is taken to oauth error page "oauth_error / Please specify a response type" -*/ - -describe('OAuth cypress tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC_Sessions - const scope = '/person/update' - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&scope=' + - scope + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#39 missing response type in authorization takes user to oauth error page', function () { - cy.visit(authorizationLink) - cy.wait(2000) - cy.get('.oauth-error').contains('Please specify a response type') - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc4.cy.js b/cypress/e2e/oauth/oauth_tc4.cy.js deleted file mode 100644 index 22b32e3cba..0000000000 --- a/cypress/e2e/oauth/oauth_tc4.cy.js +++ /dev/null @@ -1,79 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' -const randomUser = require('../../helpers/randomUser') - -/* -TC#4 -1 - visit authorization link -2 - navigate to register page in the browser -3 - complete registration process -result: user is taken to my-orcid and not to authorization screen -*/ - -describe('OAuth cypress tests', async function () { - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code&scope=/activities/update%20/person/update&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => { - cy.visit(authorizationLink) - }) - - it('TC#4 Navigating to registration instead of registering from auth link', function () { - //navigate directly to registration page - cy.visit(Cypress.env('registrationPage')) - - //Bypass the duplicated research call to avoid getting the "Is this you modal" - cy.intercept('GET', Cypress.env('duplicatedModalEndPoint'), []) - - //verify user is redirected to the register page - cy.url().should('include', '/register') - - //generate a new (random) user - const userToRegister = randomUser() - //convert email to lower case as gmail uses it this way - userToRegister.email = userToRegister.email.toLowerCase() - - //STEP 1/3 populate form - cy.get('#given-names-input').clear().type(userToRegister.name) - cy.get('#family-names-input').clear().type(userToRegister.familyName) - cy.get('#email-input').clear().type(userToRegister.email) - cy.get('#confirm-email-input').clear().type(userToRegister.email) - cy.get('#step-a-next-button').click() - - //STEP 2/3 create OID - cy.get('.mat-card-title').contains('Create your ORCID iD') - cy.get('#password-input').clear().type(userToRegister.password) - cy.get('#password-confirm-input').clear().type(userToRegister.password) - cy.get('.ng-valid #step-b-next').click() - - //STEP 3/3 - cy.get('#visibility-everyone-input-input').click({ force: true }) - cy.get('#privacy-input-input').check({ force: true }).should('be.checked') - cy.get('#data-processed-input-input') - .check({ force: true }) - .should('be.checked') - - //CAPTCHA - // Wrap iframe body into a cypress object and perform test within there - cy.getIframeBody('iframe[title="reCAPTCHA"]').within(() => { - cy.get('.recaptcha-checkbox-border').click() - cy.get('#recaptcha-anchor', { timeout: 10000 }).should( - 'have.class', - 'recaptcha-checkbox-checked' - ) - }) - - cy.get('#step-c-register-button').click() - cy.wait(2000) //wait for page to load - //verify user taken to my orcid instead of authorization screen - cy.url().then((urlString) => { - cy.url().should('include', 'my-orcid?orcid=') - }) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc40.cy.js b/cypress/e2e/oauth/oauth_tc40.cy.js deleted file mode 100644 index 886529dc15..0000000000 --- a/cypress/e2e/oauth/oauth_tc40.cy.js +++ /dev/null @@ -1,46 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#40 - authorization link customization -pre-condition: authorization link contains name parameters "given_names=Jane" and "family_names=Doe" -1 - visit authorization link -2 - click button to register new account -expected: first name and last name fields should be populated with info from the name parameters in the authorization link -*/ -describe('OAuth link customization tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC_Sessions - const scope = '/person/update' - const testGivenName = 'Jane' - const testFamilyName = 'Doe' - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code' + - '&scope=' + - scope + - '&given_names=' + - testGivenName + - '&family_names=' + - testFamilyName + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#40 authorization link contains name parameters', function () { - cy.visit(authorizationLink) - cy.wait(2000) - cy.get('#register-button').click() - cy.wait(2000) - cy.get('#given-names-input').should(($given) => { - expect($given).to.have.value(testGivenName) - }) - cy.get('#family-names-input').should(($fam) => { - expect($fam).to.have.value(testFamilyName) - }) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc41.cy.js b/cypress/e2e/oauth/oauth_tc41.cy.js deleted file mode 100644 index a7d08c3021..0000000000 --- a/cypress/e2e/oauth/oauth_tc41.cy.js +++ /dev/null @@ -1,35 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#41 - authorization link customization -pre-condition: authorization link contains parameter "show_login=false" -1 - visit authorization link -expected: user is taken to registration screen as part of OAuth session -*/ -describe('OAuth link customization tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC_Sessions - const scope = '/person/update' - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code' + - '&scope=' + - scope + - '&show_login=false' + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#41 authorization link contains parameter "show_login=false"', function () { - cy.visit(authorizationLink) - cy.wait(2000) - cy.url() - .should('include', 'register') - .and('include', userData.cyOAuth_MemberUser.clientID) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc42.cy.js b/cypress/e2e/oauth/oauth_tc42.cy.js deleted file mode 100644 index 0f44a8fb62..0000000000 --- a/cypress/e2e/oauth/oauth_tc42.cy.js +++ /dev/null @@ -1,37 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#42 - authorization link customization -pre-condition: authorization link contains parameter "show_login=true" -1 - visit authorization link -expected: user is taken to signin screen as part of OAuth session - */ - -describe('OAuth link customization tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC_Sessions - const scope = '/person/update' - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code' + - '&scope=' + - scope + - '&show_login=true' + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#42 authorization link contains parameter "show_login=true"', function () { - cy.visit(authorizationLink) - cy.wait(2000) - //verify user is redirected to Sign in page - cy.url() - .should('contain', Cypress.env('signInURL')) - .and('include', userData.cyOAuth_MemberUser.clientID) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc43.cy.js b/cypress/e2e/oauth/oauth_tc43.cy.js deleted file mode 100644 index 325d7cefec..0000000000 --- a/cypress/e2e/oauth/oauth_tc43.cy.js +++ /dev/null @@ -1,42 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#43 - authorization link customization -pre-condition: authorization link contains parameter "state=my-test-state" -1 - visit authorization link -2 - sign in with ORCID credentials -3 - click button to grant access -expected: user is taken to redirect_uri appended with authorization code as well as state parameter defined in authorization link - */ - -describe('OAuth link customization tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC_Sessions - const scope = '/person/update' - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code' + - '&scope=' + - scope + - '&state=my-test-state' + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#43 authorization link contains parameter "state=my-test-state"', function () { - cy.visit(authorizationLink) - cy.wait(2000) - cy.signin(recordOwner) - cy.wait(2000) - cy.get('#authorize-button').click() - cy.url() - .should('include', userData.cyOAuth_MemberUser.redirect_uri) - .and('include', '?code=') - .and('include', 'state=my-test-state') - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc44.cy.js b/cypress/e2e/oauth/oauth_tc44.cy.js deleted file mode 100644 index 26ef0bf4cb..0000000000 --- a/cypress/e2e/oauth/oauth_tc44.cy.js +++ /dev/null @@ -1,36 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#44 - authorization link customization -pre-condition: authorization link contains parameter "lang=" -1 - visit authorization link -expected: user is taken to signin screen as part of OAuth session in the language defined in the lang parameter - */ - -describe('OAuth link customization tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC_Sessions - const scope = '/person/update' - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code' + - '&scope=' + - scope + - '&lang=ES' + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#44 authorization link contains language parameter', function () { - cy.visit(authorizationLink) - cy.wait(2000) - cy.url().should('include', Cypress.env('signInURL')) - //testing page is displayed in language selected - cy.get('#signin-button').should('have.text', 'INICIAR SESIÓN') - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc45.cy.js b/cypress/e2e/oauth/oauth_tc45.cy.js deleted file mode 100644 index c4a521dcc0..0000000000 --- a/cypress/e2e/oauth/oauth_tc45.cy.js +++ /dev/null @@ -1,37 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#45 - authorization link customization -pre-condition: authorization link contains parameter "email=email-in-database" -1 - visit authorization link -expected: user is taken to signin screen as part of OAuth session and username field is populated with address from email parameter - */ - -describe('OAuth link customization tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC_Sessions - const scope = '/person/update' - const emailParamValue = userData.cyOAuth_RecordOwnerTC_Sessions.email - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code' + - '&scope=' + - scope + - '&email=' + - emailParamValue + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#45 authorization link contains email parameter', function () { - cy.visit(authorizationLink) - cy.wait(2000) - cy.url().should('include', Cypress.env('signInURL')) - cy.get('#username').should('have.value', emailParamValue) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc46.cy.js b/cypress/e2e/oauth/oauth_tc46.cy.js deleted file mode 100644 index 75e42e9a07..0000000000 --- a/cypress/e2e/oauth/oauth_tc46.cy.js +++ /dev/null @@ -1,37 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#46 - authorization link customization -pre-condition: authorization link contains parameter "email=email-not-in-database" -1 - visit authorization link -expected: user is taken to registration screen as part of OAuth session and primary email address field is populated with address from email parameter - */ - -describe('OAuth link customization tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC_Sessions - const scope = '/person/update' - const emailParamValue = 'user@email-not-in-database.org' - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code' + - '&scope=' + - scope + - '&email=' + - emailParamValue + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#46 authorization link contains email parameter', function () { - cy.visit(authorizationLink) - cy.wait(2000) - cy.url().should('include', Cypress.env('registrationPage')) - cy.get('#email-input').should('have.value', emailParamValue) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc47.cy.js b/cypress/e2e/oauth/oauth_tc47.cy.js deleted file mode 100644 index af4881d458..0000000000 --- a/cypress/e2e/oauth/oauth_tc47.cy.js +++ /dev/null @@ -1,38 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#47 - authorization link customization -pre-condition: authorization link contains parameters "email=email-in-database" + "show_login=false" -1 - visit authorization link -expected: email parameter takes precedence over show_login parameter, therefore user is taken to signin screen as part of OAuth session - */ - -describe('OAuth link customization tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC_Sessions - const scope = '/person/update' - const emailParamValue = userData.cyOAuth_RecordOwnerTC_Sessions.email - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code' + - '&scope=' + - scope + - '&email=' + - emailParamValue + - '&show_login=false' + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#47 authorization link contains email parameter + show_login=false', function () { - cy.visit(authorizationLink) - cy.wait(2000) - cy.url().should('include', Cypress.env('signInURL')) - cy.get('#username').should('have.value', emailParamValue) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc48.cy.js b/cypress/e2e/oauth/oauth_tc48.cy.js deleted file mode 100644 index 80dc216fcb..0000000000 --- a/cypress/e2e/oauth/oauth_tc48.cy.js +++ /dev/null @@ -1,38 +0,0 @@ -/// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#48 - authorization link customization -pre-condition: authorization link contains parameters "email=email-not-in-database" + "show_login=true" -1 - visit authorization link -expected: email parameter takes precedence over show_login parameter, therefore user is taken to registration screen as part of OAuth session -*/ - -describe('OAuth link customization tests', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC_Sessions - const scope = '/person/update' - const emailParamValue = 'user@email-not-in-database.org' - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code' + - '&scope=' + - scope + - '&email=' + - emailParamValue + - '&show_login=true' + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#48 authorization link contains email and show_login=true parameters', function () { - cy.visit(authorizationLink) - cy.wait(2000) - cy.url().should('include', Cypress.env('registrationPage')) - cy.get('#email-input').should('have.value', emailParamValue) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc49.cy.js b/cypress/e2e/oauth/oauth_tc49.cy.js deleted file mode 100644 index 0b03d4afca..0000000000 --- a/cypress/e2e/oauth/oauth_tc49.cy.js +++ /dev/null @@ -1,42 +0,0 @@ -// - -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#49 - authorization link customization -pre-condition: authorization link contains parameters "email=email-not-in-database" + "given_names=Jane" + "family_names=Doe" -1 - visit authorization link -expected: user is taken to registration screen as part of OAuth -expected: registration screen is populated with email address, given name, and family name -*/ - -describe('OAuth link customization tests', async function () { - const scope = '/person/update' - const emailParamValue = 'user@email-not-in-database.org' - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code' + - '&scope=' + - scope + - '&email=' + - emailParamValue + - '&given_names=Jane' + - '&family_names=Doe' + - '&show_login=true' + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#49 authorization link contains email given and family names parameters', function () { - cy.visit(authorizationLink) - cy.wait(2000) - cy.url().should('include', Cypress.env('registrationPage')) - cy.get('#email-input').should('have.value', emailParamValue) - cy.get('#given-names-input').should('have.value', 'Jane') - cy.get('#family-names-input').should('have.value', 'Doe') - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc50.cy.js b/cypress/e2e/oauth/oauth_tc50.cy.js deleted file mode 100644 index b45d0f550a..0000000000 --- a/cypress/e2e/oauth/oauth_tc50.cy.js +++ /dev/null @@ -1,36 +0,0 @@ -// -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#50 - authorization link customization -pre-condition: authorization link contains parameter "orcid=orcid-in-database" -1 - visit authorization link -expected: user is taken to signin screen as part of OAuth session and username field is populated with ORCID iD from orcid parameter -*/ - -describe('OAuth link customization tests', async function () { - const scope = '/person/update' - const orcidParamValue = userData.cyOAuth_RecordOwner1.oid - - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code' + - '&scope=' + - scope + - '&orcid=' + - orcidParamValue + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#50 authorization link contains valid orcid id param', function () { - cy.visit(authorizationLink) - cy.wait(2000) - cy.url().should('include', Cypress.env('signInURL')) - cy.get('#username').should('have.value', orcidParamValue) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc51.cy.js b/cypress/e2e/oauth/oauth_tc51.cy.js deleted file mode 100644 index 6b754de059..0000000000 --- a/cypress/e2e/oauth/oauth_tc51.cy.js +++ /dev/null @@ -1,35 +0,0 @@ -// -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#51 - authorization link customization -pre-condition: authorization link contains parameter "orcid=orcid-not-in-database" -1 - visit authorization link -expected: user is taken to registration screen as part of OAuth session -*/ - -describe('OAuth link customization tests', async function () { - const scope = '/person/update' - const orcidParamValue = 'AAAA-BBBB-CCCC-DDDD' - - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code' + - '&scope=' + - scope + - '&orcid=' + - orcidParamValue + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#51 authorization link contains a not existing orcid id param', function () { - cy.visit(authorizationLink) - cy.wait(2000) - cy.url().should('include', Cypress.env('registrationPage')) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc52.cy.js b/cypress/e2e/oauth/oauth_tc52.cy.js deleted file mode 100644 index 21eee57edd..0000000000 --- a/cypress/e2e/oauth/oauth_tc52.cy.js +++ /dev/null @@ -1,40 +0,0 @@ -// -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#52 - authorization link customization -pre-condition: authorization link contains parameters "orcid=orcid-not-in-database" + "given_names=Jane" + "family_names=Doe" -1 - visit authorization link -expected: user is taken to registration screen as part of OAuth -expected: registration screen is populated with given name and family name -*/ - -describe('OAuth link customization tests', async function () { - const scope = '/person/update' - const orcidParamValue = 'AAAA-BBBB-CCCC-DDDD' - - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code' + - '&scope=' + - scope + - '&orcid=' + - orcidParamValue + - '&given_names=Jane' + - '&family_names=Doe' + - '&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => {}) - - it('TC#52 authorization link contains a not existing orcid id param also given and family names params', function () { - cy.visit(authorizationLink) - cy.wait(2000) - cy.url().should('include', Cypress.env('registrationPage')) - cy.get('#given-names-input').should('have.value', 'Jane') - cy.get('#family-names-input').should('have.value', 'Doe') - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc53.cy.js b/cypress/e2e/oauth/oauth_tc53.cy.js deleted file mode 100644 index 80b4799b69..0000000000 --- a/cypress/e2e/oauth/oauth_tc53.cy.js +++ /dev/null @@ -1,100 +0,0 @@ -// -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC# 53 - client revokes access token -pre-condition: client has a valid access token for any given record -1 - API client calls /oauth/revoke endpoint to revoke access token -expected: API response HTTP/1.1 200 OK -*/ - -describe('OAuth client revokes access token', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC53 - - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code&scope=/activities/update%20/person/update&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - var token2revoke //valid access token - - before(() => { - //Pre-condition: client has a valid access token - cy.visit(authorizationLink) - cy.get('#username').clear().type(recordOwner.oid) - cy.get('#password').clear().type(recordOwner.password) - cy.get('#signin-button').click() - - //grant access to get code - cy.get('#authorize-button', { timeout: 4000 }).click() - cy.url({ timeout: 4000 }).should( - 'include', - userData.cyOAuth_MemberUser.redirect_uri + '/?code=' - ) - cy.url().then((urlString) => { - //grab appended code and exchange it for token - const codeToExchange = urlString.split('=')[1] - cy.log('codeToExchange: ' + codeToExchange) - const curlGetAccessToken = - "curl -i -L -H 'Accept: application/json' --data 'client_id=" + - userData.cyOAuth_MemberUser.clientID + - '&client_secret=' + - userData.cyOAuth_MemberUser.clientSecret + - '&grant_type=authorization_code&code=' + - codeToExchange + - "' 'https://qa.orcid.org/oauth/token'" - cy.exec(curlGetAccessToken).then((response) => { - const responseStr = response.stdout - //verify response is OK - expect(responseStr).to.contain('HTTP/2 200') - //get access token - const strStart = 'access_token":"' - const strEnd = '","token_type"' - const posStart = responseStr.lastIndexOf(strStart) + strStart.length - const posEnd = responseStr.indexOf(strEnd) - token2revoke = responseStr.slice(posStart, posEnd) - cy.log('tokenGenerated: ' + token2revoke) - }) - }) - }) - - it('TC#53 & TC#54 client revokes access token which cannot be used to make changes to record', function () { - //TC#53 Revoke access token - const curlRevokeToken = - "curl -i -L -H 'Accept: application/json' --data 'client_id=" + - userData.cyOAuth_MemberUser.clientID + - '&client_secret=' + - userData.cyOAuth_MemberUser.clientSecret + - '&token=' + - token2revoke + - "' '" + - Cypress.env('membersAPI_revokeTokenEndPoint') + - "'" - cy.log(curlRevokeToken) - //execute and verify response is OK - cy.exec(curlRevokeToken).then((response) => { - expect(response.stdout).to.contain('HTTP/2 200') - }) - - //TC#54 Try to use revoked token - const curlPostWork = - "curl -i -H 'Content-type: application/json' -H " + - "'Authorization: Bearer " + - token2revoke + - "' -d '" + - recordOwner.curlPostWorkPath + - "' -X POST 'https://api.qa.orcid.org/v3.0/" + - recordOwner.oid + - "/work'" - cy.log(curlPostWork) - - cy.exec(curlPostWork).then((response) => { - const responseStr = response.stdout - //verify error message indicates token is invalid - expect(responseStr).to.contain('"error" : "invalid_token"') - }) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc55.cy.js b/cypress/e2e/oauth/oauth_tc55.cy.js deleted file mode 100644 index 1ae48aa628..0000000000 --- a/cypress/e2e/oauth/oauth_tc55.cy.js +++ /dev/null @@ -1,111 +0,0 @@ -// -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#55 - exchange refresh token for new access token -pre-condition: client has a valid access token and respective refresh token -1 - API client calls /oauth/token endpoint to exchange refresh token for new access token -expected: API response HTTP/1.1 200 OK -expected: API response body contains new access token -*/ - -describe('OAuth client refreshes access token', async function () { - var newAccessToken - var refreshToken - const recordOwner = userData.cyOAuth_RecordOwnerTC55 - - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code&scope=/activities/update%20/person/update&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - before(() => { - //Pre-condition: client has a valid access token - cy.visit(authorizationLink) - cy.signin(recordOwner) - //grant access to get code - cy.get('#authorize-button', { timeout: 4000 }).click() - cy.url({ timeout: 4000 }).should( - 'include', - userData.cyOAuth_MemberUser.redirect_uri + '/?code=' - ) - cy.url().then((urlString) => { - //grab appended code and exchange it for a valid access token - const codeToExchange = urlString.split('=')[1] - cy.log('codeToExchange: ' + codeToExchange) - - const curlGetAccessToken = - "curl -i -L -H 'Accept: application/json' --data 'client_id=" + - userData.cyOAuth_MemberUser.clientID + - '&client_secret=' + - userData.cyOAuth_MemberUser.clientSecret + - '&grant_type=authorization_code&code=' + - codeToExchange + - "' 'https://qa.orcid.org/oauth/token'" - - cy.exec(curlGetAccessToken).then((response) => { - const responseStr = response.stdout - cy.log(responseStr) - //verify response is OK - expect(responseStr).to.contain('HTTP/2 200') - //get refresh token - const strStart = 'refresh_token":"' - const strEnd = '","expires_in"' - const posStart = responseStr.lastIndexOf(strStart) + strStart.length - const posEnd = responseStr.indexOf(strEnd) - refreshToken = responseStr.slice(posStart, posEnd) - cy.log('refresh Token: ' + refreshToken) - }) - }) - }) - - it('TC#55 client exchanges refresh token for a new access token', function () { - //use refresh token to get a new access token - const curlGetNewToken = - "curl -d 'refresh_token=" + - refreshToken + - "'" + - " -d 'grant_type=refresh_token' -d 'client_id=" + - userData.cyOAuth_MemberUser.clientID + - "'" + - " -d 'client_secret=" + - userData.cyOAuth_MemberUser.clientSecret + - "'" + - " -d 'revoke_old=true' https://api.qa.orcid.org/oauth/token" - - cy.exec(curlGetNewToken).then((response) => { - const responseStr = response.stdout - cy.log(responseStr) - //verify response returns a new access code - expect(responseStr).to.contain('access_token') - //get access token - const strStart = 'access_token":"' - const strEnd = '","token_type"' - const posStart = responseStr.lastIndexOf(strStart) + strStart.length - const posEnd = responseStr.indexOf(strEnd) - newAccessToken = responseStr.slice(posStart, posEnd) - cy.log('new access Token: ' + newAccessToken) - - //Try to use new access token - const curlPostWork = - "curl -i -H 'Content-type: application/json' -H " + - "'Authorization: Bearer " + - newAccessToken + - "' -d '" + - recordOwner.curlPostWorkPath + - "' -X POST 'https://api.qa.orcid.org/v3.0/" + - recordOwner.oid + - "/work'" - cy.log(curlPostWork) - - cy.exec(curlPostWork).then((response) => { - const responseStr = response.stdout - //verify response is succesful - expect(responseStr).to.contain('HTTP/2 201') - }) - }) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc56.cy.js b/cypress/e2e/oauth/oauth_tc56.cy.js deleted file mode 100644 index 6f4f42d539..0000000000 --- a/cypress/e2e/oauth/oauth_tc56.cy.js +++ /dev/null @@ -1,74 +0,0 @@ -// -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#56 - user visits OAuth link with orcid param while signed in (valid token exists) -pre-condition: a given user is signed in -pre-condition: test client has valid token for test user -pre-condition: authorization link contains parameter "orcid=orcid-in-database" -1 - visit authorization link -expected: orcid parameter is ignored -expected: user is taken to redirect_uri with new authorization code (authorization screen is bypassed) -*/ - -describe('OAuth link with orcid param', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC56 - - const authorizationLinkPrecondition = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code&scope=/activities/update%20/person/update&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri - - const authorizationLinkOrcidParam = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code&scope=/activities/update%20/person/update&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri + - '&orcid=' + - recordOwner.oid - - before(() => { - //Pre-condition: client has a valid access token for the record - cy.visit(authorizationLinkPrecondition) - cy.signin(recordOwner) - //grant access to get code - cy.get('#authorize-button', { timeout: 4000 }).click() - cy.url({ timeout: 4000 }).should( - 'include', - userData.cyOAuth_MemberUser.redirect_uri + '/?code=' - ) - cy.url().then((urlString) => { - //grab appended code and exchange it for a valid access token - const codeToExchange = urlString.split('=')[1] - cy.log('codeToExchange: ' + codeToExchange) - - const curlGetAccessToken = - "curl -i -L -H 'Accept: application/json' --data 'client_id=" + - userData.cyOAuth_MemberUser.clientID + - '&client_secret=' + - userData.cyOAuth_MemberUser.clientSecret + - '&grant_type=authorization_code&code=' + - codeToExchange + - "' 'https://qa.orcid.org/oauth/token'" - - cy.exec(curlGetAccessToken).then((response) => { - const responseStr = response.stdout - cy.log(responseStr) - //verify response is OK - expect(responseStr).to.contain('HTTP/2 200') - }) - }) - }) - - it('TC#56 orcid param is ignored', function () { - cy.visit(authorizationLinkOrcidParam) - //Assert user is taken to redirect_uri with new authorization code (authorization screen is bypassed) - cy.url({ timeout: 4000 }).should( - 'include', - userData.cyOAuth_MemberUser.redirect_uri + '/?code=' - ) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/oauth/oauth_tc57.cy.js b/cypress/e2e/oauth/oauth_tc57.cy.js deleted file mode 100644 index 2181a4245d..0000000000 --- a/cypress/e2e/oauth/oauth_tc57.cy.js +++ /dev/null @@ -1,39 +0,0 @@ -// -import userData from '../../fixtures/oauth-users.fixture.json' - -/* -TC#57 - user visits OAuth link with orcid param while signed in (no valid token) -pre-condition: a given user is signed in -pre-condition: test client does not have a valid token for test user -pre-condition: authorization link contains parameter "orcid=orcid-in-database" -1 - visit authorization link -expected: orcid param is ignored -expected: user is taken to authorization screen -*/ - -describe('OAuth link with orcid param', async function () { - const recordOwner = userData.cyOAuth_RecordOwnerTC57 - - const authorizationLinkOrcidParam = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOAuth_MemberUser.clientID + - '&response_type=code&scope=/activities/update%20/person/update&redirect_uri=' + - userData.cyOAuth_MemberUser.redirect_uri + - '&orcid=' + - recordOwner.oid - - before(() => { - cy.visit(Cypress.env('signInURL')) - //Pre-condition: record owner is signed in - cy.signin(recordOwner) - cy.wait(2000) - }) - - it('TC#57 OAuth link with orcid param while signed in (no valid token)', function () { - cy.visit(authorizationLinkOrcidParam) - //verify user taken to authorization screen - cy.get('#authorize-button').should('be.visible') - }) - - after(() => {}) -}) diff --git a/cypress/e2e/openID/openID_tc1.cy.js b/cypress/e2e/openID/openID_tc1.cy.js deleted file mode 100644 index 62f16303ed..0000000000 --- a/cypress/e2e/openID/openID_tc1.cy.js +++ /dev/null @@ -1,39 +0,0 @@ -/// - -import userData from '../../fixtures/openID_users.fixture.json' - -/* TC#1 -- visit authorization link -- sign in with ORCID credentials -- click button to grant access -expected: -- OAuth request returns short-lived access token (10 minutes) -- OAuth request returns id_token -- response_type ""token"" generates an implicit OAuth response -- implicit OAuth response uses URL fragments not query parameters (i.e. # not ?) -*/ - -describe('openID test cases', async function () { - const recordOwner = userData.cyOpenID_RecordOwner1 - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOpenID_client1.clientID + - '&response_type=token&scope=openid&redirect_uri=' + - userData.cyOpenID_client1.redirect_uri - - before(() => {}) - - it('TC#1 - authorization link with openid scope + response_type "token"', function () { - cy.visit(authorizationLink) - cy.signin(recordOwner) - //grant access - cy.get('#authorize-button').click({ timeout: 4000 }) - cy.url().then((urlString) => { - cy.log('responseURL: ' + urlString) - }) - cy.url().should('include', '#access_token=') - cy.url().should('include', 'id_token=') - }) - - after(() => {}) -}) diff --git a/cypress/e2e/openID/openID_tc10.cy.js b/cypress/e2e/openID/openID_tc10.cy.js deleted file mode 100644 index 7b2495a3ce..0000000000 --- a/cypress/e2e/openID/openID_tc10.cy.js +++ /dev/null @@ -1,29 +0,0 @@ -/// - -import userData from '../../fixtures/openID_users.fixture.json' - -/* TC#10 -precondition: authorization link with openid scope + no response_type parameter -steps: visit authorization link -expected: user taken to OAuth error page "oauth_error / Please specify a response type" -*/ - -describe('openID response type validations', async function () { - const recordOwner = userData.cyOpenID_RecordOwner1 - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOpenID_client1.clientID + - '&scope=openid&redirect_uri=' + - userData.cyOpenID_client1.redirect_uri - - before(() => {}) - - it('TC#10 - authorization link with openid scope + no response_type parameter ', function () { - cy.visit(authorizationLink) - cy.contains('oauth_error / Please specify a response type').should( - 'be.visible' - ) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/openID/openID_tc11.cy.js b/cypress/e2e/openID/openID_tc11.cy.js deleted file mode 100644 index a953e58143..0000000000 --- a/cypress/e2e/openID/openID_tc11.cy.js +++ /dev/null @@ -1,38 +0,0 @@ -/// - -import userData from '../../fixtures/openID_users.fixture.json' - -/* TC#11 -- visit authorization link -- sign in with ORCID credentials -- click button to grant access -expected: -- OAuth session is completed successfully and access is granted -- implicit OAuth response is generated (access token is returned in browser) -- no id_token returned -*/ - -describe('openID test cases', async function () { - const recordOwner = userData.cyOpenID_RecordOwner11 - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOpenID_client1.clientID + - '&response_type=token&scope=/authenticate&redirect_uri=' + - userData.cyOpenID_client1.redirect_uri - - before(() => {}) - - it('TC#11 - authorization link with "/authenticate" scope + response_type "token"', function () { - cy.visit(authorizationLink) - cy.signin(recordOwner) - //grant access - cy.get('#authorize-button').click({ timeout: 4000 }) - cy.url().then((urlString) => { - cy.log('responseURL: ' + urlString) - }) - cy.url().should('include', '#access_token=') - cy.url().should('not.include', 'id_token=') - }) - - after(() => {}) -}) diff --git a/cypress/e2e/openID/openID_tc2.cy.js b/cypress/e2e/openID/openID_tc2.cy.js deleted file mode 100644 index 2fe8d845e1..0000000000 --- a/cypress/e2e/openID/openID_tc2.cy.js +++ /dev/null @@ -1,49 +0,0 @@ -/// - -import userData from '../../fixtures/openID_users.fixture.json' -import jwtDecode from 'jwt-decode' -/* -TC#2 -Precondition: - authorization link with openid scope + response_type "id_token token" + nonce parameter -Steps: -- visit authorization link -- sign in with ORCID credentials -- click button to grant access -expected: -- OAuth request returns short-lived access token (10 minutes) -- OAuth request returns id_token -- response_type "token" generates an implicit OAuth response -- implicit OAuth response uses URL fragments not query parameters (i.e. # not ?) -*/ - -describe('openID test cases', async function () { - const recordOwner = userData.cyOpenID_RecordOwner2 - const nonceString = recordOwner.nonceParam - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOpenID_client1.clientID + - '&nonce=' + - nonceString + - '&response_type=id_token token&scope=openid&redirect_uri=' + - userData.cyOpenID_client1.redirect_uri - - before(() => {}) - - it('TC#2 - authorization link with openid scope + response_type "id_token token" + nonce parameter', function () { - cy.visit(authorizationLink) - cy.signin(recordOwner) - //grant access - cy.get('#authorize-button').click({ timeout: 4000 }) - cy.wait(2000) //must wait for redirect to complete - cy.url().then((urlString) => { - expect(urlString).to.include('#access_token=') - expect(urlString).to.include('id_token=') - const token2Decode = urlString.split('id_token=')[1] - const decoded = jwtDecode(token2Decode) // Returns with the JwtPayload type - expect(decoded.nonce).to.eq(nonceString) - }) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/openID/openID_tc3.cy.js b/cypress/e2e/openID/openID_tc3.cy.js deleted file mode 100644 index 338ffc2545..0000000000 --- a/cypress/e2e/openID/openID_tc3.cy.js +++ /dev/null @@ -1,49 +0,0 @@ -/// - -import userData from '../../fixtures/openID_users.fixture.json' -import jwtDecode from 'jwt-decode' -/* -TC#3 -Precondition: - authorization link with openid scope + response_type "id_token token" + nonce parameter -Steps: -- visit authorization link -- sign in with ORCID credentials -- click button to grant access -expected: -- OAuth request returns short-lived access token (10 minutes) -- OAuth request returns id_token -- response_type "token" generates an implicit OAuth response -- implicit OAuth response uses URL fragments not query parameters (i.e. # not ?) -*/ - -describe('openID test cases', async function () { - const recordOwner = userData.cyOpenID_RecordOwner2 - const nonceString = recordOwner.nonceParam - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOpenID_client1.clientID + - '&nonce=' + - nonceString + - '&response_type=token id_token&scope=openid&redirect_uri=' + - userData.cyOpenID_client1.redirect_uri - - before(() => {}) - - it('TC#3 - authorization link with openid scope + response_type "token id_token" + nonce parameter', function () { - cy.visit(authorizationLink) - cy.signin(recordOwner) - //grant access - cy.get('#authorize-button').click({ timeout: 4000 }) - cy.wait(2000) //must wait for redirect to complete - cy.url().then((urlString) => { - expect(urlString).to.include('#access_token=') - expect(urlString).to.include('id_token=') - const token2Decode = urlString.split('id_token=')[1] - const decoded = jwtDecode(token2Decode) // Returns with the JwtPayload type - expect(decoded.nonce).to.eq(nonceString) - }) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/openID/openID_tc4.cy.js b/cypress/e2e/openID/openID_tc4.cy.js deleted file mode 100644 index 1a25bf4de5..0000000000 --- a/cypress/e2e/openID/openID_tc4.cy.js +++ /dev/null @@ -1,30 +0,0 @@ -/// - -import userData from '../../fixtures/openID_users.fixture.json' - -/* TC#4 -Precond: authorization link with openid scope + response_type "token id_token" without nonce parameter -Step: visit authorization link -expected: -- user is sent to OAuth error page with error "invalid_request / Implicit id_token requests must have nonce" -*/ - -describe('openID test cases', async function () { - const recordOwner = userData.cyOpenID_RecordOwner1 - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOpenID_client1.clientID + - '&response_type=token id_token&scope=openid&redirect_uri=' + - userData.cyOpenID_client1.redirect_uri - - before(() => {}) - - it('TC#4 - authorization link with openid scope + response_type "token id_token" without nonce parameter', function () { - cy.visit(authorizationLink) - cy.contains('Implicit id_token requests must have nonce').should( - 'be.visible' - ) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/openID/openID_tc5.cy.js b/cypress/e2e/openID/openID_tc5.cy.js deleted file mode 100644 index d4dee19f69..0000000000 --- a/cypress/e2e/openID/openID_tc5.cy.js +++ /dev/null @@ -1,30 +0,0 @@ -/// - -import userData from '../../fixtures/openID_users.fixture.json' - -/* TC#5 -Precond: authorization link with openid scope + response_type "id_token token" without nonce parameter -Step: visit authorization link -expected: -- user is sent to OAuth error page with error "invalid_request / Implicit id_token requests must have nonce" -*/ - -describe('openID test cases', async function () { - const recordOwner = userData.cyOpenID_RecordOwner1 - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOpenID_client1.clientID + - '&response_type=id_token token&scope=openid&redirect_uri=' + - userData.cyOpenID_client1.redirect_uri - - before(() => {}) - - it('TC#4 - authorization link with openid scope + response_type "id_token token" without nonce parameter', function () { - cy.visit(authorizationLink) - cy.contains('Implicit id_token requests must have nonce').should( - 'be.visible' - ) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/openID/openID_tc6.cy.js b/cypress/e2e/openID/openID_tc6.cy.js deleted file mode 100644 index dc95d8463d..0000000000 --- a/cypress/e2e/openID/openID_tc6.cy.js +++ /dev/null @@ -1,56 +0,0 @@ -/// - -import userData from '../../fixtures/openID_users.fixture.json' - -/* TC#6 -- visit authorization link -- sign in with ORCID credentials -- click button to grant access -- exchange authorization code for access token - -expected: -- OAuth request returns authorization code as query parameter -- server response when exchanging authorization code contains access token as well as id_token -*/ - -describe('openID test cases', async function () { - const recordOwner = userData.cyOpenID_RecordOwner6 - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOpenID_client1.clientID + - '&response_type=code&scope=openid&redirect_uri=' + - userData.cyOpenID_client1.redirect_uri - - before(() => {}) - - it('TC#6 - authorization link with openid scope + response_type "code"', function () { - cy.visit(authorizationLink) - cy.signin(recordOwner) - //grant access - cy.get('#authorize-button').click({ timeout: 4000 }) - cy.wait(2000) - cy.url().then((urlString) => { - //grab appended code and exchange it for token - const codeToExchange = urlString.split('=')[1] - cy.log('codeToExchange: ' + codeToExchange) - - const curlGetAccessToken = - "curl -i -L -H 'Accept: application/json' --data 'client_id=" + - userData.cyOpenID_client1.clientID + - '&client_secret=' + - userData.cyOpenID_client1.clientSecret + - '&grant_type=authorization_code&code=' + - codeToExchange + - "' 'https://qa.orcid.org/oauth/token'" - - cy.log(curlGetAccessToken) - cy.exec(curlGetAccessToken).then((response) => { - expect(response.stdout).to.contain('HTTP/2 200') - expect(response.stdout).to.contain('access_token') - expect(response.stdout).to.contain('id_token') - }) - }) - }) - - after(() => {}) -}) diff --git a/cypress/e2e/openID/openID_tc9.cy.js b/cypress/e2e/openID/openID_tc9.cy.js deleted file mode 100644 index 08cc7e216f..0000000000 --- a/cypress/e2e/openID/openID_tc9.cy.js +++ /dev/null @@ -1,29 +0,0 @@ -/// - -import userData from '../../fixtures/openID_users.fixture.json' - -/* TC#9 -precondition: authorization link with openid scope + empty response_type -steps: visit authorization link -expected: user is taken to redirect_uri appended with "#error=unsupported_response_type" -*/ - -describe('openID response type validations', async function () { - const recordOwner = userData.cyOpenID_RecordOwner1 - const authorizationLink = - 'https://qa.orcid.org/oauth/authorize?client_id=' + - userData.cyOpenID_client1.clientID + - '&response_type=&scope=openid&redirect_uri=' + - userData.cyOpenID_client1.redirect_uri - - before(() => {}) - - it('TC#9 - authorization link with openid scope + empty response_type', function () { - cy.visit(authorizationLink) - cy.signin(recordOwner) - cy.wait(2000) - cy.url().should('include', '#error=unsupported_response_type') - }) - - after(() => {}) -}) diff --git a/cypress/e2e/registry/account-settings-2FA.cy.js b/cypress/e2e/registry/account-settings-2FA.cy.js deleted file mode 100644 index 00d5a20766..0000000000 --- a/cypress/e2e/registry/account-settings-2FA.cy.js +++ /dev/null @@ -1,23 +0,0 @@ -/// -import userData from '../../fixtures/testing-users.fixture.json' - -describe('Account Settings - users can activate 2FA for their record', async function () { - before(() => { - cy.visit('/') - }) - - it('Verify 2FA is requested during login if user previously activated 2FA', function () { - cy.get('#menu-signin-button').click() - //verify user is redirected to the sign in page - cy.url().should('include', '/signin') - cy.get('#username').clear().type(userData.cy2FAuser.oid) - cy.get('#password').clear().type(userData.cy2FAuser.password) - cy.get('#signin-button').click() - //verify 2FA is requested during login - cy.get('[formcontrolname="verificationCode"]').should('be.visible') - }) - - after(() => { - //no action required, user was not abe to log in - }) -}) diff --git a/cypress/e2e/registry/account-settings-reset-password.cy.js b/cypress/e2e/registry/account-settings-reset-password.cy.js deleted file mode 100644 index 1e0f651a1d..0000000000 --- a/cypress/e2e/registry/account-settings-reset-password.cy.js +++ /dev/null @@ -1,43 +0,0 @@ -/// -import userData from '../../fixtures/testing-users.fixture.json' - -describe('Account Settings - users can reset their password', async function () { - before(() => { - cy.programmaticallySignin('cyAcctSettRestPasswUser') //send user key from fixture file - cy.visit('/my-orcid') - cy.get('#biography-panel') //wait for page to load - }) - - it('Verify user is able to reset the password to a different valid password and log in', function () { - cy.get('#cy-user-info').click() - cy.get('#cy-account-settings').wait(1000).click({ force: true }) - cy.get('#cy-password-panel-action-more').wait(1000).click({ force: true }) - cy.get('[formcontrolname="oldPassword"]') - .clear() - .type(userData.cyAcctSettRestPasswUser.password) - cy.get('[formcontrolname="password"]') - .clear() - .type(userData.cyAcctSettRestPasswUser.newPassw) - cy.get('[formcontrolname="retypedPassword"]') - .clear() - .type(userData.cyAcctSettRestPasswUser.newPassw) - cy.get('#cy-save-password').click() - cy.contains('Your password has been updated').should('be.visible') //wait for update to complete - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - - //user can log in with new password - cy.get('#username').clear().type(userData.cyAcctSettRestPasswUser.oid) - cy.get('#password').clear().type(userData.cyAcctSettRestPasswUser.newPassw) - cy.get('#signin-button').click() - //verify user is redirected to my orcid page - cy.get('#biography-panel') //wait for my orcid page to load - }) - - after(() => { - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/registry/account-settings-visibility.cy.js b/cypress/e2e/registry/account-settings-visibility.cy.js deleted file mode 100644 index 13306c61d7..0000000000 --- a/cypress/e2e/registry/account-settings-visibility.cy.js +++ /dev/null @@ -1,63 +0,0 @@ -/// - -describe('Account Settings - users can change default visibility setting for data added to their record', async function () { - beforeEach(() => { - cy.programmaticallySignin('cyAcctSettVisibilityUser') //send user key from fixture file - cy.visit('/my-orcid') - cy.get('#biography-panel') //wait for page to load - }) - - it('Verify default visibility is "Everyone" when user has this setting', function () { - //check Account Settings> visibility has "Everyone" selected - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-account-settings').wait(1000).click({ force: true }) - cy.get('#cy-visibility-panel-action-more').wait(1000).click({ force: true }) - cy.get('#cy-visibility-everyone-input').click() - //try to add new affiliation, visibility "Everyone" is selected - cy.get('#cy-user-info').click() - cy.get('#cy-my-orcid').click() - cy.get('#cy-add-btn-employment').click() - cy.get('app-modal').within(() => { - cy.get('.cy-visibility-public').should('have.class', 'selected') - cy.get('#cancel-affiliation-button').click() - }) - }) - - it('Verify default visibility is "Trusted Organizations" when user has this setting', function () { - //check Account Settings> visibility has "Trusted Organizations" selected - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-account-settings').wait(1000).click({ force: true }) - cy.get('#cy-visibility-panel-action-more').wait(1000).click({ force: true }) - cy.get('#cy-visibility-trusted-input').click() - //try to add new affiliation, visibility "Trusted Organizations" is selected - cy.get('#cy-user-info').click() - cy.get('#cy-my-orcid').click() - cy.get('#cy-add-btn-employment').click() - cy.get('app-modal').within(() => { - cy.get('.cy-visibility-limited').should('have.class', 'selected') - cy.get('#cancel-affiliation-button').click() - }) - }) - - it('Verify default visibility is "Only me" when user has this setting', function () { - //check Account Settings> visibility has "Only me" selected - cy.get('#cy-user-info').click({ force: true }) - cy.get('#cy-account-settings').wait(1000).click({ force: true }) - cy.get('#cy-visibility-panel-action-more').wait(1000).click({ force: true }) - cy.get('#cy-visibility-private-input').click() - //try to add new affiliation, visibility "Only me" is selected - cy.get('#cy-user-info').click() - cy.get('#cy-my-orcid').click() - cy.get('#cy-add-btn-employment').click() - cy.get('app-modal').within(() => { - cy.get('.cy-visibility-private').should('have.class', 'selected') - cy.get('#cancel-affiliation-button').click() - }) - }) - - afterEach(() => { - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) -}) diff --git a/cypress/e2e/registry/deactivate-reactivate-user.cy.js b/cypress/e2e/registry/deactivate-reactivate-user.cy.js deleted file mode 100644 index c33777059c..0000000000 --- a/cypress/e2e/registry/deactivate-reactivate-user.cy.js +++ /dev/null @@ -1,145 +0,0 @@ -// -import userData from '../../fixtures/testing-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -/* - Deactivation scenarios -*/ - -describe('deactivation process', async function () { - var deactLink = '' - const recordOwner = userData.cyUser_Deactivate_Reactivate - - before(() => {}) - qase( - ['219', '217', '46', '53'], - it('deactivation process - user signed in', function () { - /* - 1. Sign in - 2. go to account settings - 3. request deactivation link - Expect: user receives email in primary email - Expect: confirmation banner is displayed in account settings page - 4. visit deactivation link - Expect: user is taken to /signin - Expect: account is deactivated - */ - - cy.visit('/signin') - cy.url({ timeout: 40000 }).should('include', Cypress.env('signInURL')) - cy.signin(recordOwner) - cy.get('#cy-user-info').click({ force: true }) - //wait for menu overlay to be displayed - cy.wait(4000) - cy.get('#cy-account-settings').click({ force: true }) - cy.url().should('include', '/account') - cy.get('#cy-deactivate-account-panel-action-more').click() - cy.get('#cy-deactivate-account').click() - //cy.wait(4000)//wait to receive email - //use gmail api to check deactvation link was sent - cy.task('checkInbox_from_to_subject', { - options: { - from: Cypress.env('deactivationEmailSender'), - to: recordOwner.email, - subject: Cypress.env('deactivationEmailSubject'), - include_body: true, - }, - }).then((email) => { - assert.isNotNull(email) - const emailBody = email.body.html - //convert string to DOM - const htmlDom = new DOMParser().parseFromString(emailBody, 'text/html') - //find the link that points to the correct endpoint - deactLink = htmlDom.querySelector( - `a[href*="account/confirm-deactivate-orcid"]` - ).href - cy.log('link found in email: ' + deactLink) - //verify message banner is displayed - cy.get('#cy-deactivate-account-panel').should( - 'contain', - Cypress.env('deactivationBannerMessage') - ) - cy.visit(deactLink) - cy.url({ timeout: 40000 }).should('include', Cypress.env('signInURL')) - cy.signin(recordOwner) - cy.get('app-deactivated').should( - 'contain', - Cypress.env('deactivatedRecordMessage') - ) - }) - - /* - Reactivating the account - (with a first-name and family-name that already exist on the registry). - Could this be you? modal should not be displayed. - */ - cy.visit('/signin') - cy.url({ timeout: 40000 }).should('include', Cypress.env('signInURL')) - cy.signin(recordOwner) - cy.get('input[formcontrolname="email"]').clear().type(recordOwner.email) - cy.contains('button', 'SUBMIT').click() - - //use gmail api to check reactivatoin link was sent - cy.task('checkInbox_from_to_subject', { - options: { - from: Cypress.env('reactivationEmailSender'), - to: recordOwner.email, - subject: Cypress.env('reactivationEmailSubject'), - include_body: true, - }, - }).then((email) => { - assert.isNotNull(email) - const emailBody = email.body.html - //convert string to DOM - const htmlDom = new DOMParser().parseFromString(emailBody, 'text/html') - //find the link that points to the correct endpoint - const href = htmlDom.querySelector( - `a[href*="https://qa.orcid.org/reactivation/"]` - ).href - //follow the link from the email - cy.visit(href) - }) - - cy.url().should('include', Cypress.env('reactivationEmailLink')) - cy.get('#given-names-input').clear().type(recordOwner.name) - cy.get('#family-names-input').clear().type(recordOwner.lastname) - cy.get('#email-input').should('have.value', recordOwner.email) - //step to make sure backend validation on the form is complete - cy.get('app-step-a').within(($appForm) => { - cy.get('form').should('have.class', 'ng-untouched ng-dirty ng-valid') - }) - cy.get('#step-a-next-button').click({ force: true }) - //goes right to step b, "is this you?" modal does not exist in the DOM - cy.get('app-is-this-you').should('not.exist') - cy.get('#password-input').clear().type(recordOwner.password) - cy.get('#password-confirm-input').clear().type(recordOwner.password) - //step to make sure backend validation on the form is complete - cy.get('app-step-b').within(($appForm) => { - cy.get('form').should('have.class', 'ng-untouched ng-dirty ng-valid') - }) - cy.get('#step-b-next').click({ force: true }) - - cy.get('#visibility-everyone-input-input').click({ force: true }) - cy.get('#privacy-input-input').check({ force: true }).should('be.checked') - cy.get('#data-processed-input-input') - .check({ force: true }) - .should('be.checked') - - //CAPTCHA - // Wrap iframe body into a cypress object and perform test within there - cy.getIframeBody('iframe[title="reCAPTCHA"]').within(() => { - cy.get('.recaptcha-checkbox-border').click() - cy.get('#recaptcha-anchor', { timeout: 10000 }).should( - 'have.class', - 'recaptcha-checkbox-checked' - ) - }) - //REACTIVATE button - cy.get('#step-c-register-button').click() - //user taken my orcid page - cy.url({ timeout: 40000 }).should('include', '/my-orcid') - }) - ) //end of qase tag - - after(() => {}) -}) diff --git a/cypress/e2e/registry/email-verification-reminder.cy.js b/cypress/e2e/registry/email-verification-reminder.cy.js deleted file mode 100644 index d2dc297d24..0000000000 --- a/cypress/e2e/registry/email-verification-reminder.cy.js +++ /dev/null @@ -1,65 +0,0 @@ -/// - -import userData from '../../fixtures/testing-users.fixture.json' -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Primary account email verification reminders', async function () { - beforeEach(() => { - cy.visit('/') - }) - - /* registered user has not verified primary account email, gets reminder - in scope: check the user gets the reminder email with correct link - out of scope: this test case will not click on the link so states remains the same */ - qase( - '106', - it('Receive reminder email if primary account email has not been verified', function () { - //click Sign in - cy.get('#menu-signin-button').click() - - //sign in with registered user - cy.log( - 'Signing in with user: ' + userData.cyUserPrimaryEmailNotVerified.oid - ) - cy.get('#username') - .clear() - .type(userData.cyUserPrimaryEmailNotVerified.oid) - cy.get('#password') - .clear() - .type(userData.cyUserPrimaryEmailNotVerified.password) - cy.get('#signin-button').click() - - //request to get reminder email to verify primary account email - cy.get('#biography-panel').within(($myPanel) => { - cy.get('.cy-edit-button').click() - }) - cy.contains('Resend verification email').click() - - //use gmail api to check verification email was sent - cy.task('checkInbox_from_to_subject', { - options: { - from: Cypress.env('senderVerifyEmail'), - to: userData.cyUserPrimaryEmailNotVerified.email, - subject: Cypress.env('verifyEmailReminderSubject'), - include_body: true, - }, - }).then((email) => { - assert.isNotNull(email) - const emailBody = email.body.html - cy.log('>>>>>>>>>Email body is: ' + JSON.stringify(email.body)) - - //convert string to DOM - const htmlDom = new DOMParser().parseFromString(emailBody, 'text/html') - - //href points to correct endpoint - cy.get(htmlDom.querySelector('[id$="verificationButton"]')) - .invoke('attr', 'href') - .should('include', Cypress.env('verifyEmailUrl')) - }) - - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) - ) //end of qase tag -}) diff --git a/cypress/e2e/registry/new-user-registration.cy.js b/cypress/e2e/registry/new-user-registration.cy.js deleted file mode 100644 index 87ce2e9c43..0000000000 --- a/cypress/e2e/registry/new-user-registration.cy.js +++ /dev/null @@ -1,106 +0,0 @@ -/// -const randomUser = require('../../helpers/randomUser') -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Register new user', async function () { - beforeEach(() => { - cy.visit('/') - }) - - qase( - ['104', '161'], - it('New user registers and verifies primary email', function () { - //Bypass the duplicated research call to avoid getting the "Is this you modal" - cy.intercept('GET', Cypress.env('duplicatedModalEndPoint'), []) - - //generate a new (random) user - const userToRegister = randomUser() - //convert email to lower case as gmail uses it this way - userToRegister.email = userToRegister.email.toLowerCase() - - cy.get('#menu-signin-button').click() - //verify user is redirected to the sign in page - cy.url().should('include', '/signin') - cy.get('#register-button').click() - //verify user is redirected to the register page - cy.url().should('include', '/register') - - //STEP 1/3 populate form - cy.get('#given-names-input').clear().type(userToRegister.name) - cy.get('#family-names-input').clear().type(userToRegister.familyName) - cy.get('#email-input').clear().type(userToRegister.email) - cy.get('#confirm-email-input').clear().type(userToRegister.email) - cy.get('#step-a-next-button').click() - - //STEP 2/3 create OID - cy.get('.mat-card-title').contains('Create your ORCID iD') - cy.get('#password-input').clear().type(userToRegister.password) - cy.get('#password-confirm-input').clear().type(userToRegister.password) - cy.get('.ng-valid #step-b-next').click() - - //STEP 3/3 - cy.get('#visibility-everyone-input-input').click({ force: true }) - cy.get('#privacy-input-input').check({ force: true }).should('be.checked') - cy.get('#data-processed-input-input') - .check({ force: true }) - .should('be.checked') - - //CAPTCHA - // Wrap iframe body into a cypress object and perform test within there - cy.getIframeBody('iframe[title="reCAPTCHA"]').within(() => { - cy.get('.recaptcha-checkbox-border').click() - cy.get('#recaptcha-anchor', { timeout: 10000 }).should( - 'have.class', - 'recaptcha-checkbox-checked' - ) - }) - - cy.get('#step-c-register-button').click() - - //use Gmail API to check verification email was sent - //this task will poll the inbox every 15sec to check for the email - cy.task('checkInbox_from_to_subject', { - options: { - from: Cypress.env('senderVerifyEmail'), - to: userToRegister.email, - subject: Cypress.env('verifyEmailSubject'), - include_body: true, - }, - }).then((email) => { - assert.isNotNull(email) - const emailBody = email.body.html - cy.log('>>>>>>>>>Email body is: ' + JSON.stringify(email.body)) - - //convert string to DOM - const htmlDom = new DOMParser().parseFromString(emailBody, 'text/html') - cy.log(htmlDom.documentElement.innerHTML) - //find the link - const href = htmlDom.querySelector('[id$="verificationButton"]').href - cy.log('>>>>>>>found the link: ' + href) - - // make an api request for this resource (no UI needed) - // drill into the response to check it was successful - cy.request(href).its('status').should('eq', 200) - }) - - //reload page - cy.reload() - cy.wait(4000) //REMOVE after fix by dev - //try editing Bio which only users with verified emails can do - cy.get('#biography-panel').within(($bioSection) => { - cy.get('.cy-edit-button').click() - }) - cy.get('#biography-input') - .clear() - .type('only users with verified emails can edit bio') - cy.get('#save-biography-button').click() - cy.get('#biography').contains( - 'only users with verified emails can edit bio' - ) - - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) - ) //end of qase tag -}) diff --git a/cypress/e2e/registry/reset-password-recover-id.cy.js b/cypress/e2e/registry/reset-password-recover-id.cy.js deleted file mode 100644 index 1ec310d88c..0000000000 --- a/cypress/e2e/registry/reset-password-recover-id.cy.js +++ /dev/null @@ -1,109 +0,0 @@ -/// - -import userData from '../../fixtures/testing-users.fixture.json' - -describe('Password reset and OID recovery', () => { - beforeEach(() => { - cy.visit('/') - }) - - it('User resets password', function () { - const newPassword = userData.cyResetPasswordUser.resetPasswordTo - - //click Sign in - cy.get('#menu-signin-button').click() - //click forgot password link - cy.get('#forgot-password-button').click() - //password option is selected by default, type email - cy.get('[formcontrolname="email"]') // REPLACE locator for cy id - .clear() - .type(userData.cyResetPasswordUser.email) - //click button to recover details - cy.get('#cy-recover-acc-details').click() - cy.wait(2000) - - //use gmail api to check recovery email was sent - cy.task('checkInbox_from_to_subject', { - options: { - from: Cypress.env('senderResetPassword'), - to: userData.cyResetPasswordUser.email, - subject: Cypress.env('forgotPasswordSubject'), - include_body: true, - }, - }).then((email) => { - assert.isNotNull(email) - const emailBody = email.body.html - //convert string to DOM - const htmlDom = new DOMParser().parseFromString(emailBody, 'text/html') - cy.log(htmlDom.documentElement.innerHTML) - //find the link that starts pointing to the correct endpoint - const href = htmlDom.querySelector(`a[id*='cy-pwd-reset-url']`).href - //follow the link from the email - cy.visit(href) - }) - cy.wait(3000) - //type new passw - cy.contains('There is a problem with your reset password link.').should( - 'not.exist' - ) - cy.get('#cy-password-input').clear().type(newPassword) - //confirm new passw - cy.get('#cy-password-confirm-input').clear().type(newPassword) - //save - //cy.wait(2000) - cy.get('#cy-save-password').should('be.enabled').click({ force: true }) - - //verify user is redirected to Sign in page - cy.url().should('contain', Cypress.env('signInURL')) - - //Verify user can sign in with new passw - cy.get('#username').clear().type(userData.cyResetPasswordUser.oid) - cy.get('#password').clear().type(newPassword) - cy.get('#signin-button').click() - //verify user is redirected to their my orcid page - cy.url().should('contain', userData.cyResetPasswordUser.oid) - - //sign out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click() - }) - - it('User recovers OID', function () { - //click Sign in - cy.get('#menu-signin-button').click() - //click forgot password link - cy.get('#forgot-password-button').click() - //select OID recovery option - cy.get('[value="remindOrcidId"]').click() - //type email - cy.get('[formcontrolname="email"]') // REPLACE locator for cy id - .clear() - .type(userData.cyResetPasswordUser.email) - //click button to recover details - cy.get('#cy-recover-acc-details').click() - - //use gmail api to check recovery email was sent - cy.task('checkInbox_from_to_subject', { - options: { - from: Cypress.env('senderResetPassword'), - to: userData.cyResetPasswordUser.email, - subject: Cypress.env('recoverOIDSubject'), - include_body: true, - }, - }).then((email) => { - assert.isNotNull(email) - const emailBody = email.body.html - //convert string to DOM - const htmlDom = new DOMParser().parseFromString(emailBody, 'text/html') - //find the link that contains user OID - const href = htmlDom.querySelector( - `a[href*='${userData.cyResetPasswordUser.oid}']` - ).href - cy.log('>>>>>>>found the link: ' + href) - //follow the link from the email - cy.visit(href) - }) - //verify user is redirected to their public record page - cy.url().should('contain', userData.cyResetPasswordUser.oid) - }) -}) diff --git a/cypress/e2e/registry/thank-you-for-registering-banner.cy.js b/cypress/e2e/registry/thank-you-for-registering-banner.cy.js deleted file mode 100644 index 0932b1d327..0000000000 --- a/cypress/e2e/registry/thank-you-for-registering-banner.cy.js +++ /dev/null @@ -1,120 +0,0 @@ -/// -const randomUser = require('../../helpers/randomUser') -import { qase } from 'cypress-qase-reporter/dist/mocha' - -describe('Register new user - a Thank you banner is displayed - verify email sent', async function () { - const welcomeMessage = 'Thank you for registering with ORCID' - const emailVerifRemidnerMessage = 'Please verify your primary email address!' - - beforeEach(() => { - cy.visit('/') - }) - - qase( - ['105'], - it('Register new user - a Thank you banner is displayed - verify email sent', function () { - //Bypass the duplicated research call to avoid getting the "Is this you modal" - cy.intercept('GET', Cypress.env('duplicatedModalEndPoint'), []) - - //generate a new (random) user - const userToRegister = randomUser() - //convert email to lower case as gmail uses it this way - userToRegister.email = userToRegister.email.toLowerCase() - - cy.get('#menu-signin-button').click() - //verify user is redirected to the sign in page - cy.url().should('include', '/signin') - cy.get('#register-button').click() - //verify user is redirected to the register page - cy.url().should('include', '/register') - - //STEP 1/3 populate form - cy.get('#given-names-input').clear().type(userToRegister.name) - cy.get('#family-names-input').clear().type(userToRegister.familyName) - cy.get('#email-input').clear().type(userToRegister.email) - cy.get('#confirm-email-input').clear().type(userToRegister.email) - cy.get('#step-a-next-button').click() - - //STEP 2/3 create OID - cy.get('.mat-card-title').contains('Create your ORCID iD') - cy.get('#password-input').clear().type(userToRegister.password) - cy.get('#password-confirm-input').clear().type(userToRegister.password) - cy.get('.ng-valid #step-b-next').click() - - //STEP 3/3 - cy.get('#visibility-everyone-input-input').click({ force: true }) - cy.get('#privacy-input-input').check({ force: true }).should('be.checked') - cy.get('#data-processed-input-input') - .check({ force: true }) - .should('be.checked') - - //CAPTCHA - // Wrap iframe body into a cypress object and perform test within there - cy.getIframeBody('iframe[title="reCAPTCHA"]').within(() => { - cy.get('.recaptcha-checkbox-border').click() - cy.get('#recaptcha-anchor', { timeout: 10000 }).should( - 'have.class', - 'recaptcha-checkbox-checked' - ) - }) - cy.get('#step-c-register-button').click() - - //verify top banner - cy.contains('app-top-bar-verification-email', welcomeMessage).should( - 'be.visible' - ) - cy.wait(4000) //wait for back end so button is clickable - cy.contains('button', 'Resend verification email').click({ force: true }) - cy.wait(4000) //wait for banner to dinamically update message - cy.contains( - 'app-top-bar-verification-email', - emailVerifRemidnerMessage - ).should('be.visible') - - //use Gmail API to check verification email was sent - //this task will poll the inbox every 15sec to check for the email - cy.task('checkInbox_from_to_subject', { - options: { - from: Cypress.env('senderVerifyEmail'), - to: userToRegister.email, - subject: Cypress.env('verifyEmailReminderSubject'), - include_body: true, - }, - }).then((email) => { - assert.isNotNull(email) - const emailBody = email.body.html - cy.log('>>>>>>>>>Email body is: ' + JSON.stringify(email.body)) - - //convert string to DOM - const htmlDom = new DOMParser().parseFromString(emailBody, 'text/html') - cy.log(htmlDom.documentElement.innerHTML) - //find the link - const href = htmlDom.querySelector('[id$="verificationButton"]').href - cy.log('>>>>>>>found the link: ' + href) - - // make an api request for this resource (no UI needed) - // drill into the response to check it was successful - cy.request(href).its('status').should('eq', 200) - }) - - //reload page - cy.reload() - cy.wait(4000) - //try editing Bio which only users with verified emails can do - cy.get('#biography-panel').within(($bioSection) => { - cy.get('.cy-edit-button').click() - }) - cy.get('#biography-input') - .clear() - .type('only users with verified emails can edit bio') - cy.get('#save-biography-button').click() - cy.get('#biography').contains( - 'only users with verified emails can edit bio' - ) - - //log out - cy.get('#cy-user-info').click() - cy.get('#cy-signout').click({ force: true }) - }) - ) //end of qase tag -}) diff --git a/cypress/fixtures/affiliations-testing-data.fixture.json b/cypress/fixtures/affiliations-testing-data.fixture.json deleted file mode 100644 index 21cf9d5d2b..0000000000 --- a/cypress/fixtures/affiliations-testing-data.fixture.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "affiliationNewOrg": { - "name": "UCR", - "city": "San Jose", - "region": "San Jose", - "country": "Albania", - "dept": "Engineering", - "role": "Professor", - "degree": "Msc", - "startDate_year": "2019", - "startDate_month": "01", - "startDate_day": "01", - "endDate_year": "2020", - "endDate_month": "01", - "endDate_day": "01", - "link": "ucr.ac.cr", - "visibility": "public" - }, - "affiliationExistingOrg": { - "name": "NASA Education", - "city": "Washington", - "region": "DC", - "country": "United States", - "dept": "Engineering", - "role": "Professor", - "degree": "Msc", - "startDate_year": "2020", - "startDate_month": "01", - "startDate_day": "01", - "endDate_year": "2021", - "endDate_month": "01", - "endDate_day": "01", - "link": "https://www.mit.edu/", - "visibility": "public" - }, - "affilliantionWorks": { - "DOI": "10.1087/20120404", - "workTitleDOI": "ORCID: a system to uniquely identify researchers", - "manuallyType": "Book", - "manuallyTitle": "Test Biology Research", - "manuallySubtitle": "Sub Biology", - "manuallyTranslatedTitle": "Prueba Investiga Biología", - "manuallyLanguage": "Albanian", - "manuallyJournalTitle": "Test Journal", - "manuallyLink": "orcid.org", - "manuallyCitationType": "APA", - "manuallyCitation": "Test Citation", - "manuallyCitationDesc": "Test citation desc", - "manuallyIdentifierType": "agr: Agricola", - "manuallyIdentifierId": "123", - "manuallyIdentifierLink": "orcid.org", - "manuallyRelationship": "Self", - "manuallyFormLanguage": "Albanian", - "manuallyFormCountry": "Albania", - "manuallyVisibility": "private", - "manuallyYear": "2022", - "manuallyMonth": "01", - "manuallyDay": "01" - }, - "affilliantionFunding": { - "fundingType": "Award", - "fundingSubtype": "orcid award", - "fundedProjectTitle": "Researching Quality", - "translatedTitle": "Investingando la calidad", - "tranlationLanguage": "Afar", - "fundingLink": "google.com", - "description": "cypress funding manually added", - "amountCurrency": "AFA", - "amount": "1000", - "startYear": "2021", - "startMonth": "01", - "endYear": "2023", - "endMonth": "01", - "fundingAgency": "UCR", - "city": "San Jose", - "region": "San Jose", - "country": "Albania", - "grantNumber": "777", - "grantLink": "ucr.ac.cr" - } -} diff --git a/cypress/fixtures/data/link.txt b/cypress/fixtures/data/link.txt deleted file mode 100644 index 2fd0ac79f7..0000000000 --- a/cypress/fixtures/data/link.txt +++ /dev/null @@ -1 +0,0 @@ -https://qa.orcid.org/reset-password-email/NExORDRsWGE3M2QzeFdYNithVEhHcnpkb0tFZGNpZC9PN01jOVpzL2xEYkJueUE1Qk1nMXVqOWpCQ1dNcEJtS2NaQ2N1SzZYdUR2SDNBK3kzSUJRZlYrSGVYaUYrSVZEQVBTRkl3cDUyK0RjMEt1c295cGw1N1B3dTN2cWprais \ No newline at end of file diff --git a/cypress/fixtures/data/orcid.txt b/cypress/fixtures/data/orcid.txt deleted file mode 100644 index ac3cfc6e9e..0000000000 --- a/cypress/fixtures/data/orcid.txt +++ /dev/null @@ -1 +0,0 @@ -https://qa.orcid.org/0000-0002-5420-6288 \ No newline at end of file diff --git a/cypress/fixtures/funding-duplicate-grouping.fixture.json b/cypress/fixtures/funding-duplicate-grouping.fixture.json deleted file mode 100644 index 8f58e4c80e..0000000000 --- a/cypress/fixtures/funding-duplicate-grouping.fixture.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "type": "grant", - "organization-defined-type": "Funding sub-type", - "title": { - "title": "Funding added via API", - "translated-title": { - "language-code": "en", - "value": "Translated title" - } - }, - "short-description": "Short description of the award", - "amount": { - "currency-code": "ADP", - "value": "1000" - }, - "url": "https://alt-url.org", - "start-date": { - "year": 2022, - "month": 2, - "day": 2 - }, - "end-date": { - "year": 2023, - "month": 2, - "day": 2 - }, - "external-ids": { - "external-id": { - "external-id-type": "grant_number", - "external-id-value": "123abc", - "external-id-url": "http://tempuri.org/12345", - "external-id-relationship": "self" - } - }, - "organization": { - "name": "Wellcome Trust", - "address": { - "city": "London", - "country": "GB" - }, - "disambiguated-organization": { - "disambiguated-organization-identifier": "http://dx.doi.org/10.13039/100000001", - "disambiguation-source": "FUNDREF" - } - } -} diff --git a/cypress/fixtures/funding-two-sources-grouping.fixture.json b/cypress/fixtures/funding-two-sources-grouping.fixture.json deleted file mode 100644 index d6ec72594f..0000000000 --- a/cypress/fixtures/funding-two-sources-grouping.fixture.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "type": "award", - "organization-defined-type": "Funding sub-type", - "title": { - "title": "Funding added by two sources", - "translated-title": { - "language-code": "en", - "value": "Translated title" - } - }, - "short-description": "Short description of the award", - "amount": { - "currency-code": "ADP", - "value": "1000" - }, - "url": "https://alt-url.org", - "start-date": { - "year": 2022, - "month": 2, - "day": 2 - }, - "end-date": { - "year": 2023, - "month": 2, - "day": 2 - }, - "external-ids": { - "external-id": { - "external-id-type": "grant_number", - "external-id-value": "000aaa", - "external-id-url": "http://tempuri.org/12345", - "external-id-relationship": "self" - } - }, - "organization": { - "name": "Wellcome Trust", - "address": { - "city": "London", - "country": "GB" - }, - "disambiguated-organization": { - "disambiguated-organization-identifier": "http://dx.doi.org/10.13039/100000001", - "disambiguation-source": "FUNDREF" - } - } -} diff --git a/cypress/fixtures/funding-with-contributors.fixture-sample.json b/cypress/fixtures/funding-with-contributors.fixture-sample.json deleted file mode 100644 index 4e76ca5b83..0000000000 --- a/cypress/fixtures/funding-with-contributors.fixture-sample.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "type": "grant", - "organization-defined-type": "Funding sub-type", - "title": { - "title": "Funding added via API", - "translated-title": { - "language-code": "en", - "value": "Translated title" - } - }, - "short-description": "Short description of the award", - "amount": { - "currency-code": "ADP", - "value": "1000" - }, - "url": "https://alt-url.org", - "start-date": { - "year": 2000, - "month": 2, - "day": 2 - }, - "end-date": { - "year": 2020, - "month": 2, - "day": 2 - }, - "external-ids": { - "external-id": { - "external-id-type": "grant_number", - "external-id-value": "777aaazzz", - "external-id-url": "http://tempuri.org/12345", - "external-id-relationship": "self" - } - }, - "contributors": { - "contributor": [ - { - "credit-name": "name", - "contributor-email": "name@email.com", - "contributor-attributes": { - "contributor-role": "http://credit.niso.org/contributor-roles/conceptualization/" - } - }, - { - "contributor-orcid": { - "uri": "https://qa.orcid.org/####-####-####-####", - "path": "####-####-####-####", - "host": "host" - }, - "credit-name": "name", - "contributor-email": "name@email.com", - "contributor-attributes": { - "contributor-role": "http://credit.niso.org/contributor-roles/data-curation/" - } - } - ] - }, - "organization": { - "name": "Wellcome Trust", - "address": { - "city": "London", - "country": "GB" - }, - "disambiguated-organization": { - "disambiguated-organization-identifier": "http://dx.doi.org/....", - "disambiguation-source": "FUNDREF" - } - } -} diff --git a/cypress/fixtures/inbox-notif-fixtures/employment.fixture.json b/cypress/fixtures/inbox-notif-fixtures/employment.fixture.json deleted file mode 100644 index 07012222cd..0000000000 --- a/cypress/fixtures/inbox-notif-fixtures/employment.fixture.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "source": { - "source-orcid": { - "uri": "https://qa.orcid.org/0000-0002-5078-7150", - "path": "0000-0002-5078-7150", - "host": "qa.orcid.org" - }, - "source-client-id": null, - "source-name": { - "value": "inbox_notif" - }, - "assertion-origin-orcid": null, - "assertion-origin-client-id": null, - "assertion-origin-name": null - }, - "department-name": null, - "role-title": "Awesome Astronaut", - "start-date": { - "year": { - "value": "2023" - }, - "month": { - "value": "01" - }, - "day": { - "value": "01" - } - }, - "end-date": null, - "organization": { - "name": "NASA Headquarters", - "address": { - "city": "DC", - "region": "DC", - "country": "US" - }, - "disambiguated-organization": { - "disambiguated-organization-identifier": "http://dx.doi.org/10.13039/100017437", - "disambiguation-source": "FUNDREF" - } - }, - "url": null, - "external-ids": null, - "display-index": "1", - "visibility": "public" -} diff --git a/cypress/fixtures/inbox-notif-fixtures/funding-inbox-notif.fixture.json b/cypress/fixtures/inbox-notif-fixtures/funding-inbox-notif.fixture.json deleted file mode 100644 index e7fedc6425..0000000000 --- a/cypress/fixtures/inbox-notif-fixtures/funding-inbox-notif.fixture.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "type": "award", - "organization-defined-type": "Funding sub-type", - "title": { - "title": "Funding added via API", - "translated-title": { - "language-code": "en", - "value": "Translated title" - } - }, - "short-description": "Short description of the award", - "amount": { - "currency-code": "ADP", - "value": "1000" - }, - "url": "https://alt-url.org", - "start-date": { - "year": 2022, - "month": 2, - "day": 2 - }, - "end-date": { - "year": 2023, - "month": 2, - "day": 2 - }, - "external-ids": { - "external-id": { - "external-id-type": "grant_number", - "external-id-value": "000aaa", - "external-id-url": "http://tempuri.org/12345", - "external-id-relationship": "self" - } - }, - "organization": { - "name": "Wellcome Trust", - "address": { - "city": "London", - "country": "GB" - }, - "disambiguated-organization": { - "disambiguated-organization-identifier": "http://dx.doi.org/10.13039/100000001", - "disambiguation-source": "FUNDREF" - } - } -} diff --git a/cypress/fixtures/inbox-notif-fixtures/peer-review-inbox-notif.fixture.json b/cypress/fixtures/inbox-notif-fixtures/peer-review-inbox-notif.fixture.json deleted file mode 100644 index 3162f916e4..0000000000 --- a/cypress/fixtures/inbox-notif-fixtures/peer-review-inbox-notif.fixture.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "reviewer-role": "reviewer", - "review-identifiers": { - "external-id": { - "external-id-type": "source-work-id", - "external-id-value": 1234, - "external-id-url": "https://localsystem.org/1234", - "external-id-relationship": "self" - } - }, - "review-type": "review", - "review-completion-date": { - "year": 2012 - }, - "review-group-id": "issn:1741-4857", - "convening-organization": { - "name": "ORCID", - "address": { - "city": "Bethesda", - "region": "MD", - "country": "US" - }, - "disambiguated-organization": { - "disambiguated-organization-identifier": 385488, - "disambiguation-source": "RINGGOLD" - } - } -} diff --git a/cypress/fixtures/inbox-notif-fixtures/research-inbox-notif.fixture.json b/cypress/fixtures/inbox-notif-fixtures/research-inbox-notif.fixture.json deleted file mode 100644 index ad7a87923a..0000000000 --- a/cypress/fixtures/inbox-notif-fixtures/research-inbox-notif.fixture.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "proposal": { - "title": { - "title": { - "value": "Giant Laser Award" - }, - "translated-title": { - "value": "Giant Laser Award", - "language-code": "ab" - } - }, - "hosts": { - "organization": [ - { - "name": "ORCID", - "address": { - "city": "Bethesda", - "region": "Maryland", - "country": "US" - }, - "disambiguated-organization": { - "disambiguated-organization-identifier": "grid.455335.1", - "disambiguation-source": "GRID" - } - } - ] - }, - "external-ids": { - "external-id": [ - { - "external-id-type": "source-work-id", - "external-id-value": "123456", - "external-id-normalized": { - "value": "123456", - "transient": true - }, - "external-id-relationship": "part-of" - } - ] - }, - "start-date": { - "year": { - "value": "1999" - }, - "month": { - "value": "01" - }, - "day": { - "value": "28" - } - }, - "end-date": { - "year": { - "value": "1999" - }, - "month": { - "value": "01" - }, - "day": { - "value": "28" - } - }, - "url": { - "value": "https://orcid.org" - } - }, - "resource-item": [ - { - "resource-name": "Giant Laser 1", - "resource-type": "infrastructures", - "hosts": { - "organization": [ - { - "name": "Lasers-R-US", - "address": { - "city": "Bethesda", - "region": "Maryland", - "country": "US" - }, - "disambiguated-organization": { - "disambiguated-organization-identifier": "grid.455335.1", - "disambiguation-source": "GRID" - } - } - ] - }, - "external-ids": { - "external-id": [ - { - "external-id-type": "rrid", - "external-id-value": "rrid:giantLASER", - "external-id-relationship": "part-of" - } - ] - }, - "url": { - "value": "https://example.com" - } - } - ], - "visibility": "limited" -} diff --git a/cypress/fixtures/inbox-notif-fixtures/work-inbox-notif.fixture.json b/cypress/fixtures/inbox-notif-fixtures/work-inbox-notif.fixture.json deleted file mode 100644 index ad82f398a3..0000000000 --- a/cypress/fixtures/inbox-notif-fixtures/work-inbox-notif.fixture.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "title": { - "title": { - "value": "Work added via API" - }, - "subtitle": null, - "translated-title": null - }, - "journal-title": { - "value": "journal # 1" - }, - "short-description": null, - "type": "book", - "external-ids": { - "external-id": { - "external-id-type": "doi", - "external-id-value": "10.1087/20120404", - "external-id-url": { - "value": "https://doi.org/doi:10.1087/20120404" - }, - "external-id-relationship": "self" - } - } -} diff --git a/cypress/fixtures/inboxNotif-users.fixture-sample.json b/cypress/fixtures/inboxNotif-users.fixture-sample.json deleted file mode 100644 index c4e8164d4f..0000000000 --- a/cypress/fixtures/inboxNotif-users.fixture-sample.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "cyUserMemmerAPI": { - "clientID": "APP-***********", - "clientSecret": "********-****-****-****-************", - "orcidMember": "0000-****-****-****", - "bearer": "********-****-****-****-************" - }, - "cyNotifPerm": { - "oid": "0000-****-****-****", - "password": "********", - "clientBearer": "********-****-****-****-************", - "curlPermissionNotifPath": "@cypress/fixtures/permission_notification.fixture.json", - "curlEmploymentPath": "@cypress/fixtures/inbox-notif-fixtures/employment.fixture.json", - "curlEmploymentUpdatePath": "@cypress/fixtures/inbox-notif-fixtures/put-employment.fixture.json", - "contentToBeReplaced": "Awesome", - "replaceWith": "AMAZING", - "putWriteFilePath": "cypress/fixtures/inbox-notif-fixtures/put-employment.fixture.json", - "curlWorkPath": "@cypress/fixtures/inbox-notif-fixtures/work-inbox-notif.fixture.json", - "curlWorkUpdatePath": "@cypress/fixtures/inbox-notif-fixtures/put-work.fixture.json", - "workToBeReplaced": "Work added via API", - "workReplaceWith": "Work updated via API", - "work_putWriteFilePath": "cypress/fixtures/inbox-notif-fixtures/put-work.fixture.json", - "curlFundingPath": "@cypress/fixtures/inbox-notif-fixtures/funding-inbox-notif.fixture.json", - "curlFundingUpdatePath": "@cypress/fixtures/inbox-notif-fixtures/put-funding.fixture.json", - "fundingToBeReplaced": "2022", - "fundingReplaceWith": "2000", - "funding_putWriteFilePath": "cypress/fixtures/inbox-notif-fixtures/put-funding.fixture.json", - "curlResearchPath": "@cypress/fixtures/inbox-notif-fixtures/research-inbox-notif.fixture.json", - "curlResearchUpdatePath": "@cypress/fixtures/inbox-notif-fixtures/put-research.fixture.json", - "researchToBeReplaced": "Award", - "researchReplaceWith": "PRIZE", - "research_putWriteFilePath": "cypress/fixtures/inbox-notif-fixtures/put-research.fixture.json" - } -} diff --git a/cypress/fixtures/negative-testing-data.fixture.json b/cypress/fixtures/negative-testing-data.fixture.json deleted file mode 100644 index 80e83fc1cd..0000000000 --- a/cypress/fixtures/negative-testing-data.fixture.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "sidebarWebsitesURL": { - "titleURL": "cy testing website", - "chineseTitle": "鏈接標題", - "russianTitle": "название ссылки", - "arabicTitle": "عنوان الارتباط", - "duplicateURL": "http://www.orcid.org", - "duplicateTitle": "trying to add same url", - "duplicateAllCapsURL": "HTTP://WWW.ORCID.ORG", - "mixedCaseURL": "http://www.ORCid.org", - "noProtocolURL": "www.orcid.org", - "appendixedProtocolURL": "http://www.orcid.org", - "internationalURL1": "http://Bücher.de", - "internationalURL2": "http://스타벅스코리아.com", - "internationalURL3": "스타벅스코리아.com", - "internationalURL4": "http://faß.de", - "maxSizeURL": "https://www.site.com/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/page/pag" - }, - "errorMessages": { - "displayLanguageSpanish": " Español ", - "displayLanguageEnglish": " English ", - "requiredURL": "An URL is required", - "requiredURLSpanish": "Se requiere una URL", - "invalidURL": "Invalid URL", - "duplicatedURL": "URL can not be duplicated" - } -} diff --git a/cypress/fixtures/peer-review.fixture.json b/cypress/fixtures/peer-review.fixture.json deleted file mode 100644 index 3162f916e4..0000000000 --- a/cypress/fixtures/peer-review.fixture.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "reviewer-role": "reviewer", - "review-identifiers": { - "external-id": { - "external-id-type": "source-work-id", - "external-id-value": 1234, - "external-id-url": "https://localsystem.org/1234", - "external-id-relationship": "self" - } - }, - "review-type": "review", - "review-completion-date": { - "year": 2012 - }, - "review-group-id": "issn:1741-4857", - "convening-organization": { - "name": "ORCID", - "address": { - "city": "Bethesda", - "region": "MD", - "country": "US" - }, - "disambiguated-organization": { - "disambiguated-organization-identifier": 385488, - "disambiguation-source": "RINGGOLD" - } - } -} diff --git a/cypress/fixtures/permission_notification.fixture.json b/cypress/fixtures/permission_notification.fixture.json deleted file mode 100644 index 7257d8ccc1..0000000000 --- a/cypress/fixtures/permission_notification.fixture.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "notification-type": "permission", - "authorization-url": { - "uri": "https://localhost:8443/orcid-web/oauth/authorize?client_id=APP-9999999999999901&response_type=code&scope=/activities/update&redirect_uri=https://localhost:8443/orcid-web/oauth/playground", - "path": "/oauth/authorize?client_id=APP-9999999999999901&response_type=code&scope=/activities/update&redirect_uri=https://localhost:8443/orcid-web/oauth/playground", - "host": "orcid.org" - }, - "notification-subject": "Testing Permissions Notifications", - "notification-intro": "This is the intro from json/xml file", - "items": { - "item": [ - { - "item-type": "work", - "item-name": "A Really Interesting Research Article", - "external-id": { - "external-id-type": "doi", - "external-id-value": "http://10.5555/12345ABCDE", - "external-id-relationship": "self" - } - }, - { - "item-type": "employment", - "item-name": "Head of Research at NanoBiologica" - } - ] - } -} diff --git a/cypress/fixtures/researcher_url.json b/cypress/fixtures/researcher_url.json deleted file mode 100644 index c6cfd92259..0000000000 --- a/cypress/fixtures/researcher_url.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "url-name": "added via API", - "url": { - "value": "http://www.orcid.org" - }, - "visibility": "limited" -} diff --git a/cypress/fixtures/testing-users.fixture-sample.json b/cypress/fixtures/testing-users.fixture-sample.json deleted file mode 100644 index 9fbaeb2d0b..0000000000 --- a/cypress/fixtures/testing-users.fixture-sample.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "cyUserPrimaryEmailNotVerified": { - "username": "userNotVerified", - "email": "******@orcid.org", - "password": "**********", - "oid": "****-****-****-****" - }, - "cyUserPrimaryEmaiVerified": { - "name": "userPrimaryEmailVerified", - "email": "******@orcid.org", - "password": "**********", - "oid": "****-****-****-****" - }, - "cyUserMemmerAPI": { - "clientID": "APP-********", - "clientSecret": "*******-****-****-****-********", - "orcidMember": "****-****-****-****", - "bearer": "*******-****-****-****-********", - "curlPostWebsitePath": "@/Users/...../cypress/fixtures/researcher_url.json" - } -} diff --git a/cypress/fixtures/work-visibility-different-clients.fixture.json b/cypress/fixtures/work-visibility-different-clients.fixture.json deleted file mode 100644 index a0f03442bd..0000000000 --- a/cypress/fixtures/work-visibility-different-clients.fixture.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "title": { - "title": { - "value": "Work added via API" - }, - "subtitle": null, - "translated-title": null - }, - "journal-title": { - "value": "journal # 1" - }, - "short-description": null, - "type": "journal-article", - "external-ids": { - "external-id": { - "external-id-type": "doi", - "external-id-value": "10.7135/UPO9781843317593.004", - "external-id-url": { - "value": "https://doi.org/10.7135/UPO9781843317593.004" - }, - "external-id-relationship": "self" - } - } -} diff --git a/cypress/fixtures/work-visibility.fixture.json b/cypress/fixtures/work-visibility.fixture.json deleted file mode 100644 index ad82f398a3..0000000000 --- a/cypress/fixtures/work-visibility.fixture.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "title": { - "title": { - "value": "Work added via API" - }, - "subtitle": null, - "translated-title": null - }, - "journal-title": { - "value": "journal # 1" - }, - "short-description": null, - "type": "book", - "external-ids": { - "external-id": { - "external-id-type": "doi", - "external-id-value": "10.1087/20120404", - "external-id-url": { - "value": "https://doi.org/doi:10.1087/20120404" - }, - "external-id-relationship": "self" - } - } -} diff --git a/cypress/fixtures/work-with-contributors.fixture-sample.json b/cypress/fixtures/work-with-contributors.fixture-sample.json deleted file mode 100644 index 509fcd8020..0000000000 --- a/cypress/fixtures/work-with-contributors.fixture-sample.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "title": { - "title": { - "value": "Work added via API" - }, - "subtitle": null, - "translated-title": null - }, - "journal-title": { - "value": "my journal title" - }, - "short-description": null, - "type": "journal-article", - "external-ids": { - "external-id": [ - { - "external-id-type": "doi", - "external-id-value": "value", - "external-id-url": { - "value": "http://dx.doi.org/value" - }, - "external-id-relationship": "self" - } - ] - }, - "contributors": { - "contributor": [ - { - "credit-name": "name", - "contributor-email": "name@email.com", - "contributor-attributes": { - "contributor-role": "http://credit.niso.org/contributor-roles/conceptualization/" - } - }, - { - "contributor-orcid": { - "uri": "https://host/####-####-####-####", - "path": "####-####-####-####", - "host": "host" - }, - "credit-name": "name", - "contributor-email": "name@email.com", - "contributor-attributes": { - "contributor-role": "http://credit.niso.org/contributor-roles/data-curation/" - } - } - ] - } -} diff --git a/cypress/global.d.ts b/cypress/global.d.ts deleted file mode 100644 index bc3a99e703..0000000000 --- a/cypress/global.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare module 'cypress-otp' -declare module 'gmail-tester-extended' diff --git a/cypress/helpers/date.js b/cypress/helpers/date.js deleted file mode 100644 index dd0fe69fe0..0000000000 --- a/cypress/helpers/date.js +++ /dev/null @@ -1,18 +0,0 @@ -// Get current central time hyphen separated date -module.exports = function () { - var date = new Date() - return date - .toLocaleDateString('en-US', { - day: '2-digit', - month: 'short', - year: 'numeric', - hour: '2-digit', - minute: '2-digit', - timeZoneName: 'short', - timeZone: 'America/Chicago', // Central time as Orcid servers - }) - .replace(/[,]/g, '') - .replace(/[:]/g, '-') - .split(' ') - .join('-') -} diff --git a/cypress/helpers/oauthUrlBuilder.js b/cypress/helpers/oauthUrlBuilder.js deleted file mode 100644 index 9b75d76ab7..0000000000 --- a/cypress/helpers/oauthUrlBuilder.js +++ /dev/null @@ -1,15 +0,0 @@ -module.exports = function (parameters) { - return '?' + objectToUrlParameters(parameters) -} - -// TODO this is been duplicated from the constant file on orcid.angular -// once cypress is migrated to TS thi can be removed -function objectToUrlParameters(object) { - return Object.keys(object) - .map((key) => - object[key] !== undefined - ? `${key}=${encodeURIComponent(object[key])}` - : null - ) - .join('&') -} diff --git a/cypress/helpers/randomUser.js b/cypress/helpers/randomUser.js deleted file mode 100644 index e8359a67a7..0000000000 --- a/cypress/helpers/randomUser.js +++ /dev/null @@ -1,23 +0,0 @@ -const date = require('../helpers/date') - -module.exports = function () { - var uniqueString = userID() - return { - email: 'qa' + '+cy_' + date() + '_' + uniqueString + '@orcid.org', - password: '12345678Aa', - name: 'cy_' + date() + '_' + uniqueString + '_name', - familyName: 'cy_' + date() + '_' + uniqueString + '_family', - id: undefined, - } -} - -function userID() { - var text = '' - var possible = - 'abcdefghijklmnopqrstuvwxyz123456789ñáéíóú-北查爾斯頓工廠的安全漏洞已經引起了航空公司和監管機構的密切關注' - - for (var i = 0; i < 2; i++) - text += possible.charAt(Math.floor(Math.random() * possible.length)) - - return text -} diff --git a/cypress/helpers/runInfo.js b/cypress/helpers/runInfo.js deleted file mode 100644 index 84b36cfffe..0000000000 --- a/cypress/helpers/runInfo.js +++ /dev/null @@ -1,6 +0,0 @@ -import { environment } from '../cypress.env' -const date = require('../helpers/date') - -module.exports = function () { - return ` on "${environment.baseUrl.replace('https://', '')}" at ${date()}` -} diff --git a/cypress/helpers/uniqueEntry.js b/cypress/helpers/uniqueEntry.js deleted file mode 100644 index 16d19ab5c4..0000000000 --- a/cypress/helpers/uniqueEntry.js +++ /dev/null @@ -1,6 +0,0 @@ -// Generate a unique substring/identifier to append to a given entry -module.exports = function () { - const uuid = () => Cypress._.random(0, 1e6) - const entryId = uuid() - return entryId -} diff --git a/cypress/helpers/urlMatch.js b/cypress/helpers/urlMatch.js deleted file mode 100644 index 9e6bf1059d..0000000000 --- a/cypress/helpers/urlMatch.js +++ /dev/null @@ -1,46 +0,0 @@ -/// - -module.exports = (expected) => { - return Cypress.sinon.match((value) => { - if (typeof expected === 'object') { - const urlParams1 = urlToParams(value) - const Path1 = value.split('?')[0] - const matcher = Cypress.sinon.match(expected.urlParameters) - const sameAmountOfKeys = - Object.keys(expected.urlParameters).length === - Object.keys(urlParams1).length - - return ( - matcher.test(urlParams1) && Path1 === expected.url && sameAmountOfKeys - ) - } else if (value && expected && value.indexOf('?') >= 0) { - const Path1 = value.split('?')[0] - const Path2 = expected.split('?')[0] - const urlParams1 = urlToParams(value) - const urlParams2 = urlToParams(expected) - const matcher = Cypress.sinon.match(urlParams2) - const sameAmountOfKeys = - Object.keys(urlParams1).length === Object.keys(urlParams2).length - - return matcher.test(urlParams1) && Path1 === Path2 && sameAmountOfKeys - } else if (value && expected) { - return expected === value - } else { - return false - } - }, JSON.stringify(expected)) -} - -function urlToParams(url) { - let urlParams = {} - let searchParams = new URLSearchParams(url.split('?')[1]) - searchParams.forEach((x, y) => (urlParams[y] = x)) - if (urlParams.scope) { - urlParams.scope = urlParams.scope.split(' ').sort() - } - return urlParams -} - -function matchObject(expected) { - return Cypress.sinon.match((value) => {}) -} diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js deleted file mode 100644 index e01ceb5a49..0000000000 --- a/cypress/plugins/index.js +++ /dev/null @@ -1,62 +0,0 @@ -// *********************************************************** -// This example plugins/index.js can be used to load plugins -// -// You can change the location of this file or turn off loading -// the plugins file with the 'pluginsFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/plugins-guide -// *********************************************************** - -// This function is called when a project is opened or re-opened (e.g. due to -// the project's config changing) - -/// -const debug = require('debug') -const path = require('path') -const gmail_tester = require('gmail-tester-extended') //node_modules library -const tokenFileName = 'token_qa.json' //token file is inside plugins/ directory -const credentialsFileName = 'credentials_qa.json' //credentials is inside plugins/ directory - -module.exports = (on, config) => { - require('cypress-mochawesome-reporter/plugin')(on) - - on('before:browser:launch', (browser, launchOptions) => { - if (browser.name === 'chrome' && browser.isHeadless) { - launchOptions.args.push('--disable-gpu') - return launchOptions - } - }) - - on('task', { - readAllMessages: async (args) => { - const messages = await gmail_tester.get_messages( - path.resolve(__dirname, credentialsFileName), - path.resolve(__dirname, tokenFileName), - args.options - ) - return messages //this task returns an array of emails - }, - }) - - on('task', { - checkInbox_from_to_subject: async (args) => { - const { from, to, subject } = args.options - const email = await gmail_tester.check_inbox( - path.resolve(__dirname, credentialsFileName), - path.resolve(__dirname, tokenFileName), - subject, - from, - to, - 15, // Poll interval (in seconds) - 60, // Maximum poll interval (in seconds). If reached, return null, indicating the completion of the task(). - args.options - ) - return email //this task returns one email (JSON object) - }, - }) - - on('task', { - generateOTP: require('cypress-otp'), - }) -} diff --git a/cypress/readme.md b/cypress/readme.md deleted file mode 100644 index c32f860ad5..0000000000 --- a/cypress/readme.md +++ /dev/null @@ -1,33 +0,0 @@ -# How to run - -Before the following steps make sure to have `npm` and `yarn` installed - -1- Create your own `cypress/cypress.env.js` file based on the `cypress/cypress.env.sample.js` file. - -2- Run the following command - -``` -yarn -yarn run cypress:open -``` - -**Note:** To run this on QA the same parameters of the sample file should just work, and to run this on a local environment you will need to provide your own parameters. - -# Test data - -Use `testing-users.fixture-sample.json` to create at least two types of users, one with Primary Email verified (set visibility PRIVATE) and another one with no primary email verified. - -# Gmail API library requirements - -In order to run gmail library tasks from plugins/index.js a credentials.json file needs to be generated in the API platform and then use this credentials file to generate a token.json to be able to access the gmail account where the notification emails will be sent. -Follow instructions at [gmail-tester-extended] (https://www.npmjs.com/package/gmail-tester-extended) - -# How to generate a sharable HTML report - -Run the following command and you will find the generated .html reports on the `cypress/reports` folder - -``` -yarn cypress -``` - -You can use a chrome extension like [GoFullPage](https://chrome.google.com/webstore/detail/gofullpage-full-page-scre/fdpohaocaechififmbbbbbknoalclacl) to easily share a single screen shot of all the tests results. diff --git a/cypress/support/clean.commands.js b/cypress/support/clean.commands.js deleted file mode 100644 index af41a979c0..0000000000 --- a/cypress/support/clean.commands.js +++ /dev/null @@ -1,171 +0,0 @@ -Cypress.Commands.add('cleanBiography', () => { - cy.getCookie('XSRF-TOKEN').then((cookie) => { - cy.request({ - method: 'POST', - url: '/account/biographyForm.json', // baseUrl is prepended to url - body: { - errors: [], - biography: { - errors: [], - getRequiredMessage: null, - required: true, - value: '', - }, - visibility: { - errors: [], - required: true, - getRequiredMessage: null, - visibility: 'LIMITED', - }, - }, - headers: { - 'X-XSRF-TOKEN': cookie.value, - }, - }) - }) -}) - -Cypress.Commands.add('cleanCountries', () => { - cy.getCookie('XSRF-TOKEN').then((cookie) => { - cy.request({ - method: 'POST', - url: '/account/countryForm.json', // baseUrl is prepended to url - body: { - errors: [], - addresses: [], - visibility: { - errors: [], - required: true, - getRequiredMessage: null, - visibility: 'LIMITED', - }, - }, - headers: { - 'X-XSRF-TOKEN': cookie.value, - }, - }) - }) -}) - -Cypress.Commands.add('cleanBiography', () => { - cy.getCookie('XSRF-TOKEN').then((cookie) => { - cy.request({ - method: 'POST', - url: '/account/nameForm.json', // baseUrl is prepended to url - body: { - errors: [], - givenNames: { - errors: [], - getRequiredMessage: null, - required: true, - value: '', - }, - familyName: { - errors: [], - getRequiredMessage: null, - required: true, - value: '', - }, - creditName: { - errors: [], - getRequiredMessage: null, - required: true, - value: '', - }, - visibility: { - errors: [], - required: true, - getRequiredMessage: null, - visibility: 'LIMITED', - }, - }, - headers: { - 'X-XSRF-TOKEN': cookie.value, - }, - }) - }) -}) - -/** - * Clean all emails except the primary email - * @returns {any} - */ -Cypress.Commands.add('cleanEmails', () => { - cy.getCookie('XSRF-TOKEN').then((cookie) => { - cy.request({ - method: 'POST', - url: '/account/emails.json', // baseUrl is prepended to url - body: { - emails: [], - errors: [], - }, - headers: { - 'X-XSRF-TOKEN': cookie.value, - }, - }) - }) -}) - -/** - * Clean all keywords - * @returns {any} - */ -Cypress.Commands.add('cleanKeywords', () => { - cy.getCookie('XSRF-TOKEN').then((cookie) => { - cy.request({ - method: 'POST', - url: '/my-orcid/keywordsForms.json', // baseUrl is prepended to url - body: { - errors: [], - keywords: [], - visibility: { - errors: [], - required: true, - getRequiredMessage: null, - visibility: 'LIMITED', - }, - }, - headers: { - 'X-XSRF-TOKEN': cookie.value, - }, - }) - }) -}) - -Cypress.Commands.add('cleanWebsites', () => { - cy.getCookie('XSRF-TOKEN').then((cookie) => { - cy.request({ - method: 'POST', - url: '/my-orcid/websitesForms.json', // baseUrl is prepended to url - body: { - errors: [], - websites: [], - visibility: { - errors: [], - required: true, - getRequiredMessage: null, - visibility: 'LIMITED', - }, - }, - headers: { - 'X-XSRF-TOKEN': cookie.value, - }, - }) - }) -}) - -Cypress.Commands.add('cleanPersonalIdentifiers', () => { - cy.getCookie('XSRF-TOKEN').then((cookie) => { - cy.request({ - method: 'POST', - url: '/my-orcid/externalIdentifiers.json', // baseUrl is prepended to url - body: { - errors: [], - externalIdentifiers: [], - }, - headers: { - 'X-XSRF-TOKEN': cookie.value, - }, - }) - }) -}) diff --git a/cypress/support/create.commands.js b/cypress/support/create.commands.js deleted file mode 100644 index 41f554e1e6..0000000000 --- a/cypress/support/create.commands.js +++ /dev/null @@ -1,161 +0,0 @@ -Cypress.Commands.add('createFunding', () => { - cy.getCookie('XSRF-TOKEN').then((cookie) => { - cy.request({ - method: 'POST', - url: 'fundings/funding.json', // baseUrl is prepended to url - body: { - visibility: { - errors: [], - required: true, - getRequiredMessage: null, - visibility: 'LIMITED', - }, - errors: [], - fundingTitle: { - errors: [], - title: { - errors: [], - value: 'Funding title', - required: true, - getRequiredMessage: null, - }, - translatedTitle: { - errors: [], - content: 'Translated title', - languageCode: 'es', - languageName: '', - required: false, - getRequiredMessage: null, - }, - }, - description: { - errors: [], - value: 'This is the description', - required: true, - getRequiredMessage: null, - }, - fundingName: { - errors: [], - value: 'Org name', - required: true, - getRequiredMessage: null, - }, - fundingType: { - errors: [], - value: 'award', - required: true, - getRequiredMessage: null, - }, - organizationDefinedFundingSubType: { - subtype: { - errors: [], - value: 'Funding subtype', - required: true, - getRequiredMessage: null, - }, - alreadyIndexed: false, - }, - currencyCode: { - errors: [], - value: 'CRC', - required: true, - getRequiredMessage: null, - }, - amount: { - errors: [], - value: '1000000', - required: true, - getRequiredMessage: null, - }, - url: { - errors: [], - value: 'http://qa.orcid.org', - required: true, - getRequiredMessage: null, - }, - startDate: { - errors: [], - month: '01', - day: '', - year: '2000', - required: true, - getRequiredMessage: null, - }, - endDate: { - errors: [], - month: '12', - day: '', - year: '2031', - required: true, - getRequiredMessage: null, - }, - contributors: null, - externalIdentifiers: [ - { - errors: [], - externalIdentifierId: { - errors: [], - value: '1234567890', - required: true, - getRequiredMessage: null, - }, - externalIdentifierType: { - errors: [], - value: 'Grant number', - required: true, - getRequiredMessage: null, - }, - url: { - errors: [], - value: 'http://google.com/granturl', - required: true, - getRequiredMessage: null, - }, - relationship: { - errors: [], - value: 'self', - required: true, - getRequiredMessage: null, - }, - normalized: null, - normalizedUrl: null, - }, - ], - putCode: null, - sourceName: '', - source: null, - assertionOriginOrcid: '', - assertionOriginClientId: '', - assertionOriginName: '', - disambiguatedFundingSourceId: null, - disambiguationSource: null, - city: { - errors: [], - value: 'San Jose', - required: true, - getRequiredMessage: null, - }, - region: { - errors: [], - value: 'Guadalupe', - required: true, - getRequiredMessage: null, - }, - country: { - errors: [], - value: 'CR', - required: true, - getRequiredMessage: null, - }, - countryForDisplay: null, - fundingTypeForDisplay: null, - dateSortString: null, - createdDate: null, - lastModified: null, - }, - headers: { - 'X-XSRF-TOKEN': cookie.value, - }, - }) - }) -}) diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js deleted file mode 100644 index 456e65135f..0000000000 --- a/cypress/support/e2e.js +++ /dev/null @@ -1,10 +0,0 @@ -// import 'cypress-axe' //TODO: Angular 14 aupdate need me to remove this old axe lib for now -import './google-analytics.commands' -import './platform.commands' -import './oauth.commands' -import './register.commands' -import './signin.commands' -import './clean.commands' -import './create.commands' -import 'cypress-mochawesome-reporter/register' -import 'cypress-file-upload' diff --git a/cypress/support/google-analytics.commands.js b/cypress/support/google-analytics.commands.js deleted file mode 100644 index 860acff481..0000000000 --- a/cypress/support/google-analytics.commands.js +++ /dev/null @@ -1,111 +0,0 @@ -import { environment } from '../cypress.env' -import urlMatch from '../helpers/urlMatch' - -// A mach that filters out all the non-api calls that gtag does to the datalayer array -var isNotAnInternalGtagCall = Cypress.sinon.match(function (value) { - return !!value & !!value[0] && value[1] !== 'optimize.callback' -}, 'isNotAnInternalGtagCall') - -Cypress.on('window:before:load', (win) => { - // Stub datalayer push function - win.dataLayer = win.dataLayer || [] - cy.stub(win.dataLayer, 'push') - .withArgs(isNotAnInternalGtagCall) - .callsFake((args) => { - console.debug(args) - }) - .as('ga') -}) - -Cypress.Commands.add('expectGtagInitialization', (url) => { - cy.get('@ga') - // First two calls done from index.html Gtag script initialization - // with send_page_view disable as describe on https://developers.google.com/analytics/devguides/collection/gtagjs - .should('be.calledWith', { 0: 'js', 1: Cypress.sinon.match.date }) - .and( - 'be.calledWith', - Cypress.sinon.match({ - 0: 'config', - 1: Cypress.sinon.match('UA-'), - 2: { - anonymize_ip: true, - cookie_flags: 'SameSite=None;Secure', - sample_rate: 100, - send_page_view: false, - }, - }) - ) - // Measure loading time - .and( - 'be.calledWith', - Cypress.sinon.match({ - 0: 'event', - 1: 'timing_complete', - 2: Cypress.sinon.match({ - page_location: urlMatch(url), - }), - }) - ) - // Register page view as describe on https://developers.google.com/analytics/devguides/collection/gtagjs/single-page-applications#measure_virtual_pageviews - .and( - 'be.calledWith', - Cypress.sinon.match({ - 0: 'config', - 1: Cypress.sinon.match('UA-'), - 2: Cypress.sinon.match({ - page_path: urlMatch(url), - page_location: urlMatch(environment.baseUrl + url), - sample_rate: Cypress.sinon.match.string, - }), - }) - ) -}) - -Cypress.Commands.add('expectGtagNavigation', (url) => { - return ( - cy - .get('@ga') - // Measure loading time - .should( - 'be.calledWith', - Cypress.sinon.match({ - 0: 'event', - 1: 'timing_complete', - 2: Cypress.sinon.match({ - page_location: urlMatch(url), - }), - }) - ) - // Register page view as describe on https://developers.google.com/analytics/devguides/collection/gtagjs/single-page-applications#measure_virtual_pageviews - .and( - 'be.calledWith', - Cypress.sinon.match({ - 0: 'config', - 1: Cypress.sinon.match('UA-'), - 2: Cypress.sinon.match({ - page_location: urlMatch(environment.baseUrl + url), - page_path: urlMatch(url), - }), - }) - ) - ) -}) - -Cypress.Commands.add('expectGtagRegrow', (event) => { - return ( - cy - .get('@ga') - // Measure loading time - .should( - 'be.calledWith', - Cypress.sinon.match({ - 0: 'event', - 1: event.action, - 2: Cypress.sinon.match({ - event_category: 'RegGrowth', - event_label: `OAuth ${event.clientName} - ${event.memberName}`, - }), - }) - ) - ) -}) diff --git a/cypress/support/oauth.commands.js b/cypress/support/oauth.commands.js deleted file mode 100644 index 6e31ca3382..0000000000 --- a/cypress/support/oauth.commands.js +++ /dev/null @@ -1,15 +0,0 @@ -Cypress.Commands.add('expectAuthorizeScreen', (authorize) => { - return cy - .get('app-form-authorize') - .get('#user-name') - .contains(authorize.displayName) - .get('#app-name') - .contains(authorize.appName) - .then(() => { - authorize.scopes.forEach((scope) => { - cy.get('li#openid') - }) - }) - .get('li') - .should('have.length', authorize.scopes.length) -}) diff --git a/cypress/support/platform.commands.js b/cypress/support/platform.commands.js deleted file mode 100644 index bbb285f636..0000000000 --- a/cypress/support/platform.commands.js +++ /dev/null @@ -1,19 +0,0 @@ -Cypress.Commands.add('hasNoLayout', () => { - return cy - .get('app-header', { timeout: 1 }) - .should('not.exist') - .get('app-footer', { timeout: 1 }) - .should('not.exist') -}) - -Cypress.Commands.add('hasLayout', () => { - return cy.get('app-header').get('app-footer') -}) - -Cypress.Commands.add('hasZendesk', () => { - cy.get('#launcher') -}) - -Cypress.Commands.add('hasNoZendesk', () => { - return cy.get('#launcher', { timeout: 1 }).should('not.be.visible') -}) diff --git a/cypress/support/register.commands.js b/cypress/support/register.commands.js deleted file mode 100644 index b937977914..0000000000 --- a/cypress/support/register.commands.js +++ /dev/null @@ -1,108 +0,0 @@ -Cypress.Commands.add('expectPreFillRegister', (user) => { - return cy - .get('#given-names-input') - .then((x) => { - if (user.givenNames) { - expect(x).have.value(user.givenNames) - } else { - expect(x).to.be.empty - } - }) - .get('#family-names-input') - .then((x) => { - if (user.familyNames) { - expect(x).have.value(user.familyNames) - } else { - expect(x).to.be.empty - } - }) - .get('#email-input') - .then((x) => { - if (user.email) { - expect(x).have.value(user.email) - } else { - expect(x).to.be.empty - } - }) -}) - -Cypress.Commands.add('registerUser', (user) => { - return ( - cy - .server() - // Ignore serve duplicates check - .route('GET', '/dupicateResearcher**', []) - .location() - .should((loc) => { - expect(loc.pathname).to.eq('/register') - }) - .get('#given-names-input') - .clear() - .type(user.name) - .should('have.value', user.name) - .get('#family-names-input') - .clear() - .type(user.familyName) - .should('have.value', user.familyName) - .get('#email-input') - .clear() - .type(user.email) - .should('have.value', user.email) - .get('#confirm-email-input') - .clear() - .type(user.email) - .should('have.value', user.email) - .get('.ng-valid #step-a-next-button') - .click() - .get('#password-input') - .clear() - .type(user.password) - .should('have.value', user.password) - .get('#password-confirm-input') - .clear() - .type(user.password) - .should('have.value', user.password) - .get('.ng-valid #step-b-next') - .click() - .get('#visibility-everyone-input') - .click() - .should('have.class', 'mat-radio-checked') - .get('#privacy-input input') - .check({ force: true }) - .should('be.checked') - .get('#data-processed-input input') - .check({ force: true }) - .should('be.checked') - .acceptCaptcha() - .get('.ng-valid #step-c-register-button') - .click() - .get('#loading-bar') - .get('#bottom-loading-bar') - .get('app-register', { timeout: 100000 }) - .should('not.exist') - .location() - .should((loc) => { - expect(loc.pathname).to.not.eq('/register') - }) - ) -}) - -Cypress.Commands.add('acceptCaptcha', () => { - return cy - .getIframeBody('iframe') - .within(() => - cy - .get('.recaptcha-checkbox-border') - .dblclick() - .get('#recaptcha-anchor', { timeout: 10000 }) - .should('have.class', 'recaptcha-checkbox-checked') - ) -}) - -Cypress.Commands.add('getIframeBody', (target) => { - return cy - .get(target) - .its('0.contentDocument.body') - .should('not.be.empty') - .then(cy.wrap) -}) diff --git a/cypress/support/signin.commands.js b/cypress/support/signin.commands.js deleted file mode 100644 index 22b4670d76..0000000000 --- a/cypress/support/signin.commands.js +++ /dev/null @@ -1,110 +0,0 @@ -import { environment } from '../cypress.env' -import userData from '../fixtures/testing-users.fixture.json' - -Cypress.Commands.add('expectPreFillSignin', (user) => { - return cy.get('#username').then((x) => { - if (user.username) { - expect(x).have.value(user.username) - } else { - expect(x).to.be.empty - } - }) -}) - -Cypress.Commands.add('signin', (user) => - cy - .location() - .should((loc) => { - expect(loc.pathname).to.eq('/signin') - }) - .get('#username') - .clear() - .type(user.oid || user.email) - .get('#password') - .type(user.password) - .get('#signin-button') - .click() -) -//used for legacy scripts -Cypress.Commands.add('programmaticSignin', (user) => { - cy.getCookie('XSRF-TOKEN').then((csrfCookie) => { - if (!csrfCookie) { - return cy - .visit(environment.baseUrl) - .getCookie('XSRF-TOKEN') - .then(() => cy.programmaticSignin(user)) - } else { - const fd = new FormData() - const url = environment.baseUrl + '/signin/auth.json' - const request = new XMLHttpRequest() - request.open('POST', url, false) - request.setRequestHeader('X-XSRF-TOKEN', csrfCookie.value) - request.setRequestHeader( - 'Content-Type', - 'application/x-www-form-urlencoded;charset=UTF-8' - ) - request.send( - `userId=${encodeURIComponent( - environment[user].id || environment[user].email - )}&password=${environment[user].password}&oauthRequest=false` - ) - return cy - .wrap(JSON.parse(request.response)) - .its('success') - .should('be.true') - } - }) -}) - -//login via web api reading user from fixture file -Cypress.Commands.add('programmaticallySignin', (user) => { - cy.getCookie('XSRF-TOKEN').then((csrfCookie) => { - if (!csrfCookie) { - return cy - .visit(Cypress.config().baseUrl) - .getCookie('XSRF-TOKEN') - .then(() => cy.programmaticallySignin(user)) - } else { - const fd = new FormData() - const url = Cypress.config().baseUrl + '/signin/auth.json' - const request = new XMLHttpRequest() - request.open('POST', url, false) - request.setRequestHeader('X-XSRF-TOKEN', csrfCookie.value) - request.setRequestHeader( - 'Content-Type', - 'application/x-www-form-urlencoded;charset=UTF-8' - ) - request.send( - `userId=${encodeURIComponent( - userData[user].oid || userData[user].email - )}&password=${userData[user].password}&oauthRequest=false` - ) - return cy - .wrap(JSON.parse(request.response)) - .its('success') - .should('be.true') - } - }) -}) - -//login with admin user that has 2FA enabled, oid and passw from env variables -Cypress.Commands.add('signin2FA', (token2FA) => - cy - .location() - .should((loc) => { - expect(loc.pathname).to.eq('/signin') - }) - .get('#username') - .clear() - .type(Cypress.env('cy_admin_oid')) - .get('#password') - .type(Cypress.env('cy_admin_password')) - .get('#signin-button') - .click() - .wait(2000) - .get('[formcontrolname="verificationCode"]') - .clear() - .type(token2FA) - .get('#authenticateButton') - .click() -) diff --git a/package.json b/package.json index 4656000134..03697ceb1e 100644 --- a/package.json +++ b/package.json @@ -6,13 +6,13 @@ "start": "ng serve --configuration=local-qa --host 0.0.0.0", "start-sandbox": "ng serve --configuration=local-sandbox --host 0.0.0.0", "start:en": "ng serve --configuration=local-qa-en --disable-host-check", + "start:ar": "ng serve --configuration=local-qa-ar --disable-host-check", "start:fr": "ng serve --configuration=local-qa-fr --disable-host-check", "start:xx": "ng serve --configuration=local-qa-xx --disable-host-check", "test": "ng test", "test-headless": "ng test --watch=false --browsers=ChromeHeadless", "lint": "echo 'temporally disable Angular linter to until eslint update'", "e2e": "ng e2e", - "e2e:qa": "cypress open --config baseUrl=https://qa.orcid.org", "prebuild": "rimraf dist && yarn build:i18n && yarn build:browserslist", "build": "ng build --configuration production --localize", "postbuild": "ts-node -P scripts/tsconfig.json scripts/postbuild.ts --env production", @@ -32,14 +32,7 @@ "storybook": "ng run ng-orcid:storybook ", "build:storybook": "ng run ng-orcid:build-storybook", "lighthouse": "ts-node -P scripts/tsconfig.json scripts/lighthouse/main.ts", - "build:browserslist": "ts-node -P scripts/tsconfig.json scripts/browserlist.prebuild.ts", - "cypress:open": "cypress open", - "cypress": "yarn cypress:report:clean && yarn cypress:run && yarn cypress:report:merge && yarn cypress:report:html", - "cypress:report:clean": "rimraf cypress/reports/temp", - "cypress:run": "cypress run", - "cyp": "npx cypress open", - "merge-report": "mochawesome-merge cypress/reports/mocha/.json -o cypress/reports/report.json", - "generate-report": "merge cypress/reports/mochareports/report.json -f report -o cypress/reports/mocha" + "build:browserslist": "ts-node -P scripts/tsconfig.json scripts/browserlist.prebuild.ts" }, "private": true, "dependencies": { @@ -61,7 +54,6 @@ "browserslist": "^4.19.1", "browserslist-useragent-regexp": "^3.0.0", "core-js": "^3.6.5", - "cypress-file-upload": "^5.0.8", "del": "^6.0.0", "dotenv": "^16.0.3", "firebase": "^7.6.0", @@ -103,11 +95,6 @@ "@types/xml2js": "^0.4.4", "axe-core": "^4.0.2", "cross-env": "^5.2.1", - "cypress": "12.7.0", - "cypress-mochawesome-reporter": "^3.2.0", - "cypress-multi-reporters": "^1.6.2", - "cypress-otp": "^1.0.3", - "cypress-qase-reporter": "^1.4.2-alpha.2", "fs-extra": "^8.1.0", "git-repo-info": "^2.1.1", "glob": "^7.1.6", diff --git a/src/app/account-settings/components/settings-actions-deactivate/settings-actions-deactivate.component.html b/src/app/account-settings/components/settings-actions-deactivate/settings-actions-deactivate.component.html index 2867165429..b02f7b3ba7 100644 --- a/src/app/account-settings/components/settings-actions-deactivate/settings-actions-deactivate.component.html +++ b/src/app/account-settings/components/settings-actions-deactivate/settings-actions-deactivate.component.html @@ -49,7 +49,7 @@ Account settings > Remove duplicate record diff --git a/src/app/account-settings/components/settings-actions-deactivate/settings-actions-deactivate.component.ts b/src/app/account-settings/components/settings-actions-deactivate/settings-actions-deactivate.component.ts index 4a51a44662..9f9a1f8de3 100644 --- a/src/app/account-settings/components/settings-actions-deactivate/settings-actions-deactivate.component.ts +++ b/src/app/account-settings/components/settings-actions-deactivate/settings-actions-deactivate.component.ts @@ -5,6 +5,7 @@ import { OnInit, Output, } from '@angular/core' +import { ActivatedRoute, Router } from '@angular/router' import { Subject } from 'rxjs' import { takeUntil } from 'rxjs/operators' import { PlatformInfoService } from 'src/app/cdk/platform-info' @@ -30,7 +31,8 @@ export class SettingsActionsDeactivateComponent implements OnInit, OnDestroy { constructor( private _platform: PlatformInfoService, private _deactivate: AccountActionsDeactivateService, - private _togglz: TogglzService + private _togglz: TogglzService, + private activeRoute: ActivatedRoute ) {} ngOnInit(): void { diff --git a/src/app/account-settings/components/settings-actions/settings-actions.component.spec.ts b/src/app/account-settings/components/settings-actions/settings-actions.component.spec.ts index 833399f9d9..96f0e47621 100644 --- a/src/app/account-settings/components/settings-actions/settings-actions.component.spec.ts +++ b/src/app/account-settings/components/settings-actions/settings-actions.component.spec.ts @@ -2,6 +2,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing' import { SettingsActionsComponent } from './settings-actions.component' import { WINDOW_PROVIDERS } from 'src/app/cdk/window/window.service' +import { ActivatedRoute } from '@angular/router' +import { of } from 'rxjs' describe('SettingsActionsComponent', () => { let component: SettingsActionsComponent @@ -10,7 +12,10 @@ describe('SettingsActionsComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ declarations: [SettingsActionsComponent], - providers: [WINDOW_PROVIDERS], + providers: [ + WINDOW_PROVIDERS, + { provide: ActivatedRoute, useValue: { fragment: of({}) } }, + ], }).compileComponents() }) diff --git a/src/app/account-settings/components/settings-actions/settings-actions.component.ts b/src/app/account-settings/components/settings-actions/settings-actions.component.ts index d0a34ed2ff..fb4cdf51df 100644 --- a/src/app/account-settings/components/settings-actions/settings-actions.component.ts +++ b/src/app/account-settings/components/settings-actions/settings-actions.component.ts @@ -1,4 +1,6 @@ import { Component, Inject, OnInit } from '@angular/core' +import { ActivatedRoute } from '@angular/router' +import { set } from 'lodash' import { WINDOW } from 'src/app/cdk/window' @Component({ @@ -18,10 +20,30 @@ export class SettingsActionsComponent implements OnInit { settingDownloadLoading = false settingDuplicatedRecordLoading = false settingDeactivateLoading = false - constructor(@Inject(WINDOW) private _window: Window) {} + constructor( + @Inject(WINDOW) private _window: Window, + private activeRoute: ActivatedRoute + ) {} ngOnInit(): void { const hash = this._window.location.hash.substr(1) + this.displayPanelByHashName(hash) + this.activeRoute.fragment.subscribe((fragment) => { + if (fragment === 'remove-duplicate') { + const element = this._window.document.querySelector( + '#cy-remove-duplicate-panel' + ) + this.displayPanelByHashName(fragment) + setTimeout(() => { + if (element) { + element.scrollIntoView() + } + }) + } + }) + } + + private displayPanelByHashName(hash: string) { switch (hash) { case 'download-data': this.settingDownload = true diff --git a/src/app/core/title-service/title.service.ts b/src/app/core/title-service/title.service.ts index 9e959ca9eb..e60c833409 100644 --- a/src/app/core/title-service/title.service.ts +++ b/src/app/core/title-service/title.service.ts @@ -53,7 +53,12 @@ export class TitleService { } setTitle(title: string) { - if (title) this._titleService.setTitle(title) + // Use a replacement of the score for arabic titles to avoid the ORCID to be show in reverse + const arabic = /[\u0600-\u06FF]/ + if (arabic.test(title)) { + title = title.replace(/-/g, '᭸') + } + this._titleService.setTitle(title) } setDisplayName(displayedNameWithId: string) { diff --git a/src/app/guards/authenticated-no-delagator.guard.ts b/src/app/guards/authenticated-no-delagator.guard.ts index 5fc59f6c6e..b8ce48a8b4 100644 --- a/src/app/guards/authenticated-no-delagator.guard.ts +++ b/src/app/guards/authenticated-no-delagator.guard.ts @@ -29,18 +29,13 @@ export class AuthenticatedNoDelegatorGuard { | Promise | boolean | UrlTree { - return combineLatest([ - this._togglz.getStateOf('RESTRICTED_DELEGATORS'), - this._userInfo.getUserSession(), - ]).pipe( + return combineLatest([this._userInfo.getUserSession()]).pipe( map((value) => { - const restrictedDelegators = value[0] - const userSession = value[1] + const userSession = value[0] if ( (userSession.loggedIn && userSession.userInfo.IN_DELEGATION_MODE === 'false') || - userSession.userInfo.DELEGATED_BY_ADMIN === 'true' || - !restrictedDelegators + userSession.userInfo.DELEGATED_BY_ADMIN === 'true' ) { return true } else { diff --git a/src/app/layout/user-menu/user-menu.component.html b/src/app/layout/user-menu/user-menu.component.html index c280aa2bb6..66d495ec42 100644 --- a/src/app/layout/user-menu/user-menu.component.html +++ b/src/app/layout/user-menu/user-menu.component.html @@ -38,9 +38,7 @@ id="cy-my-orcid" >
-
- -
+
{{ displayName }}
@@ -61,8 +59,7 @@ *ngIf=" userInfo && (userInfo['IN_DELEGATION_MODE'] === 'false' || - userInfo['DELEGATED_BY_ADMIN'] === 'true' || - !restrictedDelegators) + userInfo['DELEGATED_BY_ADMIN'] === 'true') " > settings diff --git a/src/app/layout/user-menu/user-menu.component.scss b/src/app/layout/user-menu/user-menu.component.scss index 4bdb7e21ce..c1445075de 100644 --- a/src/app/layout/user-menu/user-menu.component.scss +++ b/src/app/layout/user-menu/user-menu.component.scss @@ -4,7 +4,7 @@ cursor: pointer; padding-bottom: 8px; padding-top: 4px; - align-items: center; + align-items: start; width: auto; flex-wrap: nowrap; max-width: 248px; @@ -27,7 +27,8 @@ width: 199px; overflow: hidden; text-overflow: ellipsis; - text-align: left; + white-space: initial; + word-break: break-word; } } } diff --git a/src/app/layout/user-menu/user-menu.component.ts b/src/app/layout/user-menu/user-menu.component.ts index 24b4761e27..20affc0d8c 100644 --- a/src/app/layout/user-menu/user-menu.component.ts +++ b/src/app/layout/user-menu/user-menu.component.ts @@ -26,9 +26,7 @@ export class UserMenuComponent implements OnInit { labelSigninRegister = $localize`:@@layout.ariaLabelSigninRegister:Sign in to ORCID or register for your ORCID iD` labelUserMenu = $localize`:@@layout.ariaLabelUserMenu:User menu` isAccountDelegate: boolean - restrictedDelegators: boolean inboxUnread = 0 - newDeveloperTools: boolean constructor( private _router: Router, @@ -55,12 +53,6 @@ export class UserMenuComponent implements OnInit { } ngOnInit() { - this._togglz - .getStateOf('NEW_DEVELOPER_TOOLS') - .subscribe((value) => (this.newDeveloperTools = value)) - this._togglz - .getStateOf('RESTRICTED_DELEGATORS') - .subscribe((value) => (this.restrictedDelegators = value)) this._inboxService .retrieveUnreadCount() .pipe(first()) @@ -80,7 +72,7 @@ export class UserMenuComponent implements OnInit { this._router.navigate([ApplicationRoutes.trustedParties]) } else if (url === 'trusted-parties') { this._router.navigate([ApplicationRoutes.trustedParties]) - } else if (url === 'developer-tools' && this.newDeveloperTools) { + } else if (url === 'developer-tools') { this._router.navigate([ApplicationRoutes.developerTools]) } else { this.window.location.href = environment.BASE_URL + url diff --git a/src/app/link-account/pages/link-account/link-account.component.html b/src/app/link-account/pages/link-account/link-account.component.html index a94dd9a6e2..9336489237 100644 --- a/src/app/link-account/pages/link-account/link-account.component.html +++ b/src/app/link-account/pages/link-account/link-account.component.html @@ -28,7 +28,16 @@ You are signed into {{ entityDisplayName }} - as + + as + {{ signInData.email diff --git a/src/app/record/components/work-contributors/work-contributors.component.html b/src/app/record/components/work-contributors/work-contributors.component.html index 8242d352bb..37f972fe64 100644 --- a/src/app/record/components/work-contributors/work-contributors.component.html +++ b/src/app/record/components/work-contributors/work-contributors.component.html @@ -31,12 +31,7 @@

- +
- + diff --git a/yarn.lock b/yarn.lock index e8bff90676..36ca55cabb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1647,38 +1647,6 @@ dot "^2.0.0-beta.1" fs-extra "^11.1.1" -"@cypress/request@^2.88.10": - version "2.88.12" - resolved "https://registry.yarnpkg.com/@cypress/request/-/request-2.88.12.tgz#ba4911431738494a85e93fb04498cb38bc55d590" - integrity sha512-tOn+0mDZxASFM+cuAP9szGUGPI1HwWVSvdzm7V4cCsPdFTx6qMj29CwaQmRAMIEhORIUBFBsYROYJcveK4uOjA== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - http-signature "~1.3.6" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - performance-now "^2.1.0" - qs "~6.10.3" - safe-buffer "^5.1.2" - tough-cookie "^4.1.3" - tunnel-agent "^0.6.0" - uuid "^8.3.2" - -"@cypress/xvfb@^1.2.4": - version "1.2.4" - resolved "https://registry.yarnpkg.com/@cypress/xvfb/-/xvfb-1.2.4.tgz#2daf42e8275b39f4aa53c14214e557bd14e7748a" - integrity sha512-skbBzPggOVYCbnGgV+0dmBdW/s77ZkAOXIC1knS8NagwDjBrNC1LuXtQJeiN6l+m7lzmHtaoUw/ctJKdqkG57Q== - dependencies: - debug "^3.1.0" - lodash.once "^4.1.1" - "@discoveryjs/json-ext@0.5.7", "@discoveryjs/json-ext@^0.5.3": version "0.5.7" resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" @@ -3183,44 +3151,6 @@ resolved "https://registry.yarnpkg.com/@orcid/bibtex-parse-js/-/bibtex-parse-js-0.0.25.tgz#3a4996d2339cab55ab6e43849cc791efa7a35418" integrity sha512-n6VuG5/WjiifC1DoUzq0sUCWNSbAyRZznBgvPcY4jVZ/2eJiMv2tNUAt2NukbnFExOUa0RyTOFsqhH2MGpiLgQ== -"@otplib/core@^12.0.1": - version "12.0.1" - resolved "https://registry.yarnpkg.com/@otplib/core/-/core-12.0.1.tgz#73720a8cedce211fe5b3f683cd5a9c098eaf0f8d" - integrity sha512-4sGntwbA/AC+SbPhbsziRiD+jNDdIzsZ3JUyfZwjtKyc/wufl1pnSIaG4Uqx8ymPagujub0o92kgBnB89cuAMA== - -"@otplib/plugin-crypto@^12.0.1": - version "12.0.1" - resolved "https://registry.yarnpkg.com/@otplib/plugin-crypto/-/plugin-crypto-12.0.1.tgz#2b42c624227f4f9303c1c041fca399eddcbae25e" - integrity sha512-qPuhN3QrT7ZZLcLCyKOSNhuijUi9G5guMRVrxq63r9YNOxxQjPm59gVxLM+7xGnHnM6cimY57tuKsjK7y9LM1g== - dependencies: - "@otplib/core" "^12.0.1" - -"@otplib/plugin-thirty-two@^12.0.1": - version "12.0.1" - resolved "https://registry.yarnpkg.com/@otplib/plugin-thirty-two/-/plugin-thirty-two-12.0.1.tgz#5cc9b56e6e89f2a1fe4a2b38900ca4e11c87aa9e" - integrity sha512-MtT+uqRso909UkbrrYpJ6XFjj9D+x2Py7KjTO9JDPhL0bJUYVu5kFP4TFZW4NFAywrAtFRxOVY261u0qwb93gA== - dependencies: - "@otplib/core" "^12.0.1" - thirty-two "^1.0.2" - -"@otplib/preset-default@^12.0.1": - version "12.0.1" - resolved "https://registry.yarnpkg.com/@otplib/preset-default/-/preset-default-12.0.1.tgz#cb596553c08251e71b187ada4a2246ad2a3165ba" - integrity sha512-xf1v9oOJRyXfluBhMdpOkr+bsE+Irt+0D5uHtvg6x1eosfmHCsCC6ej/m7FXiWqdo0+ZUI6xSKDhJwc8yfiOPQ== - dependencies: - "@otplib/core" "^12.0.1" - "@otplib/plugin-crypto" "^12.0.1" - "@otplib/plugin-thirty-two" "^12.0.1" - -"@otplib/preset-v11@^12.0.1": - version "12.0.1" - resolved "https://registry.yarnpkg.com/@otplib/preset-v11/-/preset-v11-12.0.1.tgz#4c7266712e7230500b421ba89252963c838fc96d" - integrity sha512-9hSetMI7ECqbFiKICrNa4w70deTUfArtwXykPUvSHWOdzOlfa9ajglu7mNCntlvxycTiOAXkQGwjQCzzDEMRMg== - dependencies: - "@otplib/core" "^12.0.1" - "@otplib/plugin-crypto" "^12.0.1" - "@otplib/plugin-thirty-two" "^12.0.1" - "@pkgjs/parseargs@^0.11.0": version "0.11.0" resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" @@ -4767,11 +4697,6 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240" integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ== -"@types/node@^14.14.31": - version "14.18.63" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.63.tgz#1788fa8da838dbb5f9ea994b834278205db6ca2b" - integrity sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ== - "@types/node@^16.9.6": version "16.18.60" resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.60.tgz#0b0f4316906f1bd0e03b640363f67bd4e86958bd" @@ -4895,16 +4820,6 @@ "@types/mime" "*" "@types/node" "*" -"@types/sinonjs__fake-timers@8.1.1": - version "8.1.1" - resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.1.tgz#b49c2c70150141a15e0fa7e79cf1f92a72934ce3" - integrity sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g== - -"@types/sizzle@^2.3.2": - version "2.3.5" - resolved "https://registry.yarnpkg.com/@types/sizzle/-/sizzle-2.3.5.tgz#d93dd29cdcd5801d90be968073b09a6b370780e4" - integrity sha512-tAe4Q+OLFOA/AMD+0lq8ovp8t3ysxAOeaScnfNdZpUxaGl51ZMDEITxkvFl1STudQ58mz6gzVGl9VhMKhwRnZQ== - "@types/sockjs@^0.3.33": version "0.3.35" resolved "https://registry.yarnpkg.com/@types/sockjs/-/sockjs-0.3.35.tgz#f4a568c73d2a8071944bd6ffdca0d4e66810cd21" @@ -5333,7 +5248,7 @@ ansi-colors@4.1.1: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== -ansi-colors@4.1.3, ansi-colors@^4.1.1, ansi-colors@^4.1.3: +ansi-colors@4.1.3, ansi-colors@^4.1.3: version "4.1.3" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== @@ -5357,7 +5272,7 @@ ansi-escapes@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== -ansi-escapes@^4.2.1, ansi-escapes@^4.3.0: +ansi-escapes@^4.2.1: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== @@ -5489,11 +5404,6 @@ append-transform@^1.0.0: resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== -arch@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/arch/-/arch-2.2.0.tgz#1bc47818f305764f23ab3306b0bfc086c5a29d11" - integrity sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ== - archy@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" @@ -5748,11 +5658,6 @@ ast-types@^0.7.0: resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.7.8.tgz#902d2e0d60d071bdcd46dc115e1809ed11c138a9" integrity sha512-RIOpVnVlltB6PcBJ5BMLx+H+6JJ/zjDGU0t7f0L6c2M1dqcK92VQopLBlPQ9R80AVXelfqYgjcPLtHtDbNFg0Q== -astral-regex@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" - integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== - async-done@^1.2.0, async-done@^1.2.2: version "1.3.2" resolved "https://registry.yarnpkg.com/async-done/-/async-done-1.3.2.tgz#5e15aa729962a4b07414f528a88cdf18e0b290a2" @@ -5787,7 +5692,7 @@ async@^2.6.2: dependencies: lodash "^4.17.14" -async@^3.2.0, async@^3.2.3: +async@^3.2.3: version "3.2.4" resolved "https://registry.yarnpkg.com/async/-/async-3.2.4.tgz#2d22e00f8cddeb5fde5dd33522b56d1cf569a81c" integrity sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ== @@ -5797,11 +5702,6 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== -at-least-node@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" - integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== - atob@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" @@ -5844,13 +5744,6 @@ axe-core@^4.0.2, axe-core@^4.2.0: resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.8.2.tgz#2f6f3cde40935825cf4465e3c1c9e77b240ff6ae" integrity sha512-/dlp0fxyM3R8YW7MFzaHWXrf4zzbr0vaYb23VBFCl83R7nWNPg/yaQw2Dc8jzCMmDVLhSdzH8MjrsuIUuvX+6g== -axios@^0.25.0: - version "0.25.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.25.0.tgz#349cfbb31331a9b4453190791760a8d35b093e0a" - integrity sha512-cD8FOb0tRH3uuEe6+evtAbgJtfxr7ly3fQjYcMcuPlgkwVS9xboaVIpcDV+cYQe+yGykgwZCs1pzjntcGa6l5g== - dependencies: - follow-redirects "^1.14.7" - babel-core@^7.0.0-bridge.0: version "7.0.0-bridge.0" resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-7.0.0-bridge.0.tgz#95a492ddd90f9b4e9a4a1da14eb335b87b634ece" @@ -6024,11 +5917,6 @@ bl@^4.0.3, bl@^4.1.0: inherits "^2.0.4" readable-stream "^3.4.0" -blob-util@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/blob-util/-/blob-util-2.0.2.tgz#3b4e3c281111bb7f11128518006cdc60b403a1eb" - integrity sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ== - blocking-proxy@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/blocking-proxy/-/blocking-proxy-1.0.1.tgz#81d6fd1fe13a4c0d6957df7f91b75e98dac40cb2" @@ -6036,11 +5924,6 @@ blocking-proxy@^1.0.0: dependencies: minimist "^1.2.0" -bluebird@^3.7.2: - version "3.7.2" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" - integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== - body-parser@1.20.1: version "1.20.1" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" @@ -6266,7 +6149,7 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== -buffer@^5.2.1, buffer@^5.5.0, buffer@^5.6.0: +buffer@^5.2.1, buffer@^5.5.0: version "5.7.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== @@ -6353,11 +6236,6 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" -cachedir@^2.3.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/cachedir/-/cachedir-2.4.0.tgz#7fef9cf7367233d7c88068fe6e34ed0d355a610d" - integrity sha512-9EtFOZR8g22CL7BWjJ9BUx1+A/djkofnyW3aOXZORNW2kxoUpx2h+uN2cOqwPmFhnpVmxg+KW2OjOSgChTEvsQ== - call-bind@^1.0.0, call-bind@^1.0.2, call-bind@^1.0.4, call-bind@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.5.tgz#6fa2b7845ce0ea49bf4d8b9ef64727a2c2e2e513" @@ -6478,11 +6356,6 @@ charenc@0.0.2: resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" integrity sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA== -check-more-types@^2.24.0: - version "2.24.0" - resolved "https://registry.yarnpkg.com/check-more-types/-/check-more-types-2.24.0.tgz#1420ffb10fd444dcfc79b43891bbfffd32a84600" - integrity sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA== - cheerio-select@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cheerio-select/-/cheerio-select-2.1.0.tgz#4d8673286b8126ca2a8e42740d5e3c4884ae21b4" @@ -6631,7 +6504,7 @@ cli-spinners@^2.5.0: resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.9.1.tgz#9c0b9dad69a6d47cbb4333c14319b060ed395a35" integrity sha512-jHgecW0pxkonBJdrKsqxgRX9AcG+u/5k0Q7WPDfi8AogLAdwxEkyYYNWwZ5GvVFoFx2uiY1eNcSK00fh+1+FyQ== -cli-table3@^0.6.1, cli-table3@~0.6.1: +cli-table3@^0.6.1: version "0.6.3" resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.3.tgz#61ab765aac156b52f222954ffc607a6f01dbeeb2" integrity sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg== @@ -6640,14 +6513,6 @@ cli-table3@^0.6.1, cli-table3@~0.6.1: optionalDependencies: "@colors/colors" "1.5.0" -cli-truncate@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-2.1.0.tgz#c39e28bf05edcde5be3b98992a22deed5a2b93c7" - integrity sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg== - dependencies: - slice-ansi "^3.0.0" - string-width "^4.2.0" - cli-width@^2.0.0: version "2.2.1" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48" @@ -6788,7 +6653,7 @@ color-support@^1.1.3: resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== -colorette@^2.0.10, colorette@^2.0.16, colorette@^2.0.20: +colorette@^2.0.10, colorette@^2.0.20: version "2.0.20" resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== @@ -6805,11 +6670,6 @@ combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -commander@^10.0.1: - version "10.0.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" - integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== - commander@^11.1.0: version "11.1.0" resolved "https://registry.yarnpkg.com/commander/-/commander-11.1.0.tgz#62fdce76006a68e5c1ab3314dc92e800eb83d906" @@ -6820,11 +6680,6 @@ commander@^2.12.1, commander@^2.20.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -commander@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae" - integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg== - commander@^6.2.1: version "6.2.1" resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" @@ -6840,11 +6695,6 @@ common-path-prefix@^3.0.0: resolved "https://registry.yarnpkg.com/common-path-prefix/-/common-path-prefix-3.0.0.tgz#7d007a7e07c58c4b4d5f433131a19141b29f11e0" integrity sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w== -common-tags@^1.8.0: - version "1.8.2" - resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.2.tgz#94ebb3c076d26032745fd54face7f688ef5ac9c6" - integrity sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA== - commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" @@ -7235,93 +7085,6 @@ custom-event@~1.0.0: resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425" integrity sha512-GAj5FOq0Hd+RsCGVJxZuKaIDXDf3h6GQoNEjFgbLLI/trgtavwUbSnZ5pVfg27DVCaWjIohryS0JFwIJyT2cMg== -cypress-file-upload@^5.0.8: - version "5.0.8" - resolved "https://registry.yarnpkg.com/cypress-file-upload/-/cypress-file-upload-5.0.8.tgz#d8824cbeaab798e44be8009769f9a6c9daa1b4a1" - integrity sha512-+8VzNabRk3zG6x8f8BWArF/xA/W0VK4IZNx3MV0jFWrJS/qKn8eHfa5nU73P9fOQAgwHFJx7zjg4lwOnljMO8g== - -cypress-mochawesome-reporter@^3.2.0: - version "3.6.1" - resolved "https://registry.yarnpkg.com/cypress-mochawesome-reporter/-/cypress-mochawesome-reporter-3.6.1.tgz#929a5da5d86c154a2b0c122e2b2a6d6b418a221e" - integrity sha512-AAuJzw4SxVhq8IsfdE37fOgk8gMHlPylNIDPH3NCMoaGFKQP3lY2KoO282X1WiR4fhDLrysGCtfX6mj/k4rqXg== - dependencies: - commander "^10.0.1" - fs-extra "^10.0.1" - mochawesome "^7.1.3" - mochawesome-merge "^4.2.1" - mochawesome-report-generator "^6.2.0" - -cypress-multi-reporters@^1.6.2: - version "1.6.4" - resolved "https://registry.yarnpkg.com/cypress-multi-reporters/-/cypress-multi-reporters-1.6.4.tgz#6f9d25ed8a0d8d7fa5597977adcd2237d1249931" - integrity sha512-3xU2t6pZjZy/ORHaCvci5OT1DAboS4UuMMM8NBAizeb2C9qmHt+cgAjXgurazkwkPRdO7ccK39M5ZaPCju0r6A== - dependencies: - debug "^4.3.4" - lodash "^4.17.21" - -cypress-otp@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/cypress-otp/-/cypress-otp-1.0.3.tgz#b8658df63dedcf722c570f0b57e6501311c78823" - integrity sha512-o7LssfI0HRHa+TkaOE5/Aukv6M9vsoZAtYESr9m7Ky2i+HRNb2p/IRelE7Z0wJ/UK2f+nXAGZIfXqraf9EPDqw== - dependencies: - otplib "12.0.1" - -cypress-qase-reporter@^1.4.2-alpha.2: - version "1.4.3" - resolved "https://registry.yarnpkg.com/cypress-qase-reporter/-/cypress-qase-reporter-1.4.3.tgz#98faf926621c4ead51b2c7af0692fd63c0fbeb52" - integrity sha512-tXrUTtZ1o9D/KSustnCKADYGlBamJmcG5zALbGyMd4SEUuXQYD8PxPn/KBgW2dBgbkMkGPWXckG7YZuwU+655A== - dependencies: - form-data "^4.0.0" - qaseio "^2.0.2" - -cypress@12.7.0: - version "12.7.0" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-12.7.0.tgz#69900f82af76cf3ba0ddb9b59ec3b0d38222ab22" - integrity sha512-7rq+nmhzz0u6yabCFyPtADU2OOrYt6pvUau9qV7xyifJ/hnsaw/vkr0tnLlcuuQKUAOC1v1M1e4Z0zG7S0IAvA== - dependencies: - "@cypress/request" "^2.88.10" - "@cypress/xvfb" "^1.2.4" - "@types/node" "^14.14.31" - "@types/sinonjs__fake-timers" "8.1.1" - "@types/sizzle" "^2.3.2" - arch "^2.2.0" - blob-util "^2.0.2" - bluebird "^3.7.2" - buffer "^5.6.0" - cachedir "^2.3.0" - chalk "^4.1.0" - check-more-types "^2.24.0" - cli-cursor "^3.1.0" - cli-table3 "~0.6.1" - commander "^5.1.0" - common-tags "^1.8.0" - dayjs "^1.10.4" - debug "^4.3.4" - enquirer "^2.3.6" - eventemitter2 "6.4.7" - execa "4.1.0" - executable "^4.1.1" - extract-zip "2.0.1" - figures "^3.2.0" - fs-extra "^9.1.0" - getos "^3.2.1" - is-ci "^3.0.0" - is-installed-globally "~0.4.0" - lazy-ass "^1.6.0" - listr2 "^3.8.3" - lodash "^4.17.21" - log-symbols "^4.0.0" - minimist "^1.2.6" - ospath "^1.2.2" - pretty-bytes "^5.6.0" - proxy-from-env "1.0.0" - request-progress "^3.0.0" - semver "^7.3.2" - supports-color "^8.1.1" - tmp "~0.2.1" - untildify "^4.0.0" - yauzl "^2.10.0" - d@1, d@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" @@ -7361,11 +7124,6 @@ dateformat@^4.5.1: resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-4.6.3.tgz#556fa6497e5217fedb78821424f8a1c22fa3f4b5" integrity sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA== -dayjs@^1.10.4: - version "1.11.10" - resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.10.tgz#68acea85317a6e164457d6d6947564029a6a16a0" - integrity sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ== - debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -7984,14 +7742,6 @@ enhanced-resolve@^5.15.0, enhanced-resolve@^5.7.0: graceful-fs "^4.2.4" tapable "^2.2.0" -enquirer@^2.3.6: - version "2.4.1" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.4.1.tgz#93334b3fbd74fc7097b224ab4a8fb7e40bf4ae56" - integrity sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ== - dependencies: - ansi-colors "^4.1.1" - strip-ansi "^6.0.1" - ent@~2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" @@ -8409,11 +8159,6 @@ eventemitter-asyncresource@^1.0.0: resolved "https://registry.yarnpkg.com/eventemitter-asyncresource/-/eventemitter-asyncresource-1.0.0.tgz#734ff2e44bf448e627f7748f905d6bdd57bdb65b" integrity sha512-39F7TBIV0G7gTelxwbEqnwhp90eqCPON1k0NwNfwhgKn4Co4ybUbj2pECcXT0B3ztRKZ7Pw1JujUUgmQJHcVAQ== -eventemitter2@6.4.7: - version "6.4.7" - resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-6.4.7.tgz#a7f6c4d7abf28a14c1ef3442f21cb306a054271d" - integrity sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg== - eventemitter3@^4.0.0: version "4.0.7" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" @@ -8424,7 +8169,20 @@ events@^3.2.0: resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== -execa@4.1.0, execa@^4.0.2: +execa@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" + integrity sha512-RztN09XglpYI7aBBrJCPW95jEH7YF1UEPOoX9yDhUTPdp7mK+CQvnLTuD10BNXZ3byLTu2uehZ8EcKT/4CGiFw== + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +execa@^4.0.2: version "4.1.0" resolved "https://registry.yarnpkg.com/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a" integrity sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA== @@ -8439,19 +8197,6 @@ execa@4.1.0, execa@^4.0.2: signal-exit "^3.0.2" strip-final-newline "^2.0.0" -execa@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" - integrity sha512-RztN09XglpYI7aBBrJCPW95jEH7YF1UEPOoX9yDhUTPdp7mK+CQvnLTuD10BNXZ3byLTu2uehZ8EcKT/4CGiFw== - dependencies: - cross-spawn "^5.0.1" - get-stream "^3.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - execa@^5.0.0, execa@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" @@ -8467,13 +8212,6 @@ execa@^5.0.0, execa@^5.1.1: signal-exit "^3.0.3" strip-final-newline "^2.0.0" -executable@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/executable/-/executable-4.1.1.tgz#41532bff361d3e57af4d763b70582db18f5d133c" - integrity sha512-8iA79xD3uAch729dUG8xaaBBFGaEa0wdD2VkYLFHwlqosEj/jT66AzcreRDSgV7ehnNLBW2WR5jIXwGKjVdTLg== - dependencies: - pify "^2.2.0" - exit@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" @@ -8749,7 +8487,7 @@ figures@^2.0.0: dependencies: escape-string-regexp "^1.0.5" -figures@^3.0.0, figures@^3.2.0: +figures@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== @@ -8971,7 +8709,7 @@ flush-write-stream@^1.0.2: inherits "^2.0.3" readable-stream "^2.3.6" -follow-redirects@^1.0.0, follow-redirects@^1.14.7: +follow-redirects@^1.0.0: version "1.15.3" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a" integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q== @@ -9094,7 +8832,7 @@ fs-extra@11.1.1, fs-extra@^11.1.0, fs-extra@^11.1.1: jsonfile "^6.0.1" universalify "^2.0.0" -fs-extra@^10.0.0, fs-extra@^10.0.1: +fs-extra@^10.0.0: version "10.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== @@ -9121,16 +8859,6 @@ fs-extra@^8.1.0: jsonfile "^4.0.0" universalify "^0.1.0" -fs-extra@^9.1.0: - version "9.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" - integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== - dependencies: - at-least-node "^1.0.0" - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - fs-minipass@^2.0.0, fs-minipass@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" @@ -9314,13 +9042,6 @@ get-value@^2.0.3, get-value@^2.0.6: resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" integrity sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA== -getos@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/getos/-/getos-3.2.1.tgz#0134d1f4e00eb46144c5a9c0ac4dc087cbb27dc5" - integrity sha512-U56CfOK17OKgTVqozZjUKNdkfEv6jk5WISBJ8SHoagjE6L69zOwl3Z+O8myjY9MEW3i2HPWQBt/LTbCgcC973Q== - dependencies: - async "^3.2.0" - getpass@^0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" @@ -9460,13 +9181,6 @@ global-dirs@^0.1.0: dependencies: ini "^1.3.4" -global-dirs@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-3.0.1.tgz#0c488971f066baceda21447aecb1a8b911d22485" - integrity sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA== - dependencies: - ini "2.0.0" - global-modules@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" @@ -10055,15 +9769,6 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" -http-signature@~1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.3.6.tgz#cb6fbfdf86d1c974f343be94e87f7fc128662cf9" - integrity sha512-3adrsD6zqo4GsTqtO7FyrejHNv+NgiIfAfv68+jVlFmSr9OGy7zrxONceFRLKvnnZA5jbxQBX1u9PpB6Wi32Gw== - dependencies: - assert-plus "^1.0.0" - jsprim "^2.0.2" - sshpk "^1.14.1" - https-proxy-agent@5.0.1, https-proxy-agent@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" @@ -10227,11 +9932,6 @@ inherits@2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw== -ini@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ini/-/ini-2.0.0.tgz#e5fd556ecdd5726be978fa1001862eacb0a94bc5" - integrity sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA== - ini@4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/ini/-/ini-4.1.1.tgz#d95b3d843b1e906e56d6747d5447904ff50ce7a1" @@ -10434,13 +10134,6 @@ is-ci@^1.0.10: dependencies: ci-info "^1.5.0" -is-ci@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-3.0.1.tgz#db6ecbed1bd659c43dac0f45661e7674103d1867" - integrity sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ== - dependencies: - ci-info "^3.2.0" - is-core-module@^2.11.0, is-core-module@^2.13.0, is-core-module@^2.8.1: version "2.13.1" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.1.tgz#ad0d7532c6fea9da1ebdc82742d74525c6273384" @@ -10556,14 +10249,6 @@ is-installed-globally@^0.1.0: global-dirs "^0.1.0" is-path-inside "^1.0.0" -is-installed-globally@~0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.4.0.tgz#9a0fd407949c30f86eb6959ef1b7994ed0b7b520" - integrity sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ== - dependencies: - global-dirs "^3.0.0" - is-path-inside "^3.0.2" - is-interactive@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" @@ -11292,16 +10977,6 @@ jsprim@^1.2.2: json-schema "0.4.0" verror "1.10.0" -jsprim@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-2.0.2.tgz#77ca23dbcd4135cd364800d22ff82c2185803d4d" - integrity sha512-gqXddjPqQ6G40VdnI6T6yObEC+pDNvyP95wdQhkWkg7crHH3km5qP1FsOXEkzEQwnz6gz5qGTn1c2Y52wP3OyQ== - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.4.0" - verror "1.10.0" - jszip@^3.1.3: version "3.10.1" resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.10.1.tgz#34aee70eb18ea1faec2f589208a157d1feb091c2" @@ -11465,11 +11140,6 @@ launch-editor@^2.6.0: picocolors "^1.0.0" shell-quote "^1.8.1" -lazy-ass@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/lazy-ass/-/lazy-ass-1.6.0.tgz#7999655e8646c17f089fdd187d150d3324d54513" - integrity sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw== - lazy-universal-dotenv@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/lazy-universal-dotenv/-/lazy-universal-dotenv-4.0.0.tgz#0b220c264e89a042a37181a4928cdd298af73422" @@ -11616,20 +11286,6 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== -listr2@^3.8.3: - version "3.14.0" - resolved "https://registry.yarnpkg.com/listr2/-/listr2-3.14.0.tgz#23101cc62e1375fd5836b248276d1d2b51fdbe9e" - integrity sha512-TyWI8G99GX9GjE54cJ+RrNMcIFBfwMPxc3XTFiAYGN4s10hWROGtOg7+O6u6LE3mNkyld7RSLE6nrKBvTfcs3g== - dependencies: - cli-truncate "^2.1.0" - colorette "^2.0.16" - log-update "^4.0.0" - p-map "^4.0.0" - rfdc "^1.3.0" - rxjs "^7.5.1" - through "^2.3.8" - wrap-ansi "^7.0.0" - load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" @@ -11734,11 +11390,6 @@ lodash.isstring@^4.0.1: resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" integrity sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw== -lodash.once@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" - integrity sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg== - lodash.set@^4.3.2: version "4.3.2" resolved "https://registry.yarnpkg.com/lodash.set/-/lodash.set-4.3.2.tgz#d8757b1da807dde24816b0d6a84bea1a76230b23" @@ -11749,7 +11400,7 @@ lodash@^4.17.14, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.3.0, lodash@^4.7.0: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -log-symbols@4.1.0, log-symbols@^4.0.0, log-symbols@^4.1.0: +log-symbols@4.1.0, log-symbols@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== @@ -11757,16 +11408,6 @@ log-symbols@4.1.0, log-symbols@^4.0.0, log-symbols@^4.1.0: chalk "^4.1.0" is-unicode-supported "^0.1.0" -log-update@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/log-update/-/log-update-4.0.0.tgz#589ecd352471f2a1c0c570287543a64dfd20e0a1" - integrity sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg== - dependencies: - ansi-escapes "^4.3.0" - cli-cursor "^3.1.0" - slice-ansi "^4.0.0" - wrap-ansi "^6.2.0" - log4js@^6.4.1: version "6.9.1" resolved "https://registry.yarnpkg.com/log4js/-/log4js-6.9.1.tgz#aba5a3ff4e7872ae34f8b4c533706753709e38b6" @@ -12396,7 +12037,7 @@ mochawesome-report-generator@^6.0.1, mochawesome-report-generator@^6.2.0: validator "^13.6.0" yargs "^17.2.1" -mochawesome@^7.0.1, mochawesome@^7.1.3: +mochawesome@^7.0.1: version "7.1.3" resolved "https://registry.yarnpkg.com/mochawesome/-/mochawesome-7.1.3.tgz#07b358138f37f5b07b51a1b255d84babfa36fa83" integrity sha512-Vkb3jR5GZ1cXohMQQ73H3cZz7RoxGjjUo0G5hu0jLaW+0FdUxUwg3Cj29bqQdh0rFcnyV06pWmqmi5eBPnEuNQ== @@ -13045,20 +12686,6 @@ os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== -ospath@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/ospath/-/ospath-1.2.2.tgz#1276639774a3f8ef2572f7fe4280e0ea4550c07b" - integrity sha512-o6E5qJV5zkAbIDNhGSIlyOhScKXgQrSRMilfph0clDfM0nEnBOlKlH4sWDmG95BW/CvwNz0vmm7dJVtU2KlMiA== - -otplib@12.0.1: - version "12.0.1" - resolved "https://registry.yarnpkg.com/otplib/-/otplib-12.0.1.tgz#c1d3060ab7aadf041ed2960302f27095777d1f73" - integrity sha512-xDGvUOQjop7RDgxTQ+o4pOol0/3xSZzawTiPKRrHnQWAy0WjhNs/5HdIDJCrqC4MBynmjXgULc6YfioaxZeFgg== - dependencies: - "@otplib/core" "^12.0.1" - "@otplib/preset-default" "^12.0.1" - "@otplib/preset-v11" "^12.0.1" - p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" @@ -13459,7 +13086,7 @@ pidtree@^0.3.0: resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.3.1.tgz#ef09ac2cc0533df1f3250ccf2c4d366b0d12114a" integrity sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA== -pify@^2.0.0, pify@^2.2.0: +pify@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" integrity sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog== @@ -13632,7 +13259,7 @@ prettier@^2.0.5, prettier@^2.8.0: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== -pretty-bytes@^5.3.0, pretty-bytes@^5.6.0: +pretty-bytes@^5.3.0: version "5.6.0" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" integrity sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg== @@ -13785,11 +13412,6 @@ proxy-addr@~2.0.7: forwarded "0.2.0" ipaddr.js "1.9.1" -proxy-from-env@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee" - integrity sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A== - proxy-from-env@1.1.0, proxy-from-env@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" @@ -13910,14 +13532,6 @@ q@^1.4.1: resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" integrity sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw== -qaseio@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/qaseio/-/qaseio-2.0.2.tgz#21b1521ec41f0f69cd218de0dd44670defce43a4" - integrity sha512-yMeGtlqAg0Qd9Ao5I+IJY5yGjRjGFD1W4Eb9tQZ7LjlOYVnzSwxZmMy2z7tQeIizpHyDUNlFQKgTy7ZeIrJRFQ== - dependencies: - axios "^0.25.0" - form-data "^3.0.0" - qjobs@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" @@ -13937,13 +13551,6 @@ qs@^6.10.0, qs@^6.11.2, qs@^6.7.0: dependencies: side-channel "^1.0.4" -qs@~6.10.3: - version "6.10.5" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.5.tgz#974715920a80ff6a262264acd2c7e6c2a53282b4" - integrity sha512-O5RlPh0VFtR78y79rgcgKK4wbAI0C5zGVLztOIdpWX6ep368q5Hv6XRxDvXuZ9q3C6v+e3n8UfZZJw7IIG27eQ== - dependencies: - side-channel "^1.0.4" - qs@~6.5.2: version "6.5.3" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" @@ -14410,13 +14017,6 @@ replace-homedir@^1.0.0: is-absolute "^1.0.0" remove-trailing-separator "^1.1.0" -request-progress@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/request-progress/-/request-progress-3.0.0.tgz#4ca754081c7fec63f505e4faa825aa06cd669dbe" - integrity sha512-MnWzEHHaxHO2iWiQuHrUPBi/1WeBf5PkxQqNyNvLl9VAYSdXkP8tQ3pBSeCPD+yw0v0Aq1zosWLz0BdeXpWwZg== - dependencies: - throttleit "^1.0.0" - request@^2.87.0, request@^2.88.0: version "2.88.2" resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" @@ -14637,7 +14237,7 @@ rxjs@6.6.7: dependencies: tslib "^1.9.0" -rxjs@7.8.1, rxjs@^7.5.1, rxjs@^7.5.5: +rxjs@7.8.1, rxjs@^7.5.5: version "7.8.1" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== @@ -14813,7 +14413,7 @@ semver-greatest-satisfied-range@^1.1.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== -semver@7.5.4, semver@^7.0.0, semver@^7.1.1, semver@^7.3.2, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.3, semver@^7.5.4: +semver@7.5.4, semver@^7.0.0, semver@^7.1.1, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.3, semver@^7.5.4: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== @@ -15023,24 +14623,6 @@ slash@^4.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-4.0.0.tgz#2422372176c4c6c5addb5e2ada885af984b396a7" integrity sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew== -slice-ansi@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-3.0.0.tgz#31ddc10930a1b7e0b67b08c96c2f49b77a789787" - integrity sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ== - dependencies: - ansi-styles "^4.0.0" - astral-regex "^2.0.0" - is-fullwidth-code-point "^3.0.0" - -slice-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" - integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== - dependencies: - ansi-styles "^4.0.0" - astral-regex "^2.0.0" - is-fullwidth-code-point "^3.0.0" - smart-buffer@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae" @@ -15289,7 +14871,7 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== -sshpk@^1.14.1, sshpk@^1.7.0: +sshpk@^1.7.0: version "1.18.0" resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.18.0.tgz#1663e55cddf4d688b86a46b77f0d5fe363aba028" integrity sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ== @@ -15571,7 +15153,7 @@ style-loader@^3.3.1: resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-3.3.3.tgz#bba8daac19930169c0c9c96706749a597ae3acff" integrity sha512-53BiGLXAcll9maCYtZi2RCQZKa8NQQai5C4horqKyRmHj9H7QmcUyucrH+4KW/gBQbXM2AsB0axoEcFZPlfPcw== -supports-color@8.1.1, supports-color@^8.0.0, supports-color@^8.1.1: +supports-color@8.1.1, supports-color@^8.0.0: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== @@ -15774,16 +15356,6 @@ third-party-web@^0.11.0: resolved "https://registry.yarnpkg.com/third-party-web/-/third-party-web-0.11.1.tgz#4b5b176f0014be696002c104d76f40692318aec9" integrity sha512-PBS478cWhvCM8seuloomV5lGHvu2qMOCj8gq8wKOApdfAaGh9l2rYZkdsBDaQyQg/6plov3uodc6sZ/3c1lu/g== -thirty-two@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/thirty-two/-/thirty-two-1.0.2.tgz#4ca2fffc02a51290d2744b9e3f557693ca6b627a" - integrity sha512-OEI0IWCe+Dw46019YLl6V10Us5bi574EvlJEOcAkB29IzQ/mYD1A6RyNHLjZPiHCmuodxvgF6U+vZO1L15lxVA== - -throttleit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c" - integrity sha512-rkTVqu6IjfQ/6+uNuuc3sZek4CEYxTJom3IktzgdSxcZqdARuebbA/f4QmAxMQIxqq9ZLEUkSYqvuk1I6VKq4g== - through2-filter@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/through2-filter/-/through2-filter-3.0.0.tgz#700e786df2367c2c88cd8aa5be4cf9c1e7831254" @@ -15849,7 +15421,7 @@ tmp@0.0.x, tmp@^0.0.33: dependencies: os-tmpdir "~1.0.2" -tmp@^0.2.1, tmp@~0.2.1: +tmp@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14" integrity sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ== @@ -15923,7 +15495,7 @@ toidentifier@1.0.1: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== -tough-cookie@^4.0.0, tough-cookie@^4.1.3: +tough-cookie@^4.0.0: version "4.1.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.3.tgz#97b9adb0728b42280aa3d814b6b999b2ff0318bf" integrity sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==
{ const mockFormGroup: UntypedFormGroup = new UntypedFormGroup({}) component['parentForm'].form = mockFormGroup component.userRecord = getUserRecord() - component.togglzAddOtherContributors = true fixture.detectChanges() loader = TestbedHarnessEnvironment.loader(fixture) diff --git a/src/app/record/components/work-contributors/work-contributors.component.ts b/src/app/record/components/work-contributors/work-contributors.component.ts index 821d85c92f..c70bd32096 100644 --- a/src/app/record/components/work-contributors/work-contributors.component.ts +++ b/src/app/record/components/work-contributors/work-contributors.component.ts @@ -69,7 +69,6 @@ export class WorkContributorsComponent implements OnInit, OnDestroy { maxNumberOfContributors = 49 maxNumberOfContributorsSummary = 10 privateName = 'Name is private' - togglzAddOtherContributors: boolean contributionRoles = ContributionRoles recordHolderContribution: Contributor @@ -88,11 +87,7 @@ export class WorkContributorsComponent implements OnInit, OnDestroy { private platform: PlatformInfoService, private workService: RecordWorksService, private affiliationService: RecordAffiliationService - ) { - _togglz - .getStateOf('ADD_OTHER_WORK_CONTRIBUTORS') - .subscribe((value) => (this.togglzAddOtherContributors = value)) - } + ) {} get contributorsFormArray() { return this.parentForm.control.controls['contributors'] as UntypedFormArray @@ -220,7 +215,7 @@ export class WorkContributorsComponent implements OnInit, OnDestroy { 'contributors' ) as UntypedFormArray - if (this.togglzAddOtherContributors && this.contributors?.length > 0) { + if (this.contributors?.length > 0) { if (!this.recordHolderContribution && !this.recordHolderAsContributor) { this.addRecordHolderAsContributor() } diff --git a/src/app/record/components/work-stack-group/modals/work-bibtex-modal/work-bibtex-modal.component.ts b/src/app/record/components/work-stack-group/modals/work-bibtex-modal/work-bibtex-modal.component.ts index 74f6602406..da13f235d0 100644 --- a/src/app/record/components/work-stack-group/modals/work-bibtex-modal/work-bibtex-modal.component.ts +++ b/src/app/record/components/work-stack-group/modals/work-bibtex-modal/work-bibtex-modal.component.ts @@ -49,95 +49,77 @@ export class WorkBibtexModalComponent implements OnInit, OnDestroy { ngOnInit(): void {} bibTexInputChange($fileInputEvent: any) { - this._togglz - .getStateOf('ADD_OTHER_WORK_CONTRIBUTORS_WITH_BIBTEX') - .subscribe((ADD_OTHER_WORK_CONTRIBUTORS_WITH_BIBTEX_TOGGLZ) => { - this.bibtexErrorParsingText = undefined - this.bibtexErrorParsing = false - this.loadingWorks = true - const textFiles = $fileInputEvent.target.files - for (const bibtex of textFiles) { - const reader = new FileReader() - reader.readAsText(bibtex) - - const that = this - - reader.onloadend = function (e) { - let parsed = null - try { - parsed = bibtexParse.toJSON(reader.result) - - if ( - typeof parsed === 'string' && - parsed.substring(0, 5).toLowerCase().indexOf('error') > -1 - ) { - that.bibtexErrorParsingText = parsed - that.bibtexErrorParsing = true + this.bibtexErrorParsingText = undefined + this.bibtexErrorParsing = false + this.loadingWorks = true + const textFiles = $fileInputEvent.target.files + for (const bibtex of textFiles) { + const reader = new FileReader() + reader.readAsText(bibtex) + const that = this + reader.onloadend = function (e) { + let parsed = null + try { + parsed = bibtexParse.toJSON(reader.result) + if ( + typeof parsed === 'string' && + parsed.substring(0, 5).toLowerCase().indexOf('error') > -1 + ) { + that.bibtexErrorParsingText = parsed + that.bibtexErrorParsing = true + that.loadingWorks = false + } else { + if (parsed) { + const newWorks = [] + if (parsed.length === 0) { + that.bibtexErrorNoEntries = true that.loadingWorks = false - } else { - if (parsed) { - const newWorks = [] - if (parsed.length === 0) { - that.bibtexErrorNoEntries = true - that.loadingWorks = false - } - while (parsed.length > 0) { - const cur = parsed.shift() - const bibtexEntry = cur.entryType.toLowerCase() - if ( - bibtexEntry !== 'preamble' && - bibtexEntry !== 'comment' - ) { - newWorks.push( - that.populateWork( - cur, - ADD_OTHER_WORK_CONTRIBUTORS_WITH_BIBTEX_TOGGLZ - ) - ) - } - } - if (newWorks.length > 0) { - that._recordWorksService - .worksValidate(newWorks) - .pipe(first()) - .subscribe((data) => { - that.worksFromBibtex = [] - data.forEach((work) => { - that.worksFromBibtex.push(work) - if (work.errors.length > 0 && !that.isAnInvalidWork) { - that.isAnInvalidWork = true - that._snackBar.showValidationError() - } - }) - that.worksFromBibtex.forEach((w) => { - const newPutCode = 'new-' + that.addedWorkCount++ - w.putCode = { - value: newPutCode, - } - that.group[newPutCode] = new UntypedFormGroup({ - checked: new UntypedFormControl(false), - }) - }) - that.importForm = new UntypedFormGroup(that.group) - that.loadingWorks = false - }) - } + } + while (parsed.length > 0) { + const cur = parsed.shift() + const bibtexEntry = cur.entryType.toLowerCase() + if (bibtexEntry !== 'preamble' && bibtexEntry !== 'comment') { + newWorks.push(that.populateWork(cur)) } } - } catch (e) { - that.bibtexErrorParsingText = e - that.bibtexErrorParsing = true - that.loadingWorks = false + if (newWorks.length > 0) { + that._recordWorksService + .worksValidate(newWorks) + .pipe(first()) + .subscribe((data) => { + that.worksFromBibtex = [] + data.forEach((work) => { + that.worksFromBibtex.push(work) + if (work.errors.length > 0 && !that.isAnInvalidWork) { + that.isAnInvalidWork = true + that._snackBar.showValidationError() + } + }) + that.worksFromBibtex.forEach((w) => { + const newPutCode = 'new-' + that.addedWorkCount++ + w.putCode = { + value: newPutCode, + } + that.group[newPutCode] = new UntypedFormGroup({ + checked: new UntypedFormControl(false), + }) + }) + that.importForm = new UntypedFormGroup(that.group) + that.loadingWorks = false + }) + } } } + } catch (e) { + that.bibtexErrorParsingText = e + that.bibtexErrorParsing = true + that.loadingWorks = false } - }) + } + } } - populateWork( - bibJSON, - ADD_OTHER_WORK_CONTRIBUTORS_WITH_BIBTEX_TOGGLZ: boolean - ): Work { + populateWork(bibJSON): Work { const work = {} as Work const bibtex = bibtexParse.toBibtex([bibJSON]) @@ -271,16 +253,14 @@ export class WorkBibtexModalComponent implements OnInit, OnDestroy { } } - if (ADD_OTHER_WORK_CONTRIBUTORS_WITH_BIBTEX_TOGGLZ) { - work.contributorsGroupedByOrcid = [] - if (lowerKeyTags.hasOwnProperty('author')) { - const authors = this.removeEndingAnd(lowerKeyTags['author']) - this.addContributors(authors.split(' and '), 'author', work) - } - if (lowerKeyTags.hasOwnProperty('editor')) { - const editors = this.removeEndingAnd(lowerKeyTags['editor']) - this.addContributors(editors.split(' and '), 'editor', work) - } + work.contributorsGroupedByOrcid = [] + if (lowerKeyTags.hasOwnProperty('author')) { + const authors = this.removeEndingAnd(lowerKeyTags['author']) + this.addContributors(authors.split(' and '), 'author', work) + } + if (lowerKeyTags.hasOwnProperty('editor')) { + const editors = this.removeEndingAnd(lowerKeyTags['editor']) + this.addContributors(editors.split(' and '), 'editor', work) } } return work diff --git a/src/app/register2/components/form-personal/form-personal.component.html b/src/app/register2/components/form-personal/form-personal.component.html index 57ed615b13..8244de7b5f 100644 --- a/src/app/register2/components/form-personal/form-personal.component.html +++ b/src/app/register2/components/form-personal/form-personal.component.html @@ -274,7 +274,9 @@

- Add an additional + Add an additional professional email @@ -330,10 +332,10 @@

We recommend adding an additional - personal email - as backup so you always have access to your ORCID account if you change jobs or roles.personal email + as backup so you always have access to your ORCID account if you + change jobs or roles.