Skip to content

Add ProtoOS header reboot E2E coverage#442

Open
edgars-avotins wants to merge 2 commits into
mainfrom
codex/protoos-header-reboot-e2e
Open

Add ProtoOS header reboot E2E coverage#442
edgars-avotins wants to merge 2 commits into
mainfrom
codex/protoos-header-reboot-e2e

Conversation

@edgars-avotins

Copy link
Copy Markdown
Contributor

Summary

  • add direct ProtoOS E2E coverage for rebooting from the header power menu
  • extend the header page object with reboot dialog helpers
  • add a small auth API helper to wait for post-reboot recovery

Testing

  • ./node_modules/.bin/eslint e2eTests/protoOS/spec/power.spec.ts e2eTests/protoOS/pages/components/header.ts e2eTests/protoOS/helpers/apiAuthHelper.ts
  • ../../node_modules/.bin/playwright test spec/power.spec.ts --grep "Miner can be rebooted from the header power menu"
  • ../../node_modules/.bin/playwright test spec/power.spec.ts

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

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

🔐 Codex Security Review

Note: This is an automated security-focused code review generated by Codex.
It should be used as a supplementary check alongside human review.
False positives are possible - use your judgment.

Scope summary

  • Reviewed pull request diff only (75933fce45c269e41e0ba2b30cd33825b0389fa7...6b75c2be4fe253e7b589700068bff5f891cda81e, exact PR three-dot diff)
  • Model: gpt-5.5

💡 Click "edited" above to see previous reviews for this PR.


Review Summary

Overall Risk: NONE

Findings

No findings.

Notes

Reviewed .git/codex-review.diff only. The scoped diff adds ProtoOS Playwright E2E helper/test code for the reboot flow and page object methods; it does not modify production auth, backend handlers, SQL, protobufs, plugins, network discovery, infrastructure, or mining pool/wallet configuration.

Validation performed: git diff --check 75933fce45c269e41e0ba2b30cd33825b0389fa7 6b75c2be4fe253e7b589700068bff5f891cda81e passed. I did not run the Playwright E2E suite.


Generated by Codex Security Review |
Triggered by: @edgars-avotins |
Review workflow run

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

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 HeaderComponent page 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.

Comment on lines +36 to +41
export async function waitForAuthenticatedApiRecovery({
accessToken,
path,
request,
timeoutMs = 20_000,
}: WaitForAuthenticatedApiRecoveryParams) {

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants