Rianofc commited on
Commit
dd5f42f
·
verified ·
1 Parent(s): e0bdc8b

Create test.js

Browse files
Files changed (1) hide show
  1. test.js +20 -0
test.js ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const { chromium } = require('playwright');
2
+ const fs = require('fs');
3
+
4
+ (async () => {
5
+ const browser = await chromium.launch();
6
+ const context = await browser.newContext({
7
+ recordVideo: {
8
+ dir: '/tmp',
9
+ size: { width: 1280, height: 720 }
10
+ }
11
+ });
12
+
13
+ const page = await context.newPage();
14
+ await page.goto('https://chatgpt.com');
15
+ await page.waitForTimeout(3000);
16
+ await browser.close();
17
+
18
+ const files = fs.readdirSync('/tmp').filter(f => f.endsWith('.webm'));
19
+ console.log('Saved video:', files[0]);
20
+ })();