Skip to content

Commit 515d02b

Browse files
committed
fix: split up cypress tests to try and fix api limit
1 parent ee27e22 commit 515d02b

File tree

4 files changed

+178
-1
lines changed

4 files changed

+178
-1
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: test-e2e-cypress-csv-add-affiliations
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+
# keep running jobs even if one test fails in case there are multiple failed tests
16+
fail-fast: false
17+
18+
###################################################################################################
19+
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: "Create creds json"
26+
id: create-creds-json
27+
uses: jsdaniell/create-json@v1.2.3
28+
with:
29+
name: "credentials.json"
30+
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}}"}'
31+
dir: "ui/cypress/fixtures"
32+
33+
- name: "Create Gmail creds json"
34+
id: create-gmail-creds-file
35+
uses: jsdaniell/create-json@v1.2.3
36+
with:
37+
name: "credentials_qa.json"
38+
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"]}}'
39+
dir: "ui/cypress/plugins"
40+
41+
- name: "Create Gmail token json"
42+
id: create-gmail-token-file
43+
uses: jsdaniell/create-json@v1.2.3
44+
with:
45+
name: "token_qa.json"
46+
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}}}'
47+
dir: "ui/cypress/plugins"
48+
49+
##########################################################################################################
50+
51+
- name: Cypress run
52+
uses: cypress-io/github-action@v6
53+
with:
54+
install-command: npm install cypress --legacy-peer-deps
55+
working-directory: ui
56+
spec: "${{ matrix.spec }}"
57+
58+
# upload our cypress output results but only if the cypress tests failed
59+
# NOTE: artifacts must have unique names
60+
- uses: actions/upload-artifact@v4
61+
if: failure()
62+
with:
63+
name: "cypress-screenshots-${{ matrix.name }}"
64+
path: ui/cypress/screenshots
65+
if-no-files-found: ignore
66+
67+
- uses: actions/upload-artifact@v4
68+
if: failure()
69+
with:
70+
name: "cypress-videos-${{ matrix.name }}"
71+
path: ui/cypress/videos
72+
if-no-files-found: ignore
73+
74+

.github/workflows/cypress new ui.yml renamed to .github/workflows/test-e2e-cypress-all.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Cypress end to end tests
1+
name: test-e2e-cypress-all
22

33
on:
44
workflow_dispatch:
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
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+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ gateway/yarn.lock
99
gateway/cypress/fixtures/editAffiliations.csv
1010
gateway/cypress/fixtures/bulk-edit-salesforce-ids-config.json
1111
.idea/
12+
.vscode/

0 commit comments

Comments
 (0)