wip avec résolution de conflits

This commit is contained in:
gcch 2026-02-27 14:38:50 +01:00
commit ef19ba2b72
208 changed files with 178625 additions and 192002 deletions

View file

@ -24,8 +24,8 @@ const getAllProductsLinks = async (page: Page, request: APIRequestContext): Prom
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}` },
});
const json = await response.json() as WCV3Products;
const links = json.map(p => p.permalink);
const json = (await response.json()) as WCV3Products;
const links = json.map((p) => p.permalink);
return links;
};
@ -38,7 +38,7 @@ const scrollToGridsEnd = async (page: Page): Promise<void> => {
const productsGrid: Locator = page.locator(".grille-produits");
await expect(productsGrid, "The Product's grid is visible").toBeVisible();
expect(await (productsGrid.getAttribute("data-page")), "The initial page number attribute is correct").toBe(
expect(await productsGrid.getAttribute("data-page"), "The initial page number attribute is correct").toBe(
currentPageNumber,
);
@ -46,9 +46,7 @@ const scrollToGridsEnd = async (page: Page): Promise<void> => {
await expect(showMoreButton, "The 'Show more' button is visible").toBeVisible();
while (hasMoreProducts) {
const newProductsResponse: Promise<Response> = page.waitForResponse(
new RegExp(".*wp-json\/wc\/v3\/products.*"),
);
const newProductsResponse: Promise<Response> = page.waitForResponse(new RegExp(".*wp-json\/wc\/v3\/products.*"));
await showMoreButton.click();
await newProductsResponse;
@ -58,7 +56,7 @@ const scrollToGridsEnd = async (page: Page): Promise<void> => {
await gridWithNewPageNumber.waitFor();
// Redondance pour expliciter la raison de l'assertion.
expect(await (productsGrid.getAttribute("data-page")), "The page number attribute is incremented").toBe(
expect(await productsGrid.getAttribute("data-page"), "The page number attribute is incremented").toBe(
newPageNumber,
);
currentPageNumber = newPageNumber;