ixahmedxi / orbitkit

🚀 Orbitkit is a monorepo starterkit aiming to be the foundation you build your next startup or big idea upon.
https://orbitkit.dev
MIT License
835 stars 54 forks source link

Playwright E2E testing integration #11

Closed ixahmedxi closed 6 months ago

imCorfitz commented 7 months ago

In my attempt to create a similar turborepo starter, I implemented playwright testing by creating a dedicated tests directory which had a project for each app to perform e2e testing on. Do you have any preferred way to implement playwright here? It was honestly my first attempt in doing it in a monorepo, so you may have some experience with this already.

ixahmedxi commented 7 months ago

There seems to be two approaches to this generally, the one you are highlighting above and the other one is to just set-up playwright inside the application itself as you would normally do in a non-monorepo application, now this comes with a few benefits over the dedicated tests folder method:

Personally, as I have done it as well before in the past, I would choose to have playwright installed in apps/web and apps/marketing individually with a test:e2e scripting in these apps' package.json file.

ixahmedxi commented 7 months ago

playwright configuration tho should be in packages/config/playwright where it sets up the base config that is then used in the different playwright instances around the monorepo.

imCorfitz commented 7 months ago

I see your point. Guess the only real benefit of the other approach would be the caching of the apps when updating tests. Implementation wise, your preferred way is also the simplest to implement.

ixahmedxi commented 7 months ago

You can go around this by defining proper inputs in the task caching mechanisms.

imCorfitz commented 7 months ago

You can go around this by defining proper inputs in the task caching mechanisms.

This sounds exciting.. Looking forward to seeing this in action.