wait for webserver to respond with 2xx, fix failing first (flaky) test
Some checks failed
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
CI/CD Pipeline / test (push) Has been cancelled

This commit is contained in:
2024-03-05 00:53:09 +01:00
parent 212ef5faa7
commit 737af80c39
3 changed files with 18 additions and 18 deletions

View File

@ -1,14 +1,14 @@
import { test, expect } from "@playwright/test";
test("Cox can start and cancel trip", async ({ page }, testInfo) => {
await page.goto("http://localhost:8000/auth");
await page.goto("/auth");
await page.getByPlaceholder("Name").click();
await page.getByPlaceholder("Name").fill("cox2");
await page.getByPlaceholder("Name").press("Tab");
await page.getByPlaceholder("Passwort").fill("cox");
await page.getByPlaceholder("Passwort").press("Enter");
await page.goto("http://localhost:8000/");
await page.goto("/");
await page.getByRole("link", { name: "Ausfahrt eintragen" }).click();
if (testInfo.project.name.includes("Mobile")) {
// No left boat selector on mobile views
@ -41,14 +41,14 @@ test("Cox can start and cancel trip", async ({ page }, testInfo) => {
});
test("Cox can start and finish trip", async ({ page }, testInfo) => {
await page.goto("http://localhost:8000/auth");
await page.goto("/auth");
await page.getByPlaceholder("Name").click();
await page.getByPlaceholder("Name").fill("cox2");
await page.getByPlaceholder("Name").press("Tab");
await page.getByPlaceholder("Passwort").fill("cox");
await page.getByPlaceholder("Passwort").press("Enter");
await page.goto("http://localhost:8000/");
await page.goto("/");
await page.getByRole("link", { name: "Ausfahrt eintragen" }).click();
if (testInfo.project.name.includes("Mobile")) {
// No left boat selector on mobile views
@ -73,7 +73,7 @@ test("Cox can start and finish trip", async ({ page }, testInfo) => {
);
await expect(page.locator("body")).toContainText("Joe");
await page.goto("http://localhost:8000/log");
await page.goto("/log");
await page.locator("div:nth-child(2) > .border-0").click();
// Add a minute
await page.locator('#arrivaljs').click();
@ -91,7 +91,7 @@ test("Cox can start and finish trip", async ({ page }, testInfo) => {
"Ausfahrt korrekt eingetragen",
);
await page.goto('http://localhost:8000/log/show');
await page.goto('/log/show');
await expect(page.locator('body')).toContainText('Joe');
await expect(page.locator('body')).toContainText('(cox2)');
await expect(page.locator('body')).toContainText('Ottensheim (25 km)');
@ -99,7 +99,7 @@ test("Cox can start and finish trip", async ({ page }, testInfo) => {
});
test("Kiosk can start and cancel trip", async ({ page }, testInfo) => {
await page.goto("http://localhost:8000/log/kiosk/ekrv2019/Linz");
await page.goto("/log/kiosk/ekrv2019/Linz");
if (testInfo.project.name.includes("Mobile")) {
// No left boat selector on mobile views
await page.getByText("Kaputtes Boot :-( (7 x)").nth(1).click();
@ -131,7 +131,7 @@ test("Kiosk can start and cancel trip", async ({ page }, testInfo) => {
});
test("Kiosk can start and finish trip", async ({ page }, testInfo) => {
await page.goto("http://localhost:8000/log/kiosk/ekrv2019/Linz");
await page.goto("/log/kiosk/ekrv2019/Linz");
if (testInfo.project.name.includes("Mobile")) {
// No left boat selector on mobile views
@ -156,7 +156,7 @@ test("Kiosk can start and finish trip", async ({ page }, testInfo) => {
);
await expect(page.locator("body")).toContainText("Joe");
await page.goto("http://localhost:8000/log");
await page.goto("/log");
await page.locator('div:nth-child(2) > .pt-2 > div > div > div:nth-child(2) > .border-0').click(); // 2 trips currently running, try to close second one
// Add a minute