Skip to content

Add ProtoOS E2E coverage for auth redirects#450

Open
edgars-avotins wants to merge 1 commit into
mainfrom
codex/protoos-auth-redirect-e2e
Open

Add ProtoOS E2E coverage for auth redirects#450
edgars-avotins wants to merge 1 commit into
mainfrom
codex/protoos-auth-redirect-e2e

Conversation

@edgars-avotins

Copy link
Copy Markdown
Contributor

Summary

  • add ProtoOS E2E coverage for default-password redirect and dismissed login-modal recovery flows
  • add a simulator-only fake-rig auth-state endpoint so the tests can seed deterministic auth conditions
  • keep the spec readable by moving auth-state setup into a dedicated helper and authentication page object helpers

Testing

  • ./bin/go test ./server/fake-proto-rig (run as ok github.com/block/proto-fleet/server/fake-proto-rig (cached))
  • ./node_modules/.bin/eslint e2eTests/protoOS/helpers/authStateHelper.ts e2eTests/protoOS/fixtures/pageFixtures.ts e2eTests/protoOS/pages/authentication.ts e2eTests/protoOS/spec/authRedirects.spec.ts
  • npx playwright test spec/authRedirects.spec.ts

@edgars-avotins edgars-avotins requested a review from a team as a code owner June 15, 2026 12:54
Copilot AI review requested due to automatic review settings June 15, 2026 12:54
@github-actions github-actions Bot added javascript Pull requests that update javascript code client server labels Jun 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds ProtoOS Playwright E2E coverage for auth redirect behavior by introducing a simulator-only auth-state seeding endpoint in the fake Proto rig, plus a small set of page-object/helpers to keep the new spec readable and deterministic.

Changes:

  • Added a fake-proto-rig REST endpoint to seed auth/onboarding state for deterministic E2E setup.
  • Added a ProtoOS Playwright helper + page-object methods and a new spec covering default-password redirect and dismissed login-modal recovery flows.
  • Added unit test coverage for the new fake-proto-rig testing endpoint behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
server/fake-proto-rig/rest_api_handler.go Adds /api/v1/testing/auth-state route + handler to mutate simulator auth state for E2E setup.
server/fake-proto-rig/rest_api_handler_test.go Adds a unit test verifying the testing endpoint updates auth state and revokes credentials.
server/fake-proto-rig/models.go Adds ApplyTestingAuthState to mutate auth/onboarding fields and clear issued credentials.
client/e2eTests/protoOS/spec/authRedirects.spec.ts New E2E spec validating redirect behavior for default-password and dismissed-login flows.
client/e2eTests/protoOS/pages/authentication.ts Adds auth URL assertions and login-modal helpers to the Authentication page object.
client/e2eTests/protoOS/helpers/authStateHelper.ts New helper to safely seed simulator auth state via the new testing endpoint.
client/e2eTests/protoOS/fixtures/pageFixtures.ts Wires authStateHelper into the shared ProtoOS Playwright fixtures.

Comment on lines +1459 to +1464

var req TestingAuthStateRequest
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
h.writeError(w, http.StatusBadRequest, "INVALID_REQUEST", "Invalid request body")
return
}
Comment on lines +565 to +566
// - Simulator-only testing helpers: public endpoints under /testing used by
// Playwright to seed deterministic fake-rig state.
Comment on lines +13 to +18
async validateLoginRequiredModal() {
await this.validateModalIsOpen();
await this.validateTitleInModal("Login required");
await this.validateButtonIsVisible("Cancel");
await expect(this.page.getByTestId("login-button")).toBeVisible();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client javascript Pull requests that update javascript code server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants