2026-04-05

This commit is contained in:
gcch 2026-04-05 13:11:21 +02:00
commit 2971f5516d
62 changed files with 439 additions and 497 deletions

View file

@ -1,8 +1,8 @@
import { test, expect, Page, Locator, Response, APIRequestContext } from "@playwright/test";
import { APIRequestContext, expect, Locator, Page, Response, test } from "@playwright/test";
import { WCV3Products } from "../../web/app/themes/haiku-atelier-2024/src/scripts/lib/types/api/v3/products";
import { BackendHeaders, getBackendHeadersFromHtml } from "./utils.ts";
test.describe.configure({ mode: "parallel", timeout: 60000 });
test.describe.configure({ mode: "parallel", timeout: 60_000 });
test("can scroll to the end of the grid", async ({ page }): Promise<void> => {
await scrollToGridsEnd(page);
@ -22,12 +22,10 @@ test.skip("can access all Products' pages", async ({ page, request }): Promise<v
const getAllProductsLinks = async (page: Page, request: APIRequestContext): Promise<Array<string>> => {
const backendHeaders: BackendHeaders = await getBackendHeadersFromHtml(page);
const response = await request.get("/wp-json/wc/v3/products?page=1&per_page=100&status=publish", {
headers: { Nonce: backendHeaders.nonce, Authorization: `Basic ${backendHeaders.authString}` },
headers: { Authorization: `Basic ${backendHeaders.authString}`, Nonce: backendHeaders.nonce },
});
const json = (await response.json()) as WCV3Products;
const links = json.map((p) => p.permalink);
return links;
return json.map((p) => p.permalink);
};
const scrollToGridsEnd = async (page: Page): Promise<void> => {