CONSOLE-5240: Migrate Helm Cypress E2E tests to Playwright - #16711
CONSOLE-5240: Migrate Helm Cypress E2E tests to Playwright#16711vikram-raj wants to merge 12 commits into
Conversation
|
@vikram-raj: This pull request references CONSOLE-5240 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds Playwright page objects and smoke tests for Helm release workflows, introduces shared ChangesHelm Playwright migration
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant HelmReleaseSpec
participant HelmPage
participant HelmDetailsPage
participant ConsoleUI
HelmReleaseSpec->>HelmPage: install and filter Helm release
HelmPage->>ConsoleUI: submit install, upgrade, and rollback actions
HelmReleaseSpec->>HelmDetailsPage: inspect release details
HelmDetailsPage->>ConsoleUI: switch tabs and confirm deletion
Suggested reviewers: 🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (3)
frontend/e2e/pages/helm-page.ts (1)
40-50: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueDuplicate filter-item selector logic.
filterByStatusreconstructs the exact samedata-ouia-component-id="DataViewCheckboxFilter-filter-item-..."selector already exposed viagetFilterDropdownItem(Lines 186-190). Reuse the getter to avoid selector drift between the two.♻️ Proposed dedup
async filterByStatus(status: string): Promise<void> { const filterToggle = this.dataViewFilters.locator('.pf-v6-c-menu-toggle').first(); await this.robustClick(filterToggle); await this.page.locator('.pf-v6-c-menu__list-item', { hasText: 'Status' }).click(); await this.robustClick(this.filterDropdown); - const filterItem = this.page.locator( - `[data-ouia-component-id="DataViewCheckboxFilter-filter-item-${status.toLowerCase()}"]`, - ); + const filterItem = this.getFilterDropdownItem(status); await this.robustClick(filterItem); await this.robustClick(this.filterDropdown); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/e2e/pages/helm-page.ts` around lines 40 - 50, The filter-by-status flow duplicates the `DataViewCheckboxFilter-filter-item-*` selector logic already centralized in `getFilterDropdownItem`; update `filterByStatus` in `HelmPage` to reuse that getter instead of reconstructing the `data-ouia-component-id` string directly. Keep the existing click sequence, but resolve the item through `getFilterDropdownItem(status)` so selector changes only need to be made in one place.frontend/e2e/pages/helm-details-page.ts (1)
71-77: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove the unused
verifyActionsInMenuhelperIt has no callers in the e2e suite and only scrolls menu items into view; either delete it or replace it with an assertion-based check if it’s meant to validate the menu.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/e2e/pages/helm-details-page.ts` around lines 71 - 77, The verifyActionsInMenu helper in HelmDetailsPage is unused and only performs scrolling without validating anything. Remove the method if it is not needed, or update it to assert the expected menu items are present using this.actionItems and the listed actions ('Upgrade', 'Rollback', 'Delete Helm Release') so it actually verifies the menu state.frontend/e2e/tests/helm/helm-release.spec.ts (1)
151-158: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicated raw action-item locators instead of reusing the page object.
page.locator('[data-test-action="..."]')is constructed inline here even thoughHelmPage.selectAction()already encapsulates this exact locator pattern. Consider adding agetActionMenuItem(actionName)getter toHelmPage(mirroringHelmDetailsPage.getActionMenuItem) so the spec doesn't duplicate selector strings.♻️ Suggested approach
- const upgradeAction = page.locator('[data-test-action="Upgrade"]'); - await expect(upgradeAction).toBeVisible({ timeout: 15_000 }); - await expect(page.locator('[data-test-action="Rollback"]')).toBeVisible(); - await expect(page.locator('[data-test-action="Delete Helm Release"]')).toBeVisible(); + await expect(helmPage.getActionMenuItem('Upgrade')).toBeVisible({ timeout: 15_000 }); + await expect(helmPage.getActionMenuItem('Rollback')).toBeVisible(); + await expect(helmPage.getActionMenuItem('Delete Helm Release')).toBeVisible();🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/e2e/tests/helm/helm-release.spec.ts` around lines 151 - 158, The helm release spec is duplicating raw action-menu selectors instead of using the page object abstraction. Update the verification in helm-release.spec.ts to use HelmPage for these menu items, and add a getActionMenuItem(actionName) helper on HelmPage that mirrors HelmDetailsPage.getActionMenuItem so the selector logic lives in one place. Keep the existing clickKebabMenu and action-name usage, but replace inline page.locator('[data-test-action="..."]') calls with the shared helper.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@frontend/e2e/pages/helm-page.ts`:
- Around line 97-103: The upgradeChartVersion method currently silently no-ops
when no alternate chart version is available, allowing the caller to continue as
if an upgrade happened. Update HelmPage.upgradeChartVersion to explicitly handle
the zero-item case by failing or otherwise surfacing that no upgrade target
exists before returning, and keep the existing click-on-first-option behavior
only when console-select-item has entries.
In `@frontend/e2e/tests/helm/helm-release.spec.ts`:
- Around line 107-121: The details-page actions check is missing Rollback
coverage because it manually asserts only Upgrade and Delete. Update the helm
release e2e step to use HelmDetailsPage.verifyActionsInMenu() instead of
individual menu-item checks, so all three actions including Rollback are
verified through the existing helper.
- Around line 160-166: The second upgrade flow in helm-release.spec.ts only
waits for the URL change, so the revision list may still be stale when rollback
is opened. In the upgrade step around clickUpgradeButton() and the following
expect(page).toHaveURL check, add the same post-upgrade wait used earlier to
confirm the release reaches Deployed before proceeding. This should be done in
the test step that performs the second upgrade, so selectRevision() sees the
refreshed revision list.
---
Nitpick comments:
In `@frontend/e2e/pages/helm-details-page.ts`:
- Around line 71-77: The verifyActionsInMenu helper in HelmDetailsPage is unused
and only performs scrolling without validating anything. Remove the method if it
is not needed, or update it to assert the expected menu items are present using
this.actionItems and the listed actions ('Upgrade', 'Rollback', 'Delete Helm
Release') so it actually verifies the menu state.
In `@frontend/e2e/pages/helm-page.ts`:
- Around line 40-50: The filter-by-status flow duplicates the
`DataViewCheckboxFilter-filter-item-*` selector logic already centralized in
`getFilterDropdownItem`; update `filterByStatus` in `HelmPage` to reuse that
getter instead of reconstructing the `data-ouia-component-id` string directly.
Keep the existing click sequence, but resolve the item through
`getFilterDropdownItem(status)` so selector changes only need to be made in one
place.
In `@frontend/e2e/tests/helm/helm-release.spec.ts`:
- Around line 151-158: The helm release spec is duplicating raw action-menu
selectors instead of using the page object abstraction. Update the verification
in helm-release.spec.ts to use HelmPage for these menu items, and add a
getActionMenuItem(actionName) helper on HelmPage that mirrors
HelmDetailsPage.getActionMenuItem so the selector logic lives in one place. Keep
the existing clickKebabMenu and action-name usage, but replace inline
page.locator('[data-test-action="..."]') calls with the shared helper.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 545130e5-3425-4d94-baae-9f04c9054ca9
⛔ Files ignored due to path filters (1)
frontend/yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (46)
frontend/e2e/pages/helm-details-page.tsfrontend/e2e/pages/helm-page.tsfrontend/e2e/tests/helm/helm-release.spec.tsfrontend/integration-tests/test-cypress.shfrontend/package.jsonfrontend/packages/helm-plugin/integration-tests/.eslintrcfrontend/packages/helm-plugin/integration-tests/README.mdfrontend/packages/helm-plugin/integration-tests/cypress.config.jsfrontend/packages/helm-plugin/integration-tests/features/BestPractices.mdfrontend/packages/helm-plugin/integration-tests/features/helm-release.featurefrontend/packages/helm-plugin/integration-tests/features/helm/actions-on-helm-release-after-upgrade.featurefrontend/packages/helm-plugin/integration-tests/features/helm/actions-on-helm-release.featurefrontend/packages/helm-plugin/integration-tests/features/helm/helm-compatibility.featurefrontend/packages/helm-plugin/integration-tests/features/helm/helm-feature-flag.featurefrontend/packages/helm-plugin/integration-tests/features/helm/helm-installation-view.featurefrontend/packages/helm-plugin/integration-tests/features/helm/helm-navigation.featurefrontend/packages/helm-plugin/integration-tests/features/helm/helm-page-tabs.featurefrontend/packages/helm-plugin/integration-tests/features/helm/install-helm-chart.featurefrontend/packages/helm-plugin/integration-tests/features/helm/install-url-chart.featurefrontend/packages/helm-plugin/integration-tests/features/helm/topology-helm-release.featurefrontend/packages/helm-plugin/integration-tests/package.jsonfrontend/packages/helm-plugin/integration-tests/reporter-config.jsonfrontend/packages/helm-plugin/integration-tests/support/commands/hooks.tsfrontend/packages/helm-plugin/integration-tests/support/commands/index.tsfrontend/packages/helm-plugin/integration-tests/support/constants/index.tsfrontend/packages/helm-plugin/integration-tests/support/constants/navigation.tsfrontend/packages/helm-plugin/integration-tests/support/constants/static-text/helm-text.tsfrontend/packages/helm-plugin/integration-tests/support/pages/helm/helm-details-page.tsfrontend/packages/helm-plugin/integration-tests/support/pages/helm/helm-page.tsfrontend/packages/helm-plugin/integration-tests/support/pages/helm/index.tsfrontend/packages/helm-plugin/integration-tests/support/pages/helm/rollBack-helm-release-page.tsfrontend/packages/helm-plugin/integration-tests/support/pages/helm/upgrade-helm-release-page.tsfrontend/packages/helm-plugin/integration-tests/support/pages/helm/url-chart-install-page.tsfrontend/packages/helm-plugin/integration-tests/support/pages/index.tsfrontend/packages/helm-plugin/integration-tests/support/step-definitions/common/common.tsfrontend/packages/helm-plugin/integration-tests/support/step-definitions/helm/actions-on-helm-release-after-upgrade.tsfrontend/packages/helm-plugin/integration-tests/support/step-definitions/helm/helm-compatibility.tsfrontend/packages/helm-plugin/integration-tests/support/step-definitions/helm/helm-installation-view.tsfrontend/packages/helm-plugin/integration-tests/support/step-definitions/helm/helm-navigation.tsfrontend/packages/helm-plugin/integration-tests/support/step-definitions/helm/helm-release.tsfrontend/packages/helm-plugin/integration-tests/support/step-definitions/helm/helm.tsfrontend/packages/helm-plugin/integration-tests/support/step-definitions/helm/install-url-chart.tsfrontend/packages/helm-plugin/integration-tests/test-data/namespaced-helm-chart-repository.yamlfrontend/packages/helm-plugin/integration-tests/test-data/namespaced-helm-crd.yamlfrontend/packages/helm-plugin/integration-tests/test-data/red-hat-helm-charts.yamlfrontend/packages/helm-plugin/integration-tests/tsconfig.json
💤 Files with no reviewable changes (43)
- frontend/packages/helm-plugin/integration-tests/features/BestPractices.md
- frontend/packages/helm-plugin/integration-tests/package.json
- frontend/packages/helm-plugin/integration-tests/features/helm/actions-on-helm-release-after-upgrade.feature
- frontend/packages/helm-plugin/integration-tests/features/helm/actions-on-helm-release.feature
- frontend/packages/helm-plugin/integration-tests/support/pages/helm/rollBack-helm-release-page.ts
- frontend/packages/helm-plugin/integration-tests/features/helm-release.feature
- frontend/packages/helm-plugin/integration-tests/features/helm/topology-helm-release.feature
- frontend/packages/helm-plugin/integration-tests/tsconfig.json
- frontend/packages/helm-plugin/integration-tests/support/step-definitions/helm/install-url-chart.ts
- frontend/packages/helm-plugin/integration-tests/features/helm/install-url-chart.feature
- frontend/packages/helm-plugin/integration-tests/features/helm/helm-installation-view.feature
- frontend/packages/helm-plugin/integration-tests/test-data/namespaced-helm-crd.yaml
- frontend/packages/helm-plugin/integration-tests/support/constants/index.ts
- frontend/packages/helm-plugin/integration-tests/test-data/namespaced-helm-chart-repository.yaml
- frontend/packages/helm-plugin/integration-tests/support/step-definitions/helm/actions-on-helm-release-after-upgrade.ts
- frontend/packages/helm-plugin/integration-tests/README.md
- frontend/packages/helm-plugin/integration-tests/test-data/red-hat-helm-charts.yaml
- frontend/packages/helm-plugin/integration-tests/support/commands/hooks.ts
- frontend/packages/helm-plugin/integration-tests/.eslintrc
- frontend/packages/helm-plugin/integration-tests/features/helm/helm-feature-flag.feature
- frontend/packages/helm-plugin/integration-tests/features/helm/install-helm-chart.feature
- frontend/packages/helm-plugin/integration-tests/support/pages/helm/helm-details-page.ts
- frontend/packages/helm-plugin/integration-tests/support/pages/helm/url-chart-install-page.ts
- frontend/packages/helm-plugin/integration-tests/support/step-definitions/helm/helm-release.ts
- frontend/packages/helm-plugin/integration-tests/support/commands/index.ts
- frontend/packages/helm-plugin/integration-tests/support/constants/static-text/helm-text.ts
- frontend/packages/helm-plugin/integration-tests/support/pages/helm/upgrade-helm-release-page.ts
- frontend/packages/helm-plugin/integration-tests/support/constants/navigation.ts
- frontend/packages/helm-plugin/integration-tests/features/helm/helm-navigation.feature
- frontend/packages/helm-plugin/integration-tests/support/step-definitions/helm/helm-installation-view.ts
- frontend/packages/helm-plugin/integration-tests/features/helm/helm-compatibility.feature
- frontend/packages/helm-plugin/integration-tests/support/step-definitions/common/common.ts
- frontend/packages/helm-plugin/integration-tests/support/step-definitions/helm/helm-compatibility.ts
- frontend/packages/helm-plugin/integration-tests/support/pages/helm/helm-page.ts
- frontend/packages/helm-plugin/integration-tests/features/helm/helm-page-tabs.feature
- frontend/packages/helm-plugin/integration-tests/support/step-definitions/helm/helm-navigation.ts
- frontend/packages/helm-plugin/integration-tests/support/step-definitions/helm/helm.ts
- frontend/packages/helm-plugin/integration-tests/cypress.config.js
- frontend/packages/helm-plugin/integration-tests/support/pages/index.ts
- frontend/packages/helm-plugin/integration-tests/reporter-config.json
- frontend/package.json
- frontend/integration-tests/test-cypress.sh
- frontend/packages/helm-plugin/integration-tests/support/pages/helm/index.ts
| async upgradeChartVersion(): Promise<void> { | ||
| await this.chartVersionDropdown.click(); | ||
| const items = this.page.getByTestId('console-select-item'); | ||
| const count = await items.count(); | ||
| if (count > 0) { | ||
| await items.first().click(); | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Silent no-op when no alternate chart version is available.
If items.count() is 0, upgradeChartVersion does nothing and the caller proceeds to submit anyway, so the "upgrade" may complete without any version change, potentially passing the test without actually exercising the upgrade behavior.
🐛 Proposed fix
async upgradeChartVersion(): Promise<void> {
await this.chartVersionDropdown.click();
const items = this.page.getByTestId('console-select-item');
const count = await items.count();
- if (count > 0) {
- await items.first().click();
- }
+ if (count === 0) {
+ throw new Error('No selectable chart versions available to upgrade to');
+ }
+ await items.first().click();📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| async upgradeChartVersion(): Promise<void> { | |
| await this.chartVersionDropdown.click(); | |
| const items = this.page.getByTestId('console-select-item'); | |
| const count = await items.count(); | |
| if (count > 0) { | |
| await items.first().click(); | |
| } | |
| async upgradeChartVersion(): Promise<void> { | |
| await this.chartVersionDropdown.click(); | |
| const items = this.page.getByTestId('console-select-item'); | |
| const count = await items.count(); | |
| if (count === 0) { | |
| throw new Error('No selectable chart versions available to upgrade to'); | |
| } | |
| await items.first().click(); |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@frontend/e2e/pages/helm-page.ts` around lines 97 - 103, The
upgradeChartVersion method currently silently no-ops when no alternate chart
version is available, allowing the caller to continue as if an upgrade happened.
Update HelmPage.upgradeChartVersion to explicitly handle the zero-item case by
failing or otherwise surfacing that no upgrade target exists before returning,
and keep the existing click-on-first-option behavior only when
console-select-item has entries.
|
/label docs-approved |
ChatThere are 3 ways to chat with CodeRabbit:
CodeRabbit commands
Other keywords and placeholders
Status, support, documentation and community
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai can you tell whether the change proposed in this PR increases or decreases the test coverage? Does it create any new gaps? |
|
Tip For best results, initiate chat on the files or code changes.
Scope of removal vs. addition:
Scenarios that appear to have no Playwright equivalent (new gaps):
Net effect: while the new Playwright tests are better structured (explicit waits, higher timeouts, more resilient to flakiness) and cover the "smoke" happy path well (install → list → filter → details → upgrade → rollback → delete), the migration is not yet complete — it trades a large, if flaky, Cypress suite for a much smaller Playwright suite. Unless there's a follow-up PR planned to port the remaining scenarios, this leaves the gaps enumerated above unaddressed. You may want to confirm with the author ( |
|
@vikram-raj, while I really appreciate your effort to remove the flakiness, I'm concerned that you've also removed a substantial number of tests. Is it reasonable to ask you to restore (i.e., convert) them? |
|
Tests from second stage were triggered manually. Pipeline can be controlled only manually, until HEAD changes. Use command to trigger second stage. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vikram-raj, webbnh 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 |
|
/pipeline required |
|
Scheduling tests matching the |
|
/pipeline required |
|
Scheduling tests matching the |
|
Failing test fixes: vikram-raj#16 |
|
New changes are detected. LGTM label has been removed. |
Address CodeRabbit review findings: - Add rollback success assertion to verify operation completed - Fix race condition in upgrade confirmation dialog handling - Remove unused helmReleasesTab variable These changes prevent potential test flakiness by: 1. Ensuring rollback failures are detected (was silently continuing) 2. Properly waiting for confirmation dialogs that may appear delayed 3. Cleaning up unused code Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Remove duplicate data-test attribute on FormFooter reset button - Remove unnecessary data-test added to SectionHeading inner span; use existing dynamic data-test on the outer element instead - Replace legacy data-test-action selectors with getByTestId - Remove redundant waitFor() calls after robustClick - Remove commented-out code and unused page object fields - Fix missing semicolon Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Achieve full feature parity with deleted Cypress tests by adding 18 Playwright scenarios across 4 new spec files. Add page objects for the URL chart wizard and repository forms, extend existing page objects with new getters, and add data-test attributes to the HelmChartRepository form editor. Remove trailing waitForLoadingComplete() calls from page object methods per migration guidelines. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove .locator('input') chaining in page objects since data-test
lands directly on input elements via props spread in InputField
- Add .first() to filter toggle button in searchByName/filterByStatus
to handle strict mode when multiple buttons exist
- Add rightClickOnGroup() for Helm release topology context menu
(group nodes vs inner deployment nodes)
- Use clickTypedResourceLink() with href patterns for sidebar resource
links to avoid ambiguity when multiple resources share the release name
- Fix URL chart validation error text to match actual form validation
- Fix repo scoping test (TC12) to check Repositories tab instead of
catalog filter which requires reachable chart URLs
- Remove broken getResourceLinkByHref and unused filter methods
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove unused getResourceLink/clickResourceLink from TopologySidebarPage (all specs use clickTypedResourceLink) - Replace conditional isVisible check with proper expect assertion for "Clear all filters" button in helm-catalog spec Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The DataView "Clear filters" element is rendered by PatternFly and
the text varies ("Clear filters" vs "Clear all filters"). Use
getByText with a flexible regex pattern instead of getByRole with
an exact name.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Helm releases transition through PendingInstall before reaching Deployed, causing intermittent failures when tests assert on Deployed-only UI elements too early. Adds a waitForHelmReleaseDeployed() helper using expect().toPass() retry pattern to reliably wait for deploy completion across page refreshes. Also fixes topology group label CSS selector ($= to *=) for PF Topology compatibility and replaces fragile page.goBack() navigation with direct URL navigation in topology sidebar tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Increase toBeChecked timeout for form view radio since the editor type is set asynchronously after the chart schema loads. Skip the non-configurable chart test gracefully when the Httpd Imagestreams chart is not available on the cluster. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ed511bd to
daa3d07
Compare
|
/pipeline required |
|
Scheduling tests matching the |
|
/test e2e-gcp-console |
The default editor type (Form vs YAML) depends on persisted user preferences via useEditorType, not just the chart schema. Assert both radios are visible, switch to form view if needed, then verify form sections render. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix(e2e): stop asserting default editor type in helm release test
| // Wait for catalog to settle — either the chart tile appears or "No results found" | ||
| await expect(chartTile.or(noResults)).toBeVisible({ timeout: 30_000 }); | ||
| test.skip( | ||
| await noResults.isVisible(), | ||
| `Chart "${NON_CONFIGURABLE_CHART}" not available on this cluster`, | ||
| ); | ||
| await chartTile.click(); |
There was a problem hiding this comment.
@rhamilto, my apologies if this is obvious, but my TypeScript skills are weak....
Can't line 206 produce one of three results:
- the
chartTileis visible - the
noResultsis visible - neither, due to timeout?
Given that, what does the await at line 208 do? (That is, if we timed out at line 206, the await at line 208 will never be fullfilled...right?...so would we hang at that point?) And, if we timed out at line 206 and chartTile is not visible, what happens if/when control reaches line 211?
Thanks....
There was a problem hiding this comment.
neither, due to timeout?
If we hit a timeout, does the test stop and fail immediately, or does execution resume with the test.skip() call?
if we timed out at line 206, the await at line 208 will never be fullfilled...right?...so would we hang at that point?
Or, is the await fulfilled immediately evaluating to false? In that case, we proceed to line 211 where we don't have a chartTile to click on...so does the await there hang indefinitely?
There was a problem hiding this comment.
Great questions! The key distinction in Playwright is between assertions (expect().toBeVisible()) and checks (.isVisible()):
Line 206 — await expect(chartTile.or(noResults)).toBeVisible()
This is an assertion that auto-retries until it passes or the timeout expires. There are only two outcomes:
- At least one of the two locators becomes visible → assertion passes, execution continues.
- Neither becomes visible within 30s → Playwright throws an error and the test fails immediately. There is no silent "timed out but keep going" path.
Line 208 — await noResults.isVisible()
This is a non-asserting check — it returns true or false instantly without retrying or waiting. We can only reach this line if line 206 passed, so we already know at least one of the two locators is visible. If noResults is the visible one, test.skip() skips the rest of the test. No risk of hanging.
Line 211 — await chartTile.click()
This line is only reachable if:
- Line 206 passed (so at least one locator is visible), AND
- Line 208 returned
false(sonoResultsis not the visible one, meaningchartTilemust be).
So the three-state concern does not apply here — Playwright assertions are strict pass-or-throw, they never silently continue on timeout.
|
@vikram-raj: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Analysis / Root cause:
The Helm E2E tests were still using Cypress and needed migration to Playwright as part of the overall test migration effort. Some tests were experiencing flakiness due to timing issues with async operations.
Solution description:
waitForLoadingComplete()call that could cause race conditionsScreenshots / screen recording:
Test setup:
cd frontend && yarn test:e2e --grep @helmTest cases:
Browser conformance:
Additional info:
This PR includes two commits:
Reviewers and assignees:
Summary by CodeRabbit
Tests
Chores