Skip to content

test(frontend): point the acceptance suite at what the UI renders now - #6514

Open
ardaerzin wants to merge 4 commits into
mainfrom
fix/acceptance-antd-selectors
Open

test(frontend): point the acceptance suite at what the UI renders now#6514
ardaerzin wants to merge 4 commits into
mainfrom
fix/acceptance-antd-selectors

Conversation

@ardaerzin

Copy link
Copy Markdown
Contributor

Relates to #6154, #5616.

What's broken

tests / run-web-tests (acceptance) is red on every branch — 11 failed / 5 flaky / 33 passed on the release/v0.114.7 tip, and v0.114.7 shipped with it waived. The suite has been giving no signal, so a real frontend regression would land unseen.

Why

The antd → Radix/shadcn migration removed the CSS classes these tests select on. The UI is fine; the locators match nothing — and a locator that matches nothing doesn't fail with a reason, it hangs until the timeout. That's the 12 × locator.isDisabled: Test timeout of 60000ms and 32 × element(s) not found in the run.

Note this is not the failure #6154 describes. That issue's signature (navigateToModels waiting on an LLMs heading, 28×/run) no longer occurs at all — zero occurrences in today's run. The suite moved on to a different failure mode.

The fixes

Six locators, each pointed at a hook that survives the swap:

Where Was Now
playground/tests.ts saveVariant button.ant-btn-primary + "Commit" getByRole("button", {name: "Commit"})
playground/index.ts same same
observability projection tabs .ant-radio-button-wrapper + -checked class role=radiogroup / role=radio + toBeChecked()
observability span glyph .ant-avatar-square data-testid="span-type-avatar"
testset-management.ts .ant-table-tbody .avt-body
use-api row selection .ant-table-tbody .ant-checkbox-input .avt-body + role=checkbox
use-api variants tab .ant-radio-button-wrapper role=radio

saveVariant is the high-leverage one: the two playground failures and all three observability failures run through it, so five of the eleven are one bug.

It also asserts the Commit button is visible before calling isDisabled(). Without that, a missing button burns the full 60s and reports a timeout instead of naming what it couldn't find.

The .avt-body hook isn't invented here — @agenta/ui's tableDom.ts already defines AVT for exactly this, documenting that the .ant-table-* half "matches nothing here".

One product change: AvatarTreeContent gains a data-testid. It's a plain div since the antd Avatar was dropped, so it offered nothing stable to select; getByTestId is already the convention in this suite.

Testing

Not verified by a run — I can't reproduce the suite locally, so CI on this PR is the check. Each locator was derived from what the component actually renders today (Segmentedrole=radiogroup, Radix Checkboxrole=checkbox, AVT.body stamped at VirtualTable.tsx:562) rather than guessed. tsc and lint are clean.

Expect this to reduce the failures, not zero them. Untouched: the agent-chat, auto-evaluation and human-annotation failures, and the 5 flaky tests — which are the fixture flows (app and prompt creation), a separate problem tracked in #5977 and #5695. The run also showed Playwright's browser install retrying twice, which is environmental.

Real product bugs may be hiding behind these stale selectors; you can't see past a locator that never resolves.

The antd->Radix migration removed the classes these tests select on, so the
locators matched nothing and the tests timed out rather than failing with a
reason. Six locators moved to role/testid/AVT hooks that survive the swap:

- saveVariant waited on button.ant-btn-primary for Commit; that button is an
  EnhancedButton, now a facade over the Radix @agenta/ui Button. It also
  asserts visibility first, so a missing button reports itself instead of
  hanging isDisabled() for the full timeout. Five of the eleven failures run
  through this one helper.
- the observability projection tabs are the shared Segmented (role=radiogroup
  of role=radio), not an antd Radio.Group with a -checked class.
- the span glyph lost its antd Avatar; it gets a data-testid instead.
- the testset and registry tables are the virtual table, whose stable hook is
  .avt-body (see AVT in tableDom.ts) and whose selection control is the Radix
  Checkbox.
@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
agenta-documentation Ready Ready Preview Sep 4, 2026 9:17am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Team

Run ID: a2c4e8f0-b927-4c9d-a427-75cad92ee176

📥 Commits

Reviewing files that changed from the base of the PR and between 9a6a841 and d31eb2a.

