fix: support both OCP 4.20 (PF v5) and 4.22 (PF v6) selectors - #38
Open
talhil-rh wants to merge 2 commits into
Open
fix: support both OCP 4.20 (PF v5) and 4.22 (PF v6) selectors#38talhil-rh wants to merge 2 commits into
talhil-rh wants to merge 2 commits into
Conversation
Root cause: flightctl-ui plugin PR #803 (Device details page redesign, Sep 9) replaced fctl-device-details-tab__label with DescriptionListTerm, moved "Add label" button outside LabelGroup via EditableLabelControl, and renamed "Fleet name" label to "Fleet". Additionally, OCP 4.20 console renders pf-v5-c-* classes while OCP 4.22 renders pf-v6-c-* classes. All PF-prefixed selectors now match both versions. Changes: - views/common.js: Add pfV() helper for dual PF v5/v6 selectors and deviceDetailsFleetRow() helper that detects new vs legacy device details layout - views/fleetsPage.js: Fix createFleet label-group selector to use "Add label" button click; fix deleteFleet to use td contains instead of data-label="Name" - views/devicesPage.js: Fix fleet name detection in runFleetLabelDetachReattachTest, expectDeviceDetailsFleetConnected/Disconnected to support both layouts - e2e/vulnerability.cy.js: Fix device selector "Add label" button scope; fix fleet connection verification for both old and new device details layout - views/securityPage.js: Dual PF v5/v6 selectors for cards, drawers, tables - All view/e2e files: Replace pf-v6-c-* with dual pf-v5/pf-v6 selectors Build: https://jenkins-csb-kniqe-auto.dno.corp.redhat.com/job/Private_Folders/job/talh/job/job-runner-talh/371/ Requested-By: <@U02B10JTKDG> (thilzenr) Co-authored-by: Cursor <cursoragent@cursor.com>
Fixes:
1. common.js — deviceDetailsFleetRow: Wait for either layout element to
appear before deciding which branch to take. Previously used a synchronous
cy.get('body') check that could pick the wrong branch if the details tab
hadn't rendered yet.
2. devicesPage.js — decommissionDevice: Break checkbox click chain to avoid
'element detached from DOM' race when the enrolled-devices table re-renders
from API polling. Use .check({ force: true }) on a fresh query.
3. devicesPage.js, repositoriesPage.js, buildImagePage.js — Fix CSS compound
selector scoping in .find()/.get(). The pattern
'[data-testid] .pf-v5-class, .pf-v6-class' leaves the PF6 alternative
unscoped (matches anywhere in the parent element, not just inside the
data-testid container). Fixed to scope both alternatives.
4. devicesPage.js — loginVmSerialConsole: Add .first() to all
APP_CONSOLE_XTERM_INPUT queries. On OCP 4.22, xterm.js renders multiple
.xterm-helper-textarea elements causing cy.click() to fail with 'subject
contained 10 elements'.
5. securityPage.js — Handle EntitySecurityOverviewCard expandable layout on
Device/Fleet pages. The upstream flightctl-ui now wraps VulnerabilitiesTable
inside a collapsed CardExpandableContent. Added _expandSecurityCardIfNeeded()
helper and severity tile sum fallback for both expectVulnerabilityCount and
waitForVulnerabilityCountWithReload.
Build: https://jenkins-csb-kniqe-auto.dno.corp.redhat.com/job/Private_Folders/job/talh/job/flightctl-cypress-test/149/
Requested-By: <@U02B10JTKDG> (thilzenr)
Co-authored-by: Cursor <cursoragent@cursor.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.
Root Cause
The flightctl-ui plugin was redesigned in flightctl/flightctl-ui#803 (merged Sep 9, 2026), which:
fctl-device-details-tab__label— Device details now use PFDescriptionListTerminstead ofStackItemwith a custom classEditableLabelControlnow renders the button outsideLabelGroup, breaking.pf-v6-c-label-group button[aria-label="Add label"]selectorspf-v5-c-*classes while OCP 4.22 renderspf-v6-c-*Fix
views/common.js: AddedpfV()helper for dual PF v5/v6 selectors anddeviceDetailsFleetRow()helper that auto-detects new vs legacy device details layoutviews/fleetsPage.js: FixedcreateFleetto click "Add label" button instead of targeting.pf-v6-c-label-group__list; fixeddeleteFleetto usecy.contains("td", fleetname)instead of[data-label="Name"]views/devicesPage.js: Fixed fleet detection inrunFleetLabelDetachReattachTest,expectDeviceDetailsFleetConnected/Disconnectedto support both DescriptionList and Stack layoutse2e/vulnerability.cy.js: Fixed device selector "Add label" scope; fleet connection verification for both layouts; detach verificationpf-v6-c-*with dualpf-v5-c-*, pf-v6-c-*selectorsFailing specs addressed
#fctl-applications-tabletimeout (product/infra — not addressed here)Note: The 2
deviceApps.cy.jsfailures (#fctl-applications-tablenot found after 600s) appear to be a product/infra issue — the KVM VM app never reached Running state. This is not a selector problem.Build Reference
https://jenkins-csb-kniqe-auto.dno.corp.redhat.com/job/Private_Folders/job/talh/job/job-runner-talh/371/
Attribution
Requested by: <@U02B10JTKDG> (thilzenr)
Channel: DM