make frontend tests work @ mobile view
All checks were successful
CI/CD Pipeline / test (push) Successful in 15m36s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped

This commit is contained in:
philipp 2024-03-04 09:49:04 +01:00
parent 92518642d4
commit 971b98bf58

View File

@ -1,6 +1,6 @@
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.getByPlaceholder('Name').click();
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.getByRole('link', { name: 'Ausfahrt eintragen' }).click();
await page.getByText('Joe', { exact: true }).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.getByPlaceholder('Ruderer auswählen').click();
await page.getByRole('option', { name: 'rower2' }).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();
page.once('dialog', dialog => {
console.log(`Dialog message: ${dialog.message()}`);
dialog.accept().catch(() => {});
});
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.getByPlaceholder('Name').click();
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.getByRole('link', { name: 'Ausfahrt eintragen' }).click();
await page.getByText('Joe', { exact: true }).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.getByPlaceholder('Ruderer auswählen').click();
await page.getByRole('option', { name: 'rower2' }).click();
await page.getByRole('option', { name: 'cox2' }).click();