Add ProtoOS header reboot E2E coverage#442
Conversation
🔐 Codex Security Review
Review SummaryOverall Risk: NONE FindingsNo findings. NotesReviewed Validation performed: Generated by Codex Security Review | |
There was a problem hiding this comment.
Pull request overview
Adds Playwright E2E coverage in the ProtoOS suite for rebooting a miner via the header power menu, plus supporting page-object and API helper utilities to validate post-reboot recovery.
Changes:
- Adds a new ProtoOS E2E scenario that triggers a reboot from the header power menu and verifies the reboot request/response and UI recovery.
- Extends the
HeaderComponentpage object with reboot dialog validation/click helpers. - Introduces an auth-aware API polling helper to wait for the system API to recover after reboot.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| client/e2eTests/protoOS/spec/power.spec.ts | Adds the new “reboot from header power menu” E2E flow with request/response assertions and recovery verification. |
| client/e2eTests/protoOS/pages/components/header.ts | Adds page-object helpers for the reboot warning and rebooting dialogs. |
| client/e2eTests/protoOS/helpers/apiAuthHelper.ts | Adds helpers to extract the auth access token from localStorage and poll an authenticated API endpoint for recovery. |
| export async function waitForAuthenticatedApiRecovery({ | ||
| accessToken, | ||
| path, | ||
| request, | ||
| timeoutMs = 20_000, | ||
| }: WaitForAuthenticatedApiRecoveryParams) { |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8cce1f4664
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| expect(rebootRequest.method()).toBe("POST"); | ||
| expect(rebootResponse.status()).toBe(202); | ||
| await headerComponent.validateRebootingDialogVisible(); |
There was a problem hiding this comment.
Assert the reboot dialog before awaiting the response
In the current header implementation, confirming reboot sets shouldReboot but PowerWidget clears it as soon as isAwake is already true, which is the normal pre-reboot Mining state (client/src/protoOS/components/PageHeader/Power/PowerWidget.tsx lines 131-143). Because this test waits for the POST response before checking the dialog, fast/local runs can miss the one-render flash and fail even though the reboot request was sent. Assert the dialog immediately after clicking, or wait on a state that actually persists through reboot.
Useful? React with 👍 / 👎.
Summary
Testing