ruby - Keep Session open - Capybara/Cucumber -


i have feature requires in excess of 100 scenarios run, first step being log application. handled before hook , after hook log out. keeps tests independent of each other , me idea. in instance want log application, run scenarios , log out.

i seem having issue sessions after scenario has finished redirected about:blank , session killed.

i have tried

class capybara::selenium::driver < capybara::driver::base def reset! # use instance variable directly avoid starting browser reset session if @browser   begin     #@browser.manage.delete_all_cookies <= cookie deletion commented out!   rescue selenium::webdriver::error::unhandlederror => e     # delete_all_cookies fails when we've gone     # about:blank, rescue error , nothing     # instead.   end   @browser.navigate.to('about:blank') end end end 

but error below in console

expected not find xpath "/html/body/*", found ... 

so question how can finish scenario , click link in site , conduct next scenario

thanks

this example of when idea use background feature of cucumber.

if user log in inside background tag, logged in subsequent scenarios.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -