Add ProtoOS E2E coverage for auth redirects#450
Open
edgars-avotins wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
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(); | ||
| } |
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.
Summary
Testing