Add ProtoOS E2E coverage for no-pools callout suppression#483
Add ProtoOS E2E coverage for no-pools callout suppression#483edgars-avotins wants to merge 1 commit into
Conversation
🔐 Codex Security Review
Review SummaryOverall Risk: MEDIUM Findings[MEDIUM] E2E Test Clears All Mining Pools Without Restoring Them
NotesThe 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 | |
There was a problem hiding this comment.
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. |
| 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(); | ||
| } |
| 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(); | ||
| } |
| 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(); | ||
| }); |
There was a problem hiding this comment.
💡 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(); |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
Testing