|
| 1 | +name: test-e2e-cypress-all |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +jobs: |
| 7 | + test_e2e_cypress: |
| 8 | + strategy: |
| 9 | + matrix: |
| 10 | + include: |
| 11 | + - name: csv-add-affiliations |
| 12 | + spec: | |
| 13 | + cypress/e2e/retention/csv-add-affiliations.cy.js |
| 14 | +
|
| 15 | + - name: csv-edit-affiliations |
| 16 | + spec: | |
| 17 | + cypress/e2e/retention/csv-edit-affiliations.cy.js |
| 18 | +
|
| 19 | + - name: add-affiliation |
| 20 | + spec: | |
| 21 | + cypress/e2e/retention/add-affiliation.cy.js |
| 22 | +
|
| 23 | + - name: notifications |
| 24 | + spec: | |
| 25 | + cypress/e2e/retention/notifications.cy.js |
| 26 | +
|
| 27 | + - name: other-tests |
| 28 | + spec: | |
| 29 | + cypress/e2e/retention/add-member.cy.js |
| 30 | + cypress/e2e/retention/add-user.cy.js |
| 31 | + cypress/e2e/retention/csv-invalid-affiliation.cy.js |
| 32 | + cypress/e2e/retention/edit-affiliation.cy.js |
| 33 | + cypress/e2e/retention/edit-member.cy.js |
| 34 | + cypress/e2e/retention/edit-user.cy.js |
| 35 | + cypress/e2e/retention/reset-password.cy.js |
| 36 | + cypress/e2e/retention/restricted-access.cy.js |
| 37 | + cypress/e2e/retention/ui-authorities.cy.js |
| 38 | + cypress/e2e/retention/ui-login.cy.js |
| 39 | + cypress/e2e/retention/ui-pagination.cy.js |
| 40 | + cypress/e2e/retention/ui-homepage.cy.js |
| 41 | + cypress/e2e/retention/ui-homepage-edit.cy.js |
| 42 | + cypress/e2e/retention/ui-reports.cy.js |
| 43 | + # keep running jobs even if one test fails in case there are multiple failed tests |
| 44 | + fail-fast: false |
| 45 | + |
| 46 | +################################################################################################### |
| 47 | + |
| 48 | + runs-on: ubuntu-latest |
| 49 | + steps: |
| 50 | + - name: Checkout |
| 51 | + uses: actions/checkout@v4 |
| 52 | + |
| 53 | + - name: "Create creds json" |
| 54 | + id: create-creds-json |
| 55 | + uses: jsdaniell/create-json@v1.2.3 |
| 56 | + with: |
| 57 | + name: "credentials.json" |
| 58 | + json: '{"adminEmail": "${{secrets.CY_ADMIN_EMAIL}}", "adminPassword": "${{secrets.CY_ADMIN_PASSWORD}}", "password": "${{secrets.CY_PASSWORD}}", "shortPassword": "${{secrets.CY_SHORT_PASSWORD}}", "shortConfirmationPassword": "${{secrets.CY_SHORT_CONFIRMATION_PASSWORD}}", "wrongConfirmationPasssword": "${{secrets.CY_WRONG_CONFIRMATION_PASSWORD}}"}' |
| 59 | + dir: "ui/cypress/fixtures" |
| 60 | + |
| 61 | + - name: "Create Gmail creds json" |
| 62 | + id: create-gmail-creds-file |
| 63 | + uses: jsdaniell/create-json@v1.2.3 |
| 64 | + with: |
| 65 | + name: "credentials_qa.json" |
| 66 | + json: '{"installed":{"client_id":"${{secrets.CY_CREDS_CLIENT_ID}}","project_id":"${{secrets.CY_CREDS_PROJECT_ID}}","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"${{secrets.CY_CREDS_CLIENT_SECRET}}","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]}}' |
| 67 | + dir: "ui/cypress/plugins" |
| 68 | + |
| 69 | + - name: "Create Gmail token json" |
| 70 | + id: create-gmail-token-file |
| 71 | + uses: jsdaniell/create-json@v1.2.3 |
| 72 | + with: |
| 73 | + name: "token_qa.json" |
| 74 | + json: '{"access_token":"${{secrets.CY_TOKEN_ACCESS}}","refresh_token":"${{secrets.CY_TOKEN_REFRESH}}","scope":"https://www.googleapis.com/auth/gmail.readonly https://www.googleapis.com/auth/gmail.send","token_type":"Bearer","expiry_date":${{secrets.CY_TOKEN_EXPIRY_DATE}}}' |
| 75 | + dir: "ui/cypress/plugins" |
| 76 | + |
| 77 | +########################################################################################################## |
| 78 | + |
| 79 | + - name: Cypress run |
| 80 | + uses: cypress-io/github-action@v6 |
| 81 | + with: |
| 82 | + install-command: npm install cypress --legacy-peer-deps |
| 83 | + working-directory: ui |
| 84 | + spec: "${{ matrix.spec }}" |
| 85 | + |
| 86 | + # upload our cypress output results but only if the cypress tests failed |
| 87 | + # NOTE: artifacts must have unique names |
| 88 | + - uses: actions/upload-artifact@v4 |
| 89 | + if: failure() |
| 90 | + with: |
| 91 | + name: "cypress-screenshots-${{ matrix.name }}" |
| 92 | + path: ui/cypress/screenshots |
| 93 | + if-no-files-found: ignore |
| 94 | + |
| 95 | + - uses: actions/upload-artifact@v4 |
| 96 | + if: failure() |
| 97 | + with: |
| 98 | + name: "cypress-videos-${{ matrix.name }}" |
| 99 | + path: ui/cypress/videos |
| 100 | + if-no-files-found: ignore |
| 101 | + |
| 102 | + |
0 commit comments