diff options
| author | Adam Soltys <[email protected]> | 2026-02-11 09:44:48 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-11 15:34:35 -0800 |
| commit | 2cc4969678f4d073ebddec0e7e9f2aac707fb761 (patch) | |
| tree | 7b196647aa87432e4eb420a43d0b9e839078133b /test | |
| parent | b484f522ef032c0469db976a422fc667ca402855 (diff) | |
| download | coinos-ui-2cc4969678f4d073ebddec0e7e9f2aac707fb761.tar.gz coinos-ui-2cc4969678f4d073ebddec0e7e9f2aac707fb761.zip | |
playwright test
Diffstat (limited to 'test')
| -rw-r--r-- | test/e2e/login-balance.spec.ts | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/e2e/login-balance.spec.ts b/test/e2e/login-balance.spec.ts new file mode 100644 index 00000000..75148bc4 --- /dev/null +++ b/test/e2e/login-balance.spec.ts @@ -0,0 +1,23 @@ +import { expect, test } from "@playwright/test"; + +const username = process.env.E2E_USERNAME || "bob"; +const password = process.env.E2E_PASSWORD || "pw"; + +test("login and report account balance", async ({ page }) => { + await page.goto("/login"); + + await page.getByTestId("login-username").fill(username); + await page.locator('input[name="password"]').first().fill(password); + await page.getByTestId("login-submit").click(); + + await expect(page).toHaveURL(new RegExp(`/${username}(?:[/?#]|$)`)); + + const balances = page.getByTestId("balance-value"); + await expect(balances.first()).toBeVisible(); + + const balanceText = (await balances.first().innerText()).trim(); + const hasNumericBalance = /\d/.test(balanceText); + expect(hasNumericBalance).toBeTruthy(); + + console.log(`[e2e] ${username} visible balance: ${balanceText}`); +}); |
