Created
January 17, 2022 02:14
-
-
Save toshvelaga/718e5c51a65774d200812a36e6b3dc08 to your computer and use it in GitHub Desktop.
puppeteer.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const puppeteer = require('puppeteer') | |
| // node arguments are present from the third position going forward. | |
| const args = process.argv.slice(2) | |
| ;(async () => { | |
| const browser = await puppeteer.launch({ headless: true }) | |
| const page = await browser.newPage() | |
| // create a room called room | |
| await page.goto('https://video-meeting-socket.herokuapp.com/room') | |
| await page.waitForSelector('button') | |
| await page.click('button') | |
| await page.waitForTimeout(2000) | |
| await page.screenshot({ path: `./reports/images/${args[0]}.png` }) | |
| await browser.close() | |
| })() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment