- Introduced live smoke tests for Edge Gateways, verifying gateway routes and destructive-action prevention. - Added e2e scenarios for deep-link navigation, unavailable gateway recovery, token rotation, and background page refresh. - Refactored test helpers for streamlined functional validation in gateway scenarios. - Updated `EdgeGatewayTerminal.vue` with test IDs for enhanced testability. - Added and configured Husky pre-commit hooks for automated test file formatting and validation.
50 lines
1.8 KiB
TypeScript
50 lines
1.8 KiB
TypeScript
import { test, expect } from "@playwright/test";
|
|
import {
|
|
userCredentials,
|
|
subuserPhoneCredentials,
|
|
subuserUsernameCredentials,
|
|
operatorCredentials,
|
|
customerRegistrationData,
|
|
driverRegistrationData,
|
|
invalidCredentials,
|
|
loginAsUser,
|
|
loginAsSubuserByPhone,
|
|
loginAsSubuserByUsername,
|
|
loginAsOperator,
|
|
goToUserLogin,
|
|
goToSubuserLogin,
|
|
goToOperatorLogin,
|
|
} from "./fixtures";
|
|
|
|
/** User home Tests */
|
|
// User home page content tests
|
|
test("[PAGES][User][/user] should display a welcome message", async ({ page }) => {
|
|
await loginAsUser(page);
|
|
await expect(page.locator(".title")).toContainText(/Velkommen\s+\S+/);
|
|
});
|
|
|
|
// Book wash button visibility test
|
|
test("[PAGES][User][/user] should display the book wash button", async ({ page }) => {
|
|
await loginAsUser(page);
|
|
// Check if the "book wash" element is visible
|
|
await expect(page.locator("a#book-wash-button")).toBeVisible();
|
|
});
|
|
// Add vehicle button visibility test
|
|
test("[PAGES][User][/user] should display the add vehicle button", async ({ page }) => {
|
|
await loginAsUser(page);
|
|
// Check if the "create vehicle" element is visible
|
|
await expect(page.locator("a#add-vehicle-button")).toBeVisible();
|
|
});
|
|
// Download wash certificate button visibility test
|
|
test("[PAGES][User][/user] should display the download certificate button", async ({ page }) => {
|
|
await loginAsUser(page);
|
|
// Check if the "download certificate" element is visible
|
|
await expect(page.locator("a#download-certificates-button")).toBeVisible();
|
|
});
|
|
// Download invoices button visibility test
|
|
test("[PAGES][User][/user] should display the download invoices button", async ({ page }) => {
|
|
await loginAsUser(page);
|
|
// Check if the "download invoices" element is visible
|
|
await expect(page.locator("a#download-invoices-button")).toBeVisible();
|
|
});
|