2024-03-04 13:28:42 +01:00
|
|
|
import { test, expect } from "@playwright/test";
|
2024-03-04 09:55:39 +01:00
|
|
|
|
2024-03-04 13:28:42 +01:00
|
|
|
test("Cox can start and cancel trip", async ({ page }, testInfo) => {
|
2024-03-05 00:53:09 +01:00
|
|
|
await page.goto("/auth");
|
2024-03-04 13:28:42 +01:00
|
|
|
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");
|
2024-03-04 09:55:39 +01:00
|
|
|
|
2024-03-05 00:53:09 +01:00
|
|
|
await page.goto("/");
|
2024-03-04 13:28:42 +01:00
|
|
|
await page.getByRole("link", { name: "Ausfahrt eintragen" }).click();
|
|
|
|
if (testInfo.project.name.includes("Mobile")) {
|
|
|
|
// No left boat selector on mobile views
|
2024-04-29 22:17:40 +02:00
|
|
|
await page.getByText('-- Wähle ein Boot aus ---').nth(1).click();
|
2024-03-04 13:28:42 +01:00
|
|
|
await page.getByRole("option", { name: "Joe" }).click();
|
|
|
|
} else {
|
2024-04-24 15:39:13 +02:00
|
|
|
await page.getByText('2x', { exact: true }).click();
|
2024-03-04 13:28:42 +01:00
|
|
|
await page.getByText("Joe", { exact: true }).click();
|
2024-03-04 09:55:39 +01:00
|
|
|
}
|
2024-04-26 09:50:01 +02:00
|
|
|
await page.getByLabel('Remove item: \'6\'').click(); // remove pre-filled cox2
|
2024-03-04 13:28:42 +01:00
|
|
|
await page.getByPlaceholder("Ruderer auswählen").click();
|
|
|
|
await page.getByRole("option", { name: "rower2" }).click();
|
|
|
|
await page.getByRole("option", { name: "cox2" }).click();
|
|
|
|
await expect(page.getByRole("listbox")).toContainText(
|
|
|
|
"Nur 2 Ruderer können hinzugefügt werden",
|
|
|
|
);
|
|
|
|
await expect(page.locator("#shipmaster-newrowerjs")).toContainText("cox");
|
|
|
|
await expect(page.locator("#steering_person-newrowerjs")).toContainText(
|
|
|
|
"rower2 cox",
|
|
|
|
);
|
|
|
|
await page.getByRole("button", { name: "Ausfahrt eintragen" }).click();
|
|
|
|
await expect(page.locator("body")).toContainText(
|
|
|
|
"Ausfahrt erfolgreich hinzugefügt",
|
|
|
|
);
|
|
|
|
await expect(page.locator("body")).toContainText("Joe");
|
2024-03-04 09:55:39 +01:00
|
|
|
|
2024-03-04 13:28:42 +01:00
|
|
|
await page.getByRole("link", { name: "Joe" }).click();
|
|
|
|
page.once("dialog", (dialog) => {
|
2024-03-04 09:55:39 +01:00
|
|
|
dialog.accept().catch(() => {});
|
|
|
|
});
|
2024-03-04 13:28:42 +01:00
|
|
|
await page.getByRole("link", { name: "Löschen" }).click();
|
2024-03-04 09:55:39 +01:00
|
|
|
});
|
|
|
|
|
2024-03-04 13:28:42 +01:00
|
|
|
test("Cox can start and finish trip", async ({ page }, testInfo) => {
|
2024-03-05 00:53:09 +01:00
|
|
|
await page.goto("/auth");
|
2024-03-04 13:28:42 +01:00
|
|
|
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");
|
2024-03-04 09:55:39 +01:00
|
|
|
|
2024-03-05 00:53:09 +01:00
|
|
|
await page.goto("/");
|
2024-03-04 13:28:42 +01:00
|
|
|
await page.getByRole("link", { name: "Ausfahrt eintragen" }).click();
|
|
|
|
if (testInfo.project.name.includes("Mobile")) {
|
|
|
|
// No left boat selector on mobile views
|
2024-04-29 22:17:40 +02:00
|
|
|
await page.getByText('-- Wähle ein Boot aus ---').nth(1).click();
|
2024-03-04 13:28:42 +01:00
|
|
|
await page.getByRole("option", { name: "Joe" }).click();
|
|
|
|
} else {
|
2024-04-24 15:39:13 +02:00
|
|
|
await page.getByText('2x', { exact: true }).click();
|
2024-03-04 13:28:42 +01:00
|
|
|
await page.getByText("Joe", { exact: true }).click();
|
2024-03-04 09:55:39 +01:00
|
|
|
}
|
2024-04-26 09:50:01 +02:00
|
|
|
await page.getByLabel('Remove item: \'6\'').click(); // remove pre-filled cox2
|
2024-03-04 13:28:42 +01:00
|
|
|
await page.getByPlaceholder("Ruderer auswählen").click();
|
|
|
|
await page.getByRole("option", { name: "rower2" }).click();
|
|
|
|
await page.getByRole("option", { name: "cox2" }).click();
|
|
|
|
await expect(page.getByRole("listbox")).toContainText(
|
|
|
|
"Nur 2 Ruderer können hinzugefügt werden",
|
|
|
|
);
|
2024-05-22 22:28:33 +02:00
|
|
|
|
|
|
|
// Trip starts 2 hours ago
|
|
|
|
const datetimeSelector = '#departure';
|
|
|
|
const currentValue = await page.$eval(datetimeSelector, el => el.value);
|
|
|
|
const currentDate = new Date(currentValue);
|
|
|
|
currentDate.setMinutes(currentDate.getMinutes());
|
|
|
|
currentDate.setHours(currentDate.getHours() - new Date().getTimezoneOffset()/60 - 2);
|
|
|
|
const newDatetime = currentDate.toISOString().slice(0, 16);
|
|
|
|
await page.$eval(datetimeSelector, (el, value) => el.value = value, newDatetime);
|
|
|
|
|
2024-03-04 13:28:42 +01:00
|
|
|
await expect(page.locator("#shipmaster-newrowerjs")).toContainText("cox");
|
|
|
|
await expect(page.locator("#steering_person-newrowerjs")).toContainText(
|
|
|
|
"rower2 cox",
|
|
|
|
);
|
|
|
|
await page.getByRole("button", { name: "Ausfahrt eintragen" }).click();
|
|
|
|
await expect(page.locator("body")).toContainText(
|
|
|
|
"Ausfahrt erfolgreich hinzugefügt",
|
|
|
|
);
|
|
|
|
await expect(page.locator("body")).toContainText("Joe");
|
2024-03-04 09:55:39 +01:00
|
|
|
|
2024-03-05 00:53:09 +01:00
|
|
|
await page.goto("/log");
|
2024-03-04 13:28:42 +01:00
|
|
|
await page.locator("div:nth-child(2) > .border-0").click();
|
2024-03-05 14:29:27 +01:00
|
|
|
|
2024-03-04 13:28:42 +01:00
|
|
|
await page.getByRole("combobox", { name: "Destination" }).click();
|
|
|
|
await page.getByRole("combobox", { name: "Destination" }).fill("Ottensheim");
|
|
|
|
await page.getByRole("button", { name: "Ausfahrt beenden" }).click();
|
|
|
|
await expect(page.locator("body")).toContainText(
|
|
|
|
"Ausfahrt korrekt eingetragen",
|
|
|
|
);
|
2024-03-04 14:04:13 +01:00
|
|
|
|
2024-03-05 00:53:09 +01:00
|
|
|
await page.goto('/log/show');
|
2024-03-04 14:04:13 +01:00
|
|
|
await expect(page.locator('body')).toContainText('Joe');
|
2024-03-04 14:28:19 +01:00
|
|
|
await expect(page.locator('body')).toContainText('(cox2)');
|
2024-03-04 14:04:13 +01:00
|
|
|
await expect(page.locator('body')).toContainText('Ottensheim (25 km)');
|
2024-03-04 14:25:14 +01:00
|
|
|
await expect(page.locator('body')).toContainText('Ruderer: cox2, rower2');
|
2024-08-21 17:05:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
//Ausloggen...
|
|
|
|
await page.getByRole('banner').getByRole('link', { name: 'Logbuch' }).click();
|
|
|
|
await page.getByRole('link', { name: 'Ausloggen' }).click();
|
|
|
|
// Login as admin
|
|
|
|
await page.getByPlaceholder("Name").click();
|
|
|
|
await page.getByPlaceholder("Name").fill("main");
|
|
|
|
await page.getByPlaceholder("Name").press("Tab");
|
|
|
|
await page.getByPlaceholder("Passwort").fill("admin");
|
|
|
|
await page.getByPlaceholder("Passwort").press("Enter");
|
|
|
|
|
|
|
|
await page.goto("/log/show");
|
|
|
|
await page.getByText('(cox2)').click();
|
|
|
|
page.once("dialog", (dialog) => {
|
|
|
|
dialog.accept().catch(() => {});
|
|
|
|
});
|
|
|
|
await page.getByRole('link', { name: 'Löschen' }).click();
|
|
|
|
|
|
|
|
//Ausloggen...
|
|
|
|
await page.getByRole('banner').getByRole('link', { name: 'Logbuch' }).click();
|
|
|
|
await page.getByRole('link', { name: 'Ausloggen' }).click();
|
2024-03-04 14:04:13 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
test("Kiosk can start and cancel trip", async ({ page }, testInfo) => {
|
2024-03-05 00:53:09 +01:00
|
|
|
await page.goto("/log/kiosk/ekrv2019/Linz");
|
2024-03-04 14:04:13 +01:00
|
|
|
if (testInfo.project.name.includes("Mobile")) {
|
|
|
|
// No left boat selector on mobile views
|
2024-04-29 22:17:40 +02:00
|
|
|
await page.getByText('-- Wähle ein Boot aus ---').nth(1).click();
|
2024-03-04 14:04:13 +01:00
|
|
|
await page.getByRole("option", { name: "Joe" }).click();
|
|
|
|
} else {
|
2024-04-24 15:39:13 +02:00
|
|
|
await page.getByText('2x', { exact: true }).click();
|
2024-03-04 14:04:13 +01:00
|
|
|
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();
|
|
|
|
await expect(page.getByRole("listbox")).toContainText(
|
|
|
|
"Nur 2 Ruderer können hinzugefügt werden",
|
|
|
|
);
|
|
|
|
await expect(page.locator("#shipmaster-newrowerjs")).toContainText("cox");
|
|
|
|
await expect(page.locator("#steering_person-newrowerjs")).toContainText(
|
|
|
|
"rower2 cox",
|
|
|
|
);
|
|
|
|
await page.getByRole("button", { name: "Ausfahrt eintragen" }).click();
|
|
|
|
await expect(page.locator("body")).toContainText(
|
|
|
|
"Ausfahrt erfolgreich hinzugefügt",
|
|
|
|
);
|
|
|
|
await expect(page.locator("body")).toContainText("Joe");
|
|
|
|
|
|
|
|
await page.getByRole("link", { name: "Joe" }).click();
|
|
|
|
page.once("dialog", (dialog) => {
|
|
|
|
dialog.accept().catch(() => {});
|
|
|
|
});
|
|
|
|
await page.getByRole("link", { name: "Löschen" }).click();
|
|
|
|
});
|
|
|
|
|
|
|
|
test("Kiosk can start and finish trip", async ({ page }, testInfo) => {
|
2024-03-05 00:53:09 +01:00
|
|
|
await page.goto("/log/kiosk/ekrv2019/Linz");
|
2024-03-04 14:04:13 +01:00
|
|
|
|
|
|
|
if (testInfo.project.name.includes("Mobile")) {
|
|
|
|
// No left boat selector on mobile views
|
2024-04-29 22:17:40 +02:00
|
|
|
await page.getByText('-- Wähle ein Boot aus ---').nth(1).click();
|
2024-03-04 14:04:13 +01:00
|
|
|
await page.getByRole("option", { name: "Joe" }).click();
|
|
|
|
} else {
|
2024-04-24 15:39:13 +02:00
|
|
|
await page.getByText('2x', { exact: true }).click();
|
2024-03-04 14:04:13 +01:00
|
|
|
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();
|
|
|
|
await expect(page.getByRole("listbox")).toContainText(
|
|
|
|
"Nur 2 Ruderer können hinzugefügt werden",
|
|
|
|
);
|
2024-05-22 22:28:33 +02:00
|
|
|
|
|
|
|
// Trip starts 2 hours ago
|
|
|
|
const datetimeSelector = '#departure';
|
|
|
|
const currentValue = await page.$eval(datetimeSelector, el => el.value);
|
|
|
|
const currentDate = new Date(currentValue);
|
|
|
|
currentDate.setMinutes(currentDate.getMinutes());
|
|
|
|
currentDate.setHours(currentDate.getHours() - new Date().getTimezoneOffset()/60 - 2);
|
|
|
|
const newDatetime = currentDate.toISOString().slice(0, 16);
|
|
|
|
await page.$eval(datetimeSelector, (el, value) => el.value = value, newDatetime);
|
|
|
|
|
2024-03-04 14:04:13 +01:00
|
|
|
await expect(page.locator("#shipmaster-newrowerjs")).toContainText("cox");
|
|
|
|
await expect(page.locator("#steering_person-newrowerjs")).toContainText(
|
|
|
|
"rower2 cox",
|
|
|
|
);
|
|
|
|
await page.getByRole("button", { name: "Ausfahrt eintragen" }).click();
|
|
|
|
await expect(page.locator("body")).toContainText(
|
|
|
|
"Ausfahrt erfolgreich hinzugefügt",
|
|
|
|
);
|
|
|
|
await expect(page.locator("body")).toContainText("Joe");
|
|
|
|
|
2024-03-05 00:53:09 +01:00
|
|
|
await page.goto("/log");
|
2024-03-04 14:55:11 +01:00
|
|
|
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
|
2024-03-05 00:17:02 +01:00
|
|
|
|
2024-03-04 14:04:13 +01:00
|
|
|
await page.getByRole("combobox", { name: "Destination" }).click();
|
|
|
|
await page.getByRole("combobox", { name: "Destination" }).fill("Ottensheim");
|
|
|
|
await page.getByRole("button", { name: "Ausfahrt beenden" }).click();
|
|
|
|
await expect(page.locator("body")).toContainText(
|
|
|
|
"Ausfahrt korrekt eingetragen",
|
|
|
|
);
|
|
|
|
|
|
|
|
await page.getByRole('link', { name: 'Logbuch' }).click();
|
|
|
|
await expect(page.locator('body')).toContainText('Joe');
|
2024-03-04 14:28:19 +01:00
|
|
|
await expect(page.locator('body')).toContainText('(cox2)');
|
2024-03-04 14:04:13 +01:00
|
|
|
await expect(page.locator('body')).toContainText('Ottensheim (25 km)');
|
2024-03-04 14:25:14 +01:00
|
|
|
await expect(page.locator('body')).toContainText('Ruderer: cox2, rower2');
|
2024-08-21 17:05:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Ausloggen...
|
|
|
|
await page.context().clearCookies();
|
|
|
|
await page.goto("/auth");
|
|
|
|
// Login as admin
|
|
|
|
await page.getByPlaceholder("Name").click();
|
|
|
|
await page.getByPlaceholder("Name").fill("main");
|
|
|
|
await page.getByPlaceholder("Name").press("Tab");
|
|
|
|
await page.getByPlaceholder("Passwort").fill("admin");
|
|
|
|
await page.getByPlaceholder("Passwort").press("Enter");
|
|
|
|
|
|
|
|
await page.goto("/log/show");
|
|
|
|
await page.getByText('(cox2)').click();
|
|
|
|
page.once("dialog", (dialog) => {
|
|
|
|
dialog.accept().catch(() => {});
|
|
|
|
});
|
|
|
|
await page.getByRole('link', { name: 'Löschen' }).click();
|
|
|
|
|
|
|
|
//Ausloggen...
|
|
|
|
await page.getByRole('banner').getByRole('link', { name: 'Logbuch' }).click();
|
|
|
|
await page.getByRole('link', { name: 'Ausloggen' }).click();
|
2024-03-04 09:55:39 +01:00
|
|
|
});
|
2024-07-13 20:58:13 +02:00
|
|
|
|
|
|
|
test("Cox can start and finish trip with cox steering only", async ({ page }, testInfo) => {
|
|
|
|
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("/");
|
|
|
|
await page.getByRole("link", { name: "Ausfahrt eintragen" }).click();
|
|
|
|
if (testInfo.project.name.includes("Mobile")) {
|
|
|
|
// No left boat selector on mobile views
|
|
|
|
await page.getByText('-- Wähle ein Boot aus ---').nth(1).click();
|
|
|
|
await page.getByRole("option", { name: "cox_only_steering_boat" }).click();
|
|
|
|
} else {
|
|
|
|
await page.getByText('2+', { exact: true }).click();
|
|
|
|
await page.getByText("cox_only_steering_boat", { exact: true }).click();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Trip starts 2 hours ago
|
|
|
|
const datetimeSelector = '#departure';
|
|
|
|
const currentValue = await page.$eval(datetimeSelector, el => el.value);
|
|
|
|
const currentDate = new Date(currentValue);
|
|
|
|
currentDate.setMinutes(currentDate.getMinutes());
|
|
|
|
currentDate.setHours(currentDate.getHours() - new Date().getTimezoneOffset()/60 - 2);
|
|
|
|
const newDatetime = currentDate.toISOString().slice(0, 16);
|
|
|
|
await page.$eval(datetimeSelector, (el, value) => el.value = value, newDatetime);
|
|
|
|
|
|
|
|
await expect(page.locator("#shipmaster-newrowerjs")).toContainText("cox");
|
|
|
|
await expect(page.locator("#steering_person-newrowerjs")).toContainText(
|
2024-07-13 21:03:10 +02:00
|
|
|
"cox",
|
2024-07-13 20:58:13 +02:00
|
|
|
);
|
|
|
|
await page.getByRole("button", { name: "Ausfahrt eintragen" }).click();
|
|
|
|
await expect(page.locator("body")).toContainText(
|
|
|
|
"Ausfahrt erfolgreich hinzugefügt",
|
|
|
|
);
|
|
|
|
await expect(page.locator("body")).toContainText("cox_only_steering_boat");
|
|
|
|
|
|
|
|
await page.goto("/log");
|
|
|
|
await page.locator("div:nth-child(2) > .border-0").click();
|
|
|
|
|
|
|
|
await page.getByRole("combobox", { name: "Destination" }).click();
|
|
|
|
await page.getByRole("combobox", { name: "Destination" }).fill("Ottensheim");
|
|
|
|
await page.getByRole("button", { name: "Ausfahrt beenden" }).click();
|
|
|
|
await expect(page.locator("body")).toContainText(
|
|
|
|
"Ausfahrt korrekt eingetragen",
|
|
|
|
);
|
|
|
|
|
|
|
|
await page.goto('/log/show');
|
|
|
|
await expect(page.locator('body')).toContainText('cox_only_steering_boat');
|
2024-08-21 17:05:41 +02:00
|
|
|
await expect(page.locator('body')).toContainText('(cox2 - handgesteuert)');
|
2024-07-13 20:58:13 +02:00
|
|
|
await expect(page.locator('body')).toContainText('Ottensheim (25 km)');
|
2024-08-21 17:05:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Ausloggen...
|
|
|
|
await page.getByRole('banner').getByRole('link', { name: 'Logbuch' }).click();
|
|
|
|
await page.getByRole('link', { name: 'Ausloggen' }).click();
|
|
|
|
// Login as admin
|
|
|
|
await page.getByPlaceholder("Name").click();
|
|
|
|
await page.getByPlaceholder("Name").fill("main");
|
|
|
|
await page.getByPlaceholder("Name").press("Tab");
|
|
|
|
await page.getByPlaceholder("Passwort").fill("admin");
|
|
|
|
await page.getByPlaceholder("Passwort").press("Enter");
|
|
|
|
|
|
|
|
await page.goto("/log/show");
|
|
|
|
await page.getByText('(cox2 - handgesteuert)').click();
|
|
|
|
page.once("dialog", (dialog) => {
|
|
|
|
dialog.accept().catch(() => {});
|
|
|
|
});
|
|
|
|
await page.getByRole('link', { name: 'Löschen' }).click();
|
|
|
|
|
|
|
|
//Ausloggen...
|
|
|
|
await page.getByRole('banner').getByRole('link', { name: 'Logbuch' }).click();
|
|
|
|
await page.getByRole('link', { name: 'Ausloggen' }).click();
|
2024-07-13 20:58:13 +02:00
|
|
|
});
|
2024-07-27 20:48:32 +02:00
|
|
|
|
|
|
|
test("Kiosk can start and finish trip in one stop", async ({ page }, testInfo) => {
|
|
|
|
await page.goto("/log/kiosk/ekrv2019/Linz");
|
|
|
|
|
|
|
|
if (testInfo.project.name.includes("Mobile")) {
|
|
|
|
// No left boat selector on mobile views
|
|
|
|
await page.getByText('-- Wähle ein Boot aus ---').nth(1).click();
|
|
|
|
await page.getByRole("option", { name: "Joe" }).click();
|
|
|
|
} else {
|
|
|
|
await page.getByText('2x', { exact: true }).click();
|
|
|
|
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();
|
|
|
|
await expect(page.getByRole("listbox")).toContainText(
|
|
|
|
"Nur 2 Ruderer können hinzugefügt werden",
|
|
|
|
);
|
|
|
|
|
|
|
|
// Trip starts 2 hours ago
|
|
|
|
const datetimeSelector = '#departure';
|
|
|
|
const currentValue = await page.$eval(datetimeSelector, el => el.value);
|
|
|
|
const currentDate = new Date(currentValue);
|
|
|
|
currentDate.setMinutes(currentDate.getMinutes());
|
|
|
|
currentDate.setHours(currentDate.getHours() - new Date().getTimezoneOffset()/60 - 2);
|
|
|
|
const newDatetime = currentDate.toISOString().slice(0, 16);
|
|
|
|
await page.$eval(datetimeSelector, (el, value) => el.value = value, newDatetime);
|
|
|
|
|
|
|
|
await page.getByLabel('Ankunftszeit').click();
|
|
|
|
await page.locator('#destination').fill('a');
|
|
|
|
await page.getByLabel('Distanz').fill('1');
|
|
|
|
|
|
|
|
await expect(page.locator("#shipmaster-newrowerjs")).toContainText("cox");
|
|
|
|
await expect(page.locator("#steering_person-newrowerjs")).toContainText(
|
|
|
|
"rower2 cox",
|
|
|
|
);
|
|
|
|
await page.getByRole("button", { name: "Ausfahrt eintragen" }).click();
|
|
|
|
await expect(page.locator("body")).toContainText(
|
|
|
|
"Ausfahrt erfolgreich hinzugefügt",
|
|
|
|
);
|
|
|
|
await page.getByRole('link', { name: 'Logbuch' }).click();
|
|
|
|
await expect(page.locator('body')).toContainText('Joe');
|
|
|
|
await expect(page.locator('body')).toContainText('(cox2)');
|
|
|
|
await expect(page.locator('body')).toContainText('a (1 km)');
|
|
|
|
await expect(page.locator('body')).toContainText('Ruderer: cox2, rower2');
|
2024-08-21 17:05:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Ausloggen...
|
|
|
|
await page.context().clearCookies();
|
|
|
|
await page.goto("/auth");
|
|
|
|
// Login as admin
|
|
|
|
await page.getByPlaceholder("Name").click();
|
|
|
|
await page.getByPlaceholder("Name").fill("main");
|
|
|
|
await page.getByPlaceholder("Name").press("Tab");
|
|
|
|
await page.getByPlaceholder("Passwort").fill("admin");
|
|
|
|
await page.getByPlaceholder("Passwort").press("Enter");
|
|
|
|
|
|
|
|
await page.goto("/log/show");
|
|
|
|
await page.getByText('(cox2)').click();
|
|
|
|
page.once("dialog", (dialog) => {
|
|
|
|
dialog.accept().catch(() => {});
|
|
|
|
});
|
|
|
|
await page.getByRole('link', { name: 'Löschen' }).click();
|
|
|
|
|
|
|
|
//Ausloggen...
|
|
|
|
await page.getByRole('banner').getByRole('link', { name: 'Logbuch' }).click();
|
|
|
|
await page.getByRole('link', { name: 'Ausloggen' }).click();
|
2024-07-27 20:48:32 +02:00
|
|
|
});
|