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.
Example 'it' block
it "should load example.com" do
page.open("http://example.com")
page.wait_for_page_to_load(25)
end
I don't like my current solution and think there is a better way to accomplish this, but for now...
.
it "should load example.com" do
begin
page.open("http://example.com")
page.wait_for_page_to_load(25)
"wow".should == "cool"
rescue Exception => e
// code that responds to failed test
end
end
Why I don't like this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With