Skip to content

Add ProtoOS E2E coverage for no-pools callout suppression#483

Open
edgars-avotins wants to merge 1 commit into
mainfrom
codex/protoos-no-pools-callout-e2e
Open

Add ProtoOS E2E coverage for no-pools callout suppression#483
edgars-avotins wants to merge 1 commit into
mainfrom
codex/protoos-no-pools-callout-e2e

Conversation

@edgars-avotins

Copy link
Copy Markdown
Contributor

Summary

  • add ProtoOS E2E coverage for the route-sensitive no-pools global callout behavior
  • verify the global no-pools banner appears on Home when pools are cleared
  • verify the Pools page shows its own empty state while suppressing the global banner

Testing

  • ./node_modules/.bin/eslint e2eTests/protoOS/pages/home.ts e2eTests/protoOS/pages/pools.ts e2eTests/protoOS/spec/pools.spec.ts
  • npx playwright test spec/00-onboarding.spec.ts --project=desktop
  • npx playwright test spec/pools.spec.ts --project=desktop --grep "Suppress no-pools global callout"
  • npx playwright test spec/pools.spec.ts --project=desktop
  • npx playwright test spec/pools.spec.ts --project=mobile --grep "Suppress no-pools global callout"

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

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 (d34b3cd7fc43747cf82d7170d3bd4e0b5756b8c9...70fa0a4c85e268c420b80786ea43609d7f1e956a, exact PR three-dot diff)
  • Model: gpt-5.5

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


Review Summary

Overall Risk: MEDIUM

Findings

[MEDIUM] E2E Test Clears All Mining Pools Without Restoring Them

  • Category: Reliability
  • Location: client/e2eTests/protoOS/spec/pools.spec.ts:104
  • Description: The new test calls clearAllPoolsViaApi(), which posts [] to POST /api/v1/pools. That endpoint replaces the current pool configuration, so this permanently leaves the target miner/test fixture with zero configured pools. There is no finally, afterEach, or fixture-level restore of the previous/default pool configuration.
  • Impact: A successful test run contaminates shared state for later specs, later Playwright projects, or the next suite run. If this suite is pointed at real miner hardware, it also leaves the miner without mining pools configured, interrupting mining and revenue until manually repaired.
  • Recommendation: Snapshot the existing pool configuration before clearing it and restore it in a finally/afterEach, or create this empty-state scenario in an isolated disposable fixture. At minimum, recreate the default test pool before the test exits.

Notes

The reviewed diff only changes ProtoOS Playwright page objects/specs. I did not find auth, SQL injection, gRPC, command injection, infrastructure, protobuf, Rust, or cryptostealing/pool-hijack issues in the changed hunks.


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 ProtoOS Playwright E2E coverage for the route-sensitive “no pools” global callout behavior, ensuring the global banner appears on Home when pools are cleared, but is suppressed on the Pools empty-state page in favor of the page-specific empty state.

Changes:

  • Added a new Pools spec asserting global “no pools” callout behavior on Home and suppression on Pools settings.
  • Added Pools page-object helpers to clear pools via authenticated API and validate the empty state / hidden global callout.
  • Added Home page-object helpers to validate and click the “no pools” callout CTA.

Reviewed changes

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

File Description
client/e2eTests/protoOS/spec/pools.spec.ts Adds a new scenario validating global callout vs Pools empty-state suppression.
client/e2eTests/protoOS/pages/pools.ts Adds API-based pool clearing and new empty-state/callout assertions.
client/e2eTests/protoOS/pages/home.ts Adds helpers to assert/click the “no pools configured” callout on Home.

Comment on lines +5 to +10
async validateNoMiningPoolsCallout() {
const callout = this.page.getByTestId("callout");
await expect(callout).toBeVisible();
await expect(callout.getByText("No mining pools configured.")).toBeVisible();
await expect(callout.getByRole("button", { name: "Add mining pools" })).toBeVisible();
}
Comment on lines +52 to +56
async validateNoPoolsEmptyState() {
await expect(this.page.getByText("Pools", { exact: true })).toBeVisible();
await expect(this.page.getByText("Add up to 3 pools for your miner.")).toBeVisible();
await expect(this.page.getByTestId("add-pool-button")).toBeVisible();
}
Comment on lines +102 to +106
test("Suppress no-pools global callout on the pools empty state page", async ({ homePage, poolsPage }) => {
await test.step("Clear configured pools through the authenticated API", async () => {
await poolsPage.clearAllPoolsViaApi();
await homePage.reloadPage();
});

@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: 70fa0a4c85

ℹ️ 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".

}

async clickAddMiningPoolsInCallout() {
await this.page.getByTestId("callout").getByRole("button", { name: "Add mining pools" }).click();

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 Make the CTA locator unique

When Home has no pools, the route renders two NoPoolsCallouts: the App-level banner in client/src/protoOS/components/App/App.tsx:400-402 and the KPI layout banner in client/src/protoOS/features/kpis/components/KpiLayout/KpiLayout.tsx:58. Both use the default data-testid="callout" and button text Add mining pools, so this click() locator matches two buttons; Playwright strict locator actions throw when an action resolves to more than one element, so the new E2E fails before it can assert the Pools page. Scope the click to the intended banner or otherwise make the locator unique.

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