Make your life easier with modules
When you create your tests do you notice that they contain steps you have to repeat over and over, like logging in, setting up test data, or navigating to a deep page? Instead of recording the same “log in as admin” steps in twenty different tests, you can record it once as a module and then reuse it wherever you need it. When the test runs, AIVA executes the module exactly as if those steps were written directly in the test.
Right now the one supported type of module is the Authentication Module (for all the different ways users log in to your app). More module types are coming soon.
Modules keep your tests short, clean, and easy to maintain — change the module once (e.g., your login flow changes slightly) and every test that uses it automatically gets the update.
Record authentication only once and reuse it
If your tested app requires authentication of the user, your tests will generally all start with a login procedure, with only few exceptions.
If that’s the case, we suggest recording the login procedure as a module and using that module in all tests where it makes sense. This has several advantages:
- You won’t have to re-record the login procedure over and over again, saving time and avoiding mistakes.
- Your tests will be shorter and more readable.
- Should anything change about the login procedure of your app, you will only have to reflect that change in one place, not all the tests.
- In case of test failures, you will easily see whether it was the actual test that failed, or just the login procedure (perhaps indicating simply a wrong password, or the whole application being down).
As with tests, we suggest ending the module with an assertion, so you instantly know if the login itself failed instead of the test that comes after it.