These are chat archives for cucumber/cucumber-ruby

22nd
Sep 2016
blueice349
@blueice349
Sep 22 2016 13:50
Anyone know a good way to close session after running test and restart session where or left off
So I have 2000 features to run. I wanna close after 1000 then start the driver again and finish the other 1000
blueice349
@blueice349
Sep 22 2016 18:10
Trying to close the driver and start the driver after x test has run my code below works, but the at_exit breaks and does not close the driver any thoughts?
hooks.rb
Before do
puts '***BEFORE test count: ' + $test_count.to_s
    if ( $test_count == 3 ) 
        $test_count = 0
        $driver.close()
        $driver = Selenium::WebDriver.for( :"#{$browser_type}" )
        $driver.manage().window().maximize()
    end        
end

After  do
    $test_count += 1
    puts '***After test count: ' + $test_count.to_s
end

at_exit do

    begin
        $driver.close()
    rescue Exception => e
         puts e.message
         Process.exit( 0 )
          end
end
env.rb
   require 'rubygems'
    require 'selenium-cucumber'
$browser_type    = ENV[ 'BROWSER' ]  || 'chrome'
    $driver = Selenium::WebDriver.for( :"#{$browser_type}" )
    $driver.manage().window().maximize()
    $lastTestFailed  = false
    $default_account = ENV[ 'SITE' ]
    $setup           = ENV[ 'SETUP_FORMS' ]
    $test_count      = 0
blueice349
@blueice349
Sep 22 2016 18:20
When it runs the at_exit I get Connection refused - connect(2)