fix(ui): Fix PF6 e2e test failures#19342
Draft
sachaudh wants to merge 7 commits intodv/ROX-28622-pf-6from
Draft
Conversation
Replace last two pf-v5 references in Cypress selector files: - Clusters.selectors.js: pf-v5 form group classes to pf-v6 - Risk.selectors.js: pf-v5 global CSS variable to pf-v6 Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
Update Cypress test selectors to match PF6 component changes: - Banner: pf-m-gold -> pf-m-yellow (PF6 renamed warning color) - HelpMenu: Remove sibling selector for portaled dropdown - NetworkGraph sidebar: ExpandableSection replaced with Title h2 - ChipGroup -> LabelGroup class rename - OUIA Tab type: PF6/Tab -> PF6/TabButton Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
The deploymentMatching e2e test was failing because "sensor" fell on page 2 of paginated results. The stackrox namespace now has 11+ deployments (scanner-v4, scanner-v4-db were added), exceeding the previous page size of 10. Increasing to 20 ensures all typical stackrox deployments load on the first page. Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
The scrolled event handler in e2e.js calls $el.get(0).scrollIntoView() but PF6 portaled elements (Select menus rendered on document.body) can cause $el.get(0) to return a non-DOM object without scrollIntoView, crashing the handler with "scrollIntoView is not a function". Adding a type check allows Cypress to fall back to its default scroll behavior. Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
PF6 changed Checkbox labels from <span> to <label>, causing
getInputByLabel('Name') to match "Advisory Name and Advisory Link" in
the background report form instead of the "Name" label inside the
collection modal. Scoping cy.contains to the open modal prevents
matching labels in background content.
Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
The test compared the sum of severity card counts against "results found", but these use different counting methods. A single CVE can have different severities from different sources, making the per-severity sum larger than the deduplicated imageVulnerabilityCount. Also adds the missing Unknown severity to the selector list. The test now verifies that severity and status card sums are internally consistent (both derive from imageCVECountBySeverity) and that "results found" renders with a positive count. Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
|
Skipping CI for Draft Pull Request. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dv/ROX-28622-pf-6 #19342 +/- ##
=====================================================
- Coverage 49.68% 49.68% -0.01%
=====================================================
Files 2693 2693
Lines 202653 202653
=====================================================
- Hits 100697 100691 -6
- Misses 94445 94450 +5
- Partials 7511 7512 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The status card reduce callback incorrectly reset the accumulator to 0 on NaN instead of preserving it, which could discard the running sum and cause a false test failure. Extract COLLECTION_RESULTS_PAGE_SIZE constant to prevent the page size in fetchMatchingDeployments and usePaginatedQuery from drifting apart. Signed-off-by: Saif Chaudhry <schaudhr@redhat.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.
Description
Jira: ROX-28622
Fixes Cypress e2e test failures caused by the PatternFly 6 migration.
pf-v5-*→pf-v6-*,chip-group→label-group,pf-m-gold→pf-m-yellow,PF6/Tab→PF6/TabButton)getInputByLabelto open modals to prevent matching background labels (PF6 changed Checkbox<span>to<label>)scrolledhandler against non-DOM elementsh2headings)User-facing documentation
Testing and quality
Automated testing
How I validated my change
CollectionResults.tsxpage size change is a minimal config bump with no logic change