I'm in the process of building a smoke testing suite for a web application, specifically using Playwright. I'm encountering a challenge with testing a wizard form that consists of several pages:
- Personal details
- Product details
- Personal Details
- Confirm and submit
Each of these pages contains various input fields and elements.
The unique aspect of my problem is that the application generates a unique token that identifies each application form instance. Reloading the page or initiating a new test case for the same form results in a 404 Error, which is the expected behavior.
Our current testing approach involves duplicating the functions used on the previous page to navigate to the desired page. However, this approach can lead to lengthy test cases, with a significant portion of the code dedicated to navigating between pages.
I'm looking for insights and best practices on how to structure my Playwright smoke testing suite to handle this scenario more efficiently. Any suggestions on improving the testing workflow and reducing code duplication would be greatly appreciated.
In general, I would approach similar situation like below: