lib/scoutui/eyes/eye_scout.rb in scoutui-2.0.3.8.pre vs lib/scoutui/eyes/eye_scout.rb in scoutui-2.0.3.9.pre

- old
+ new

@@ -141,19 +141,32 @@ eyes().abort_if_not_closed if !eyes().nil? end def check_window(tag, region=nil) - Scoutui::Logger::LogMgr.instance.info __FILE__ + (__LINE__).to_s + " check_window(#{tag.to_s})" if Scoutui::Utils::TestUtils.instance.isDebug? + Scoutui::Logger::LogMgr.instance.info __FILE__ + (__LINE__).to_s + " check_window(#{tag.to_s}, #{region})" if Scoutui::Utils::TestUtils.instance.isDebug? return if !Scoutui::Utils::TestUtils.instance.eyesEnabled? if region.nil? + Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " check_window(#{tag.to_s})" eyes().check_window(tag.to_s) else + + Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " check_window.fullshot" f = eyes().force_fullpage_screenshot - eyes().check_region(:xpath, region, tag) + + if region.match(/^css\s*\=\s*/) + _css = region.gsub(/^css\s*\=\s*/,"").to_s + + Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " snapshot(region.css) : #{_css}" + eyes().check_region(:css, _css, tag) + else + Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + "check_window(:xpath, #{region}, #{tag})" + eyes().check_region(:xpath, region, tag) + end + eyes().force_fullpage_screenshot = f end end @@ -191,10 +204,11 @@ browserType = Scoutui::Base::UserVars.instance.getBrowserType() viewport_size = Scoutui::Base::UserVars.instance.getViewPort() puts __FILE__ + (__LINE__).to_s + " browserType => #{browserType}" + puts __FILE__ + (__LINE__).to_s + " viewport : #{viewport_size}" Testmgr::TestReport.instance.setDescription('ScoutUI Test') Testmgr::TestReport.instance.setEnvironment(:qa, Scoutui::Utils::TestUtils.instance.getHost()) Testmgr::TestReport.instance.setHost(Scoutui::Base::UserVars.instance.get(:host)) @@ -236,10 +250,10 @@ # viewport_size: {width: 800, height: 600}, driver: @strategy.getDriver()) end rescue => ex - Scoutui::Logger::LogMgr.instance.info ex.backtrace + Scoutui::Logger::LogMgr.instance.warn ex.backtrace end end \ No newline at end of file