ottensheim-boats #224

Merged
philipp merged 7 commits from ottensheim-boats into staging 2024-03-04 09:55:40 +01:00
Showing only changes of commit 971b98bf58 - Show all commits

View File

@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test'; import { test, expect } from '@playwright/test';
test('Cox can start and cancel trip', async ({ page }) => { test('Cox can start and cancel trip', async ({ page }, testInfo) => {
await page.goto('http://localhost:8000/auth'); await page.goto('http://localhost:8000/auth');
await page.getByPlaceholder('Name').click(); await page.getByPlaceholder('Name').click();
await page.getByPlaceholder('Name').fill('cox2'); await page.getByPlaceholder('Name').fill('cox2');
@ -10,7 +10,12 @@ test('Cox can start and cancel trip', async ({ page }) => {
await page.goto('http://localhost:8000/'); await page.goto('http://localhost:8000/');
await page.getByRole('link', { name: 'Ausfahrt eintragen' }).click(); await page.getByRole('link', { name: 'Ausfahrt eintragen' }).click();
if (testInfo.project.name.includes('Mobile')) { // No left boat selector on mobile views
await page.getByText('Kaputtes Boot :-( (7 x)').nth(1).click();
await page.getByRole('option', { name: 'Joe' }).click();
} else{
await page.getByText('Joe', { exact: true }).click(); await page.getByText('Joe', { exact: true }).click();
}
await page.getByPlaceholder('Ruderer auswählen').click(); await page.getByPlaceholder('Ruderer auswählen').click();
await page.getByRole('option', { name: 'rower2' }).click(); await page.getByRole('option', { name: 'rower2' }).click();
await page.getByRole('option', { name: 'cox2' }).click(); await page.getByRole('option', { name: 'cox2' }).click();
@ -23,13 +28,12 @@ test('Cox can start and cancel trip', async ({ page }) => {
await page.getByRole('link', { name: 'Joe' }).click(); await page.getByRole('link', { name: 'Joe' }).click();
page.once('dialog', dialog => { page.once('dialog', dialog => {
console.log(`Dialog message: ${dialog.message()}`);
dialog.accept().catch(() => {}); dialog.accept().catch(() => {});
}); });
await page.getByRole('link', { name: 'Löschen' }).click(); await page.getByRole('link', { name: 'Löschen' }).click();
}); });
test('Cox can start and finish trip', async ({ page }) => { test('Cox can start and finish trip', async ({ page }, testInfo) => {
await page.goto('http://localhost:8000/auth'); await page.goto('http://localhost:8000/auth');
await page.getByPlaceholder('Name').click(); await page.getByPlaceholder('Name').click();
await page.getByPlaceholder('Name').fill('cox2'); await page.getByPlaceholder('Name').fill('cox2');
@ -39,7 +43,12 @@ test('Cox can start and finish trip', async ({ page }) => {
await page.goto('http://localhost:8000/'); await page.goto('http://localhost:8000/');
await page.getByRole('link', { name: 'Ausfahrt eintragen' }).click(); await page.getByRole('link', { name: 'Ausfahrt eintragen' }).click();
if (testInfo.project.name.includes('Mobile')) { // No left boat selector on mobile views
await page.getByText('Kaputtes Boot :-( (7 x)').nth(1).click();
await page.getByRole('option', { name: 'Joe' }).click();
} else{
await page.getByText('Joe', { exact: true }).click(); await page.getByText('Joe', { exact: true }).click();
}
await page.getByPlaceholder('Ruderer auswählen').click(); await page.getByPlaceholder('Ruderer auswählen').click();
await page.getByRole('option', { name: 'rower2' }).click(); await page.getByRole('option', { name: 'rower2' }).click();
await page.getByRole('option', { name: 'cox2' }).click(); await page.getByRole('option', { name: 'cox2' }).click();