OCPBUGS-102342: Dismiss Quick Start drawer in Playwright e2e tests - #16903
OCPBUGS-102342: Dismiss Quick Start drawer in Playwright e2e tests#16903rhamilto wants to merge 1 commit into
Conversation
The "Get started with a sample application" Quick Start drawer auto-opens on fresh CI clusters, covering the right side of the screen and blocking test interactions. This caused topology, user-preferences, and other test failures. Fix by clearing the active quickstart in the user settings ConfigMap during cluster setup and dismissing the drawer in warmupSPA() and topology tests as a browser-side safety net. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@rhamilto: This pull request references Jira Issue OCPBUGS-102342, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. 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. |
WalkthroughThe E2E setup initializes quick-start state, adds a helper to dismiss the quick-start drawer, and invokes the helper during SPA warmup and topology test setup. ChangesQuick-start E2E handling
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@rhamilto: This pull request references Jira Issue OCPBUGS-102342, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
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. |
|
/jira refresh |
|
@rhamilto: This pull request references Jira Issue OCPBUGS-102342, which is valid. 3 validation(s) were run on this bug
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. |
|
@rhamilto: This PR has been marked as verified by 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. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhamilto 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: 1
🤖 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/base-page.ts`:
- Around line 37-45: Update dismissQuickStartDrawer so only closeButton.waitFor
visibility is wrapped in the try/catch, allowing click failures to propagate.
Pass a five-second timeout to closeButton.click(), then wait for closeButton to
become hidden before returning.
🪄 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: 2e655547-a2da-45ae-b500-55212823d0e2
📒 Files selected for processing (3)
frontend/e2e/clients/kubernetes-client.tsfrontend/e2e/pages/base-page.tsfrontend/e2e/tests/topology/topology-ci.spec.ts
| export async function dismissQuickStartDrawer(page: Page): Promise<void> { | ||
| const closeButton = page.getByRole('button', { name: 'Close drawer panel' }); | ||
| try { | ||
| // eslint-disable-next-line no-restricted-syntax | ||
| await closeButton.waitFor({ state: 'visible', timeout: 5_000 }); | ||
| await closeButton.click(); | ||
| } catch { | ||
| // No quickstart drawer open — continue | ||
| } |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
fd -a -t f 'playwright\.config\..*|package\.json' . |
while IFS= read -r file; do
rg -n 'actionTimeout|setDefaultTimeout|`@playwright/test`|playwright' "$file" || true
doneRepository: openshift/console
Length of output: 998
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo '--- candidate files ---'
fd -a -t f 'playwright\.config\..*|base-page\.ts|package\.json' . | sort
echo '--- Playwright configuration ---'
config=$(fd -a -t f 'playwright\.config\..*' . | head -n 1)
if [ -n "${config:-}" ]; then
wc -l "$config"
cat -n "$config"
fi
echo '--- helper and call sites ---'
rg -n -C 4 'dismissQuickStartDrawer|Close drawer panel|quickstart drawer' frontend/e2e
echo '--- timeout configuration across E2E files ---'
rg -n -C 2 'actionTimeout|navigationTimeout|setDefaultTimeout|setDefaultNavigationTimeout|timeout:' frontend/e2e playwright.config.* package.json 2>/dev/null || trueRepository: openshift/console
Length of output: 50374
🌐 Web query:
Playwright Locator.click timeout default waitFor timeout default actionTimeout setDefaultTimeout
💡 Result:
In Playwright, timeout behaviors differ depending on whether you are using the Playwright Test runner or the Playwright library directly. Default Timeout Behaviors: 1. locator.click and other Action Timeouts: - When using Playwright Test (the recommended runner), the default timeout for actions like click is 0 (no timeout) [1][2]. This means the action will wait indefinitely unless otherwise configured [3][1]. - When using the Playwright library (e.g., in a script without the test runner), the default timeout for actions is typically 30 seconds [4][5][6]. - You can override this per-action by passing a timeout option: await locator.click({ timeout: 5000 }); [7][8]. 2. locator.waitFor Timeout: - By default, locator.waitFor uses a 30-second timeout [5][9]. - Like other actions, you can override this by passing the timeout option: await locator.waitFor({ timeout: 5000 });. Configuring Default Timeouts: You can change these defaults globally or at the suite/context/page level: - Playwright Configuration (playwright.config.ts): Use the actionTimeout property in the use object to set a default for all actions [1][8]. export default defineConfig({ use: { actionTimeout: 10000, // 10 seconds }, }); - Programmatic Defaults: You can use page.setDefaultTimeout(ms) or browserContext.setDefaultTimeout(ms) to override the default timeout for all operations (including actions and wait functions) on that page or context [3][4][10]. Passing 0 disables the timeout [3][5]. Important Distinctions: - Action Timeout vs. Test Timeout: The actionTimeout only applies to individual actions (like clicking or filling). It is distinct from the overall test timeout, which is set via the timeout property in the config or test.setTimeout [7][11][8]. - Troubleshooting: If you encounter a timeout error (e.g., Timeout 30000ms exceeded), it is often because you have either not changed the default 30-second wait in a non-test-runner environment or are hitting a configured limit [11][12]. If using Playwright Test, check your config file for an actionTimeout setting [11][8].
Citations:
- 1: https://playwright.dev/docs/test-use-options
- 2: https://playwright.dev/docs/next/api/class-testoptions
- 3: https://playwright.dev/docs/api/class-locator
- 4: https://playwright.dev/python/docs/api/class-locator
- 5: https://github.com/microsoft/playwright/blob/main/docs/src/api/params.md
- 6: https://github.com/microsoft/playwright/blob/v1.4.0/docs/api.md
- 7: https://playwright.dev/docs/test-timeouts
- 8: https://playwright.dev/docs/next/test-timeouts
- 9: [Question] Does waitFor() throw an error when the element is not present on the page after default timeout? microsoft/playwright#11239
- 10: https://playwright.dev/docs/api/class-page
- 11: [Bug]: TimeoutError: locator.click: Timeout 30000ms exceeded. microsoft/playwright#34945
- 12: [BUG] Document needs to be modified regarding locator.fill Maximum timeout 30 seconds will be overridden by actionTimeout of 0. microsoft/playwright#19018
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo '--- base page context ---'
sed -n '1,75p' frontend/e2e/pages/base-page.ts
echo '--- relevant package versions and scripts ---'
sed -n '1,80p' frontend/e2e/package.json
sed -n '130,155p' frontend/package.json
echo '--- topology actions immediately after drawer dismissal ---'
sed -n '50,75p' frontend/e2e/tests/topology/topology-ci.spec.ts
sed -n '115,135p' frontend/e2e/tests/topology/topology-ci.spec.tsRepository: openshift/console
Length of output: 5455
Bound and verify the drawer-close action.
Playwright Test has no configured action timeout, so click() does not enforce the five-second limit. The broad catch also hides click failures. Catch only the visibility wait, pass timeout: 5_000 to click(), and wait for the button to become hidden.
🤖 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/base-page.ts` around lines 37 - 45, Update
dismissQuickStartDrawer so only closeButton.waitFor visibility is wrapped in the
try/catch, allowing click failures to propagate. Pass a five-second timeout to
closeButton.click(), then wait for closeButton to become hidden before
returning.
Source: MCP tools
|
/test backend |
|
@rhamilto: 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 "Get started with a sample application" Quick Start drawer auto-opens on fresh CI clusters. It covers ~30% of the screen width on the right side, blocking test interactions with topology nodes, menus, and other UI elements. The existing
setupConsoleUserSettings()suppresses the guided tour but does not suppress the Quick Start drawer.Jira: https://redhat.atlassian.net/browse/OCPBUGS-102342
CI failures: https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/test-platform-results/pr-logs/pull/openshift_console/16741/pull-ci-openshift-console-main-e2e-playwright/2084317442368081920/artifacts/e2e-playwright/test/artifacts/playwright-report/index.html
Solution description:
kubernetes-client.ts): Clearconsole.quickstart.activein the user settings ConfigMap during cluster setup to prevent the drawer from auto-opening.base-page.ts): Add exporteddismissQuickStartDrawer()helper that clicks the "Close drawer panel" button if visible (5s timeout, swallows errors if absent). Called fromwarmupSPA()as a safety net.topology-ci.spec.ts): CalldismissQuickStartDrawer()afterpage.goto('/')in the two places that navigate directly instead of usingwarmupSPA().Screenshots / screen recording:
N/A — e2e test infrastructure fix, no visual changes.
Test setup:
No special setup required. Run the Playwright e2e suite on a fresh CI cluster.
Test cases:
warmupSPA()dismiss the drawer if presentBrowser conformance:
Additional info:
The Quick Start drawer is rendered by
@patternfly/quickstartsand configured via user preferences stored in a ConfigMap inopenshift-console-user-settings. Theconsole.quickstart.activekey controls which quickstart is currently open.🤖 Generated with Claude Code
Summary by CodeRabbit