Take a look at Knowledge Administration And Dependencies
That is sometimes 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, akin to account, website, group, and so on. It’s solved in a different way for handbook testing the place both the consumer registers every time as a part of the testing or the group establishes take a look at accounts with entry often arrange as soon as after which used repeatedly going ahead.
Automation for take a look at instances which have dependencies akin 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 complicated for automation.
Listed here are among 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 take a look at automation instances solely
- Accounts which can be created via an API particularly for testing
My advice is mocking and stubbing and/or the power 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 facet it would be best to grasp just isn’t solely creating, however deleting the artifacts as soon as the particular take a look at has run. With out this automation you’ll quickly create 1000’s of artifacts and that can turn out to be an issue. Much like artifacts creation, you will wish to do that via API calls and never through the use of the UI which is gradual and unreliable.
My least favored choice is creating the account via the UI, e.g. the login exams. UI automation is gradual, typically would not scale and at all times has parts of flakiness and thus must be averted as a dependency for working different automation. It is going to steadily work OK for the primary couple of take a look at instances however then as you scale testing with extra instances it sometimes breaks down with flaky failures and gradual suggestions from the take a look at suite.