Test a user flow in Next #17135
-
Hi all, I'm new to Next (so far I really like it tho) and currently running into a challenge I need to overcome. In my app there is a list of options a user can choose from. When a user picks one of the options a button becomes available and the user can go to the next page where a component is loaded based on the picked option Now I want to write a test so I can test the flow and see if when option 1 is picked component a is rendered. So far I can't find any documentation on how to achieve that. I and the team I work in both don't have any clue on how we could achieve this. Is there anyone that can point us in the right direction where we can build on? I'm not looking for a complete code example but more a some pointers on how to set it up so I can learn from it aswel Thanks in advance |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @edwinboon. It sounds like you want to setup some end-to-end tests. cypress is a great choice for this. Their docs should be rather universal in the sense you'd start up your Next app and cypress would navigate to it and perform actions as you specify. You could also look at Puppeteer and Jest although this requires a bit more setup initially from my experience. |
Beta Was this translation helpful? Give feedback.
Hi @edwinboon. It sounds like you want to setup some end-to-end tests. cypress is a great choice for this. Their docs should be rather universal in the sense you'd start up your Next app and cypress would navigate to it and perform actions as you specify.
You could also look at Puppeteer and Jest although this requires a bit more setup initially from my experience.