Skip to content

Conversation

@n3c777
Copy link
Collaborator

@n3c777 n3c777 commented Nov 13, 2025

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.

@vercel
Copy link

vercel bot commented Nov 13, 2025

@n3c777 is attempting to deploy a commit to the Compass Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Member

@MartinBraquet MartinBraquet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's fix the failing preSetup and postSetup tests, otherwise it's a great structure!

@vercel
Copy link

vercel bot commented Nov 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
compass Ready Ready Preview Comment Nov 18, 2025 10:18pm

await authenticatedPage.goto('/settings');

await expect(
authenticatedPage.getByRole('heading', { name: 'Theme' })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

codecov bot commented Nov 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@MartinBraquet MartinBraquet merged commit f7fb0c6 into CompassConnections:main Nov 18, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants