feat(dcm): add Playwright E2E test suite for DCM RHDH plugin#3249
Conversation
Changed Packages
|
154c858 to
9d4352c
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3249 +/- ##
==========================================
+ Coverage 54.01% 54.34% +0.33%
==========================================
Files 2325 2312 -13
Lines 89151 88313 -838
Branches 24911 24579 -332
==========================================
- Hits 48156 47997 -159
+ Misses 40760 38824 -1936
- Partials 235 1492 +1257
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
2699029 to
908548c
Compare
|
@chadcrum @testetson22 @y-first @asmasarw @mareklibra @jkilzi please review thanks |
There was a problem hiding this comment.
lgtm. One question: Did we see any rendering delays or weirdness?
I ask because waitForTableRefresh() just does a waitForLoadState('networkidle');, which is a global wait that might arbitrarily complete when not intently waiting on a network call, followed by a sleep (which obviously does force the test to really wait).
Not a blocker, just curious. It's usually followed by solid checks on relevant elements, so it just seems redundant in many instances. I'd usually throw something like that in when hit with rendering issues during test dev and later fix the issue then forget I threw that in.
|
@mareklibra @jkilzi please give a review for me please |
|
/lgtm |
|
New changes are detected. LGTM label has been removed. |
mareklibra
left a comment
There was a problem hiding this comment.
Generic recommendations (valid across multiple/all tests):
- let the
afterEach()handle the clean-up logic. If something fails, in the middle, everything following is affected. Moreover, you can reuse it... - wherever you have a timeout, think twice whether you can introduce a conditional waiting. It will significantly improve stability of the tests. If not, at least externalize the timeout constants.
46 browser-based E2E tests covering the full DCM Data Center UI: - Smoke tests: navigation, 6 tabs, seed data verification, API proxy - Providers CRUD: register, edit, search, delete - Policies CRUD: create GLOBAL/USER, toggle, edit, delete - Catalog items: Pet Clinic, create/edit/delete, YAML import - Instances: create dialog, empty state - Regressions: deep link, delete guard, search+pagination, toggle persistence, chip/switch sync, read-only name, whitespace validation, success snackbar, empty table rows, rows-per-page persistence Includes Playwright config, page object (DcmPage), auth fixture, and YAML test data fixtures. Follows rhdh-plugins workspace conventions. Ref: FLPATH-3241, FLPATH-4200 Co-authored-by: Cursor <cursoragent@cursor.com>
Addresses SonarQube security hotspots (typescript:S2245) flagging Math.random() as weak PRNG. Uses globalThis.crypto to satisfy both SonarQube and ESLint no-restricted-globals rule. Co-authored-by: Cursor <cursoragent@cursor.com>
Add missing lockfile entries for @playwright/test, playwright, and playwright-core to fix immutable install failure in CI. Co-authored-by: Cursor <cursoragent@cursor.com>
- 'chromium' project: runs app.test.ts only (merge gate safe) - 'live' project: runs dcm-*.test.ts (requires PLAYWRIGHT_URL) - Fix baseURL to use localhost:3000 (matching other workspaces) - Add e2e-test:live script for running against live environments Co-authored-by: Cursor <cursoragent@cursor.com>
The invalid-catalog-item.yaml is intentionally malformed for testing file import error handling. Prettier cannot parse it and fails CI. Co-authored-by: Cursor <cursoragent@cursor.com>
- Use getByRole('navigation') with auto-waiting assertions (matches
app-defaults, translations, konflux patterns)
- Add @playwright/test to app-level package.json devDependencies
(required by @backstage/no-undeclared-imports ESLint rule)
- Update workspace yarn.lock
Co-authored-by: Cursor <cursoragent@cursor.com>
Having @playwright/test in both the workspace root and packages/app causes Playwright's singleton check to fail with "Requiring @playwright/test second time". Keep it only in packages/app/package.json (matching app-defaults and konflux patterns). Co-authored-by: Cursor <cursoragent@cursor.com>
CI runs `yarn playwright install` and `yarn playwright test` at the workspace root level, so the dependency must be declared there. Remove the duplicate from packages/app/package.json to avoid Playwright's singleton "Requiring second time" error. Co-authored-by: Cursor <cursoragent@cursor.com>
The DCM sidebar labels its catalog link "Home" (not "Catalog" like the app-defaults workspace). Update the nav assertion accordingly. Co-authored-by: Cursor <cursoragent@cursor.com>
"Home" matches two elements (logo link + sidebar item) causing strict mode violation. Use "APIs" and "Docs" which are unique sidebar items. Co-authored-by: Cursor <cursoragent@cursor.com>
Add test-results/ and playwright-results.xml to .gitignore so the CI "ensure clean working directory" step doesn't fail after playwright tests produce output files. Co-authored-by: Cursor <cursoragent@cursor.com>
Add comments to playwright.config.ts explaining which project runs where: chromium (merge gate, local dev server) vs live (downstream Jenkins, requires PLAYWRIGHT_URL pointing at deployed cluster). Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Upgrade from 1.58.2 to 1.60.0 to match lightspeed and homepage workspaces. 1.58.2's playwright install --with-deps hangs consistently on Node 24 GitHub Actions runners. Co-authored-by: Cursor <cursoragent@cursor.com>
…stants - Extract suffix/uniquePriority/kebabToDisplayName to shared utils/helpers.ts - Extract timeout constants to utils/constants.ts (TIMEOUTS object) - Move cleanup logic from inline to afterEach() with tracking arrays - Set actionTimeout to 10s instead of 0 (infinite) - Prefer ARIA-based locators over CSS selectors in DcmPage.ts - Mark blocked FLPATH-4274 invalid YAML test with test.skip() Co-authored-by: Cursor <cursoragent@cursor.com>
3ea614e to
fbe6415
Compare
mareklibra
left a comment
There was a problem hiding this comment.
The issue with fragile CSS selectors remain (like [class*="MuiDrawer"] or label:has-text("Path *") + div input, but there are more of them). The data-testid would be much better option.
I will not block merging the PR on this, leaving up to you to decide whether and when to address that.
|



Summary
Adds a comprehensive Playwright E2E test suite for the DCM (Data Center Management) RHDH plugin, with a two-tier testing strategy:
Merge gate (CI):
app.test.tsruns against the local dev server — validates the app boots and sidebar renders correctly.Downstream E2E (Jenkins): 5 test files with 46 tests run against a live RHDH+DCM deployment, activated by setting
PLAYWRIGHT_URL. Covers all major UI workflows:Architecture
The
playwright.config.tsdefines two projects:chromium— merge-gate safe, runsapp.test.tsonly (local dev server)live— conditionally activated whenPLAYWRIGHT_URLis set, runs alldcm-*.test.tsfilesRun downstream tests with:
Files Added
playwright.config.tse2e-tests/app.test.tse2e-tests/pages/DcmPage.tse2e-tests/fixtures/auth.tsperformGuestLoginauth setup (live tests)e2e-tests/fixtures/dcm/*.yamle2e-tests/dcm-smoke.test.tse2e-tests/dcm-providers.test.tse2e-tests/dcm-policies.test.tse2e-tests/dcm-catalog-items.test.tse2e-tests/dcm-regressions.test.ts.prettierignore.gitignoreJIRA Coverage
All tests are tagged with JIRA IDs. Covers verification of 21 ON_QA stories under FLPATH-3241, including regression tests for FLPATH-4111 and FLPATH-4112.
Test plan
app.test.tsvalidates app renders with sidebar navigationyarn e2e-test:livepasses against a live RHDH+DCM deployment