📒 Files selected for processing (4)
  • web/oss/tests/playwright/acceptance/app/app-management.ts
  • web/oss/tests/playwright/acceptance/playground/index.ts
  • web/oss/tests/playwright/acceptance/testsset/testset-management.ts
  • web/oss/tests/playwright/acceptance/use-api/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/oss/tests/playwright/acceptance/use-api/index.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Tests
    • Updated automated coverage for observability, playground, testset, and API workflows following interface updates.
    • Improved validation of trace controls, commit actions, table interactions, and API drawer selections.
    • Expanded checks to support accessible checkbox and radio controls across evaluation and table workflows.
    • Strengthened coverage for span indicators and table implementations used throughout app management.

Walkthrough

Acceptance tests now use role-based selectors, stable test IDs, and virtual-table hooks for the updated UI. The observability avatar component exposes the new test ID.

Changes

UI locator migration

Layer / File(s) Summary
Observability trace selectors
web/packages/agenta-observability-ui/src/cells/AvatarTreeContent.tsx, web/oss/tests/playwright/acceptance/observability/index.ts
The trace avatar uses span-type-avatar. Trace projection checks use segmented-control radio roles and checked state.
Playground commit selectors
web/oss/tests/playwright/acceptance/playground/index.ts, web/oss/tests/playwright/acceptance/playground/tests.ts
Playground flows support virtual-table or antd row selectors. Commit buttons use accessible role locators and visibility checks.
Virtual table and API selectors
web/oss/tests/playwright/acceptance/app/app-management.ts, web/oss/tests/playwright/acceptance/testsset/testset-management.ts, web/oss/tests/playwright/acceptance/use-api/index.ts, web/oss/tests/playwright/acceptance/auto-evaluation/tests.ts, web/oss/tests/playwright/acceptance/human-annotation/tests.ts
Acceptance tests use virtual-table hooks, compatible antd selectors, and Radix checkbox and radio roles. The variants-page readiness check waits for .avt-body.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: 🔵 Low · up to d31eb

This change updates acceptance-test locators for the migrated UI and preserves compatibility with both table implementations. The functional selector issue is addressed; only minor repository comment-style cleanup remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: updating frontend acceptance-test selectors to match the current UI.
Description check ✅ Passed The description directly explains the stale selector failures, the locator updates, the affected tests, and the remaining failures.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 9…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/acceptance-antd-selectors

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/oss/tests/playwright/acceptance/testsset/testset-management.ts (1)

213-213: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Migrate the remaining active table selectors.

Line 213 still queries .ant-table-cell, and Line 348 still queries .ant-table-thead .anticon-plus. The same virtual table uses avt-cell and avt-thead. These selectors can fail before the new .avt-body assertion completes. Replace them with current AVT hooks or stable roles/test IDs.

Also applies to: 348-348


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Team

Run ID: d977c360-c809-47fd-9f79-6cf30417105c

📥 Commits

Reviewing files that changed from the base of the PR and between ded2cc3 and f9de3d9.

📒 Files selected for processing (6)
  • web/oss/tests/playwright/acceptance/observability/index.ts
  • web/oss/tests/playwright/acceptance/playground/index.ts
  • web/oss/tests/playwright/acceptance/playground/tests.ts
  • web/oss/tests/playwright/acceptance/testsset/testset-management.ts
  • web/oss/tests/playwright/acceptance/use-api/index.ts
  • web/packages/agenta-observability-ui/src/cells/AvatarTreeContent.tsx

Included review availability: Your plan provides up to 8 included reviews per hour; 4 remain after this review.

Comment on lines +318 to +319
// Each span in the tree renders a span-type glyph (AvatarTreeContent, a plain div
// since the antd Avatar was dropped). At least one confirms the tree has nodes.

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Keep each new code comment to one short line.

The same hard-rule violation appears at every listed site. Compress each block to one short line. Keep the trace-control wording accurate and remove the stale Ant Design description.

  • web/oss/tests/playwright/acceptance/observability/index.ts#L318-L319: shorten the span-avatar comment.
  • web/oss/tests/playwright/acceptance/observability/index.ts#L340-L342: shorten and correct the Segmented-control comment.
  • web/oss/tests/playwright/acceptance/playground/tests.ts#L352-L354: shorten the Commit-locator comment.
  • web/oss/tests/playwright/acceptance/playground/tests.ts#L356-L358: shorten the visibility comment.
  • web/oss/tests/playwright/acceptance/testsset/testset-management.ts#L311-L312: shorten the virtual-table comment.
  • web/oss/tests/playwright/acceptance/use-api/index.ts#L127-L129: shorten the checkbox-locator comment.

As per coding guidelines: At most ONE short line per comment.

