Skip to content

Align E2E assertions with current app behavior - #38365

Closed
AmethystLiang wants to merge 1 commit into
mainfrom
AmethystLiang/auto-e2e-tests-autofix-scheduled-ci-1h-run-16-20261105T0300
Closed

AmethystLiang wants to merge 1 commit into
mainfrom
AmethystLiang/auto-e2e-tests-autofix-scheduled-ci-1h-run-16-20261105T0300

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Several end-to-end checks expect older app behavior, so they can fail even when the current behavior works.

Solution

Update the checks to match the current permission menus, sidebar selection, project-board requests, and chat initialization. Use distinct links for the two CSV previews so each navigation can be checked independently. This fixes the outdated assertions covered by these changes.

ELI5

The tests now look for what the app does today instead of what it used to do.

Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​30 $\color{#cf222e}{\Huge{\mathbf{−}}}$​15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​15
Prod 0 0 0 0

What Changed

Updated five E2E specs to follow current UI and request contracts. No production behavior changed.

Why

Stale expectations make it harder to tell real regressions from test failures caused by intentional changes.

Linked Issue

None.

Visual Proof

N/A — test-only changes; no UI or interaction behavior changed.

Testing

Automated E2E tests were updated. Test execution and platforms tested are not specified.

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below
  • Every added test fails without this change and avoids the test anti-patterns

Risk

Level: Low. Incorrect expectations could hide a regression or cause E2E failures. A plain revert restores the previous tests.

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Test-only changes; no production security, cross-platform, remote SSH, mobile, compatibility, or performance behavior is changed.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

Five end-to-end tests update permission-menu checks, a sidebar assertion, CSV fixture URLs, project-board request arguments, and a structured-chat request sequence.

Merge Risk: Moderate · up to 5c6a8

This PR only changes end-to-end tests, so it has no production behavior impact. At least one of the updated specs, the permission-menu test, is still failing in CI, and the project-board spec is also reported as failing with an unidentified cause. Resolve these before merging so the E2E suite is green.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: updating E2E assertions to match current application behavior.
Description check Passed The description is mostly complete and covers the problem, solution, changed tests, rationale, risk, visual-proof rationale, and scope. It identifies no linked issue and does not specify test executio…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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.
Full details: Description check

Explanation

The description is mostly complete and covers the problem, solution, changed tests, rationale, risk, visual-proof rationale, and scope. It identifies no linked issue and does not specify test execution or platforms tested, but the overall description remains relevant and sufficiently detailed.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 5 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@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 GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Fix the failing permission-menu state or assertion. · agent-auto-permissions.spec.ts:6

tests/e2e/agent-auto-permissions.spec.ts:6
Minor · Functional Correctness · Quick win

Fix the failing permission-menu state or assertion.

The changed test fails at line 38 after opening Permissions for other agents. Full access remains unchecked, so the E2E job exits with code 1 before it can test persistence.

Source: Pipeline failures

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ba904604-d570-4d2a-a5d4-aacd7a4a57cd
Commits

Reviewing files that changed from the base of the PR and between b6d760d and 5c6a831.

Files selected for processing: 5

  • tests/e2e/agent-auto-permissions.spec.ts
  • tests/e2e/claude-sidebar-agent-view.spec.ts
  • tests/e2e/csv-url-links.spec.ts
  • tests/e2e/github-project-board.spec.ts
  • tests/e2e/structured-chat-tabs-open-close.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

await expect(parent.getByLabel('Viewing subagent Sidebar child proof')).toBeVisible()
await orcaPage.screenshot({ path: testInfo.outputPath('collapsed-child-indicator.png') })
await disclosure.click()
await expect(child).toHaveAttribute('aria-current', 'true')

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.

Minor · Functional Correctness · Quick win

Verify that the disclosure reopened before checking aria-current.

The child remains mounted while the disclosure is collapsed, and aria-current depends on view.current, not disclosure state. toHaveAttribute does not require the element to be visible. If reopening fails, this assertion can still pass on the hidden child. (raw.githubusercontent.com)

Assert aria-expanded="true" or child.toBeVisible() after the second click, then check aria-current.

As per coding guidelines, E2E tests must assert user-visible behavior through the DOM.

Proposed assertion

--- "a/tests/e2e/claude-sidebar-agent-view.spec.ts"
+++ "b/tests/e2e/claude-sidebar-agent-view.spec.ts"
@@ -179,8 +179,10 @@
   await expect(disclosure).toHaveAttribute('aria-expanded', 'false')
   await expect(child.locator('xpath=ancestor::*[@inert]')).toHaveCount(1)
   await orcaPage.screenshot({ path: testInfo.outputPath('collapsed-child-indicator.png') })
   await disclosure.click()
+  await expect(disclosure).toHaveAttribute('aria-expanded', 'true')
+  await expect(child).toBeVisible()
   await expect(child).toHaveAttribute('aria-current', 'true')
   await sendToTerminal(orcaPage, ptyId, '\x0b')
   await expect(parent).toHaveAttribute('aria-current', 'true')
   expect(events().filter((event) => event.unexpected)).toEqual([])

Source: Coding guidelines

@nwparker

nwparker commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Overlap note: #39193 makes the same wakeWslDistro: true update to tests/e2e/github-project-board.spec.ts (intended since #36230). With only that change the spec still fails locally one step later. The rollback toast now shows the localized "Network error — check your connection." (#34621), not the mock's message. #39193 also updates that assertion and adds PR routing for the spec. If #39193 lands first, this PR's board hunk can be dropped.

@nwparker

nwparker commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Heads-up: #39196 makes the same csv-url-links change (a separate URL per CSV preview, since #32907 reuses a tab that already shows the same address) and also routes CSV viewer sources to the CSV e2e specs. I checked this part of your diff and it keeps the assertions as strict as before. Whichever PR merges second will need to drop that hunk.

@nwparker

nwparker commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Overlap note for tests/e2e/agent-auto-permissions.spec.ts: #39202 fixes that spec on its own. One thing here would still fail on current main. After Full access → Approve for me, the 'Permissions for other agents' dropdown shows Mixed, not Full access, because a fresh profile keeps OpenCode, OpenCode 2 and OMP on their own settings (that's the migration in tui-agent-permission-choice.test.ts). So the menu's value is empty and no item is checked. The menuitemradio queries here are also unscoped, so they can match items in the main Permissions menu. #39202 scopes them to the other-agents menu group, asserts Mixed, and adds opencode to the saved-permission checks. It might be simplest to drop this spec from this PR.

@AmethystLiang

Copy link
Copy Markdown
Contributor Author

This PR now looks obsolete. All five specs it edits pass on main without it, in run 43079702969 (d46091d39, 2026-11-11): agent-auto-permissions, claude-sidebar-agent-view, csv-url-links, github-project-board and structured-chat-tabs-open-close. None of them appear in that run's failures or in the scheduled runs since 2026-11-09. The current stale-test fixes for main E2E are in #41365, and the product regressions are tracked in #41361 and #41362. Recommending that this be closed rather than rebased.

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.

2 participants