add playwright tests
This commit is contained in:
22
frontend/tests/example.spec.ts
Normal file
22
frontend/tests/example.spec.ts
Normal file
@ -0,0 +1,22 @@
|
||||
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.');
|
||||
});
|
Reference in New Issue
Block a user