-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathvisual-testing.js
31 lines (26 loc) · 888 Bytes
/
visual-testing.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
const fs = require('fs');
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch({
headless: false,
});
const context = await browser.newContext({
videosPath: __dirname, // save videos here.
videoSize: { width: 1024, height: 768 }, // downscale
});
const page = await context.newPage();
await page.goto('https://gocovid19.netlify.app/');
await page.waitForTimeout(1000);
await page.click(`[href$="/WHO"]`);
await page.waitForTimeout(1000);
await page.click(`[href$="/symptoms"]`);
await page.waitForTimeout(1000);
await page.click(`[href$="/info"]`);
await page.waitForTimeout(1000);
await page.click(`[href$="/faq"]`);
await page.waitForTimeout(1000);
// ... perform actions
await page.close();
fs.renameSync(await page.video().path(), 'visual-testing.webm');
await browser.close();
})();