puppeteer-wait-for-transition
v1.0.1
Published
Waits until a transition has finished for a Puppeteer element.
Downloads
2
Readme
puppeteer-wait-for-transition
Waits until a transition has finished for a Puppeteer element.
Usage
import puppeteer from 'puppeteer'
import waitTransition from 'puppeteer-wait-transition'
const browser = await puppeteer.launch()
const page = await browser.newPage()
// ...
const button = await modal.$('.open-button')
await button.click()
const modal = await page.waitForSelector('.modal')
// Wait for the fade in transition to end
await waitTransition(modal)
// E.g. take a screenshot of the modal
expect(await page.screenshot()).toMatchImageSnapshot
Install
# npm
$ npm install puppeteer-wait-for-transition
# Yarn
$ yarn add puppeteer-wait-for-transition
Contribute
Are you missing something or want to contribute? Feel free to file an issue or a pull request! ⚙️
Support
Hey, I am Sebastian Landwehr, a freelance web developer, and I love developing web apps and open source packages. If you want to support me so that I can keep packages up to date and build more helpful tools, you can donate here:
Thanks a lot for your support! ❤️