|
1 | 1 | // example.spec.ts
|
2 | 2 | import { test, expect } from '@playwright/test';
|
3 |
| -import {default as domains} from '../domains.json'; |
| 3 | +import { default as domains } from '../domains.json'; |
4 | 4 |
|
5 | 5 | const stagingUrl = 'https://staging-docs-page-website-euw1-dzpolnxswq-ew.a.run.app';
|
6 | 6 |
|
7 | 7 | // skip these as these are not working (user error)
|
8 |
| -const skipList = ['dokumentacja.otwartaturystyka.pl'] |
| 8 | +const skipList = ['dokumentacja.otwartaturystyka.pl']; |
9 | 9 |
|
10 | 10 | domains.forEach(domain => {
|
11 |
| - if (!skipList.includes(domain[0])) { |
| 11 | + if (!skipList.includes(domain[0])) { |
12 | 12 | test(`${domain[0]}`, async ({ page }) => {
|
| 13 | + const response = await page.goto(`https://${domain[0]}`); |
13 | 14 |
|
14 |
| - const response = await page.goto(`https://${domain[0]}`); |
| 15 | + expect(response).toBeDefined(); |
| 16 | + expect(response!.status()).toBe(200); |
15 | 17 |
|
16 |
| - expect(response).toBeDefined(); |
17 |
| - expect(response!.status()).toBe(200); |
| 18 | + const screenshotName = `${domain[1]}-original.png`; |
| 19 | + await expect(page).toHaveScreenshot(screenshotName); |
18 | 20 |
|
19 |
| - const screenshotName = `${domain[1]}-original.png`; |
20 |
| - await expect(page).toHaveScreenshot(`${domain[1]}-original.png`); |
21 |
| - |
22 |
| - await page.goto(`${stagingUrl}/${domain[1]}`) |
23 |
| - await expect(page).toHaveScreenshot(`${domain[1]}-original.png`); |
| 21 | + await page.goto(`${stagingUrl}/${domain[1]}`); |
| 22 | + await expect(page).toHaveScreenshot(screenshotName); |
24 | 23 | });
|
25 |
| -} |
26 |
| -}) |
| 24 | + } |
| 25 | +}); |
0 commit comments