lundi 29 janvier 2018

Automated testing - Best practice - getting test data before test suite

I have a question about getting test data for automated testing, here is my problem: I need to prepare automated testing scripts for a clothes shop. And I need to know what is the best practice for getting test data needed for the following scenario:

Scenario description: Checking if a user can correctly add a product to the basket.

Given I am on the "WOMEN'S DRESSES" page

When I add "XXX" product to the bag

Then I can see "XXX" product displayed in the basket

My question is: how to ensure that the "XXX" product is always available and what is the best practice for this? Do I have to always connect to the env database and check if the "XXX" product is available and if not then insert it into DB?

Or maybe should modify a little BDD scenario and get the list of currently available products on the "WOMEN'S DRESSES" page, chose any product, add it to the bag and check if it is correctly added to the basket? ( but in that case what to do if there are no products available for the testing env ?)

I want to have efficient and strong automated tests.

Aucun commentaire:

Enregistrer un commentaire