import { test, expect } from "@playwright/test"; import { userCredentials, subuserPhoneCredentials, subuserUsernameCredentials, operatorCredentials, customerRegistrationData, driverRegistrationData, invalidCredentials, loginAsUser, loginAsSubuserByPhone, loginAsSubuserByUsername, loginAsOperator, goToUserLogin, goToSubuserLogin, goToOperatorLogin, vehicleTestData, } from "./fixtures"; /** My wash start tests */ const LIVE_WASH_START_ENABLED = process.env.PLAYWRIGHT_LIVE === "1"; /** * Test that the dynamic machine status image loads successfully after lane selection. * Fails if ERR_BLOCKED_BY_ORB or other load error hides the image. */ test("dynamic machine status image renders after lane selection @live", async ({ browser }) => { test.skip(!LIVE_WASH_START_ENABLED, "Set PLAYWRIGHT_LIVE=1 to run the live wash-start machine image check."); // Mock geolocation to Copenhagen area for nearest department with lanes const context = await browser.newContext({ geolocation: { latitude: 55.6761, longitude: 12.5683, }, permissions: ["geolocation"], }); const page = await context.newPage(); await loginAsUser(page); await page.goto("/user/wash/start"); await page.waitForLoadState("networkidle"); // Wait for lane options to load await expect(page.locator("b-radio-button")).toBeVisible({ timeout: 45000 }); // Select the second radio (first lane, skip 'Any') await page.locator("b-radio-button").nth(1).click(); // Wait a bit for watch/effect await page.waitForTimeout(1000); // Assert dynamic image loads and is visible await expect(page.locator('img[alt="Machine status"]')).toBeVisible({ timeout: 15000 }); await context.close(); });