From 76b1a0b24e41023727f62d22555c79f68e577c3a Mon Sep 17 00:00:00 2001 From: Vladimir Lazar <106525396+cbr7@users.noreply.github.com> Date: Tue, 21 Apr 2026 09:53:02 +0200 Subject: [PATCH] chore(fix): fixing compose e2e tests to handle new flow (#17165) Signed-off-by: Vladimir Lazar --- .../specs/compose-onboarding-smoke.spec.ts | 14 +++++++----- .../specs/extension-onboarding-smoke.spec.ts | 22 +++++++++---------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/tests/playwright/src/specs/compose-onboarding-smoke.spec.ts b/tests/playwright/src/specs/compose-onboarding-smoke.spec.ts index bab46cad477..5cf6c64c9c9 100644 --- a/tests/playwright/src/specs/compose-onboarding-smoke.spec.ts +++ b/tests/playwright/src/specs/compose-onboarding-smoke.spec.ts @@ -84,14 +84,16 @@ test.describe await playExpect(onboardingPage.heading).toBeVisible(); const onboardingVersionPage = new ComposeVersionPage(page); - await playExpect(onboardingVersionPage.onboardingStatusMessage).toHaveText('Compose download'); + await playExpect(onboardingVersionPage.onboardingStatusMessage).toContainText( + /Compose download|Unable to retrieve Compose version/, + { timeout: 10_000 }, + ); - const rateLimitExceededText = '${onboardingContext}'; - const rateLimitExceededLocator = page.getByText(rateLimitExceededText); + const statusText = await onboardingVersionPage.onboardingStatusMessage.innerText(); - if ((await rateLimitExceededLocator.count()) > 0 || cliToolsPage.wasRateLimitReached()) { - test.info().annotations.push({ type: 'skip', description: 'Rate limit exceeded for Compose download' }); - test.skip(true, 'Rate limit exceeded; skipping compose onboarding checks'); + if (statusText.includes('Unable to retrieve Compose version') || cliToolsPage.wasRateLimitReached()) { + test.skip(true, 'Unable to retrieve Compose version; likely GitHub API rate limit or network issue'); + return; } await playExpect(onboardingVersionPage.versionStatusMessage).toBeVisible(); diff --git a/tests/playwright/src/specs/extension-onboarding-smoke.spec.ts b/tests/playwright/src/specs/extension-onboarding-smoke.spec.ts index e43ef8dc595..0c2b32971ba 100644 --- a/tests/playwright/src/specs/extension-onboarding-smoke.spec.ts +++ b/tests/playwright/src/specs/extension-onboarding-smoke.spec.ts @@ -134,15 +134,20 @@ test.describe await welcomePage.nextStepButton.click(); }); - test('Check other versions for compose', async ({ welcomePage, page }) => { + test('Check other versions for compose', async ({ welcomePage }) => { await playExpect(welcomePage.onboardingMessageStatus).toBeVisible({ timeout: 10_000 }); - // Wait for compose step to be shown (either "Compose installed" or "Compose download") - await playExpect(welcomePage.onboardingMessageStatus).toContainText(/Compose (installed|download)/, { - timeout: 10_000, - }); + await playExpect(welcomePage.onboardingMessageStatus).toContainText( + /Compose (installed|download)|Unable to retrieve Compose version/, + { timeout: 10_000 }, + ); composeOnboardingStatusText = await welcomePage.onboardingMessageStatus.innerText(); + if (composeOnboardingStatusText?.includes('Unable to retrieve Compose version') || rateLimitReachedFlag) { + test.skip(true, 'Unable to retrieve Compose version; likely GitHub API rate limit or network issue'); + return; + } + if (composeOnboardingStatusText?.toLowerCase().includes('compose installed')) { test.skip(true, 'Compose already installed; see "Compose already installed" test'); return; @@ -151,12 +156,7 @@ test.describe await playExpect(welcomePage.onboardingMessageStatus).toContainText('Compose download', { timeout: 10_000 }); await playExpect(welcomePage.otherVersionButton).toBeVisible(); - const rateLimitExceededText = '${onboardingContext}'; - const rateLimitExceededLocator = page.getByText(rateLimitExceededText); - - if ((await rateLimitExceededLocator.count()) > 0 || rateLimitReachedFlag) { - // we have hit the rate limit, we cannot continue, exit the test suite - test.info().annotations.push({ type: 'skip', description: 'Rate limit exceeded for Compose download' }); + if (rateLimitReachedFlag) { test.skip(true, 'Rate limit exceeded; skipping compose onboarding checks'); }