Fixed e2e tests when running multiple browsers concurrently#2799
Fixed e2e tests when running multiple browsers concurrently#2799
Conversation
Sigrid maintainability feedback💭️ You did not change any files that are analyzed by Sigrid. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2799 +/- ##
==========================================
+ Coverage 91.33% 91.36% +0.02%
==========================================
Files 376 379 +3
Lines 17574 17639 +65
Branches 2004 1987 -17
==========================================
+ Hits 16051 16115 +64
+ Misses 1426 1425 -1
- Partials 97 99 +2 ☔ View full report in Codecov by Sentry. |
| const adminContext = await request.newContext(); | ||
| await page.goto("/account/login"); | ||
| await adminContext.storageState({ path: "e2e-tests/state/coordinator2.json" }); | ||
|
|
||
| const loginPage = new LoginPgObj(page); | ||
| await loginPage.login("coordinator2", getTestPassword("coordinator2")); |
There was a problem hiding this comment.
These lines are mixing up storageState and logging in.
What happens here is:
- we create an
adminContextwith the storageState ofcoordinator2; - we don't use that
adminContextin the rest of the test; - we log in as
coordinator2, invalidating the session of theadminContext.
| let electionId: number | null = null; | ||
|
|
||
| test(`create typists for flow`, async ({ page }) => { | ||
| test(`create typists for flow`, async ({ page, browserName }) => { |
There was a problem hiding this comment.
An advantage of adding a random string to the usernames is that we can do it where they are defined as const as on line 65 for the typists. You do then lose the information on which browser the test is running, but the test outut/report also contains that information.
There was a problem hiding this comment.
typist3 and typist4 are also used in these tests:
Do I need to use a random string for the usernames instead?
5633844 to
33bb5e5
Compare
PDF Diff SummaryComparing against base branch:
|
Fixes #2793