2026-04-05
This commit is contained in:
parent
5f835ca4e6
commit
949195caf8
71 changed files with 535 additions and 458 deletions
|
|
@ -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> => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue