I'm no Ruby guru so please can I get some help: I want to add whatever code is needed so that there is an option where the following case statement will execute every case. Basically if the user declares a 'browser' name at command line then Cucumber selenium tests will be run against a certain platform/browser. I want it so that if they declare 'all', or if they declare nothing (else) then every case will be executed.
Thanks
case ENV['BROWSER'] when 'safari' $browser = Selenium::WebDriver.for :safari $browser_name = 'Safari' when 'mobile' $browser = Selenium::WebDriver.for :chrome $browser_name = 'Mobile' $browser.manage.window.resize_to(400, 650) else $browser = Selenium::WebDriver.for :chrome $browser_name = 'Chrome' end
$-prefixed variables like$browserare global and these are almost always trouble, so they're best avoided.