forked from IamTalha-Sajid/telegraph-hackathon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtake-shots.js
More file actions
19 lines (19 loc) · 986 Bytes
/
Copy pathtake-shots.js
File metadata and controls
19 lines (19 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
const page = await browser.newPage();
await page.setViewportSize({ width: 1400, height: 900 });
await page.goto('http://localhost:3001', { waitUntil: 'networkidle' });
await page.waitForTimeout(2000);
await page.screenshot({ path: 'C:/Users/MT/AppData/Local/Temp/tele-hero.png' });
await page.evaluate(() => window.scrollBy(0, window.innerHeight));
await page.waitForTimeout(600);
await page.screenshot({ path: 'C:/Users/MT/AppData/Local/Temp/tele-why.png' });
await page.evaluate(() => window.scrollBy(0, window.innerHeight));
await page.waitForTimeout(600);
await page.screenshot({ path: 'C:/Users/MT/AppData/Local/Temp/tele-ticker.png' });
await page.evaluate(() => window.scrollBy(0, window.innerHeight));
await page.waitForTimeout(600);
await page.screenshot({ path: 'C:/Users/MT/AppData/Local/Temp/tele-series.png' });
await browser.close();
})();