lib/scoutui/commands/strategy.rb in scoutui-2.0.5.1.1.pre vs lib/scoutui/commands/strategy.rb in scoutui-2.0.5.2

- old
+ new

@@ -25,12 +25,19 @@ rc=true begin rc=Scoutui::Utils::TestUtils.instance.loadModel(f) rescue => ex rc=false + Scoutui::Logger::LogMgr.instance.fatal __FILE__ + (__LINE__).to_s + " loadModel(#{f}) => Failed" end + Testmgr::TestReport.instance.getReq("ScoutUI").testcase('Setup').add(rc, "Verify load model #{f}.") + + if !rc + Scoutui::Utils::TestUtils.instance.setState(:abort, "Failed to load model file #{f}.") + end + rc end def isHeadlessBrowser?(browserType) !browserType.match(/(phantom|phantomjs|ghost|ghostdriver)/i).nil? @@ -113,12 +120,13 @@ caps.platform = dut[:platform] caps[:name] = dut[:full_description] caps end - def initialize() + def initialize(opts=nil) + Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Scoutui::Commands.initialize(#{opts})" @profile=nil browserType = Scoutui::Base::UserVars.instance.getBrowserType() caps = Scoutui::Utils::TestUtils.instance.getCapabilities() ## @@ -294,12 +302,23 @@ Testmgr::TestReport.instance.getReq('Execution').tc('Status').add(_connected, "Connect to GhostDriver on #{selenium_server}", _tm[:end] - _tm[:start]) else Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Create WebDriver: #{browserType.to_s}" - @drv=Selenium::WebDriver.for browserType.to_sym, :profile => @profile + + if @profile.nil? + @drv=Selenium::WebDriver.for browserType.to_sym + else + @drv=Selenium::WebDriver.for browserType.to_sym, :profile => @profile + end + setViewport() + end + + + if opts.is_a?(Hash) && opts.has_key?(:loadModel).nil? + loadModel(opts[:loadModel]) end end end