📍 Affects 4 files
  • web/oss/tests/playwright/acceptance/observability/index.ts#L318-L319 (this comment)
  • web/oss/tests/playwright/acceptance/observability/index.ts#L340-L342
  • web/oss/tests/playwright/acceptance/playground/tests.ts#L352-L354
  • web/oss/tests/playwright/acceptance/playground/tests.ts#L356-L358
  • web/oss/tests/playwright/acceptance/testsset/testset-management.ts#L311-L312
  • web/oss/tests/playwright/acceptance/use-api/index.ts#L127-L129

Source: Coding guidelines

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Preview URL https://gateway-pr-6514.up.railway.app/w
Project agenta-oss-clone-spike
Image tag pr-6514-5020a11
Status Deployed
Railway logs Open logs
Workflow logs View workflow run
Updated at 2026-09-04T09:21:31.024Z

@ardaerzin

Copy link
Copy Markdown
Contributor Author

Verified locally — the fix is confirmed, not just argued

Ran the playground spec against a local EE stack, on main and on this branch, same command both times:

AGENTA_LICENSE=ee AGENTA_API_URL=http://localhost:8081/api \
  ./node_modules/.bin/playwright test run-variant --reporter=line
main this branch
passed 2 3
failed 3 2
locator.isDisabled timeouts 2 0
wall clock 5.0m 4.3m

The baseline reproduced CI's signature exactly: both Should update the prompt and save the changes and should save the current changes as a new variant died on locator.isDisabled: Test timeout of 60000ms exceededsaveVariant waiting on button.ant-btn-primary.

Outcome per test:

  • should save the current changes as a new variantnow passes.
  • Should update the prompt and save the changes — still fails, but the isDisabled error is gone; it now reaches page.waitForResponse. It finds and clicks Commit, opens the modal, and fails later on a network wait. This is the "real bugs hiding behind stale selectors" case from the description, now demonstrated: a second, unrelated bug was masked by the locator that never resolved.
  • Should run single view variant for chat — unchanged (page.goto: net::ERR_ABORTED), unrelated to selectors.

No regressions, and the run is faster purely from not burning 60s hangs.

