Only run selenium test if previous selenium test fails
- by Mike Grace
I have several 'it' blocks in my selenium test file (using Ruby and rspec) that test various portions of my web application. Each 'it' block stops executing and goes to the next 'it' block if any of the conditions or code fails.
Is there a way to run an 'it' block
only if the previous fails or call a
function to react to the failed test?
Is there a better way to accomplish what I am wanting to do that doesn't involve an 'it' block?
Example 'it' block
it "should load example.com" do
page.open("http://example.com")
page.wait_for_page_to_load(25)
end