Skip to content

Commit

Permalink
[SALEOR_119] Increase timeouts on app install (#5147)
Browse files Browse the repository at this point in the history
* increase timeouts

* extract timeout values to variables
  • Loading branch information
Cloud11PL authored Sep 5, 2024
1 parent aa152b0 commit 4d226ce
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/dirty-rivers-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

SALEOR_119 now has increased timeouts for app instalation. This means the test should fail less.
18 changes: 15 additions & 3 deletions playwright/tests/apps.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ test.beforeEach(({ page }) => {
appPage = new AppPage(page);
});

const PRE_INSTALLATION_TIMEOUT = 20 * 1000;
const INSTALLATION_PENDING_TIMEOUT = 50 * 1000;
const APP_LISTED_TIMEOUT = 15 * 1000;
const APP_INSTALLED_TIMEOUT = 50 * 1000;

test("TC: SALEOR_119 User should be able to install and configure app from manifest @e2e", async ({
page,
}) => {
Expand All @@ -25,21 +30,28 @@ test("TC: SALEOR_119 User should be able to install and configure app from manif
await appsPage.installExternalAppButton.click();
await appsPage.typeManifestUrl("https://klaviyo.saleor.app/api/manifest");
await appsPage.installAppFromManifestButton.click();
// Klaviyo app can take a while to respond with manifest if it's
// cold-starting
await expect(installationPage.appInstallationPageHeader).toHaveText(

Check failure on line 35 in playwright/tests/apps.spec.ts

View workflow job for this annotation

GitHub Actions / run-tests-on-release / run-pw-tests (2/2)

[apps-e2e] › apps.spec.ts:24:5 › TC: SALEOR_119 User should be able to install and configure app from manifest @e2e

1) [apps-e2e] › apps.spec.ts:24:5 › TC: SALEOR_119 User should be able to install and configure app from manifest @e2e Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Timed out 20000ms waiting for expect(locator).toHaveText(expected) Locator: getByTestId('app-installation-page-header') Expected string: "You are about to install Klaviyo" Received string: "" Call log: - expect.toHaveText with timeout 20000ms - waiting for getByTestId('app-installation-page-header') - locator resolved to <span data-macaw-ui-component="Text" data-test-id="app…>…</span> - unexpected value "" - locator resolved to <span data-macaw-ui-component="Text" data-test-id="app…>…</span> - unexpected value "" - locator resolved to <span data-macaw-ui-component="Text" data-test-id="app…>…</span> - unexpected value "" - locator resolved to <span data-macaw-ui-component="Text" data-test-id="app…>…</span> - unexpected value "" - locator resolved to <span data-macaw-ui-component="Text" data-test-id="app…>…</span> - unexpected value "" 33 | // Klaviyo app can take a while to respond with manifest if it's 34 | // cold-starting > 35 | await expect(installationPage.appInstallationPageHeader).toHaveText( | ^ 36 | "You are about to install Klaviyo", 37 | { 38 | timeout: PRE_INSTALLATION_TIMEOUT, at /home/runner/work/saleor-dashboard/saleor-dashboard/playwright/tests/apps.spec.ts:35:60

Check failure on line 35 in playwright/tests/apps.spec.ts

View workflow job for this annotation

GitHub Actions / run-tests-on-release / run-pw-tests (2/2)

[apps-e2e] › apps.spec.ts:24:5 › TC: SALEOR_119 User should be able to install and configure app from manifest @e2e

1) [apps-e2e] › apps.spec.ts:24:5 › TC: SALEOR_119 User should be able to install and configure app from manifest @e2e Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: Timed out 20000ms waiting for expect(locator).toHaveText(expected) Locator: getByTestId('app-installation-page-header') Expected string: "You are about to install Klaviyo" Received string: "" Call log: - expect.toHaveText with timeout 20000ms - waiting for getByTestId('app-installation-page-header') - locator resolved to <span data-macaw-ui-component="Text" data-test-id="app…>…</span> - unexpected value "" - locator resolved to <span data-macaw-ui-component="Text" data-test-id="app…>…</span> - unexpected value "" - locator resolved to <span data-macaw-ui-component="Text" data-test-id="app…>…</span> - unexpected value "" - locator resolved to <span data-macaw-ui-component="Text" data-test-id="app…>…</span> - unexpected value "" 33 | // Klaviyo app can take a while to respond with manifest if it's 34 | // cold-starting > 35 | await expect(installationPage.appInstallationPageHeader).toHaveText( | ^ 36 | "You are about to install Klaviyo", 37 | { 38 | timeout: PRE_INSTALLATION_TIMEOUT, at /home/runner/work/saleor-dashboard/saleor-dashboard/playwright/tests/apps.spec.ts:35:60
"You are about to install Klaviyo",
{
timeout: PRE_INSTALLATION_TIMEOUT,
},
);
await installationPage.installAppButton.click();
await appsPage.expectSuccessBanner();
await expect(appsPage.installedAppRow.first()).toBeVisible();
await appsPage.installationPendingLabel.waitFor({
state: "hidden",
timeout: 50000,
timeout: INSTALLATION_PENDING_TIMEOUT,
});
await expect(appsPage.appKlaviyo).toContainText("Klaviyo", {
timeout: APP_LISTED_TIMEOUT,
});
await expect(appsPage.appKlaviyo).toContainText("Klaviyo");
await appsPage.installedAppRow
.filter({ hasText: "Klaviyo" })
.first()
.waitFor({ state: "visible", timeout: 50000 });
.waitFor({ state: "visible", timeout: APP_INSTALLED_TIMEOUT });
await appsPage.appKlaviyo.click();

const iframeLocator = page.frameLocator("iframe");
Expand Down

0 comments on commit 4d226ce

Please sign in to comment.