Skip to content

Test/e2e login auth#19

Merged
MartinBraquet merged 8 commits into
CompassConnections:mainfrom
n3c777:test/e2e-login-auth
Nov 18, 2025
Merged

Test/e2e login auth#19
MartinBraquet merged 8 commits into
CompassConnections:mainfrom
n3c777:test/e2e-login-auth

Conversation

@n3c777

@n3c777 n3c777 commented Nov 13, 2025

Copy link
Copy Markdown
Collaborator

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

vercel Bot commented Nov 13, 2025

Copy link
Copy Markdown

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

A member of the Team first needs to authorize it.

@MartinBraquet MartinBraquet left a comment

Copy link
Copy Markdown
Member

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!

Comment thread tests/e2e/web/specs/postSetup.spec.ts Outdated
Comment thread playwright.config.ts Outdated
Comment thread tests/e2e/web/specs/setup.ts Outdated
Comment thread tests/e2e/web/specs/signIn.preSetup.spec.ts Outdated
Comment thread tests/e2e/web/specs/setup.ts Outdated
Comment thread tests/e2e/web/specs/signIn.preSetup.spec.ts Outdated
@vercel

vercel Bot commented Nov 17, 2025

Copy link
Copy Markdown

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

codecov Bot commented Nov 18, 2025

Copy link
Copy Markdown

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