forked from IamTalha-Sajid/telegraph-hackathon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtake-shots-all.js
More file actions
17 lines (17 loc) · 789 Bytes
/
Copy pathtake-shots-all.js
File metadata and controls
17 lines (17 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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);
// HowItWorks
await page.evaluate(() => window.scrollTo(0, document.getElementById('how').offsetTop));
await page.waitForTimeout(400);
await page.screenshot({ path: 'C:/Users/MT/AppData/Local/Temp/gold-how.png' });
// ApiSection
await page.evaluate(() => window.scrollTo(0, document.getElementById('apis').offsetTop));
await page.waitForTimeout(400);
await page.screenshot({ path: 'C:/Users/MT/AppData/Local/Temp/gold-api.png' });
await browser.close();
})();