Files
zitadel/acceptance/tests/code.ts

20 lines
560 B
TypeScript
Raw Normal View History

2024-11-20 14:22:22 +01:00
import { Page } from "@playwright/test";
import { codeScreen } from "./code-screen";
import { getOtpFromSink } from "./sink";
2024-11-20 14:22:22 +01:00
export async function otpFromSink(page: Page, key: string) {
2024-11-20 14:22:22 +01:00
// wait for send of the code
2024-11-20 16:03:20 +01:00
await page.waitForTimeout(3000);
const c = await getOtpFromSink(key);
2024-11-20 14:22:22 +01:00
await code(page, c);
}
export async function code(page: Page, code: string) {
await codeScreen(page, code);
await page.getByTestId("submit-button").click();
}
export async function codeResend(page: Page) {
await page.getByTestId("resend-button").click();
}