wip avec résolution de conflits
This commit is contained in:
parent
63b2d2b256
commit
ef19ba2b72
208 changed files with 178625 additions and 192002 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue