Get help with testing, discuss unit testing strategies etc.


Post by satishkn »

Hi,

We have authored a few test scripts using siesta and now we are facing a dilemma.

In our test scripts, some data is hardcoded. However, whenever we have to run the test, we would have to change the data. For ex., user creation. Since it is unique I would have to change the data whenever I run the test. I am not in a situation to recreate the d/b from scratch each time the test is run nor to change the application to handle the same data each time test is run.

Now my question is, what would be the best way for me to externalize the data so I don't have to change the data in test scripts in 'n' number of places whenever I want to run the test cases.

I understand there are different approaches, but with siesta I would like to achieve the same in an effective way and so this question.

Thx & regards,
-satish

Post by mats »

You should definitely mock the database data. Involving the DB in a UI test will be a big pain. Just create a dummy response JS file in the filesystem which will represent a known, fixed new user etc.

Post Reply