Selenium setup/teardown best practices- returning data to orginal state -


    {         assert.that(_edituserpage.state.selectedtext, is.equalto("illinois"));         _edituserpage.state.selectedtext = "new york";         assert.that(_edituserpage.state.selectedtext, is.equalto("new york"));         _edituserpage.savechanges();         assert.that(_edituserpage.state.selectedtext, is.equalto("new york"));      } 

in example above, changing user's state illinois new york; question is: should change state orignal value of illiois @ end of test?

i have 20 other independent tests in same file , wanted know best practice returning data original state. using setup/teardown entire test suite, not within each individual test.

best practice far did see this:

  1. the test had 1 test data input (excel sheet)
  2. each run add prefix data (e.g. name pavel => test01_pavel)
  3. test did verify such data not exist in system
  4. test created testing data according input , verified data present
  5. test deleted testing data , verified data deleted.

but best answer "it depends." i, personally, not deleting test data system because

  • test environment strictly divided prod one
  • test data can useful later on during performance testing (e.g. downloading list of users system)

so real question should ask is:

  • does deleting test data @ end bring you?
  • and vice versa: happens if test data remain in system?

btw, if feel "the application break if there nonsense/dummy data in it" should test scenario. imagine service become popular on night (charlie sheen tweeting using page:) ) , millions of users register themselves.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -