I started using Playwright, and one of the first things I noticed is that if you're trying to implement a custom page object that stores methods, click actions, and assertions, you should create a fixture file so that you can inject that page object into every test. To achieve this in Cypress, one way you can do it is by instantiating the class. Another way is to create a custom command. I feel that Playwright's way is much cleaner and more efficient. The test runner in PW controls setup and teardown; therefore, the page object is created at the right time, it's tied to the test pages instance, and it's automatically cleaned up. Not to mention, every test gets its own fresh, isolated object, so fixture injection guarantees fresh browser context, a fresh page, and a fresh page-object instance. Needless to say, I am hooked on Playwright, but I would love to hear what others think. Does anyone have anything to add or any counterargument?

0

Your Reply

By clicking “Post Your Reply”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.