Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
amontenegro committed Jul 27, 2022
2 parents b5cc95e + 4bef229 commit a93299e
Show file tree
Hide file tree
Showing 492 changed files with 8,527 additions and 1,010 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
on:
push:
branches:
- development
pull_request:
name: Unit Tests 🧪

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 'v16.13.2'
- run: yarn
- run: yarn test-headless
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ yarn build:i18n
2- Run the application on the language you want using one of the following options

```
yarn start:aot ## Runs the application in using the english properties
yarn start:en ## Runs the application in using the english properties
yarn start:fr ## Runs the application in using the french properties
yarn start:ar ## Runs the application in using the arabic properties
yarn start:es ## Runs the application in using the spanish properties
Expand Down
47 changes: 47 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { defineConfig } from 'cypress'

export default defineConfig({
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: '[email protected]',
verifyEmailReminderSubject:
'[ORCID] Reminder to verify your primary email address',
senderResetPassword: '[email protected]',
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_workEndpoint: '/work',
membersAPI_peerReviewEndpoint: '/peer-review',
registrationPage: 'https://qa.orcid.org/register',
},
chromeWebSecurity: false,
viewportWidth: 1000,
viewportHeight: 1000,
reporter: 'mochawesome',
reporterOptions: {
charts: true,
overwrite: false,
html: true,
json: false,
reportDir: 'cypress/reports/temp/mochawesome-report',
},
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config)
},
baseUrl: 'https://qa.orcid.org',
excludeSpecPattern: [
'**/legacy_oldScripts/*',
'**/registry/gmail_check_test_ignore.js',
],
},
})
39 changes: 0 additions & 39 deletions cypress.json

This file was deleted.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ describe('My orcid - via API members can add fundings', async function () {
before(() => {
//add a new funding via API
const endpoint =
Cypress.env('membersAPI-URL') +
Cypress.env('membersAPI_URL') +
userData.cyFundingContributorsUser.oid +
Cypress.env('membersAPI-fundingsEndpoint')
Cypress.env('membersAPI_fundingsEndpoint')

const curlStatement =
"curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " +
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ 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') +
Cypress.env('membersAPI_URL') +
userData.cyUserPrimaryEmaiVerified.oid +
Cypress.env('membersAPI-peerReviewEndpoint')
Cypress.env('membersAPI_peerReviewEndpoint')

const curlStatement =
"curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " +
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ describe('My orcid - via API members can add works', async function () {
before(() => {
//add a new funding via API
const endpoint =
Cypress.env('membersAPI-URL') +
Cypress.env('membersAPI_URL') +
userData.cyWorkContributorsUser.oid +
Cypress.env('membersAPI-workEndpoint')
Cypress.env('membersAPI_workEndpoint')

const curlStatement =
"curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ describe('My orcid - funding duplicates grouping', async function () {
before(() => {
//member adds existing funding
const endpoint =
Cypress.env('membersAPI-URL') +
Cypress.env('membersAPI_URL') +
userData.cyFundingDuplicatesUser.oid +
Cypress.env('membersAPI-fundingsEndpoint')
Cypress.env('membersAPI_fundingsEndpoint')

const curlStatement =
"curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const jsonfile = require('../../fixtures/funding-two-sources-grouping.fixture.js
describe('My orcid - funding duplicates grouping', async function () {
before(() => {
const endpoint =
Cypress.env('membersAPI-URL') +
Cypress.env('membersAPI_URL') +
userData.cyFundingDuplicatesUser.oid +
Cypress.env('membersAPI-fundingsEndpoint')
Cypress.env('membersAPI_fundingsEndpoint')

//add funding with source A
const curlStatement =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,54 +274,6 @@ describe('App displays error messages when user inputs invalid data', async func
cy.get('[lang="en"]') //wait for language to refresh before Log out
})

it('Leading whitespace in URL are invalid', function () {
//click on edit pencil for websites section
cy.get('#websites-panel').within(($myPanel) => {
cy.get('#edit-button').click()
})
cy.get('#add-link').click()
cy.get('#description-input')
.clear()
.type(testingData.sidebarWebsitesURL.titleURL)
cy.get('#url-input')
.clear()
.type(' ' + testingData.sidebarWebsitesURL.duplicateURL)
//try to save
cy.get('#save-websites-button').click()

//verify the URL field is required
cy.get('mat-error').should(
'have.text',
testingData.errorMessages.invalidURL
)

cy.get('#cancel-websites-button').click()
})

it('Trailing whitespace in URL are invalid', function () {
//click on edit pencil for websites section
cy.get('#websites-panel').within(($myPanel) => {
cy.get('#edit-button').click()
})
cy.get('#add-link').click()
cy.get('#description-input')
.clear()
.type(testingData.sidebarWebsitesURL.titleURL)
cy.get('#url-input')
.clear()
.type(testingData.sidebarWebsitesURL.duplicateURL + ' ')
//try to save
cy.get('#save-websites-button').click()

//verify the URL field is required
cy.get('mat-error').should(
'have.text',
testingData.errorMessages.invalidURL
)

cy.get('#cancel-websites-button').click()
})

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,
Expand All @@ -343,9 +295,9 @@ describe('App displays error messages when user inputs invalid data', async func
//add same URL via API
//const jsonFilePath=userData.cyUserMemmerAPI.curlPostWebsitePath
const endpoint =
Cypress.env('membersAPI-URL') +
Cypress.env('membersAPI_URL') +
userData.cyUserPrimaryEmaiVerified.oid +
Cypress.env('membersAPI-websitesEndPoint')
Cypress.env('membersAPI_websitesEndPoint')
const curlStatement =
"curl -i -H 'Content-type: application/json' -H 'Authorization: Bearer " +
userData.cyUserMemmerAPI.bearer +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,66 @@ describe('My orcid - users are able to add content to their record', async funct
.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('#edit-button').click()
})
cy.get('#add-link').click()
cy.get('#description-input')
.clear()
.type(testingData.sidebarWebsitesURL.titleURL)
cy.get('#url-input')
.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('#edit-button').click()
})
cy.get('#url-input').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('#edit-button').click()
})
cy.get('#add-link').click()
cy.get('#description-input')
.clear()
.type(testingData.sidebarWebsitesURL.titleURL)
cy.get('#url-input')
.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('#edit-button').click()
})
cy.get('#url-input').should('not.contain', ' ')
})

afterEach(() => {
//clean up state
cy.cleanWebsites()
Expand Down
Loading

0 comments on commit a93299e

Please sign in to comment.