-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Missions] Corrections de l'enregistrement automatique (ENV VAR UPDAT…
…E) (#2838) ## Linked issues - Resolve #2820 - [x] Ajout de tests multi-fenêtres - [x] Ajout d'un docker-compose pour faire tourner MonitorEnv - [x] Ajout de la nouvelle CI pour run les tests multi-windows ---- - [x] Tests E2E (Cypress)
- Loading branch information
Showing
56 changed files
with
1,897 additions
and
699 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Test end-to-end (e2e) multi-fenêtres pour la synchronisation des missions | ||
|
||
Date: 17/01/2024 | ||
|
||
## Statut | ||
|
||
Résolu, à approfondir. | ||
|
||
## Contexte | ||
|
||
Les tests de synchronisation du formulaire des missions sont : | ||
- Fastidieux à effectuer (il faut ouvrir plusieurs fenêtre et switcher entre celles-ci) et difficile à repliquer | ||
- Impossible à exécuter de manière automatique dans `Cypress` | ||
|
||
En se basant sur [cet article](https://liveblocks.io/blog/e2e-tests-with-puppeteer-and-jest-for-multiplayer-apps), `Puppeteer` a été choisi comme pour tester | ||
sur plusieurs fenêtres. | ||
|
||
### `Puppeteer` | ||
|
||
L'outil est simple à mettre en place et se focalise seulement sur la manipulation d'un navigateur depuis `NodeJS`. | ||
Nous utilisons `jest` pour écrire les assertions. | ||
|
||
Il est possible de tester en mode `headless` (pour la CI) ou `headfull` (pour développer). | ||
|
||
Les tests ont été concluants et permettent d'avoir un premier jeu de tests de la synchronisation des missions, voir `puppeteer/e2e/*.spec.ts`. | ||
|
||
## Décision | ||
|
||
`Puppeteer` est ajouté dans la CI de tests e2e. | ||
|
||
## Conséquences | ||
|
||
Une deuxième librairie de test e2E a été ajoutée, attention à bien utiliser `Puppeteer` seulement pour les tests de plusieurs fenêtres. | ||
|
||
à creuser : | ||
- L'utilisation de `Puppeteer` pour les tests de `SideWindow` (ouvertes avec `document.open()`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module.exports = { | ||
rootDir: '../..', | ||
globalSetup: "<rootDir>/puppeteer/setup.ts", | ||
testEnvironment: '<rootDir>/puppeteer/puppeteer_environment.ts', | ||
// because it's detected by the default value of testRegex | ||
// https://jestjs.io/docs/configuration#testregex-string--arraystring | ||
globalTeardown: "<rootDir>/puppeteer/teardown.ts", | ||
testMatch: ['<rootDir>/puppeteer/e2e/*.spec.ts'], | ||
preset: "ts-jest", | ||
transform: { | ||
".ts": [ | ||
"ts-jest", | ||
{ | ||
isolatedModules: true, | ||
useESM: true, | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.