@stateful
for tests that use cookies
October 10, 2013I have a test suite that currently takes 4:30 to run, and I guessed that it's the browser slowing it down. My tests use cucumber, so these hooks take care of stateful tests while cutting down time to run for every other test:
Before('@stateful') do |scenario|
kill_browser
end
After('@stateful') do |scenario|
kill_browser
end
def kill_browser
if $browser
BrowserHelper.close_browser
end
end
When tests that write cookies exist, they'll be tagged with @stateful
.