Workout Management tests done

This commit is contained in:
AG
2025-12-09 18:11:55 +02:00
parent f32661d892
commit 2352ac04d6
14 changed files with 557 additions and 67 deletions

36
tests/test-2.spec.ts Normal file
View File

@@ -0,0 +1,36 @@
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();
});