Skip to content

Commit

Permalink
chore(e2e): do not always slow down cypress videos (#1017)
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasduteil authored Mar 5, 2025
1 parent 210ae7b commit 7889491
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 57 deletions.
57 changes: 4 additions & 53 deletions .github/workflows/end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,11 @@ on:
- "!master"

env:
PGUSER: moncomptepro
PGPASSWORD: moncomptepro
PGDATABASE: moncomptepro
PGHOST: 127.0.0.1
PGPORT: 5432
BREVO_API_KEY: ${{ secrets.BREVO_API_KEY }}
CYPRESS_BASE_URL: http://172.18.0.1:3000
CYPRESS_MAILSLURP_API_KEY: ${{ secrets.MAILSLURP_API_KEY }}
DATABASE_URL: postgres://moncomptepro:[email protected]:5432/moncomptepro
CYPRESS_RECORD: true
DATABASE_URL: postgres://moncomptepro:moncomptepro@localhost:5432/moncomptepro
DEBOUNCE_API_KEY: ${{ secrets.DEBOUNCE_API_KEY }}
FEATURE_SEND_MAIL: "True"
HOST: http://172.18.0.1:3000
ZAMMAD_TOKEN: ${{ secrets.ZAMMAD_TOKEN }}
jobs:
test:
Expand Down Expand Up @@ -54,52 +47,10 @@ jobs:
- signup_entreprise_unipersonnelle
- update_personal_information
runs-on: ubuntu-22.04
services:
standard-client:
image: ghcr.io/numerique-gouv/proconnect-test-client
ports:
- 4000:3000
env:
SITE_TITLE: standard-client
HOST: http://localhost:4000
PC_CLIENT_ID: standard_client_id
PC_CLIENT_SECRET: standard_client_secret
PC_PROVIDER: ${{ env.HOST }}
PC_SCOPES: openid email profile organization
ACR_VALUE_FOR_2FA: https://proconnect.gouv.fr/assurance/consistency-checked-2fa
STYLESHEET_URL: ""
proconnect-federation-client:
image: ghcr.io/numerique-gouv/proconnect-test-client
ports:
- 4001:3000
env:
SITE_TITLE: proconnect-federation-client
HOST: http://localhost:4001
PC_CLIENT_ID: proconnect_federation_client_id
PC_CLIENT_SECRET: proconnect_federation_client_secret
PC_PROVIDER: ${{ env.HOST }}
PC_SCOPES: openid uid given_name usual_name email siren siret organizational_unit belonging_population phone chorusdt is_service_public is_public_service
PC_ID_TOKEN_SIGNED_RESPONSE_ALG: ES256
PC_USERINFO_SIGNED_RESPONSE_ALG: ES256
STYLESHEET_URL: ""
LOGIN_HINT: [email protected]
ACR_VALUES: eidas1
redis:
image: redis:7.2
ports:
- 6379:6379
postgres:
image: postgres:15.10
env:
POSTGRES_USER: ${{ env.PGUSER }}
POSTGRES_PASSWORD: ${{ env.PGPASSWORD }}
POSTGRES_DB: ${{ env.PGDATABASE }}
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4

- run: docker compose up --build --detach maildev
- run: docker compose up --build --detach

- run: corepack enable
- uses: actions/setup-node@v4
Expand All @@ -114,7 +65,7 @@ jobs:
- name: Cypress run
uses: cypress-io/[email protected]
with:
wait-on: ${{ env.HOST }}/users/start-sign-in
wait-on: http://localhost:3000/users/start-sign-in
build: npm run build:assets
start: npx dotenvx run -f cypress/e2e/${{ matrix.e2e_test }}/env.conf --overload -- npm run start:with-mocks
install: false
Expand Down
2 changes: 1 addition & 1 deletion cypress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ By default, the Docker Compose file is configured to launch enough test clients
To help support and the team better visualise the different ProConnect Identity paths, it is possible to film the paths via Cypress. The command to run is as follows:
```bash
CYPRESS_RECORD=true npx dotenvx run -- npx cypress run --headed --spec "cypress/e2e/join_and_moderation/index.cy.ts"
CYPRESS_RECORD=true CYPRESS_RECORD_FOR_HUMANS=true npx dotenvx run -- npx cypress run --headed --spec "cypress/e2e/join_and_moderation/index.cy.ts"
```
The videos are listed on the following documentation page: https://documentation.beta.numerique.gouv.fr/doc/videos-des-differents-parcours-A3UJiqFLZn
Expand Down
6 changes: 3 additions & 3 deletions cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import "cypress-maildev";

import "./commands";

const RECORD = Cypress.env("RECORD") === true;
const RECORD_FOR_HUMANS = Cypress.env("RECORD_FOR_HUMANS") === true;

if (RECORD) {
if (RECORD_FOR_HUMANS) {
["visit", "click", "trigger", "type", "clear", "reload", "select"].forEach(
(command) => {
Cypress.Commands.overwrite(
Expand All @@ -18,7 +18,7 @@ if (RECORD) {
() => {
resolve(origVal);
},
RECORD ? 2000 : 0,
RECORD_FOR_HUMANS ? 2000 : 0,
);
});
},
Expand Down

0 comments on commit 7889491

Please sign in to comment.