Closed ixahmedxi closed 6 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:
apps/web
if for example that's all you're working on and that way you don't need to have the entire monorepo open just to jump to the tests application to change something up.tests
folder breaks context awareness, where you will need to shift focus onto a completely different package and do changes there.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.
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.
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.
You can go around this by defining proper inputs
in the task caching mechanisms.
You can go around this by defining proper
inputs
in the task caching mechanisms.
This sounds exciting.. Looking forward to seeing this in action.
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.