Integration Testing automation - checking DB values

孤者浪人 提交于 2019-12-25 01:38:36

问题


I'm dealing now with a problem during creating automation of integration test.

I would like to:

  1. input data via selenium RC
  2. check if values are correct in DB after import.

I've got problem with logic of those tests. Now I do it as it follows: in one test I generate random data (first name, last name, etc of the person). Then, by simple select from DB I obtain unique person_id key (I assumed that if first and last name are both 8 characters long, random generated strings I can treat them as unique) and then use this id in next queries.

Is this method correct? If not, how can I deal with it?


回答1:


What exactly is the purpose of this integration test?

If you're testing your DB adaptor layer, then is there any need to use the Web UI? You can exercise the adaptor directly.

If you're testing the Web UI is there any need to actually store data in a database? You can check the values using a mock (or some other sort of test double).

If you're doing an end-2-end skim test, is it necessary to check the actual data values (over and above the success of the actual interaction)? And if the answer is yes, maybe the test should be along the lines of:

Given I have registered as "Random Person"
When I retrieve my details
Then my name is displayed correctly.


来源:https://stackoverflow.com/questions/11932459/integration-testing-automation-checking-db-values

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!