|
1 | | -import { test, expect, Page } from "@playwright/test"; |
| 1 | +import { Page, expect, test } from '@playwright/test'; |
2 | 2 |
|
3 | 3 | const TESTS: Array<{ id: string; play?: (page: Page) => Promise<void> }> = [ |
4 | | - { id: "complete" }, |
5 | | - { id: "custom-renderer" }, |
6 | | - { id: "demo" }, |
7 | | - { id: "drag-n-drop" }, |
8 | | - { id: "events" }, |
9 | | - { id: "external" }, |
10 | | - { id: "layout-circular" }, |
11 | | - { id: "layout-fa2-control" }, |
12 | | - { id: "load-graph-hook" }, |
13 | | - { id: "load-graph-prop" }, |
14 | | - { id: "multi-directed" }, |
15 | | - { id: "multi" }, |
16 | | - { id: "node-border" }, |
17 | | - { id: "edge-curve" }, |
| 4 | + { id: 'complete' }, |
| 5 | + { id: 'custom-renderer' }, |
| 6 | + { id: 'demo' }, |
| 7 | + { id: 'drag-n-drop' }, |
| 8 | + { id: 'events' }, |
| 9 | + { id: 'external' }, |
| 10 | + { id: 'layout-circular' }, |
| 11 | + { id: 'layout-fa2-control' }, |
| 12 | + { id: 'load-graph-hook' }, |
| 13 | + { id: 'load-graph-prop' }, |
| 14 | + { id: 'multi-directed' }, |
| 15 | + { id: 'multi' }, |
| 16 | + { id: 'node-border' }, |
| 17 | + { id: 'edge-curve' }, |
| 18 | + { id: 'graph-search' }, |
| 19 | + { id: 'minimap' }, |
18 | 20 | ]; |
19 | 21 |
|
20 | 22 | function getTestUrl(id: string): string { |
21 | 23 | return `/iframe.html?args=&id=${id}--default&viewMode=story&seed=foo&faTime=-1`; |
22 | 24 | } |
23 | | - |
24 | 25 | TESTS.forEach(({ id, play }) => { |
25 | 26 | test(`Screenshot for "${id}"`, async ({ page }) => { |
26 | | - await page.goto(getTestUrl(id), { waitUntil: "networkidle" }); |
| 27 | + await page.goto(getTestUrl(id), { waitUntil: 'networkidle' }); |
27 | 28 | if (play) await play(page); |
28 | 29 | await expect(page).toHaveScreenshot(`${id}.png`, { |
29 | 30 | maxDiffPixels: 2, |
| 31 | + timeout: 10000, |
30 | 32 | }); |
31 | 33 | }); |
32 | 34 | }); |
0 commit comments