Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 3, 2025

Proposed changes

The patternhub overview tests fail intermittently because h1 elements are checked before React finishes hydrating. The DefaultPage component uses dynamic imports with SSR disabled, so content only renders after client-side JavaScript executes.

Changes:

  • Changed waitUntil from 'domcontentloaded' to 'networkidle' in test helper to ensure JavaScript execution completes before asserting element visibility
  • Fixed misleading variable name firstH2firstH1 (was already querying h1 elements)
// Before: DOM loaded, but React may not have hydrated
await page.goto(`${path}`, { waitUntil: 'domcontentloaded' });

// After: All network requests complete, React hydrated
await page.goto(`${path}`, { waitUntil: 'networkidle' });

resolves https://github.com/db-ux-design-system/core-team/issues/1512

Types of changes

  • Bugfix (non-breaking change that fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (improvements to existing components or architectural decisions)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Further comments

The networkidle strategy waits until no network connections exist for ≥500ms, ensuring dynamic imports and React hydration complete before tests run. This eliminates the race condition without adding artificial delays.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www-api.ibm.com
    • Triggering command: /opt/hostedtoolcache/node/24.11.1/x64/bin/node node /home/REDACTED/work/core-web/core-web/node_modules/@ibm/telemetry-js/dist/REDACTED-process.js --log=/tmp/ibmtelemetry-20251203T165307876Z-840652.log --config=telemetry.yml (dns block)
    • Triggering command: /opt/hostedtoolcache/node/24.11.1/x64/bin/node node /home/REDACTED/work/core-web/core-web/node_modules/@ibm/telemetry-js/dist/REDACTED-process.js --log=/tmp/ibmtelemetry-20251203T165628811Z-612582.log --config=telemetry.yml (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Pipeline fix für Step regenerate-snapshots-patternhub</issue_title>
<issue_description>### Beschreibung

Der Test schlägt fehl, weil h1 Elemente auf einigen oder allen overview Seiten nicht konsistent sichtbar sind.
Die Ursache der inkonsistenten h1-Sichtbarkeit auf den overview-Seiten der Breadcrumb-Komponente muss ermittelt und behoben werden.

Der auskommentierte Test-Code-Block muss wieder aktiviert oder angepasst werden.

Datei: showcases/patternhub/tests/default.spec.ts

Akzeptanzkriterien:

  • Test aktiviert: Der provisorisch auskommentierte Test-Block in showcases/patternhub/tests/default.spec.ts (Zeilen 32-42 im Diff) wird wieder aktiviert und muss erfolgreich durchlaufen (grün sein).
  • Code-Bereinigung: Der erklärende Kommentar (// COMMENTED OUT: This test fails because h1 elements are not consistently visible on all pages) sowie der auskommentierte Code selbst werden aus der Datei entfernt, sobald der Test wieder aktiv ist.</issue_description>

Comments on the Issue (you are @copilot in this section)

  • Fixes db-ux-design-system/core-team#1512

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

🔭🐙🐈 Test this branch here: https://design-system.deutschebahn.com/core-web/review/copilot/fix-h1-visibility-test

@changeset-bot
Copy link

changeset-bot bot commented Dec 3, 2025

⚠️ No Changeset found

Latest commit: 7a11be2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI changed the title [WIP] Fix inconsistent h1 visibility in overview pages Fix h1 visibility test by waiting for network idle Dec 3, 2025
Copilot AI requested a review from mfranzke December 3, 2025 17:01
Copilot finished work on behalf of mfranzke December 3, 2025 17:01
@mfranzke mfranzke marked this pull request as ready for review December 3, 2025 20:37
@mfranzke mfranzke enabled auto-merge (squash) December 3, 2025 20:37
@mfranzke mfranzke moved this from 🏗 In progress to 🎁 Ready for review in UX Engineering Team Backlog Dec 3, 2025
@github-actions github-actions bot added the 📺showcases Changes to 1-n showcases label Dec 3, 2025
@mfranzke mfranzke changed the title Fix h1 visibility test by waiting for network idle fix: h1 visibility test by waiting for network idle Dec 4, 2025
@mfranzke mfranzke requested a review from Copilot December 4, 2025 11:59
Copilot finished reviewing on behalf of mfranzke December 4, 2025 12:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes intermittent test failures in the patternhub overview tests where h1 elements were being checked before React completed hydration. The fix changes the Playwright wait strategy and corrects a misleading variable name.

  • Changed waitUntil from 'domcontentloaded' to 'networkidle' to ensure JavaScript execution and React hydration complete before assertions
  • Fixed misleading variable name firstH2firstH1 (was already querying h1 elements)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📺showcases Changes to 1-n showcases

Projects

Status: 🎁 Ready for review

Development

Successfully merging this pull request may close these issues.

2 participants