Skip to content

Stabilize flaky E2E waits for TOC init and dynamic tag selection#447

Merged
rvanmaanen merged 3 commits into
mainfrom
copilot/improve-flaky-e2e-tests
May 29, 2026
Merged

Stabilize flaky E2E waits for TOC init and dynamic tag selection#447
rvanmaanen merged 3 commits into
mainfrom
copilot/improve-flaky-e2e-tests

Conversation

Copilot AI commented May 29, 2026

Copy link
Copy Markdown
Contributor

Two E2E tests were intermittently timing out due to brittle readiness conditions: TOC initialization depended solely on window.__e2e signals, and dynamic-tag setup depended on URL mutation timing. This change hardens both waits to assert stable UI state directly.

  • TOC readiness fallback in E2E helper

    • Updated WaitForTocInitializedAsync to keep signal-based waiting when window.__e2e exists, but fall back to DOM readiness when it does not.
    • Fallback now waits for TOC anchor links to be present, and treats pages as TOC-not-applicable only when heading anchors are absent.
  • State-based setup in dynamic tag flake paths

    • Replaced setup assertions that waited for tags= in URL with assertions that selected-tag count increases after click.
    • Applied in the two loop-based paths that build disabled-tag scenarios, removing dependency on URL timing while preserving test intent.
  • Representative change

    var selectedCountBefore = await Page.Locator(".tag-cloud-item.selected").CountAsync();
    await enabledTags[0].ClickAndExpectAsync(async () =>
        await Page.WaitForConditionAsync(
            $"() => document.querySelectorAll('.tag-cloud-item.selected').length > {selectedCountBefore}"));

Copilot AI linked an issue May 29, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix flaky end to end tests for sidebar TOC Stabilize flaky E2E waits for TOC init and dynamic tag selection May 29, 2026
Copilot AI requested a review from rvanmaanen May 29, 2026 12:53
@github-actions

github-actions Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

⏰ PR Preview Environment — Nightly Teardown

The preview environment was automatically torn down as part of the nightly cleanup (23:00 Brussels time).

To resume testing:

  • Push a new commit to this branch to automatically re-deploy (full CI + new images), or
  • Trigger the Redeploy PR Environment workflow manually to redeploy using the last-built image (no new commit needed).

@rvanmaanen
rvanmaanen marked this pull request as ready for review May 29, 2026 15:22
@rvanmaanen
rvanmaanen requested a review from rajbos as a code owner May 29, 2026 15:22
Copilot AI review requested due to automatic review settings May 29, 2026 15:22
@rvanmaanen
rvanmaanen merged commit c6ec3bc into main May 29, 2026
19 of 20 checks passed
@rvanmaanen
rvanmaanen deleted the copilot/improve-flaky-e2e-tests branch May 29, 2026 15:22

Copilot AI 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

improve flaky e2e tests

3 participants