Merge pull request 'fix ci' (#250) from staging into main
Some checks failed
CI/CD Pipeline / test (push) Failing after 3m44s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped

Reviewed-on: #250
This commit is contained in:
philipp 2024-03-05 14:29:58 +01:00
commit 3b9d743603

View File

@ -75,13 +75,15 @@ test("Cox can start and finish trip", async ({ page }, testInfo) => {
await page.goto("/log"); await page.goto("/log");
await page.locator("div:nth-child(2) > .border-0").click(); await page.locator("div:nth-child(2) > .border-0").click();
// Add a minute // Add a minute
await page.locator('#arrivaljs').click(); const datetimeSelector = '#arrivaljs';
await page.locator('#arrivaljs').press('Tab'); const currentValue = await page.$eval(datetimeSelector, el => el.value);
await page.locator('#arrivaljs').press('Tab'); const currentDate = new Date(currentValue);
await page.locator('#arrivaljs').press('Tab'); currentDate.setMinutes(currentDate.getMinutes() + 1);
await page.locator('#arrivaljs').press('Tab'); currentDate.setHours(currentDate.getHours() + 1);
await page.locator('#arrivaljs').press('ArrowUp'); const newDatetime = currentDate.toISOString().slice(0, 16);
await page.$eval(datetimeSelector, (el, value) => el.value = value, newDatetime);
await page.getByRole("combobox", { name: "Destination" }).click(); await page.getByRole("combobox", { name: "Destination" }).click();
await page.getByRole("combobox", { name: "Destination" }).fill("Ottensheim"); await page.getByRole("combobox", { name: "Destination" }).fill("Ottensheim");
@ -159,12 +161,13 @@ test("Kiosk can start and finish trip", async ({ page }, testInfo) => {
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 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 // Add a minute
await page.locator('#arrivaljs').click(); const datetimeSelector = '#arrivaljs';
await page.locator('#arrivaljs').press('Tab'); const currentValue = await page.$eval(datetimeSelector, el => el.value);
await page.locator('#arrivaljs').press('Tab'); const currentDate = new Date(currentValue);
await page.locator('#arrivaljs').press('Tab'); currentDate.setMinutes(currentDate.getMinutes() + 1);
await page.locator('#arrivaljs').press('Tab'); currentDate.setHours(currentDate.getHours() + 1);
await page.locator('#arrivaljs').press('ArrowUp'); const newDatetime = currentDate.toISOString().slice(0, 16);
await page.$eval(datetimeSelector, (el, value) => el.value = value, newDatetime);
await page.getByRole("combobox", { name: "Destination" }).click(); await page.getByRole("combobox", { name: "Destination" }).click();
await page.getByRole("combobox", { name: "Destination" }).fill("Ottensheim"); await page.getByRole("combobox", { name: "Destination" }).fill("Ottensheim");