Update vehicles table action visibility and adjust E2E test timeouts and MinIO configuration
- Change `displayActionsDirectly` prop to `false` in vehicles table for compact mode consistency. - Refactor E2E tests with reusable `PAGE_READY_TIMEOUT` constant to prevent flaky behavior. - Enhance MinIO configuration in replication management and system status tests to include additional environment variables and form fields.
This commit is contained in:
@@ -240,7 +240,7 @@ const getProductOptionsLabel = (vehicle) => {
|
||||
v-if="!props.compact"
|
||||
:user_id="object.user_id"
|
||||
:reg_1="object.reg"
|
||||
:displayActionsDirectly="true"
|
||||
:displayActionsDirectly="false"
|
||||
>
|
||||
<template #actions>
|
||||
<!-- View (Redirect to the vehicle page) -->
|
||||
|
||||
@@ -335,6 +335,8 @@ async function generateMinioComposeTemplate() {
|
||||
kind: "minio",
|
||||
role: minioComposeForm.role,
|
||||
service_name: minioComposeForm.service_name,
|
||||
host: minioForm.host,
|
||||
scheme: minioForm.scheme,
|
||||
host_port: minioComposeForm.host_port,
|
||||
console_port: minioComposeForm.console_port,
|
||||
username: minioForm.username,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
import { mockApi, seedAuthenticatedState } from "./support/network.js";
|
||||
|
||||
const PAGE_READY_TIMEOUT = 60_000;
|
||||
|
||||
function json(body, status = 200) {
|
||||
return {
|
||||
status,
|
||||
@@ -186,7 +188,7 @@ async function installReplicationMock(page) {
|
||||
console_port: 9011,
|
||||
compose:
|
||||
'services:\n minio-replica-1:\n image: "minio/minio:latest"\n command:\n - server\n - /data\n minio-replica-1-setup:\n image: "minio/mc:latest"\n',
|
||||
env: "MINIO_ROOT_USER=truckwash-minio\nMINIO_ROOT_PASSWORD=generated-minio-secret\nMINIO_BUCKETS=attachments,uploads\nMINIO_PRIMARY_ENDPOINT=\nMINIO_PRIMARY_ACCESS_KEY=\nMINIO_PRIMARY_SECRET_KEY=\n",
|
||||
env: "MINIO_ROOT_USER=twminio0123456789abcdef01234567\nMINIO_ROOT_PASSWORD=generated-minio-secret\nMINIO_SERVER_URL=http://minio-replica.example.test:9010\nMINIO_BROWSER_REDIRECT_URL=http://minio-replica.example.test:9011\nMINIO_BUCKETS=attachments,uploads\nMINIO_PRIMARY_ENDPOINT=https://minio-primary.internal:9000\nMINIO_PRIMARY_ACCESS_KEY=primary-access\nMINIO_PRIMARY_SECRET_KEY=primary-secret\n",
|
||||
credentials: {
|
||||
label: "minio-replica-1",
|
||||
host: "",
|
||||
@@ -195,7 +197,7 @@ async function installReplicationMock(page) {
|
||||
endpoint: "",
|
||||
buckets: ["attachments", "uploads"],
|
||||
console_port: 9011,
|
||||
username: "truckwash-minio",
|
||||
username: "twminio0123456789abcdef01234567",
|
||||
password: "generated-minio-secret",
|
||||
space_headroom_percent: 20,
|
||||
},
|
||||
@@ -730,6 +732,8 @@ const longTitleSnapshot = {
|
||||
};
|
||||
|
||||
test.describe("Superuser system status smoke", () => {
|
||||
test.describe.configure({ timeout: 120_000 });
|
||||
|
||||
test("@smoke @pr superuser status dashboard renders Danish translations for degraded infrastructure and recent sessions", async ({
|
||||
page,
|
||||
}) => {
|
||||
@@ -739,8 +743,8 @@ test.describe("Superuser system status smoke", () => {
|
||||
await page.goto("/superuser");
|
||||
|
||||
await expect(page).toHaveURL(/\/superuser$/);
|
||||
await expect(page.getByTestId("system-status-dashboard")).toBeVisible({ timeout: 20_000 });
|
||||
await expect(page.getByTestId("status-card-database")).toContainText("truckwash", { timeout: 20_000 });
|
||||
await expect(page.getByTestId("system-status-dashboard")).toBeVisible({ timeout: PAGE_READY_TIMEOUT });
|
||||
await expect(page.getByTestId("status-card-database")).toContainText("truckwash", { timeout: PAGE_READY_TIMEOUT });
|
||||
await expect(page.getByTestId("status-card-database-replication")).toContainText("100.0% replikering");
|
||||
await expect(page.getByTestId("status-card-minio-replication")).toContainText("67.4% replikering");
|
||||
await expect(page.locator("body")).toContainText("Acme Logistics");
|
||||
@@ -763,7 +767,7 @@ test.describe("Superuser system status smoke", () => {
|
||||
await page.goto("/superuser/system/database");
|
||||
|
||||
await expect(page).toHaveURL(/\/superuser\/system\/database$/);
|
||||
await expect(page.getByTestId("database-status-card")).toBeVisible();
|
||||
await expect(page.getByTestId("database-status-card")).toBeVisible({ timeout: PAGE_READY_TIMEOUT });
|
||||
await expect(page.getByTestId("database-status-card")).toContainText("truckwash");
|
||||
await expect(page.getByTestId("database-status-card")).toContainText("8.0.36");
|
||||
});
|
||||
@@ -775,7 +779,7 @@ test.describe("Superuser system status smoke", () => {
|
||||
await page.goto("/superuser/system/replication");
|
||||
|
||||
await expect(page).toHaveURL(/\/superuser\/system\/replication$/);
|
||||
await expect(page.getByTestId("replication-management-page")).toBeVisible();
|
||||
await expect(page.getByTestId("replication-management-page")).toBeVisible({ timeout: PAGE_READY_TIMEOUT });
|
||||
await expect(page.getByTestId("replication-summary-database")).toContainText("42.5%");
|
||||
await expect(page.getByTestId("replication-summary-redis")).toContainText("81.2%");
|
||||
await expect(page.getByTestId("replication-summary-minio")).toContainText("67.4%");
|
||||
@@ -902,7 +906,7 @@ test.describe("Superuser system status smoke", () => {
|
||||
const pill = card.locator(".status-pill");
|
||||
const reason = page.getByTestId("module-reason-shelly");
|
||||
|
||||
await expect(card).toBeVisible();
|
||||
await expect(card).toBeVisible({ timeout: PAGE_READY_TIMEOUT });
|
||||
await expect(reason).toContainText("der findes ikke et kendt device-id");
|
||||
|
||||
const [titleBox, pillBox, reasonBox] = await Promise.all([
|
||||
@@ -930,7 +934,7 @@ test.describe("Superuser system status smoke", () => {
|
||||
const title = card.locator(".module-card__title");
|
||||
const pill = card.locator(".status-pill");
|
||||
|
||||
await expect(card).toBeVisible();
|
||||
await expect(card).toBeVisible({ timeout: PAGE_READY_TIMEOUT });
|
||||
await expect(title).toContainText("License Plate Recognizer");
|
||||
|
||||
const [cardBox, titleBox, pillBox] = await Promise.all([
|
||||
@@ -1055,7 +1059,7 @@ test.describe("Superuser system status smoke", () => {
|
||||
|
||||
await page.goto("/superuser");
|
||||
|
||||
await expect(page.getByTestId("system-status-gateways")).toBeVisible();
|
||||
await expect(page.getByTestId("system-status-gateways")).toBeVisible({ timeout: PAGE_READY_TIMEOUT });
|
||||
await expect(page.getByTestId("gateway-summary-card-total")).toContainText("10");
|
||||
await expect(page.getByTestId("gateway-summary-card-online")).toContainText("4");
|
||||
await expect(page.getByTestId("gateway-summary-card-degraded")).toContainText("3");
|
||||
|
||||
Reference in New Issue
Block a user