-
Notifications
You must be signed in to change notification settings - Fork 34
Cypress <> Playwright Comparison #6
Comments
Re proxy support - I just found microsoft/playwright#810, looks like this is on your radar already. |
Thanks for the great list!
We definitely should have a better debugging story. Filed as #14. I'm not so sure about combining a debug mode and a watch mode. We could easily just have your tests run in headful, and browsers will pop up and go away with your tests. But doing a good visual test dashboard is probably out of scope of this project, or at least very far away.
What does this mean? It changes the url the page navigates to at the start? I think you could emulate that today with like
Our e2e tests run in node, and so you can use process.env in them. The unit tests run in the browser, but I can create a fake
In e2e tests this works with page.route. For unit tests, this is blocked on #13. |
Using
Why are there two test modes with this distinction? Are there some parts of the API only available in one test mode or the other? But yeah, I think it should be fine. We're using the env vars in Cypress tests to do things like, bootstrap pages with some required cookies, adjust the timeout on certain commands in different environments, etc. |
So these are just quick thoughts on the benefits we get from Cypress, and where Playwright might be able to bridge the gap. Some of these might be things better supported on Playwright itself and not the runner (like proxy config).
These are things that Cypress has that I'm not sure Playwright does yet (correct me if I'm wrong):
A headed in-browser test runner UI - developers can watch and debug tests in real time, this is also hooked up to a "watch" mode that picks up code changes. This may be the largest benefit we receive from Cypress in terms of developer experience. The UI test runner allows you to interact with the DOM and pause the test on any steps. (video eg). This UI also surfaces the test failure messages in recorded videos.
Config options to run tests against any base URL -- we point Cypress at any host by changing an env variable
CYPRESS_BASE_URL
.On the same note as the previous ^, ability to propagate any environment variables into browser tests. Cypress uses a convention where any env var prefixed with
CYPRESS_
can be discovered and used by tests. https://docs.cypress.io/guides/guides/environment-variables.html#SettingAbility to listen mock and stub routes and API responses https://docs.cypress.io/api/commands/route.html#Syntax
Option to output recorded video of the test runs -- seems like you heard this one already Record a video for tests #5
Proxy configuration for in browser tests https://docs.cypress.io/guides/references/proxy-configuration.html#Set-a-proxy-on-Linux-or-macOS
There's probably more that I'm forgetting, but those are the big ones I can think of.
The text was updated successfully, but these errors were encountered: