Skip to content

Commit 0c318a2

Browse files
committed
Disable animations in visual tests and improve page load handling
Refs: #7460
1 parent c0e2cff commit 0c318a2

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

packages/tools/visual-tests/tests/theme-snapshots.spec.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,26 @@ test.use({
1414
});
1515

1616
const DEFAULT_SNAPSHOT_OPTIONS = {
17+
animations: 'disabled',
1718
fullPage: true,
1819
maxDiffPixelRatio: 0,
20+
scale: 'css', // 'css' or 'device'
21+
timeout: 10000,
1922
};
2023

2124
ROUTES.forEach((options, route) => {
2225
test(`snapshot for ${route}`, async ({ page }) => {
2326
const hideMenusParam = `${route.includes('?') ? '&' : '?'}hideMenus`;
24-
await page.goto(`/#${route}${hideMenusParam}`, { waitUntil: 'networkidle' });
27+
await page.goto(`/#${route}${hideMenusParam}`);
28+
await page.waitForLoadState('networkidle');
29+
await page.addStyleTag({
30+
content: `
31+
* {
32+
transition: none !important;
33+
animation: none !important;
34+
}
35+
`,
36+
});
2537
if (options?.viewportSize) {
2638
await page.setViewportSize(options.viewportSize);
2739
}

0 commit comments

Comments
 (0)