-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathspecial-error-screenshots.spec.js
36 lines (30 loc) · 1.58 KB
/
special-error-screenshots.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* global process */
import { expect, test } from '@playwright/test';
import { SpecialErrorPage } from './special-error';
const maxDiffPixels = 20;
test.describe('screenshots @screenshots', () => {
test.skip(process.env.CI === 'true');
test('SSL expired cert error', async ({ page }, workerInfo) => {
const special = SpecialErrorPage.create(page, workerInfo);
await special.openPage({ errorId: 'ssl.expired' });
await expect(page).toHaveScreenshot('ssl-expired-cert.png', { maxDiffPixels });
});
test('SSL expired cert error with reduced motion', async ({ page }, workerInfo) => {
const special = SpecialErrorPage.create(page, workerInfo);
await special.reducedMotion();
await special.openPage({ errorId: 'ssl.expired' });
await special.showsAdvancedInfo();
await expect(page).toHaveScreenshot('ssl-expired-cert-reduced-motion.png', { maxDiffPixels });
});
test('Phishing warning with advanced info', async ({ page }, workerInfo) => {
const special = SpecialErrorPage.create(page, workerInfo);
await special.openPage({ errorId: 'phishing' });
await special.showsAdvancedInfo();
await expect(page).toHaveScreenshot('phishing-warning-advanced.png', { maxDiffPixels });
});
test('Malware warning in Russian', async ({ page }, workerInfo) => {
const special = SpecialErrorPage.create(page, workerInfo);
await special.openPage({ errorId: 'malware', locale: 'ru' });
await expect(page).toHaveScreenshot('malware-warning-ru.png', { maxDiffPixels });
});
});