Files
pleno-vue/tests/e2e/userMyWashStart.spec.ts
T
Jeppe Bundgaard f040614f46 Refactor module paths, layout responsiveness, and testing configurations:
- Replaced repetitive department module URL logic with `buildDepartmentModulePath` utility in `DepartmentModulesDisplay.vue`.
- Enhanced layouts and responsive behavior across components, including `PosDepartmentStep1MobileTransactionHistory.vue` and `DepartmentDailyReport.vue`.
- Removed unused `SuperuserInvoicingLocalStore.vue` and refactored to `SuperuserInvoicingLocalStore.ts`.
- Updated media query handling and card layout adjustments in `DepartmentDailyReport.vue`.
- Added new Playwright configurations (`playwright.prod.config.ts` and `playwright.live.config.ts`) for e2e release workflows.
- Extended e2e and unit test coverage for mobile POS and department modules.
2026-04-09 16:32:25 +02:00

58 lines
1.7 KiB
TypeScript

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();
});