navapbc / wic-participant-recertification-portal

https://navapbc.github.io/wic-participant-recertification-portal/
Apache License 2.0
0 stars 1 forks source link

[PRP-181] Set up testing for staff portal using Playwright #29

Closed rocketnova closed 1 year ago

rocketnova commented 1 year ago

Ticket

https://wicmtdp.atlassian.net/browse/PRP-181

Changes

What was added, updated, or removed in this PR.

Context for reviewers

Testing instructions, background context, more in-depth details of the implementation, and anything else you'd like to call out or ask reviewers. Explain how the changes were verified.

This PR configures the staff portal to be able to run Playwright for e2e tests. When you run npm run e2e, it will call playwright.config.ts's webServer command, which looks like this:

  webServer: {
    command:
      "npm run prisma:update && \
       docker compose up --build && \
       docker compose exec remix_dev npx prisma migrate reset --force",
    port: 3033,

This is configured to:

  1. Copy the prisma schema and migrations from the participant folder into the staff folder (I tried symlinks but symlinks outside the docker context break docker builds)
  2. Build and run the docker containers
  3. Force a prisma reset
  4. Tell Playwright to wait for port 3033 (the lowdefy_dev container) to be ready

Testing

Screenshots, GIF demos, code examples or output to help show the changes working as expected. ProTip: you can drag and drop or paste images into this textbox.

Run npm run e2e