chore(E2E): add toBeExpanded() aria-expanded matcher - #3437
Draft
Dave Shoup (shouples) wants to merge 2 commits into
Draft
chore(E2E): add toBeExpanded() aria-expanded matcher#3437Dave Shoup (shouples) wants to merge 2 commits into
Dave Shoup (shouples) wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a typed Playwright toBeExpanded() matcher and replaces 19 direct aria-expanded="true" assertions across the E2E suite.
Changes:
- Adds and registers the shared matcher.
- Migrates positive expansion assertions.
- Updates E2E documentation while preserving absence checks and control-flow reads.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Changes | Review note |
|---|---|---|
tests/README.md |
Updates the E2E assertion example. | — |
tests/e2e/utils/workspace.ts |
Migrates workspace expansion assertions. | — |
tests/e2e/utils/connections.ts |
Migrates connection expansion assertions. | — |
tests/e2e/specs/schemas.spec.ts |
Migrates schema setup assertions. | — |
tests/e2e/specs/scaffold.spec.ts |
Migrates scaffolding assertions. | — |
tests/e2e/specs/produceMessage.spec.ts |
Migrates topic setup assertions. | — |
tests/e2e/specs/flinkStatement.spec.ts |
Migrates statement setup assertions. | — |
tests/e2e/specs/flinkArtifact.spec.ts |
Migrates artifact setup assertions. | — |
tests/e2e/specs/directConnectionLifecycle.spec.ts |
Migrates lifecycle assertions. | — |
tests/e2e/objects/views/View.ts |
Migrates base view assertions. | — |
tests/e2e/objects/views/TopicsView.ts |
Migrates topics view assertions. | — |
tests/e2e/objects/views/SchemasView.ts |
Migrates schemas view assertions. | — |
tests/e2e/objects/views/ResourcesView.ts |
Migrates resources assertions. | — |
tests/e2e/objects/views/FlinkDatabaseView.ts |
Migrates database view assertions. | — |
tests/e2e/matchers.ts |
Defines the matcher and global typings. | Nit (3 votes): add focused assertions covering expanded and non-expanded locators for .not.toBeExpanded(). |
tests/e2e/baseTest.ts |
Registers the matcher and updates fixture assertions. | — |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Covers both toBeExpanded() and .not.toBeExpanded() across expanded, collapsed, and absent aria-expanded states via the rollwright harness, exercising the negated branch that no converted call site hits. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





Summary of Changes
Across the E2E suite we repeatedly assert that a tree item or view is expanded by checking its
aria-expandedattribute directly:await expect(locator).toHaveAttribute("aria-expanded", "true"). This PR adds a small Playwright custom matcher so that reads asawait expect(locator).toBeExpanded()instead, and converts the 19 existing positive assertions to use it.No functional or behavioral changes to any test. Full E2E pipeline passing.
Closes #2566
Optional: Any additional details or context that should be provided?
tests/e2e/matchers.ts, registers on Playwright's sharedexpectviaexpect.extend, and is wired in through a side-effect import intests/e2e/baseTest.ts(which every spec already imports), so it's available everywhere without per-file setup. It's typed via a global augmentation so.toBeExpanded()type-checks anywhereexpectis imported, and it delegates totoHaveAttributeinternally, so auto-waiting and.not.toBeExpanded()still work.aria-expandedusage were intentionally left as-is: the twonot.toHaveAttribute("aria-expanded")checks (which assert the attribute is absent on a non-expandable leaf item, a stricter condition than "not expanded"), and the fivegetAttribute("aria-expanded")reads that feed anifto decide whether to click (control-flow, not assertions). A value-asserting matcher can't cover either without weakening or reshaping them.toBeExpanded()and.not.toBeExpanded(), across expanded / collapsed / absent states) is covered by a focused functional test atsrc/webview/aria-expanded-matcher.spec.ts. The rollwright functional harness is the only non-Electron way to run real-DOM Playwright assertions here, so the matcher's edge cases run fast innpx gulp functionalwithout needing Docker/sidecar. The 19 converted assertions additionally exercise the positive path in the E2E suite in CI.npx gulp check(the type augmentation and all 19 converted call sites compile),npx gulp lint,prettier, andnpx gulp functional -t "toBeExpanded"(3 passing).Pull request checklist
Please check if your PR fulfills the following (if applicable):
Tests
Release notes