https://www.npmjs.com/package/expect-puppeteer
Why do we need it
Writing integration test is very hard, especially when you are testing a Single Page Applications. Data are loaded asynchronously and it is difficult to know exactly when an element will be displayed in the page.
Puppeteer API is great, but it is low level and not designed for integration testing.
This API is designed for integration testing:
- It will wait for element before running an action
- It adds additional feature like matching an element using text