Documentation
Recipes
Extract Reusable Test Code
It is a good practice to extract reusable test code to separate files. We recommend that you use a page model pattern for this. It allows you to abstract out both page structure and test logic.
However, if you need to extract only the helper functions, you can export them from a separate script file.