Take a look at Information Administration And Dependencies
That is usually the 2nd main problem in automation. As soon as the group is satisfied of the worth of automated exams the subsequent problem is information administration.
In all of the organizations that I’ve labored in, the identical challenges comes up – dependencies for authentication, authorization and the particular artifacts wanted within the product, similar to account, web site, group, and so on. It’s solved in a different way for guide testing the place both the person registers every time as a part of the testing or the group establishes check accounts with entry often arrange as soon as after which used repeatedly going ahead.
Automation for check circumstances which have dependencies similar to authentication, authorization and different artifacts creation require new approaches which can be solely related to automation.
Thus the method for testing ‘after a typical login’ – or different ‘setup’ actions are advanced for automation.
Listed here are a few of the choices:
- Mocking and stubbing for the authentication or code that depends on it
- Scripts that do logins utilizing the UI
- Everlasting accounts used for check automation circumstances solely
- Accounts which can be created by an API particularly for testing
My advice is mocking and stubbing and/or the flexibility to create or use accounts particularly for automation. This may be categorized as gray field testing, the place you do not know the internals however you do have acceptable hooks for testing functions.
One side it would be best to grasp just isn’t solely creating, however deleting the artifacts as soon as the particular check has run. With out this automation you’ll quickly create hundreds of artifacts and that may develop into an issue. Much like artifacts creation, you may wish to do that by API calls and never by utilizing the UI which is gradual and unreliable.
My least favored possibility is creating the account by the UI, e.g. the login exams. UI automation is gradual, typically does not scale and at all times has components of flakiness and thus needs to be averted as a dependency for operating different automation. It’ll often work OK for the primary couple of check circumstances however then as you scale testing with extra circumstances it usually breaks down with flaky failures and gradual suggestions from the check suite.