glpi icon indicating copy to clipboard operation
glpi copied to clipboard

Playwright setup

Open AdrienClairembault opened this issue 9 months ago • 4 comments

Checklist before requesting a review

  • [X] I have performed a self-review of my code.
  • [X] I have added tests that prove my fix is effective or that my feature works.

Description

Extracted from https://github.com/glpi-project/glpi/pull/18927 with only one test (others needs to be reworked since they have been updated on cypress in the meantime - will be done on dedicated PRs to keep this one light).

AdrienClairembault avatar May 20 '25 13:05 AdrienClairembault

This setup is nearly complete and could be merged right now IMO, which will allow me to get started on migrating existing tests (and adding an install test as we discussed today).

Things that are missing and could be added in a followup PR:

  • ~Use a dedicated "e2e" environment different from "testing" (more convenient for running tests locally as they won't conflict/pollute the phpunit database. We have a good idea on how to do this with @cedric-anne and we can probably do it next week).~ -> done in 8bd6ad55fb687b98419a5093e10bbb6807eabbe2.
  • Use our own runner for better performances and multi-threading (not relevant yet as only one test exist, can be delayed until more tests are migrated. POC have been done on possible runners already, just need some more tests with our own machines to limit costs).

AdrienClairembault avatar May 21 '25 13:05 AdrienClairembault

Trying to run locally, I got the following fail: image

trasher avatar May 22 '25 13:05 trasher

Can you retry with the latest changes (and generate a trace (npx playwright test --trace=on) and send it to me if it still fails) ?

AdrienClairembault avatar May 26 '25 11:05 AdrienClairembault

WIth lastest changes, I no longer can run tests:

Can you retry with the latest changes (and generate a trace (npx playwright test --trace=on) and send it to me if it still fails) ?

My local setup is now broken. I'm not going to spend more time on that; goal is not to run all that locally.

trasher avatar Jun 02 '25 08:06 trasher

@cedric-anne the recent changes you made to the githubactions-php-apache ci image prevent me from running the playwright tests on them.

Indeed, you forced the testing env in the virtual env which mean we can't run playwright on the e2e_testing env. We need to either:

  • Rollback this change (find another fix if possible, I do not know why you needed this)
  • Change githubactions-php-apache to expose another port with the e2e_testing env, like we did for the dev image.

Edit: done, see https://github.com/glpi-project/docker-images/commit/1b77895c64e9dc12e8801b1a20cd3bfa0b634a2c.

AdrienClairembault avatar Jul 07 '25 08:07 AdrienClairembault

Replaced by #21922 .

cedric-anne avatar Nov 13 '25 10:11 cedric-anne