test: fix TestHeader of Developer Sandbox E2E Tests#1244
Conversation
WalkthroughAdded Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
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. Comment |
|
xcoulon
left a comment
There was a problem hiding this comment.
that's a clever way to fix the problem while keeping it working with the older versions! ;)
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rsoaresd, xcoulon The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
test/e2e/devsandbox-dashboard/header_test.go (1)
26-28: Consider applying the same normalization for consistency.The "Contact Red Hat Sales" popup test normalizes non-breaking spaces (lines 41-42), but this "Red Hat Developer Hub" popup test does not. For consistency and to make both tests equally resilient to whitespace variations, consider applying the same normalization here.
🔎 Proposed fix for consistency
h1Text, err := rhdhPage.Locator("h1").TextContent() require.NoError(t, err) +// replace non-breaking space with regular space +h1Text = strings.ReplaceAll(h1Text, "\u00a0", " ") require.Contains(t, h1Text, "Red Hat Developer Hub")
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
test/e2e/devsandbox-dashboard/header_test.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Unit Tests
- GitHub Check: Build & push operator bundles & dashboard image for e2e tests
🔇 Additional comments (2)
test/e2e/devsandbox-dashboard/header_test.go (2)
4-4: LGTM!The
stringspackage import is correctly added and used for the non-breaking space normalization.
39-43: LGTM! Clear fix for non-breaking space handling.The normalization approach is correct and the comment clearly explains the intent. This makes the test resilient to non-breaking space characters in the h1 text.
Note: The AI summary states normalization was added for both popups, but the code only applies it to the "Contact Red Hat Sales" popup.



Description
Today, we came across a failure in the
TestHeaderof Developer Sandbox E2E Tests.Looking at the page redirected from "Contact Red Hat Sales" button, we can see:

Since we do not know if they will change again, I suggest replacing the non-breaking space with regular space
Issue ticket number and link
SANDBOX-1565
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.