Files
rowt/frontend/tests/helpers.ts
T
philipp 910c51d01f
CI/CD Pipeline / test (push) Failing after 28m52s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
fix ci
2026-05-01 08:32:51 +02:00

19 lines
661 B
TypeScript

import { exec } from 'child_process';
import { promisify } from 'util';
import { Page } from '@playwright/test';
const execAsync = promisify(exec);
export async function resetDatabase(): Promise<void> {
await execAsync('cd .. && ./reset_test_data.sh');
}
export async function login(page: Page, username: string, password: string): Promise<void> {
await page.context().clearCookies();
await page.goto("/auth", { waitUntil: 'load' });
await page.getByPlaceholder("Name").fill(username);
await page.getByPlaceholder("Passwort").fill(password);
await page.getByPlaceholder("Passwort").press("Enter");
await page.waitForURL(/\/(planned|log|$)/);
}