1.0.1 • Published 11 months ago

puppeteer-wait-for-transition v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

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! ❤️

License

MIT License © Sebastian Landwehr

1.0.1

11 months ago