This commit is contained in:
Paul Miller
2024-01-13 12:45:58 +00:00
parent ee32e59eb7
commit 33b8190a2d
165 changed files with 5892 additions and 10147 deletions

27
e2e/utils.ts Normal file
View File

@@ -0,0 +1,27 @@
import { expect, Page } from "@playwright/test";
export async function loadHome(page: Page) {
// Start on the home page
await expect(page).toHaveTitle(/Mutiny Wallet/);
await page.waitForSelector("text=Welcome to the Mutiny!");
console.log("Waiting for new wallet to be created...");
await page.locator(`button:has-text('New Wallet')`).click();
await page.locator("text=Create your profile").first();
await page.locator("button:has-text('Skip for now')").click();
// Should have a balance up top now
await page.locator(`text=0 sats`).first();
// Status light should be ready
await page.locator(`title="READY"`).first();
}
export async function visitSettings(page: Page) {
// Find an image with an alt text of "mutiny" and click it
// TODO: probably should have better ARIA stuff for this
await page.locator("img[alt='mutiny']").first().click();
await expect(page.locator("h1").first()).toHaveText("Settings");
}