This library uses the expect-playwright model that I created to allow a page, frame, element handle, or locator (with automatic promise resolution). Given that we are removing support for jest-playwright in #4, let's also remove support for non-locator assertions.
The one exception here is if a page/frame is passed, let's automatically convert that to a locator to prevent projects from needing to do this:
We will remove element handles which are the main hangup due to handling them within frames. Page/frame support is easy enough, as we can determine if the provided handle is a locator, and if not we simply call .locator('body') before sending it along.
This library uses the
expect-playwright
model that I created to allow a page, frame, element handle, or locator (with automatic promise resolution). Given that we are removing support for jest-playwright in #4, let's also remove support for non-locator assertions.The one exception here is if a page/frame is passed, let's automatically convert that to a locator to prevent projects from needing to do this:
We will remove element handles which are the main hangup due to handling them within frames. Page/frame support is easy enough, as we can determine if the provided handle is a locator, and if not we simply call
.locator('body')
before sending it along.