I’d like to open a discussion on migrating our E2E test cases from Cypress to Playwright. While Playwright provides benefits such as better cross-browser support and enhanced debugging, transitioning to a new framework is a significant effort that requires strategic planning.
Currently, our Cypress test coverage isn’t where we want it to be. Instead of an immediate switch, I propose a phased approach that balances test stability with future improvements:
Strengthening Cypress First – Improve test coverage, refine selectors, and enhance overall stability.
Parallel Testing & Evaluation – Run both frameworks in tandem to compare effectiveness and identify challenges.
Full Migration (If Justified) – If Playwright reaches parity with Cypress and proves to be a better long-term solution, we can plan a full transition.
I’d love to hear your thoughts—should we prioritize improving our Cypress tests for now, or is this the right time to start shifting towards Playwright? Additionally, if we decide to migrate, how can we best distribute the workload to ensure an efficient transition?
Hello @Vishal_Sharma Thank you for bringing up this topic.
I have a few questions that we should consider.
Are the benefits cited that Playwright has over Cypress a limitation to us.
Are we failing to test some use cases because of using Cypress instead of Playwright
Won’t we be burdened if we decided to push Cypress and then later catch up with Playwright. If we chose to go with Playwright, it doesn’t make sense to continue with Cypress. @Manish do you mind adding on your experience/pain points that might have come from improving the E2E tests using Cypress?
Regards
Lack of Parallel Execution – Tests cannot run truly in parallel without external setup, which can slow down execution time.
Limited Cross-Browser Support – While Cypress does support multiple browsers, it lacks full compatibility with all major browsers, especially Safari.
My take on these limitations:
Parallel Execution: Since our tests follow a specific execution order, we wouldn’t fully benefit from Playwright’s parallel execution capabilities. Maintaining test consistency and reliability is more important than raw execution speed.
Cross-Browser Support: Most of our testing is focused on validating functionality rather than user experience across different browsers. Cypress tests can be efficiently run via the IDE or terminal (e.g., npm run cy:run) to catch issues related to our code, which is our primary concern.
But still playwright could be given a point here
Thanks @Vishal_Sharma . i think given that assesment , we can first currently focuss our limited dev resources on buiding comprehensive and reliable tests in Cypress .
We would always migrate to playwright when need would arise
Sorry for the delayed response—company work had me occupied. Here’s my input:
Multi-Tab Handling: Cypress struggles with multiple tabs, while Playwright handles it well. Not a major blocker for us.
Selector Strategy: We are currently using CSS selectors, which can be flaky. Ideally, switching to ID-based selectors would be better for test stability. (This is something we need to work on.)
Safari Support: Cypress has experimental WebKit support, including Safari, which should stabilize soon—so not a big issue.
Migration Concerns: Switching to Playwright would require time and effort. Unless we face complex testing challenges, Cypress remains an excellent choice.
Both are great tools. Cypress isn’t significantly limiting us, but if we were starting from scratch, Playwright would be a better choice. Happy to discuss further if needed.
@Manish thanks for the info I beleive we can migrate to playwright as it will result in both openmrs and Openelis having same e2e framework making it easier for maintenance
Migration Concerns: Switching to Playwright would require time and effort.
I’ve already invested significant time and effort into this, which has given me a deep understanding of the codebase so it won’t be an issue , I can get it done within a week if you want. there are 16 files left, but in reality, only 8 need full migration. The remaining 8 i have already but haven’t pushed since it requires some testing to eliminate flaky behavior.
Both are great tools. Cypress isn’t significantly limiting us, but if we were starting from scratch, Playwright would be a better choice. Happy to discuss further if needed.
We can definitely start from scratch if the maintainer’s prefer. I’m confident I can complete the rest of the migration within a week, while also ensuring all test cases pass with improved selectors like i did for the 14 files. Let me know your thoughts
In conclusion, only 8 more files need to be migrated—the rest of the work is already done. We can easily start from scratch if needed, and it won’t be a burden at all.