-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright-video.js
More file actions
21 lines (20 loc) · 984 Bytes
/
Copy pathplaywright-video.js
File metadata and controls
21 lines (20 loc) · 984 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// playwright-video.js
// This script captures a video of the deployed Elmentor landing page, including prompt and output sections if visible.
// Usage: node playwright-video.js
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
const context = await browser.newContext({ recordVideo: { dir: 'screenshots/' } });
const page = await context.newPage();
const url = 'https://aymanaboghonim.github.io/elmentor-landing-page-mvp/';
await page.goto(url);
// Optionally, scroll through the page to show all sections
await page.waitForTimeout(2000);
await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight / 3));
await page.waitForTimeout(2000);
await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight * 2 / 3));
await page.waitForTimeout(2000);
await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight));
await page.waitForTimeout(2000);
await browser.close();
})();