Skip to content

Commit 67b762a

Browse files
fixed and improved autotests
1 parent 1a09aba commit 67b762a

File tree

16 files changed

+372
-195
lines changed

16 files changed

+372
-195
lines changed

autotests/playwright.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { PlaywrightTestConfig } from "@playwright/test";
2+
import { resolve } from "path";
23

34
const config: PlaywrightTestConfig = {
45
timeout: process.env.PW_TIMEOUT ? Number(process.env.PW_TIMEOUT) : 60_000,
@@ -7,6 +8,7 @@ const config: PlaywrightTestConfig = {
78
workers: process.env.PW_WORKERS ? Number(process.env.PW_WORKERS) : 1,
89
use: {
910
viewport: { width: 1600, height: 1200 },
11+
storageState: resolve(__dirname, "./.storage.json"),
1012
},
1113
};
1214

autotests/src/elements/base-page.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ export class BasePage {
7272
return this.wrapLocatorWithRoot(locator, locatorSelector);
7373
}
7474

75+
async allowSpentTokens() {
76+
const popup = await this.wallet.page.context().waitForEvent("page");
77+
await popup.waitForSelector('[data-testid="page-container-footer-next"]');
78+
await popup.click('[data-testid="page-container-footer-next"]');
79+
await popup.waitForSelector('[data-testid="page-container-footer-next"]:has-text("Approve")');
80+
await popup.click('[data-testid="page-container-footer-next"]:has-text("Approve")');
81+
}
82+
7583
async has(locator: string | Locator, timeout = 5000) {
7684
const selector = typeof locator === "string" ? this.locator(locator).selector : locator.selector;
7785

autotests/src/elements/common.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ export class Tabs<T extends string> extends BasePage {
1616
return window.getComputedStyle(el).pointerEvents;
1717
});
1818

19-
if (style !== "none") {
20-
await tab.click();
19+
if (style === "none") {
20+
return;
2121
}
22+
23+
await tab.click();
2224
}
2325
}
2426

0 commit comments

Comments
 (0)