E2E Tests t3-turbo stack
Hi guys I found out that in the community of the t3 stack, it’s common to use in the examples dirs the playwright for the e2e, but my question is...
If I have a turbo repo with expo and nextjs with similar code... should I choose to test with cypress on both apps due to the lacking of playwright testing on iOS? or it’s enough to test it on the nextjs?
18 Replies
the purpose of this question is to find a lib or framework that can do unit and e2e tests like playwright all in one, having the ability to testing on the mobile native apps and web apps with different devices on the e2e side and unit tests in the apps or even in the packages like the trpc api or other libs that i made for the project...
i found out a project made by juliusmarminge https://github.com/juliusmarminge/t3-complete/blob/main/test/trpc/post-router.test.ts that in a normal repo not a turbo repo with playwright and vitest in that case but why not use playwright only?
GitHub
t3-complete/post-router.test.ts at main · juliusmarminge/t3-complete
Contribute to juliusmarminge/t3-complete development by creating an account on GitHub.
what about the combo of detox for mobile & playwrite for web and api
not sure - if cypress is workign for both sides then use that i guess?
playwright and vitest in that case but why not use playwright only?
not sure what you mean here, playwright can't do unit/integration testsI checked and cypress can’t be used on mobile e2e on expo only web
So playwright for nextjs and trpc
And detox for expo e2e tests
Do you have an example of a unit test on playwright for trpc crud?
In this case u use vitest for trpc testing
it's in the e2e tests https://github.com/juliusmarminge/t3-complete/blob/main/e2e/smoke.test.ts
I was talking about unit test with trpc, i think that the code made with vitest in the repo is the same thing if i use it with playwright
Thx btw ❤️
sure you could write similar tests in playwright but playwright is an e2e test runner meant to test interactions in web apps - just using it for unit/integratoin tests will result in much slower test times
but it's very nice that they use a very similar api
how would you break the trpc test down further? i dont think unit testing makes sense here - the integration covers enough for me at least
I would use it in nextjs for e2e and for unit test for the trpc api
Nono i was saying to use playwright instead of vitest
making the test for a crud api for example and then the code for the BE and FE
Instead of doing the FE side first and the BE on the end and finally the e2e test on the nextjs app
like a TDD sample
i mean if you want to use playwright for everything go ahead but i dont know why it makes sense... playwright is huge compared to vitest and there's no harm in having two separate runners for different types of tests
just running the 2 trpc tests in the repo now runs like 30% slower in playwright compared to vitest
Good to know thx!
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Yeah i think so but at this point you can use playwright for both, It’s way faster than jest and it has ts support out of the box to
Or vitest for unit tests and playwright for e2e
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
It’s not planned as the readme says
U can look to t3-complete repo
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Btw vitest is way faster
And supports ts ootb
U should give it a try
This repo here
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View