diff --git a/c2cwsgiutils/acceptance/image.py b/c2cwsgiutils/acceptance/image.py index a08de53b5..95cc79ac0 100644 --- a/c2cwsgiutils/acceptance/image.py +++ b/c2cwsgiutils/acceptance/image.py @@ -125,7 +125,7 @@ def check_image( assert ((0 < mask) & (mask < 255)).sum() == 0, "Mask should be only black and white image" # Convert to boolean - mask = mask != 0 + mask = mask == 0 assert ( mask.shape[0] == image_to_check.shape[0] and mask.shape[1] == image_to_check.shape[1] @@ -148,6 +148,7 @@ def check_image( assert ( expected.shape[0] == mask.shape[0] and expected.shape[1] == mask.shape[1] ), f"Mask and expected image should have the same shape ({mask.shape} != {expected.shape})" + expected[mask] = [255, 255, 255] assert ( expected.shape == image_to_check.shape diff --git a/c2cwsgiutils/acceptance/screenshot.js b/c2cwsgiutils/acceptance/screenshot.js index 9661df891..5d29c3da7 100644 --- a/c2cwsgiutils/acceptance/screenshot.js +++ b/c2cwsgiutils/acceptance/screenshot.js @@ -49,13 +49,13 @@ const options = program.opts(); } }); - await page.goto(options.url, { timeout: 60000 }); - await page.setViewport({ width: parseInt(options.width), height: parseInt(options.height), }); - await page.waitForTimeout(parseInt(options.sleep)); + await page.goto(options.url, { timeout: 60000 }); + + await new Promise((r) => setTimeout(r, parseInt(options.sleep))); await page.screenshot({ path: options.output, clip: { x: 0, y: 0, width: parseInt(options.width), height: parseInt(options.height) },