Reproducing locally (three traps, worth adding to #6154)

#6154's next step is "reproduce locally against a fresh stack". Three things block that, none of which point at the real cause when you hit them:

  1. Stale Playwright copy. Only web/tests/package.json declares @playwright/test (1.60.0), but an undeclared 1.59.1 can linger in web/node_modules from an older install. Test files under web/oss/tests/ resolve up the tree and get the old one → Requiring @playwright/test second time → reported as No tests found. A pnpm install in web/ prunes it.
  2. Cold Turbopack compiles exceed the harness timeouts. global-setup allows 60s for /auth and 15s for /get-started; a cold /auth compile took 143s here. A first local run therefore cannot clear global-setup, and fails looking like an auth bug. Warm /auth, /w, /post-signup and /workspaces/accept first.
  3. /get-started 404s on EE. global-setup's post-signup fallback navigates there (global-setup.ts:256). Harmless today since a 404 still fires domcontentloaded, but that safety net does nothing on EE.

CI on this branch cut failures 11 -> 8, and named the two that remained:

- testset-management still waited on .ant-table-cell, a second stale selector
  in the same file the first fix did not cover; the virtual table stamps
  .avt-cell.
- the use-api page-rendered check was my own bad replacement: the Variants
  control is not a role=radio. It now waits for the registry table the test
  actually goes on to use, so the check cannot drift with the chrome again.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Team

Run ID: f9706e98-3b05-4598-881b-537da359d008

📥 Commits

Reviewing files that changed from the base of the PR and between f9de3d9 and c59ad2a.

📒 Files selected for processing (2)
  • web/oss/tests/playwright/acceptance/testsset/testset-management.ts
  • web/oss/tests/playwright/acceptance/use-api/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/oss/tests/playwright/acceptance/testsset/testset-management.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Comment on lines +208 to +209
// Wait for the registry table itself — the thing this test goes on to use —
// rather than a tab control, so the check cannot drift with the chrome again.

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Keep the new comment to one short line. Condense the two-line note into one short // comment. As per coding guidelines: “At most ONE short line per comment.”

Source: Coding guidelines

The evaluation and annotation modals pick rows through a table whose selection
control is now a Radix <button role="checkbox">, not an <input>. isSelected()
looked for input[type=checkbox] and the antd classes, matched nothing, and fell
through to a selected-tag lookup that also no longer applied — so it returned
false however many rows were selected.

The CLICK already worked (controlSelector carries [role="checkbox"]); only the
verification was blind, which is why these failed on a 30s poll rather than on
the click. Same one-line widening in both helpers.
@ardaerzin

Copy link
Copy Markdown
Contributor Author

Third pass — CI's own results drove these

CI on the previous commit cut the suite from 11 failed → 8, and named exactly what was still wrong. Two more commits:

1. The two locators CI proved wrong (c59ad2a)

  • testset-management was still waiting on .ant-table-cell — a second stale selector in the same file the first fix didn't cover. Now .avt-cell (stamped at VirtualTable.tsx:611).
  • The use-api page-rendered check was my own bad replacement: the Variants control is not a role=radio, so getByRole('radio', {name: 'Variants'}) never resolved. It now waits for the registry table the test actually goes on to use, so the check can't drift with the chrome again.

2. The selection check was blind to Radix (9a6a841) — this one explains three failures at once.

selectAutoEvaluationModalTableInput / selectHumanEvaluationModalTableInput decide whether a row got selected via:

'input[type="checkbox"], input[type="radio"], .ant-checkbox-input, .ant-radio-input'

The control is now a Radix <button role="checkbox"> — not an <input>, and carrying no antd class. So isSelected() matched nothing, fell through to a selected-tag lookup that also no longer applies, and returned false however many rows were selected.

The click already worked (controlSelector carries [role="checkbox"]); only the verification was blind. That's why these failed on a 30s expect.poll rather than on the click. One-line widening in both helpers.

Deliberately left alone: the other .ant-* selectors in those files. That modal still genuinely renders antd Tabs/Tag, so .ant-tabs-tabpane-active and .ant-tabs-tab .ant-tag are correct.

The two remaining failures are not selector drift

Worth separating so they aren't chased as part of this:

  • observability/index.ts:244 fails inside createApp — a fixture — on waitForMatchingResponses: got 0 of 2 for POST /workflows. App creation via the UI didn't complete. app/index.ts:43 creates new completion prompt app is also in the flaky list, so this is the fixture-instability cluster ((bug) A slow environment turns an acceptance run into hundreds of fixture errors with no product signal #5977, (chore) Five web acceptance tests disabled: intermittent 60s UI timeouts in preview environments #5695), not this PR's subject.
  • agent-chat/attach-send-render-reload.spec.ts:38 times out clicking getByRole("button", {name: "Attach files"}). That locator is correct — the button carries aria-label="Attach files" — but it renders disabled={!uploadsEnabled || composerDisabled}, and Playwright's .click() waits for enabled. So either NEXT_PUBLIC_AGENT_FILE_UPLOADS=false in the preview env, or the composer is disabled for want of a provider. Either way it's environment/state, and arguably the spec should skip when the feature is off rather than hang for 120s.

Local verification note

The testsets/use-api corrections could not be confirmed locally: against a Next dev server those specs fail earlier with page.goto: net::ERR_ABORTED; maybe frame was detached?, a Turbopack-recompile artifact that doesn't occur against the built app CI tests. The playground fixes were verified locally (2 passed → 3, locator.isDisabled 2 → 0); these two rest on CI.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Team

Run ID: 1be8b5e6-0f02-494c-a116-535f0e295a85

📥 Commits

Reviewing files that changed from the base of the PR and between c59ad2a and 9a6a841.

📒 Files selected for processing (2)
  • web/oss/tests/playwright/acceptance/auto-evaluation/tests.ts
  • web/oss/tests/playwright/acceptance/human-annotation/tests.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.

Comment on lines +176 to +177
// `[role]` included: the Radix checkbox/radio is a <button role="checkbox">, not an
// <input>, so the native+antd list alone matched nothing and selection read as false.

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use one short line for both new comments.

Rewrite each two-line explanation as one short line.

  • web/oss/tests/playwright/acceptance/auto-evaluation/tests.ts#L176-L177: collapse the explanation into one line.
  • web/oss/tests/playwright/acceptance/human-annotation/tests.ts#L551-L552: collapse the explanation into one line.

As per coding guidelines, “Hard rule. At most ONE short line per comment.”

📍 Affects 2 files
  • web/oss/tests/playwright/acceptance/auto-evaluation/tests.ts#L176-L177 (this comment)
  • web/oss/tests/playwright/acceptance/human-annotation/tests.ts#L551-L552

Source: Coding guidelines

CI got the suite to 4 failures and named another stale one: the add-column
click used .ant-table-thead, which no longer matches (the icon inside it is
still antd, only the header moved). Rather than keep finding these one CI run
at a time, every table selector now accepts both halves — .avt-*, .ant-table-* —
which is the pattern DOM_SELECTOR in the package already uses, and for its
stated reason: a host may still mount an antd table through the legacy adapter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant