Skip to content

fix: update dialog selectors to avoid matching toast notifications in… - #737

Merged
pikann merged 2 commits into
masterfrom
fix/fix-failed-e2e-testings
Nov 13, 2026
Merged

pikann merged 2 commits into
masterfrom
fix/fix-failed-e2e-testings

Conversation

@pikann

@pikann pikann commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes the failing e2e-tests run 43390604283 (about 35–40 failures per browser, the same specs in every browser). The specs were out of date with a recent UI refactor (base-ui dialogs, selects, tabs, toasts); no app code changes.

Changes

Spec Cause Fix
sprint-lifecycle (~25 tests) Modals are now Dialog/AlertDialog, not div.fixed.inset-0 modal() targets dialog-content / alert-dialog-content; "no dialog" check uses the same locator
mfa, passkeys, git-agent-tab base-ui toasts have role="dialog", so getByRole("dialog") matched the success toast once the modal closed Exclude [data-slot="toast"] from the dialog locator
interaction-views (7 tests) View-settings rows are now Select comboboxes with option items; Escape with unsaved edits opens a "Discard unsaved changes?" dialog Rewrote rowLabel/rowButton/chooseOption, added a discard step
conversations (3), role-badges-selector (filter) Searchable-list items are now role=option Select by option
environments Detail header uses tab elements Select by tab
git-automation (2) Inline "Saved." replaced by the global toast Assert on "Git automation settings updated successfully"

Not changed

passkeys:212, git-task-detail:195 and subtask-hierarchy:415 failed only in chromium on the first attempt (reported as flaky), and the webkit-only role-badges-selector failures pass in chromium, so they are left alone.

Verification

  • tsc reports no errors in the touched files.
  • The specs have not been run against the e2e stack yet; re-run the e2e-tests workflow on this branch to confirm.

@pullfrog pullfrog 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.

ℹ️ Minor suggestions only — the selector rewrites all match the current base-ui components.

Reviewed changes

  • Dialog vs. toast (mfa, passkeys, git-agent-tab) — dialog locators now intersect getByRole("dialog") with :not([data-slot="toast"]), which correctly drops base-ui toasts (their root carries both role="dialog" and data-slot="toast").
  • Sprint modals (sprint-lifecycle) — modal() targets [data-slot="dialog-content"], [data-slot="alert-dialog-content"] instead of div.fixed.inset-0; the quick-create negative check reuses the same constant.
  • View settings (interaction-views) — new rowLabel / rowButton / chooseOption helpers drive the base-ui Select rows (role=combobox → role=option), discardAndClose handles the new unsaved-changes confirmation, and value assertions use toContainText.
  • Option and tab roles — conversations and role-badges-selector pick role=option items from SearchableList; environments asserts the detail-header tab bar as role=tab.
  • Save confirmation (git-automation) — asserts the global "Git automation settings updated successfully" toast instead of the removed inline "Saved.".

I checked each new selector against the components it targets (toast.tsx data-slot="toast" + role="dialog", dialog-content/alert-dialog-content slots, SelectTrigger's role="combobox", SelectItem's role="option", the Tabs header in environment-detail.tsx, and the gitSettings toast subject) and they line up.

ℹ️ Feature files still describe the replaced UI

Every spec here opens with // spec: features/... and those feature files are the documented source of truth, but two of them still describe the pre-refactor behavior, so the spec and its scenario text now disagree.

Technical details
# Feature/spec drift left by the spec updates

## Affected sites
- `apps/e2e/features/projects/git-automation.feature:61` — `Then "Saved." is shown and the warning disappears`
  still names the inline confirmation this PR stops asserting.
- `apps/e2e/features/projects/interaction-views.feature:594-599` — the "Closing the popup without
  saving discards unsaved changes" scenario goes straight from Escape to "the settings popup should
  close", with no mention of the new "Discard unsaved changes?" confirmation the spec now clicks through.

## Required outcome
- Both scenario steps describe what the specs actually assert (the toast title for git automation;
  Escape → discard confirmation → popup closes for view settings).

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

Comment thread apps/e2e/tests/auth/mfa.spec.ts Resolved

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

  • Shared dialog helper — apps/e2e/tests/helpers/dialog.ts now exports DIALOG_CONTENT and dialogPanel(), documenting that base-ui toasts carry role="dialog" + data-slot="toast".
  • Dialog sites consolidated — the seven mfa / passkeys / git-agent-tab dialog locators now call dialogPanel(page) instead of repeating the toast-exclusion intersection inline.
  • Sprint modals — sprint-lifecycle imports DIALOG_CONTENT from the helper, and its header comment and modal() docstring now describe Dialog/AlertDialog panels instead of plain divs.
  • Role filter — role-badges-selector selects the filter option with { name: describedRole, exact: true }.
  • Feature files synced — git-automation.feature now names the success toast, and interaction-views.feature includes the "Discard unsaved changes?" → "Discard" steps.

I re-checked the helper against the components it targets: DeleteGitIdentityDialog and the MFA/passkey dialogs are Dialog (role=dialog), the view-settings-panel.tsx close handler only prompts when the draft differs, and common.toast.updated + the gitSettings subject produce the asserted toast copy exactly. biome lint on apps/e2e still passes.

The one remaining validation step is the PR body's own caveat: these specs have not yet been run against the e2e stack, so dispatching e2e-tests.yml on the branch is what proves the selectors end to end.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

@pikann
pikann merged commit 7d0ef7e into master Nov 13, 2026
2 checks passed
@pikann
pikann deleted the fix/fix-failed-e2e-testings branch November 13, 2026 10:50
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