-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup end to end tests #376
base: main
Are you sure you want to change the base?
Conversation
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
Ok pour moi sur le principe, c'est vrai qu'il y a de plus en plus de js dans les pages, ça devient une nécessité. |
README.md
Outdated
|
||
```bash | ||
$ . envs/postgres | ||
$ docker-compose exec postgres bash -c 'dropdb envergo-test -U "$POSTGRES_USER" -f' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ docker-compose exec postgres bash -c 'dropdb envergo-test -U "$POSTGRES_USER" -f' | |
$ docker-compose exec postgres bash -c 'dropdb --if-exists envergo-test -U "$POSTGRES_USER" -f' |
$ docker-compose exec postgres bash -c 'dropdb envergo-test -U "$POSTGRES_USER" -f' | ||
$ docker-compose exec postgres bash -c 'createdb envergo-test -U "$POSTGRES_USER" -O "$POSTGRES_USER"' | ||
$ docker-compose run -e POSTGRES_DB=envergo-test --rm django python manage.py migrate | ||
$ docker compose run -e POSTGRES_DB=envergo-test --rm django python manage.py loaddata e2e/fixtures/db_seed.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ docker compose run -e POSTGRES_DB=envergo-test --rm django python manage.py loaddata e2e/fixtures/db_seed.json | |
$ docker-compose run -e POSTGRES_DB=envergo-test --rm django python manage.py loaddata e2e/fixtures/db_seed.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
La V2 de Docker compose utilise la syntaxe docker compose
et non plus docker-compose
.
Je crois comprendre que dans le future c'est cette syntaxe qui devrait s'imposer . Je préconise donc que l'on utilise docker compose
partout dans les Readme. Qu'en penses tu ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok j'ignorais. Je rencontre des erreurs lorsque j'utilise cette commande telle quelle. Peut-être ajouter une mini note là dessus dans la doc ?
README.md
Outdated
Vous devez ensuite lancer l'application en pointant vers la base de test: | ||
|
||
```bash | ||
$ POSTGRES_DB=envergo-test docker compose up -d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ POSTGRES_DB=envergo-test docker compose up -d | |
$ POSTGRES_DB=envergo-test docker-compose up -d |
Enfin vous pouvez lancer les tests avec l'une des commandes suivantes : | ||
|
||
```bash | ||
$ npx playwright test --ui # pour lancer les tests dans un navigateur |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quand j'installe playwright, il me pose les questions d'initialisation du projet (js / ts, initi de la github action, etc.). Pourtant le projet est déjà configuré ici. Ça te parle ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Du coup chez moi aucun test ne passe. Est-ce normal ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'ai améliorer le Readme. Certaine commande n'était pas complète.
Dis moi si c'est mieux.
Evidemment le comportement "normal", c'est quand les tests passent en local et sur la CI :)
README.md
Outdated
$ docker compose run -e POSTGRES_DB=envergo-test --rm django python manage.py loaddata e2e/fixtures/db_seed.json | ||
``` | ||
|
||
Vous devez ensuite installer Playwright en suivant les instructions de la [documentation](https://playwright.dev/docs/intro#installing-playwright). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'ai installé via :
npm install @playwright/test
npm install @playwright/test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Effectivement, la page d'installation de la documentation présente le processus d'initialisation.
Lorsque le projet est déjà configuré, comme c'est le cas ici, il faut utiliser les commandes suivantes:
$ npm install @playwright/test
$ npx playwright install
Je mets à jour le Readme
Bon j'ai eu pas mal de galère comme l'historique de commit peut en témoigner.
J'ai écris 3 tests assez minimalistes (affichage de la home, demande d'AR, simulation), mais ca fait une base que l'on pourra completer à partir de maintenant.
Ce qu'il faudrait améliorer :
Je te laisse regarder ça @thibault et me dire ce que tu en penses.
GitGuardian : selon ce document les ops devrait lever l'alerte en la flagant comme faux positif.