Selenium Best Practice: One Long Test or Several Successively Long Tests? -


in selenium find myself making tests ...

// test #1 login();  // test #2 login(); gotopagefoo();  // test #3 login(); gotopagefoo(); dosomethingonpagefoo();  // ... 

in unit testing environment, you'd want separate tests each piece (ie. 1 login, 1 gotopagefoo, etc.) when test fails know went wrong. however, i'm not sure practice in selenium.

it seems result in lot of redundant tests, , "know went wrong" problem doesn't seem bad since it's clear went wrong looking @ step test on. , takes longer run bunch of "build up" tests takes run last ("built up") test.

am missing anything, or should have single long test , skip shorter ones building it?

i have built large test suite in selenium using lot of smaller tests (like in code example). did same reasons did. know "what went wrong" on test failure.

this common best practice standard unit tests, if had on again, go second approach. larger built-up tests smaller tests when needed.

the reason selenium tests take order of magnitude longer standard unit tests run, particularly on longer scenarios. makes whole test suite unbearably long of time being spent on running same redundant code on , on again.

when error, in step repeated @ beginning of 20+ different tests, not know got same error 20+ times. test runner runs test out of order first error isn't on first incremental test of "build-up" series end looking @ first test failure , it's error message see failure came from. same thing if had used larger "built-up" tests.


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -