From 982c6bafa0049c4995bbd839c0d6a454ed39f54d Mon Sep 17 00:00:00 2001 From: Iveta Date: Mon, 2 Dec 2024 15:16:25 -0500 Subject: [PATCH] Wait for account response --- tests/savedKeypairs.test.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/savedKeypairs.test.ts b/tests/savedKeypairs.test.ts index 32aceefd..38675823 100644 --- a/tests/savedKeypairs.test.ts +++ b/tests/savedKeypairs.test.ts @@ -118,14 +118,15 @@ test.describe("Saved Keypairs Page", () => { ); // Wait for the Friendbot response - const responsePromise = pageContext.waitForResponse( + const friendbotResponse = pageContext.waitForResponse( (response) => - response.url().includes("?addr=") && response.status() === 200, + response.url().includes(`?addr=${SAVED_ACCOUNT_2}`) && + response.status() === 200, ); await fundButton.click(); - await responsePromise; + await friendbotResponse; // Mock Account 2 response await pageContext.route( @@ -139,6 +140,14 @@ test.describe("Saved Keypairs Page", () => { }, ); + const accountResponse = pageContext.waitForResponse( + (response) => + response.url().includes(`accounts/${SAVED_ACCOUNT_2}`) && + response.status() === 200, + ); + + await accountResponse; + await expect(fundButton).toBeHidden(); await expect( keypairItem.getByText("Balance: 10000.0000000 XLM", { exact: true }),