@manufac/general-tests 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -22,7 +22,13 @@ const test_1 = require("@playwright/test");
|
|
|
22
22
|
await test_1.test.step(storyID, async () => {
|
|
23
23
|
try {
|
|
24
24
|
await page.goto(`iframe.html?id=${storyID}&viewMode=story`);
|
|
25
|
-
await
|
|
25
|
+
await page.evaluate(() => {
|
|
26
|
+
for (const image of document.querySelectorAll("img[loading='lazy']")) {
|
|
27
|
+
image.loading = "eager";
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
// `not.toBeEmpty()` instead of `toBeVisible()`: a story made only of fixed/absolute elements (like a header) leaves the root 0px tall, which Playwright counts as hidden.
|
|
31
|
+
await (0, test_1.expect)(page.locator("#storybook-root")).not.toBeEmpty();
|
|
26
32
|
await (0, test_1.expect)(page.locator(".sb-preparing-story .sb-loader")).toBeHidden(); // Avoid screenshotting a half-rendered story
|
|
27
33
|
// Ensure all images are fully loaded before taking the visual regression screenshot.
|
|
28
34
|
// Ref: https://playwright.dev/docs/api/class-page#page-wait-for-function
|