zero-rower-events #931
@ -121,18 +121,69 @@ test.describe("cox can edit trips", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("call off trip", async () => {
|
test("call off trip", async () => {
|
||||||
|
// Someone registers...
|
||||||
|
await sharedPage.goto("/auth/logout");
|
||||||
|
await sharedPage.goto("/auth");
|
||||||
|
await sharedPage.getByPlaceholder("Name").click();
|
||||||
|
await sharedPage.getByPlaceholder("Name").fill("rower");
|
||||||
|
await sharedPage.getByPlaceholder("Name").press("Tab");
|
||||||
|
await sharedPage.getByPlaceholder("Passwort").fill("rower");
|
||||||
|
await sharedPage.getByPlaceholder("Passwort").press("Enter");
|
||||||
|
|
||||||
await sharedPage.goto("/planned");
|
await sharedPage.goto("/planned");
|
||||||
|
await sharedPage.getByRole('link', { name: 'Mitrudern' }).nth(1).click();
|
||||||
|
|
||||||
|
|
||||||
|
// Login as cox again
|
||||||
|
await sharedPage.goto("/auth/logout");
|
||||||
|
await sharedPage.goto("/auth");
|
||||||
|
await sharedPage.getByPlaceholder("Name").click();
|
||||||
|
await sharedPage.getByPlaceholder("Name").fill("cox");
|
||||||
|
await sharedPage.getByPlaceholder("Name").press("Tab");
|
||||||
|
await sharedPage.getByPlaceholder("Passwort").fill("cox");
|
||||||
|
await sharedPage.getByPlaceholder("Passwort").press("Enter");
|
||||||
|
|
||||||
|
await sharedPage.goto("/planned");
|
||||||
|
|
||||||
|
|
||||||
|
// ... now I can cancel trip
|
||||||
await sharedPage.getByRole("link", { name: "Details" }).nth(1).click();
|
await sharedPage.getByRole("link", { name: "Details" }).nth(1).click();
|
||||||
await expect(sharedPage.locator("#sidebar")).toContainText(
|
await sharedPage.getByRole("button", { name: "Ausfahrt absagen" }).click();
|
||||||
"Freie Plätze: 3",
|
|
||||||
);
|
|
||||||
await sharedPage.getByRole("spinbutton").click();
|
|
||||||
await sharedPage.getByRole("spinbutton").fill("0");
|
|
||||||
await sharedPage.getByRole("button", { name: "Speichern" }).click();
|
|
||||||
await expect(sharedPage.locator("body")).toContainText(
|
await expect(sharedPage.locator("body")).toContainText(
|
||||||
"Ausfahrt erfolgreich aktualisiert.",
|
"Ausfahrt erfolgreich aktualisiert.",
|
||||||
);
|
);
|
||||||
await expect(sharedPage.locator("body")).toContainText("(Absage cox)");
|
await expect(sharedPage.locator("body")).toContainText("(Absage cox)");
|
||||||
|
|
||||||
|
|
||||||
|
// Done with the test -> cancel the cancellation of the trip, otherwise the afterAll function below fails
|
||||||
|
await sharedPage.getByRole("link", { name: "Details" }).nth(1).click();
|
||||||
|
await sharedPage.getByRole("spinbutton").click();
|
||||||
|
await sharedPage.getByRole("spinbutton").fill("3");
|
||||||
|
await sharedPage.getByRole("button", { name: "Speichern" }).click();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// deregistering
|
||||||
|
await sharedPage.goto("/auth/logout");
|
||||||
|
await sharedPage.goto("/auth");
|
||||||
|
await sharedPage.getByPlaceholder("Name").click();
|
||||||
|
await sharedPage.getByPlaceholder("Name").fill("rower");
|
||||||
|
await sharedPage.getByPlaceholder("Name").press("Tab");
|
||||||
|
await sharedPage.getByPlaceholder("Passwort").fill("rower");
|
||||||
|
await sharedPage.getByPlaceholder("Passwort").press("Enter");
|
||||||
|
|
||||||
|
await sharedPage.goto("/planned");
|
||||||
|
await sharedPage.getByRole('link', { name: 'Abmelden' }).click();
|
||||||
|
|
||||||
|
|
||||||
|
// now cox can delete trip again in afterAll
|
||||||
|
await sharedPage.goto("/auth/logout");
|
||||||
|
await sharedPage.goto("/auth");
|
||||||
|
await sharedPage.getByPlaceholder("Name").click();
|
||||||
|
await sharedPage.getByPlaceholder("Name").fill("cox");
|
||||||
|
await sharedPage.getByPlaceholder("Name").press("Tab");
|
||||||
|
await sharedPage.getByPlaceholder("Passwort").fill("cox");
|
||||||
|
await sharedPage.getByPlaceholder("Passwort").press("Enter");
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterAll(async () => {
|
test.afterAll(async () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user