From 41b4c13fed5ec84b403ce13fd8daf7e3109418b9 Mon Sep 17 00:00:00 2001 From: Iveta Date: Wed, 18 Dec 2024 11:27:56 -0500 Subject: [PATCH] Fix flaky test --- tests/feeBumpPage.test.ts | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/tests/feeBumpPage.test.ts b/tests/feeBumpPage.test.ts index 13a96fd9..31d945e9 100644 --- a/tests/feeBumpPage.test.ts +++ b/tests/feeBumpPage.test.ts @@ -53,12 +53,15 @@ test.describe("Fee Bump Page", () => { test("Sign in Transaction Signer", async ({ page }) => { await page.getByLabel("Base Fee").fill(BASE_FEE); - await page.getByText("Sign in Transaction Signer").click(); - // Adding extra delay because sometimes it takes longer to load the next page - await expect(page.locator("h1")).toHaveText("Transaction Overview", { - timeout: 5000, + const signButton = page.getByText("Sign in Transaction Signer", { + exact: true, }); + + await expect(signButton).toBeVisible(); + await signButton.click(); + + await expect(page.locator("h1")).toHaveText("Transaction Overview"); await expect(page.getByLabel("Transaction Envelope XDR")).toHaveText( MOCK_XDR, ); @@ -66,12 +69,13 @@ test.describe("Fee Bump Page", () => { test("View in XDR viewer", async ({ page }) => { await page.getByLabel("Base Fee").fill(BASE_FEE); - await page.getByText("View in XDR Viewer").click(); - // Adding extra delay because sometimes it takes longer to load the next page - await expect(page.locator("h1")).toHaveText("View XDR", { - timeout: 5000, - }); + const viewButton = page.getByText("View in XDR viewer", { exact: true }); + + await expect(viewButton).toBeVisible(); + await viewButton.click(); + + await expect(page.locator("h1")).toHaveText("View XDR"); await expect(page.getByLabel("Base-64 encoded XDR")).toHaveText(MOCK_XDR); }); });