chore(fix): fixing compose e2e tests to handle new flow (#17165)

Signed-off-by: Vladimir Lazar <vlazar@redhat.com>
This commit is contained in:
Vladimir Lazar 2026-04-21 09:53:02 +02:00 committed by GitHub
parent 7e0b9fbb85
commit 76b1a0b24e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 17 deletions

View file

@ -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();

View file

@ -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');
}