fix tests, they used to rely on boat travelling multiple times at the same time...
This commit is contained in:
		| @@ -102,6 +102,28 @@ test("Cox can start and finish trip", async ({ page }, testInfo) => { | |||||||
|   await expect(page.locator('body')).toContainText('(cox2)'); |   await expect(page.locator('body')).toContainText('(cox2)'); | ||||||
|   await expect(page.locator('body')).toContainText('Ottensheim (25 km)'); |   await expect(page.locator('body')).toContainText('Ottensheim (25 km)'); | ||||||
|   await expect(page.locator('body')).toContainText('Ruderer: cox2, rower2'); |   await expect(page.locator('body')).toContainText('Ruderer: cox2, rower2'); | ||||||
|  |  | ||||||
|  |  | ||||||
|  |   //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("admin"); | ||||||
|  |   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(); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| test("Kiosk can start and cancel trip", async ({ page }, testInfo) => { | test("Kiosk can start and cancel trip", async ({ page }, testInfo) => { | ||||||
| @@ -189,6 +211,29 @@ test("Kiosk can start and finish trip", async ({ page }, testInfo) => { | |||||||
|   await expect(page.locator('body')).toContainText('(cox2)'); |   await expect(page.locator('body')).toContainText('(cox2)'); | ||||||
|   await expect(page.locator('body')).toContainText('Ottensheim (25 km)'); |   await expect(page.locator('body')).toContainText('Ottensheim (25 km)'); | ||||||
|   await expect(page.locator('body')).toContainText('Ruderer: cox2, rower2'); |   await expect(page.locator('body')).toContainText('Ruderer: cox2, rower2'); | ||||||
|  |    | ||||||
|  |  | ||||||
|  |  | ||||||
|  |   //Ausloggen... | ||||||
|  |   await page.context().clearCookies(); | ||||||
|  |   await page.goto("/auth"); | ||||||
|  |   // Login as admin | ||||||
|  |   await page.getByPlaceholder("Name").click(); | ||||||
|  |   await page.getByPlaceholder("Name").fill("admin"); | ||||||
|  |   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(); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| test("Cox can start and finish trip with cox steering only", async ({ page }, testInfo) => { | test("Cox can start and finish trip with cox steering only", async ({ page }, testInfo) => { | ||||||
| @@ -241,8 +286,31 @@ test("Cox can start and finish trip with cox steering only", async ({ page }, te | |||||||
|  |  | ||||||
|   await page.goto('/log/show'); |   await page.goto('/log/show'); | ||||||
|   await expect(page.locator('body')).toContainText('cox_only_steering_boat'); |   await expect(page.locator('body')).toContainText('cox_only_steering_boat'); | ||||||
|   await expect(page.locator('body')).toContainText('(cox2)'); |   await expect(page.locator('body')).toContainText('(cox2 - handgesteuert)'); | ||||||
|   await expect(page.locator('body')).toContainText('Ottensheim (25 km)'); |   await expect(page.locator('body')).toContainText('Ottensheim (25 km)'); | ||||||
|  |    | ||||||
|  |  | ||||||
|  |  | ||||||
|  |   //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("admin"); | ||||||
|  |   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(); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| test("Kiosk can start and finish trip in one stop", async ({ page }, testInfo) => { | test("Kiosk can start and finish trip in one stop", async ({ page }, testInfo) => { | ||||||
| @@ -289,4 +357,27 @@ test("Kiosk can start and finish trip in one stop", async ({ page }, testInfo) = | |||||||
|   await expect(page.locator('body')).toContainText('(cox2)'); |   await expect(page.locator('body')).toContainText('(cox2)'); | ||||||
|   await expect(page.locator('body')).toContainText('a (1 km)'); |   await expect(page.locator('body')).toContainText('a (1 km)'); | ||||||
|   await expect(page.locator('body')).toContainText('Ruderer: cox2, rower2'); |   await expect(page.locator('body')).toContainText('Ruderer: cox2, rower2'); | ||||||
|  |    | ||||||
|  |  | ||||||
|  |  | ||||||
|  |   //Ausloggen... | ||||||
|  |   await page.context().clearCookies(); | ||||||
|  |   await page.goto("/auth"); | ||||||
|  |   // Login as admin | ||||||
|  |   await page.getByPlaceholder("Name").click(); | ||||||
|  |   await page.getByPlaceholder("Name").fill("admin"); | ||||||
|  |   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(); | ||||||
| }); | }); | ||||||
|   | |||||||
| @@ -10,11 +10,13 @@ INSERT INTO "role" (name) VALUES ('Vorstand'); | |||||||
| INSERT INTO "role" (name) VALUES ('Bootsführer'); | INSERT INTO "role" (name) VALUES ('Bootsführer'); | ||||||
| INSERT INTO "role" (name) VALUES ('schnupperant'); | INSERT INTO "role" (name) VALUES ('schnupperant'); | ||||||
| INSERT INTO "role" (name) VALUES ('kassier'); | INSERT INTO "role" (name) VALUES ('kassier'); | ||||||
|  | INSERT INTO "role" (name) VALUES ('schriftfuehrer'); | ||||||
| INSERT INTO "user" (name, pw) VALUES('admin', '$argon2id$v=19$m=19456,t=2,p=1$dS/X5/sPEKTj4Rzs/CuvzQ$4P4NCw4Ukhv80/eQYTsarHhnw61JuL1KMx/L9dm82YM'); | INSERT INTO "user" (name, pw) VALUES('admin', '$argon2id$v=19$m=19456,t=2,p=1$dS/X5/sPEKTj4Rzs/CuvzQ$4P4NCw4Ukhv80/eQYTsarHhnw61JuL1KMx/L9dm82YM'); | ||||||
| INSERT INTO "user_role" (user_id, role_id) VALUES(1,1); | INSERT INTO "user_role" (user_id, role_id) VALUES(1,1); | ||||||
| INSERT INTO "user_role" (user_id, role_id) VALUES(1,2); | INSERT INTO "user_role" (user_id, role_id) VALUES(1,2); | ||||||
| INSERT INTO "user_role" (user_id, role_id) VALUES(1,5); | INSERT INTO "user_role" (user_id, role_id) VALUES(1,5); | ||||||
| INSERT INTO "user_role" (user_id, role_id) VALUES(1,6); | INSERT INTO "user_role" (user_id, role_id) VALUES(1,6); | ||||||
|  | INSERT INTO "user_role" (user_id, role_id) VALUES(1,9); | ||||||
| INSERT INTO "user" (name, pw) VALUES('rower', '$argon2id$v=19$m=19456,t=2,p=1$dS/X5/sPEKTj4Rzs/CuvzQ$jWKzDmI0jqT2dqINFt6/1NjVF4Dx15n07PL1ZMBmFsY'); | INSERT INTO "user" (name, pw) VALUES('rower', '$argon2id$v=19$m=19456,t=2,p=1$dS/X5/sPEKTj4Rzs/CuvzQ$jWKzDmI0jqT2dqINFt6/1NjVF4Dx15n07PL1ZMBmFsY'); | ||||||
| INSERT INTO "user_role" (user_id, role_id) VALUES(2,5); | INSERT INTO "user_role" (user_id, role_id) VALUES(2,5); | ||||||
| INSERT INTO "user" (name, pw) VALUES('guest', '$argon2id$v=19$m=19456,t=2,p=1$dS/X5/sPEKTj4Rzs/CuvzQ$GF6gizbI79Bh0zA9its8S0gram956v+YIV8w8VpwJnQ'); | INSERT INTO "user" (name, pw) VALUES('guest', '$argon2id$v=19$m=19456,t=2,p=1$dS/X5/sPEKTj4Rzs/CuvzQ$GF6gizbI79Bh0zA9its8S0gram956v+YIV8w8VpwJnQ'); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user