Files
gymflow/tests/test-2.spec.ts
2025-12-09 18:11:55 +02:00

36 lines
2.1 KiB
TypeScript

import { test, expect } from '@playwright/test';
test('test', async ({ page }) => {
await page.goto('http://localhost:3000/login');
await page.getByRole('textbox', { name: 'Email' }).click();
await page.getByRole('textbox', { name: 'Email' }).fill('admin@gymflow.ai');
await page.getByRole('textbox', { name: 'Email' }).press('Tab');
await page.getByRole('textbox', { name: 'Password' }).fill('admin123');
await page.getByRole('button', { name: 'Login' }).click();
await page.getByRole('button', { name: 'Plans' }).click();
await page.getByRole('button', { name: 'Create Plan' }).click();
await page.getByRole('textbox', { name: 'Name' }).click();
await page.getByRole('textbox', { name: 'Name' }).fill('Smart Plan');
await page.getByRole('button', { name: 'Add Exercise' }).click();
await page.getByRole('button').filter({ hasText: /^$/ }).nth(2).click();
await page.locator('[id="_r_3_"]').fill('Exercise A');
await page.getByRole('button', { name: 'Create' }).click();
await page.getByRole('button', { name: 'Add Exercise' }).click();
await page.getByRole('button').filter({ hasText: /^$/ }).nth(3).click();
await page.locator('[id="_r_4_"]').fill('Exercise B');
await page.getByRole('button', { name: 'Create' }).click();
await page.getByRole('button', { name: 'Save' }).click();
await page.getByRole('button', { name: 'Start' }).nth(1).click();
await page.getByRole('spinbutton', { name: 'Weight (kg)' }).click();
await page.getByRole('spinbutton', { name: 'Weight (kg)' }).fill('12');
await page.getByRole('spinbutton', { name: 'Reps' }).click();
await page.getByRole('spinbutton', { name: 'Reps' }).fill('13');
await page.getByRole('button', { name: 'Log Set' }).click();
await page.getByRole('spinbutton', { name: 'Weight (kg)' }).click();
await page.getByRole('spinbutton', { name: 'Weight (kg)' }).fill('13');
await page.getByRole('spinbutton', { name: 'Reps' }).click();
await page.getByRole('spinbutton', { name: 'Reps' }).fill('14');
await page.getByRole('button', { name: 'Log Set' }).click();
await page.getByRole('button', { name: 'Finish' }).click();
await page.getByRole('button', { name: 'Confirm' }).click();
});