2026-04-10

- corvée: met à jour les deps
- corvée: formate
This commit is contained in:
gcch 2026-04-10 17:21:57 +02:00
commit b2a0012590
85 changed files with 132083 additions and 31328 deletions

View file

@ -1,6 +1,8 @@
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";
import type { APIRequestContext, Locator, Page, Response } from "@playwright/test";
import { expect, test } from "@playwright/test";
import type { WCV3Products } from "../../web/app/themes/haiku-atelier-2024/src/scripts/lib/types/api/v3/products";
import type { BackendHeaders } from "./utils.ts";
import { getBackendHeadersFromHtml } from "./utils.ts";
test.describe.configure({ mode: "parallel", timeout: 60_000 });
@ -9,13 +11,13 @@ test("can scroll to the end of the grid", async ({ page }): Promise<void> => {
});
test.skip("can access all Products' pages", async ({ page, request }): Promise<void> => {
await page.goto("https://haikuatelier.gcch.local/shop/");
await page["goto"]("https://haikuatelier.gcch.local/shop/");
const links = await getAllProductsLinks(page, request);
for (const link of links) {
// Vérifie que le lien de la page retourne OK.
const req = await request.get(link as string);
expect(req, "The Product's page is accessible").toBeOK();
const req = await request.get(link);
await expect(req, "The Product's page is accessible").toBeOK();
}
});
@ -25,11 +27,11 @@ const getAllProductsLinks = async (page: Page, request: APIRequestContext): Prom
headers: { Authorization: `Basic ${backendHeaders.authString}`, Nonce: backendHeaders.nonce },
});
const json = (await response.json()) as WCV3Products;
return json.map((p) => p.permalink);
return json.map(p => p.permalink);
};
const scrollToGridsEnd = async (page: Page): Promise<void> => {
await page.goto("https://haikuatelier.gcch.local/shop/");
await page["goto"]("https://haikuatelier.gcch.local/shop/");
let hasMoreProducts = true;
let currentPageNumber = "1";