Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playwright E2E Tests for Offline Mode | Monorepo Conversion #13

Merged
merged 9 commits into from
Aug 12, 2022

Conversation

manuelroemer
Copy link
Member

Introduction

For about a year, the OpenMRS frontend has been continuously enhanced with offline related features. These have, at the moment, very little test coverage due to the complexity of covering offline mode using "normal" unit tests. We want to change this, but this more or less requires E2E tests to fully capture all possible interactions and flows.

The existing Cypress project would have been an ideal starting place for such test cases. Unfortunately, a known Cypress issue makes this nearly impossible without bad consequences. For this reason, this PR introduces another testing project specifically for offline related test cases in this repository. The new project is based on the Playwright framework which makes testing offline features possible while also following many of the newest best practices regarding E2E testing and browser automation.

The fact that a new project is added to this repository also meant that I had to do some repository restructuring. Since there are now two entirely separate projects living in this single repository, it made sense to convert it to a monorepo. This means that the existing Cypress code has been moved into a sub-directory (./packages/cypress) where it can peacefully coexist with the new playwright package. yarn workspaces take care of the dependency management.

Discussion

I did my best to keep everything Cypress-related working. Obviously I'm not perfect, meaning that I might have broken one or the other non-obvious thing while merging the changes into a monorepo. A thorough review is welcome! 😄

I also want to note that, for the scope of this PR, the playwright project should simply be "parked" inside this repository. The goal is not to have it integrated with, e.g., pipelines or anything else. After merging, it should be possible to run the tests and to write new ones locally. Anything else is, from my POV, out of scope at the moment.

@manuelroemer
Copy link
Member Author

manuelroemer commented Aug 11, 2022

@ibacher I added you as single reviewer only because I don't know who else might be interested in approving/validating this. If you know someone, please feel free to add them!

@ibacher ibacher merged commit 4f241be into main Aug 12, 2022
@ibacher ibacher deleted the monorepo-playwright branch August 12, 2022 11:59
@ibacher
Copy link
Member

ibacher commented Aug 12, 2022

@pasindur99 @jayasanka-sack @jnsereko @kdaud FYI. Note that this changes the structure of the repo so that the the cypress tests are in packages/cypress. We've also added support for playwright to test offline mode.

@ibacher
Copy link
Member

ibacher commented Aug 12, 2022

@manuelroemer Thanks for this! Nice work as always!

@pasindur99
Copy link
Contributor

@pasindur99 @jayasanka-sack @jnsereko @kdaud FYI. Note that this changes the structure of the repo so that the the cypress tests are in packages/cypress. We've also added support for playwright to test offline mode.

Noted. Thanks @ibacher
Nice work @manuelroemer

jnsereko pushed a commit to jnsereko/openmrs-test-3refapp that referenced this pull request Aug 23, 2022
jnsereko pushed a commit to jnsereko/openmrs-test-3refapp that referenced this pull request Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants