23 lines
1.2 KiB
TypeScript
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.');
|
||
|
});
|