I recently started using Playwright (coming from Cypress), and one thing I cant figure out is how to modify or add to Page methods.
In Cypress, I can make modify default behaviors of functions such as cy.get(...)
. Or create new methods such as cy.get(...).clearType(...)
which would differ from the regular type method in that it clears the input box before typing.
In Playwright (Typescript), I haven't figured out how to modify any behaviors or add new methods to the Page
class.
I want to add new functions such as this.page.clearType(...)
which differs from this.page.type(...)
in that it clears the input box before typing.
Looking through the Playwright documentation, the only thing that I can see mentions modifying the test fixtures (which I dont think is the same thing?)
Thank you in advance for your help :)