Skip to content

Commit 55da6d7

Browse files
authored
test: updates leap wallet fixture for web e2e and adjusts interactions
1 parent eda2f96 commit 55da6d7

File tree

245 files changed

+1035667
-11025
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

245 files changed

+1035667
-11025
lines changed
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { Page } from "@playwright/test";
2-
import { setTimeout as wait } from "timers/promises";
32

43
import { waitForLocator } from "../fixture/testing-helpers";
54
import { approveWalletOperation } from "../fixture/wallet-setup";
@@ -12,13 +11,10 @@ export async function selectChainNetwork(page: Page, networkId = "sandbox") {
1211

1312
await page.getByLabel(new RegExp(networkId, "i")).click();
1413

15-
const [popupPage] = await Promise.all([
16-
// sometimes Leap requires to approve the operation again
17-
page
18-
.context()
19-
.waitForEvent("page", { timeout: 3_000 })
20-
.catch(() => null),
21-
wait(100).then(() => page.getByRole("button", { name: "Save" }).click())
22-
]);
14+
const popupPromise = page.context().waitForEvent("page", { timeout: 5000 });
15+
await page.getByRole("button", { name: "Save" }).click();
16+
17+
const popupPage = await popupPromise;
18+
2319
await approveWalletOperation(popupPage);
2420
}
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import { test } from "./fixture/context-with-extension";
1+
import { expect, test } from "./fixture/context-with-extension";
22
import { LeapExt } from "./pages/LeapExt";
33

44
test("wallet stays disconnected after disconnecting and reloading", async ({ page, context }) => {
55
test.setTimeout(5 * 60 * 1000);
6-
76
const frontPage = new LeapExt(context, page);
8-
97
await frontPage.disconnectWallet();
8+
109
await expect(page.getByTestId("connect-wallet-btn")).toBeVisible();
1110
});
-1.77 KB
Binary file not shown.
-1.11 KB
Binary file not shown.
-998 Bytes
Binary file not shown.
-235 Bytes
Binary file not shown.

apps/deploy-web/tests/ui/fixture/Leap/1035.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

apps/deploy-web/tests/ui/fixture/Leap/1131.js

Lines changed: 0 additions & 1 deletion
This file was deleted.
-1013 Bytes
Binary file not shown.
-1.72 KB
Binary file not shown.

0 commit comments

Comments
 (0)