Test/e2e login auth#19
Merged
MartinBraquet merged 8 commits intoNov 18, 2025
Merged
Conversation
|
@n3c777 is attempting to deploy a commit to the Compass Team on Vercel. A member of the Team first needs to authorize it. |
MartinBraquet
left a comment
Member
There was a problem hiding this comment.
Let's fix the failing preSetup and postSetup tests, otherwise it's a great structure!
Co-authored-by: Martin Braquet <martin.braquet@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
MartinBraquet
requested changes
Nov 17, 2025
| await authenticatedPage.goto('/settings'); | ||
|
|
||
| await expect( | ||
| authenticatedPage.getByRole('heading', { name: 'Theme' }) |
Member
There was a problem hiding this comment.
Test still errors out here. Not sure why right now.
1) [main] › tests/e2e/web/specs/postSignIn.spec.ts:4:5 › should be logged in and see settings page
Error: expect(locator).toBeVisible() failed
Locator: getByRole('heading', { name: 'Theme' })
Expected: visible
Received: <element(s) not found>
Timeout: 5000ms
Call log:
- Expect "toBeVisible" with timeout 5000ms
- waiting for getByRole('heading', { name: 'Theme' })
7 | await expect(
8 | authenticatedPage.getByRole('heading', { name: 'Theme' })
> 9 | ).toBeVisible();
| ^
10 | });
at /home/runner/work/Compass/Compass/tests/e2e/web/specs/postSignIn.spec.ts:9:5
Error Context: test-results/web-specs-postSignIn-shoul-5e404-ed-in-and-see-settings-page-main/error-context.md
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces three components that enable two separate frontend E2E testing functionalities.
preSetup
This component is for testing areas of Compass that don’t require a logged-in user, such as signin and signup. These tests run independently.
To have Playwright recognize these files as part of preSetup, their filenames must include preSetup. This is the only component with this naming requirement; the others work normally.
A basic login test (signIn.setup.spec.ts and signInPage) has been added to demonstrate preSetup. It uses the POM design pattern.
setup
This component sets up the postSetup tests. It logs in by directly contacting Firebase and retrieves the auth state, which is then saved for future use. By avoiding UI-based login, this reduces flakiness and removes the need to re-login for every test.
postSetup
This is where the majority of E2E tests will live. It leverages the saved auth state from setup.ts as described above.
A small demonstration test (postSetup.spec.ts) shows postSetup functionality, but it can easily be replaced with other tests. The main advantage of this three-component setup is the ease of adding postSetup tests without worrying about login or authentication setup.
Hopefully this makes sense. The only thing missing is further documentation, which could be added maybe as a README for a more in-depth explanation.