rowt/frontend/tests/example.spec.ts
philipp ce3562f079
Some checks failed
CI/CD Pipeline / test-frontend (push) Failing after 4s
CI/CD Pipeline / test-backend (push) Has been cancelled
CI/CD Pipeline / deploy-staging (push) Has been cancelled
CI/CD Pipeline / deploy-main (push) Has been cancelled
add playwright tests
2024-01-16 16:00:02 +01:00

23 lines
1.2 KiB
TypeScript

import { test, expect } from '@playwright/test';
test('cox can create trip', async ({ page }) => {
await page.goto('http://localhost:8000/auth');
await page.getByPlaceholder('Name').click();
await page.getByPlaceholder('Name').fill('cox');
await page.getByPlaceholder('Name').press('Tab');
await page.getByPlaceholder('Passwort').fill('cox');
await page.getByRole('button', { name: 'Einloggen' }).click();
await expect(page.locator('body')).toContainText('Login erfolgreich');
await page.locator('li').filter({ hasText: 'Geplante Ausfahrten' }).click();
await page.getByRole('link', { name: 'Geplante Ausfahrten' }).click();
await page.locator('.relative').first().click();
await page.locator('#sidebar #planned_starting_time').click();
await page.locator('#sidebar #planned_starting_time').press('ArrowLeft');
await page.locator('#sidebar #planned_starting_time').press('Tab');
await page.locator('#sidebar #planned_starting_time').fill('14:00');
await page.locator('#sidebar #planned_starting_time').press('Tab');
await page.getByRole('spinbutton').fill('4');
await page.getByRole('button', { name: 'Erstellen', exact: true }).click();
await expect(page.locator('body')).toContainText('Ausfahrt erfolgreich erstellt.');
});