scoutui 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/examples/capabilities/win10.chrome46.json +6 -0
- data/examples/ex1/test-example.sh +4 -4
- data/examples/ex1/test.config.json +1 -1
- data/examples/ex2/appmodel/common.json +51 -0
- data/examples/ex2/appmodel/page_model.json +106 -0
- data/examples/ex2/appmodel/register.model.json +42 -0
- data/examples/ex2/commands/commands.basic.appmodel.yml +8 -0
- data/examples/ex2/commands/commands.yml +115 -0
- data/examples/ex2/commands/ex1.yml +7 -0
- data/examples/ex2/commands/ex1c.yml +8 -0
- data/examples/ex2/commands/ex1d.yml +22 -0
- data/examples/ex2/commands/ex2.hover.yml +43 -0
- data/examples/ex2/commands/ex2.yml +24 -0
- data/examples/ex2/data.json +6 -0
- data/examples/ex2/test-configs/test.config.basic.json +12 -0
- data/examples/ex2/{test.config.json → test-configs/test.config.json} +8 -2
- data/examples/ex2/tests/run-test.sh +125 -0
- data/examples/ex2/tests/test-basic-appmodel.sh +14 -0
- data/examples/ex2/{test-example.sh → tests/test-example.sh} +3 -3
- data/examples/ex2/tests/test-example1a.sh +16 -0
- data/examples/ex2/tests/test-example1b.sh +13 -0
- data/examples/ex2/tests/test-example1c.sh +15 -0
- data/examples/ex2/tests/test-example1d.sh +15 -0
- data/examples/ex2/tests/test-example2.forms.eyes.sh +40 -0
- data/examples/ex2/tests/test-example2.hover.eyes.sh +40 -0
- data/examples/ex2/tests/test-example2.hover.sh +26 -0
- data/examples/ex2/tests/test-example2.sh +43 -0
- data/examples/ex2/tests/test-example3.sauce.sh +77 -0
- data/examples/ex2/tests/test-example3.sh +41 -0
- data/lib/scoutui/appmodel/q_model.rb +105 -0
- data/lib/scoutui/base/assertions.rb +570 -10
- data/lib/scoutui/base/q_applitools.rb +2 -2
- data/lib/scoutui/base/q_browser.rb +38 -5
- data/lib/scoutui/base/q_form.rb +7 -7
- data/lib/scoutui/base/test_scout.rb +2 -1
- data/lib/scoutui/base/user_vars.rb +29 -2
- data/lib/scoutui/base/visual_test_framework.rb +308 -24
- data/lib/scoutui/commands/click_object.rb +86 -13
- data/lib/scoutui/commands/commands.rb +20 -7
- data/lib/scoutui/commands/jsalert/action_jsalert.rb +1 -1
- data/lib/scoutui/commands/mouse_over.rb +94 -8
- data/lib/scoutui/commands/select_object.rb +1 -1
- data/lib/scoutui/commands/select_window.rb +43 -0
- data/lib/scoutui/commands/strategy.rb +40 -3
- data/lib/scoutui/commands/type.rb +99 -11
- data/lib/scoutui/commands/update_url.rb +1 -1
- data/lib/scoutui/commands/utils.rb +43 -5
- data/lib/scoutui/commands/verify_element.rb +38 -7
- data/lib/scoutui/eyes/eye_factory.rb +7 -1
- data/lib/scoutui/eyes/eye_scout.rb +20 -7
- data/lib/scoutui/utils/utils.rb +59 -1
- data/lib/scoutui/version.rb +1 -1
- data/scoutui.gemspec +5 -4
- metadata +77 -39
- data/examples/ex2/commands.yml +0 -35
- data/examples/ex2/page_model.json +0 -28
| @@ -4,36 +4,109 @@ module Scoutui::Commands | |
| 4 4 |  | 
| 5 5 | 
             
              class ClickObject < Command
         | 
| 6 6 |  | 
| 7 | 
            +
                def _whenClicked(page_elt)
         | 
| 8 | 
            +
             | 
| 9 | 
            +
                  if page_elt.is_a?(Hash) && page_elt.has_key?('when_clicked')
         | 
| 10 | 
            +
                    Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Verify #{page_elt['when_clicked']}"
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                    page_elt['when_clicked'].each do |_elt|
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                      _r = _elt.keys[0].to_s
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                      _pg = _elt[_r]
         | 
| 17 | 
            +
             | 
| 18 | 
            +
                      #    _c = Scoutui::Commands::VerifyElement.new("verifyelement(" + _elt + ")")
         | 
| 19 | 
            +
                      #    _c.execute(@drv)
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                      Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " _whenClicked -> assertions (#{_pg}, #{_r.to_s})"
         | 
| 22 | 
            +
             | 
| 23 | 
            +
             | 
| 24 | 
            +
                      if _pg.is_a?(Array)
         | 
| 25 | 
            +
                        _pg.each do |_pg2|
         | 
| 26 | 
            +
                          isVisible=Scoutui::Base::Assertions.instance.isVisible(@drv, _pg2, _r)
         | 
| 27 | 
            +
                        end
         | 
| 28 | 
            +
                      elsif _pg.is_a?(String)
         | 
| 29 | 
            +
                        isVisible=Scoutui::Base::Assertions.instance.isVisible(@drv, _pg, _r)
         | 
| 30 | 
            +
                      else
         | 
| 31 | 
            +
                        puts __FILE__ + (__LINE__).to_s + " => #{_pg}"
         | 
| 32 | 
            +
                      end
         | 
| 33 | 
            +
             | 
| 34 | 
            +
            #         Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " IsVisible #{isVisible} - PAUSE"; gets
         | 
| 35 | 
            +
             | 
| 36 | 
            +
                    end
         | 
| 37 | 
            +
             | 
| 38 | 
            +
                  end
         | 
| 39 | 
            +
             | 
| 40 | 
            +
                end
         | 
| 7 41 |  | 
| 8 42 | 
             
                def execute(drv)
         | 
| 9 43 | 
             
                  @drv=drv if !drv.nil?
         | 
| 10 44 |  | 
| 11 | 
            -
                   | 
| 12 | 
            -
                   | 
| 45 | 
            +
                  _req = Scoutui::Utils::TestUtils.instance.getReq()
         | 
| 46 | 
            +
                  _locator = @cmd.match(/click\s*\((.*)\)/)[1].to_s.strip
         | 
| 47 | 
            +
                  Scoutui::Logger::LogMgr.instance.command.info __FILE__ + (__LINE__).to_s + " clickObject => #{_locator}"
         | 
| 48 | 
            +
             | 
| 49 | 
            +
                  # _vars = _locator.scan(/(\$\{.*?\})/)
         | 
| 50 | 
            +
                  # _vars.each do | _v|
         | 
| 51 | 
            +
                  #   if _v.length==1
         | 
| 52 | 
            +
                  #
         | 
| 53 | 
            +
                  #     _u = Scoutui::Base::UserVars.instance.get(_v[0].to_s)
         | 
| 54 | 
            +
                  #     puts __FILE__ + (__LINE__).to_s + " Normalize(#{_v}) => #{_u}"
         | 
| 55 | 
            +
                  #
         | 
| 56 | 
            +
                  #     _locator.gsub!(_v[0].to_s, _u)
         | 
| 57 | 
            +
                  #   end
         | 
| 58 | 
            +
                  #
         | 
| 59 | 
            +
                  # end
         | 
| 13 60 |  | 
| 14 | 
            -
                  _xpath = Scoutui::Base::UserVars.instance.get(_xpath)
         | 
| 15 61 |  | 
| 16 | 
            -
                   | 
| 62 | 
            +
                  # _locator = Scoutui::Base::UserVars.instance.get(_locator)
         | 
| 63 | 
            +
                  _locator = Scoutui::Base::UserVars.instance.normalize(_locator)
         | 
| 64 | 
            +
             | 
| 65 | 
            +
                  Scoutui::Logger::LogMgr.instance.command.info __FILE__ + (__LINE__).to_s + " | translate : #{_locator}" if Scoutui::Utils::TestUtils.instance.isDebug?
         | 
| 17 66 |  | 
| 18 67 | 
             
                  _clicked=false
         | 
| 19 68 |  | 
| 20 69 | 
             
                  begin
         | 
| 21 | 
            -
                    obj = Scoutui::Base::QBrowser.getObject(@drv,  | 
| 70 | 
            +
                    obj = Scoutui::Base::QBrowser.getObject(@drv, _locator, Scoutui::Commands::Utils.instance.getTimeout)
         | 
| 71 | 
            +
             | 
| 72 | 
            +
             | 
| 22 73 |  | 
| 23 74 | 
             
                    if obj
         | 
| 24 | 
            -
             | 
| 25 | 
            -
                       | 
| 75 | 
            +
             | 
| 76 | 
            +
                      # Refactor in qbrowser
         | 
| 77 | 
            +
             | 
| 78 | 
            +
                      wait = Selenium::WebDriver::Wait.new(:timeout =>  Scoutui::Commands::Utils.instance.getTimeout)
         | 
| 79 | 
            +
             | 
| 80 | 
            +
                      isDisplayed=false
         | 
| 81 | 
            +
                      isDisplayed = wait.until {
         | 
| 82 | 
            +
                        true if obj.displayed?
         | 
| 83 | 
            +
                      }
         | 
| 84 | 
            +
             | 
| 85 | 
            +
                      if isDisplayed
         | 
| 86 | 
            +
                        obj.click
         | 
| 87 | 
            +
                        _clicked=true
         | 
| 88 | 
            +
             | 
| 89 | 
            +
                        page_elt = Scoutui::Utils::TestUtils.instance.getPageElement(_locator)
         | 
| 90 | 
            +
             | 
| 91 | 
            +
                        Scoutui::Logger::LogMgr.instance.debug "PageElement(#{_locator}) => #{page_elt}"
         | 
| 92 | 
            +
             | 
| 93 | 
            +
                        _whenClicked(page_elt)
         | 
| 94 | 
            +
                      else
         | 
| 95 | 
            +
                        Scoutui::Logger::LogMgr.instance.warn __FILE__ + (__LINE__).to_s + " Unable to click object that is not displayed."
         | 
| 96 | 
            +
                      end
         | 
| 97 | 
            +
             | 
| 26 98 | 
             
                    end
         | 
| 27 99 |  | 
| 28 | 
            -
                  rescue
         | 
| 29 | 
            -
                     | 
| 100 | 
            +
                  rescue => ex
         | 
| 101 | 
            +
                    Scoutui::Logger::LogMgr.instance.warn "Error during processing: #{$!}"
         | 
| 102 | 
            +
                    Scoutui::Logger::LogMgr.instance.warn "Backtrace:\n\t#{ex.backtrace.join("\n\t")}"
         | 
| 30 103 | 
             
                  end
         | 
| 31 104 |  | 
| 32 | 
            -
                  Scoutui::Logger::LogMgr.instance.asserts.info "Verify object to click exists #{ | 
| 33 | 
            -
                  Scoutui::Logger::LogMgr.instance.asserts.info "Verify clicked #{ | 
| 105 | 
            +
                  Scoutui::Logger::LogMgr.instance.asserts.info "Verify object to click exists #{_locator} : #{obj.class.to_s} - #{!obj.nil?.to_s}"
         | 
| 106 | 
            +
                  Scoutui::Logger::LogMgr.instance.asserts.info "Verify clicked #{_locator} - #{_clicked.to_s}"
         | 
| 34 107 |  | 
| 35 | 
            -
                  Testmgr::TestReport.instance.getReq( | 
| 36 | 
            -
                  Testmgr::TestReport.instance.getReq( | 
| 108 | 
            +
                  Testmgr::TestReport.instance.getReq(_req).testcase('click').add(!obj.nil?, "Verify object to click exists #{_locator} : #{obj.class.to_s}")
         | 
| 109 | 
            +
                  Testmgr::TestReport.instance.getReq(_req).testcase('click').add(_clicked, "Verify clicked #{_locator}")
         | 
| 37 110 |  | 
| 38 111 | 
             
                  setResult(_clicked)
         | 
| 39 112 | 
             
                end
         | 
| @@ -6,7 +6,7 @@ module Scoutui::Commands | |
| 6 6 |  | 
| 7 7 |  | 
| 8 8 | 
             
              def self.processCommands(commandList, my_driver)
         | 
| 9 | 
            -
             | 
| 9 | 
            +
                Scoutui::Logger::LogMgr.instance.debug " enter [processCommands]"
         | 
| 10 10 | 
             
                commandList.each do |cmd|
         | 
| 11 11 | 
             
                  begin
         | 
| 12 12 | 
             
                    rc=processCommand(cmd[:command], cmd[:e], my_driver)
         | 
| @@ -14,35 +14,45 @@ module Scoutui::Commands | |
| 14 14 | 
             
                    Scoutui::Logger::LogMgr.instance.debug "Error during processing: #{$!}"
         | 
| 15 15 | 
             
                    Scoutui::Logger::LogMgr.instance.debug "Backtrace:\n\t#{e.backtrace.join("\n\t")}"
         | 
| 16 16 | 
             
                  end
         | 
| 17 | 
            -
             | 
| 18 17 | 
             
                end
         | 
| 19 18 |  | 
| 19 | 
            +
                Scoutui::Logger::LogMgr.instance.debug " exit [processCommands]"
         | 
| 20 20 | 
             
              end
         | 
| 21 21 |  | 
| 22 | 
            +
             | 
| 22 23 | 
             
              def self.processCommand(_action, e, my_driver)
         | 
| 23 | 
            -
                Scoutui::Logger::LogMgr.instance.commands.debug __FILE__ + (__LINE__).to_s + "  | 
| 24 | 
            +
                Scoutui::Logger::LogMgr.instance.commands.debug __FILE__ + (__LINE__).to_s + " enter [processCommand(#{_action})"
         | 
| 24 25 |  | 
| 25 26 | 
             
                _aborted=false
         | 
| 26 27 | 
             
                _cmd=nil
         | 
| 27 | 
            -
                _totalWindows = my_driver.window_handles.length
         | 
| 28 28 |  | 
| 29 29 | 
             
                rc=true
         | 
| 30 30 | 
             
                _req = Scoutui::Utils::TestUtils.instance.getReq()
         | 
| 31 31 |  | 
| 32 32 | 
             
                begin
         | 
| 33 33 |  | 
| 34 | 
            +
                  _totalWindows = my_driver.window_handles.length
         | 
| 35 | 
            +
                  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Current Total Windows : #{_totalWindows}"
         | 
| 36 | 
            +
             | 
| 34 37 | 
             
                  _c=nil
         | 
| 35 38 |  | 
| 36 39 | 
             
                  if Scoutui::Commands::Utils.instance.isPause?(_action)
         | 
| 37 40 | 
             
                    _cmd='pause'
         | 
| 38 41 | 
             
                    _c = Scoutui::Commands::Pause.new(nil)
         | 
| 39 42 | 
             
                    _c.execute(e);
         | 
| 40 | 
            -
             | 
| 43 | 
            +
                  elsif Scoutui::Commands::Utils.instance.isSelectWindow?(_action)
         | 
| 44 | 
            +
                    _cmd='SelectWindow'
         | 
| 45 | 
            +
                    _c = Scoutui::Commands::SelectWindow.new(_action)
         | 
| 46 | 
            +
                    _c.execute(my_driver)
         | 
| 41 47 | 
             
                  elsif Scoutui::Commands::Utils.instance.isClick?(_action)
         | 
| 42 48 | 
             
                    _cmd='Click'
         | 
| 43 49 | 
             
                    _c = Scoutui::Commands::ClickObject.new(_action)
         | 
| 44 50 | 
             
                    _c.execute(my_driver)
         | 
| 45 51 |  | 
| 52 | 
            +
                    if e["page"].has_key?('then')
         | 
| 53 | 
            +
                      Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " then => #{e['page']['then]']}"
         | 
| 54 | 
            +
                    end
         | 
| 55 | 
            +
             | 
| 46 56 | 
             
                  elsif Scoutui::Commands::Utils.instance.isExistsAlert?(_action)
         | 
| 47 57 | 
             
                    _cmd='ExistsAlert'
         | 
| 48 58 | 
             
                    _c = Scoutui::Commands::JsAlert::ExistsAlert.new(_action)
         | 
| @@ -122,10 +132,13 @@ module Scoutui::Commands | |
| 122 132 | 
             
                end
         | 
| 123 133 |  | 
| 124 134 | 
             
                if my_driver.window_handles.length > _totalWindows
         | 
| 125 | 
            -
                  Scoutui::Logger::LogMgr.instance.info " New Window generated"
         | 
| 135 | 
            +
                  Scoutui::Logger::LogMgr.instance.info " New Window generated from command #{_cmd}."
         | 
| 126 136 | 
             
                end
         | 
| 127 137 |  | 
| 128 | 
            -
                Testmgr::TestReport.instance.getReq(_req).get_child(_cmd.downcase).add(!_aborted, "Verify command did not abort")
         | 
| 138 | 
            +
                Testmgr::TestReport.instance.getReq(_req).get_child(_cmd.downcase).add(!_aborted, "Verify command #{_cmd} did not abort")
         | 
| 139 | 
            +
             | 
| 140 | 
            +
                Scoutui::Logger::LogMgr.instance.commands.debug __FILE__ + (__LINE__).to_s + " exit [processCommand(#{_action})"
         | 
| 141 | 
            +
             | 
| 129 142 | 
             
                _c
         | 
| 130 143 | 
             
              end
         | 
| 131 144 |  | 
| @@ -15,7 +15,7 @@ module Scoutui::Commands::JsAlert | |
| 15 15 |  | 
| 16 16 | 
             
                  _action=@cmd.match(/(exist[s]*_*alert|existAlert|existsAlert|existsJsAlert|existsJsConfirm|existsJsPrompt)\s*\((.*)\)/i)[2].to_s.strip
         | 
| 17 17 |  | 
| 18 | 
            -
                  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " ExistsAlert(#{_action})" | 
| 18 | 
            +
                  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " ExistsAlert(#{_action})"
         | 
| 19 19 |  | 
| 20 20 | 
             
                  alert=nil
         | 
| 21 21 |  | 
| @@ -3,24 +3,110 @@ module Scoutui::Commands | |
| 3 3 |  | 
| 4 4 | 
             
              class MouseOver < Command
         | 
| 5 5 |  | 
| 6 | 
            +
             | 
| 7 | 
            +
                def _whenHovered(page_elt)
         | 
| 8 | 
            +
             | 
| 9 | 
            +
                  if page_elt.is_a?(Hash) && page_elt.has_key?('when_hovered')
         | 
| 10 | 
            +
                    Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Verify #{page_elt['when_hovered']}"
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                    page_elt['when_hovered'].each do |_elt|
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                      _r = _elt.keys[0].to_s
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                      _pg = _elt[_r]
         | 
| 17 | 
            +
             | 
| 18 | 
            +
                      #    _c = Scoutui::Commands::VerifyElement.new("verifyelement(" + _elt + ")")
         | 
| 19 | 
            +
                      #    _c.execute(@drv)
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                      Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " processPageElement(#{_pg})"
         | 
| 22 | 
            +
             | 
| 23 | 
            +
             | 
| 24 | 
            +
                      if _pg.is_a?(Array)
         | 
| 25 | 
            +
                        _pg.each do |_pg2|
         | 
| 26 | 
            +
                          isVisible=Scoutui::Base::Assertions.instance.isVisible(@drv, _pg2, _r)
         | 
| 27 | 
            +
                        end
         | 
| 28 | 
            +
                      elsif _pg.is_a?(String)
         | 
| 29 | 
            +
                        isVisible=Scoutui::Base::Assertions.instance.isVisible(@drv, _pg, _r)
         | 
| 30 | 
            +
                      else
         | 
| 31 | 
            +
                        puts __FILE__ + (__LINE__).to_s + " => #{_pg}"
         | 
| 32 | 
            +
                      end
         | 
| 33 | 
            +
             | 
| 34 | 
            +
              #       Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " IsVisible #{isVisible} - PAUSE"; gets
         | 
| 35 | 
            +
             | 
| 36 | 
            +
                    end
         | 
| 37 | 
            +
             | 
| 38 | 
            +
                  end
         | 
| 39 | 
            +
             | 
| 40 | 
            +
                end
         | 
| 41 | 
            +
             | 
| 42 | 
            +
             | 
| 6 43 | 
             
                def execute(drv=nil)
         | 
| 7 44 | 
             
                  _rc=false
         | 
| 8 45 | 
             
                  _req = Scoutui::Utils::TestUtils.instance.getReq()
         | 
| 9 46 |  | 
| 47 | 
            +
                  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " MouseOver.execute(#{@cmd})"
         | 
| 48 | 
            +
             | 
| 10 49 | 
             
                  @drv=drv if !drv.nil?
         | 
| 11 50 |  | 
| 12 51 | 
             
                  begin
         | 
| 13 | 
            -
                     | 
| 14 | 
            -
                    obj = Scoutui::Base::QBrowser.getObject(@drv,  | 
| 15 | 
            -
             | 
| 16 | 
            -
                     | 
| 17 | 
            -
             | 
| 18 | 
            -
             | 
| 52 | 
            +
                    _locator = @cmd.match(/mouseover\s*\((.*)\)/)[1].to_s.strip
         | 
| 53 | 
            +
                    obj = Scoutui::Base::QBrowser.getObject(@drv, _locator, Scoutui::Commands::Utils.instance.getTimeout)
         | 
| 54 | 
            +
             | 
| 55 | 
            +
                    if !obj.nil?
         | 
| 56 | 
            +
                      @drv.action.move_to(obj).perform
         | 
| 57 | 
            +
                      _rc=true
         | 
| 58 | 
            +
             | 
| 59 | 
            +
             | 
| 60 | 
            +
                      page_elt = Scoutui::Utils::TestUtils.instance.getPageElement(_locator)
         | 
| 61 | 
            +
                      Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " PageElement(#{_locator}) => #{page_elt}"
         | 
| 62 | 
            +
                      _whenHovered(page_elt)
         | 
| 63 | 
            +
             | 
| 64 | 
            +
             | 
| 65 | 
            +
                      #------------
         | 
| 66 | 
            +
             | 
| 67 | 
            +
                      appModel = Scoutui::Utils::TestUtils.instance.getAppModel()
         | 
| 68 | 
            +
             | 
| 69 | 
            +
                      triggers = appModel.itemize('visible_when', 'mouseover', _locator)
         | 
| 70 | 
            +
                      Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " triggers => #{triggers}"
         | 
| 71 | 
            +
             | 
| 72 | 
            +
                      if !(triggers.nil? || triggers.empty?)
         | 
| 73 | 
            +
             | 
| 74 | 
            +
                        triggers.each do |_pageObj|
         | 
| 75 | 
            +
                          _tObj=nil
         | 
| 76 | 
            +
             | 
| 77 | 
            +
                          if !_pageObj.match(/^page\([\w\d]+\)/).nil?
         | 
| 78 | 
            +
                  #         _tObj = Scoutui::Base::VisualTestFramework.processPageElement(@drv, 'peter', _pageObj)
         | 
| 79 | 
            +
             | 
| 80 | 
            +
                            _tLocator = Scoutui::Utils::TestUtils.instance.getPageElement(_pageObj)
         | 
| 81 | 
            +
                            _tObj = Scoutui::Base::QBrowser.getFirstObject(@drv, _tLocator['locator'])
         | 
| 82 | 
            +
             | 
| 83 | 
            +
                          else
         | 
| 84 | 
            +
                            _tObj = Scoutui::Base::QBrowser.getFirstObject(@drv, _pageObj, Scoutui::Commands::Utils.instance.getTimeout())
         | 
| 85 | 
            +
                          end
         | 
| 86 | 
            +
             | 
| 87 | 
            +
                          Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " HIT #{_pageObj} => #{!_tObj.nil?}"
         | 
| 88 | 
            +
             | 
| 89 | 
            +
                          Scoutui::Logger::LogMgr.instance.asserts.info "Verify #{_pageObj} is visible when mouseover #{_locator} - #{!_tObj.nil?.to_s}"
         | 
| 90 | 
            +
                          Testmgr::TestReport.instance.getReq(_req).get_child('mouseover').add(!_tObj.nil?, "Verify #{_pageObj} is visible when mouseover #{_locator}")
         | 
| 91 | 
            +
                        end
         | 
| 92 | 
            +
             | 
| 93 | 
            +
                      end
         | 
| 94 | 
            +
             | 
| 95 | 
            +
             | 
| 96 | 
            +
             | 
| 97 | 
            +
                    end
         | 
| 98 | 
            +
             | 
| 99 | 
            +
                  rescue => ex
         | 
| 100 | 
            +
                    Scoutui::Logger::LogMgr.instance.warn "Error during processing: #{$!}"
         | 
| 101 | 
            +
                    Scoutui::Logger::LogMgr.instance.warn "Backtrace:\n\t#{ex.backtrace.join("\n\t")}"
         | 
| 19 102 | 
             
                  end
         | 
| 20 103 |  | 
| 21 | 
            -
                  Testmgr::TestReport.instance.getReq(_req).testcase('mouseover').add(!obj.nil?, "Verify object #{ | 
| 22 | 
            -
                  Testmgr::TestReport.instance.getReq(_req).testcase('mousseover').add(_rc, "Verify mouseover #{_rc}")
         | 
| 104 | 
            +
                  Testmgr::TestReport.instance.getReq(_req).testcase('mouseover').add(!obj.nil?, "Verify object #{_locator} to mouseover exists : #{obj.class.to_s}")
         | 
| 105 | 
            +
                  Testmgr::TestReport.instance.getReq(_req).testcase('mousseover').add(_rc, "Verify mouseover #{_rc} performed for #{_locator}")
         | 
| 23 106 | 
             
                  setResult(_rc)
         | 
| 107 | 
            +
             | 
| 108 | 
            +
             | 
| 109 | 
            +
             | 
| 24 110 | 
             
                end
         | 
| 25 111 |  | 
| 26 112 |  | 
| @@ -23,7 +23,7 @@ module Scoutui::Commands | |
| 23 23 |  | 
| 24 24 | 
             
                      Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + "Process SELECT #{_val} into  #{_xpath}"  if Scoutui::Utils::TestUtils.instance.isDebug?
         | 
| 25 25 |  | 
| 26 | 
            -
                      obj = Scoutui::Base::QBrowser.getObject(@drv, _xpath)
         | 
| 26 | 
            +
                      obj = Scoutui::Base::QBrowser.getObject(@drv, _xpath, Scoutui::Commands::Utils.instance.getTimeout)
         | 
| 27 27 |  | 
| 28 28 | 
             
                      if !obj.nil? && obj.tag_name.downcase.match(/(select)/)
         | 
| 29 29 |  | 
| @@ -0,0 +1,43 @@ | |
| 1 | 
            +
             | 
| 2 | 
            +
            module Scoutui::Commands
         | 
| 3 | 
            +
             | 
| 4 | 
            +
              class SelectWindow < Command
         | 
| 5 | 
            +
             | 
| 6 | 
            +
                def execute(drv=nil)
         | 
| 7 | 
            +
                  _rc=false
         | 
| 8 | 
            +
                  _req = Scoutui::Utils::TestUtils.instance.getReq()
         | 
| 9 | 
            +
                  _window_id=nil
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                  @drv=drv if !drv.nil?
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                  puts __FILE__ + (__LINE__).to_s + " SELECT WINDOW +++++++++++++++"
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                  begin
         | 
| 16 | 
            +
                    _window_id = @cmd.match(/select_window\s*\((.*)\)/)[1].to_s.strip
         | 
| 17 | 
            +
             | 
| 18 | 
            +
                    puts __FILE__ + (__LINE__).to_s + " ==> WindowID : #{_window_id}"
         | 
| 19 | 
            +
                    puts __FILE__ + (__LINE__).to_s + " ==> handles  : #{@drv.window_handles.length.to_s}"
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                    i=0
         | 
| 22 | 
            +
                    @drv.window_handles.each do |_w|
         | 
| 23 | 
            +
                      puts __FILE__ + (__LINE__).to_s + "#{i}. #{_w.class.to_s}"
         | 
| 24 | 
            +
                      @drv.switch_to.window(_w)
         | 
| 25 | 
            +
                      puts __FILE__ + (__LINE__).to_s + " Title : #{@drv.title.to_s}"
         | 
| 26 | 
            +
                    end
         | 
| 27 | 
            +
             | 
| 28 | 
            +
                    _rc=true
         | 
| 29 | 
            +
                  rescue => ex
         | 
| 30 | 
            +
                    Scoutui::Logger::LogMgr.instance.debug "Error during processing: #{$!}"
         | 
| 31 | 
            +
                    Scoutui::Logger::LogMgr.instance.debug "Backtrace:\n\t#{ex.backtrace.join("\n\t")}"
         | 
| 32 | 
            +
                  end
         | 
| 33 | 
            +
             | 
| 34 | 
            +
                  Testmgr::TestReport.instance.getReq(_req).testcase('select_window').add(_rc, "Verify select_window #{_window_id} command passed #{_rc}")
         | 
| 35 | 
            +
                  setResult(_rc)
         | 
| 36 | 
            +
                end
         | 
| 37 | 
            +
             | 
| 38 | 
            +
             | 
| 39 | 
            +
             | 
| 40 | 
            +
              end
         | 
| 41 | 
            +
             | 
| 42 | 
            +
             | 
| 43 | 
            +
            end
         | 
| @@ -1,5 +1,5 @@ | |
| 1 1 | 
             
            require 'testmgr'
         | 
| 2 | 
            -
             | 
| 2 | 
            +
            require 'sauce_whisk'
         | 
| 3 3 |  | 
| 4 4 | 
             
            module Scoutui::Commands
         | 
| 5 5 |  | 
| @@ -24,6 +24,7 @@ module Scoutui::Commands | |
| 24 24 | 
             
                end
         | 
| 25 25 |  | 
| 26 26 | 
             
                def navigate(url)
         | 
| 27 | 
            +
                  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " [enter]:navigate(#{url})"
         | 
| 27 28 | 
             
                  rc = false
         | 
| 28 29 | 
             
                  begin
         | 
| 29 30 | 
             
                    processCommand('navigate(' + url + ')', nil)
         | 
| @@ -38,9 +39,37 @@ module Scoutui::Commands | |
| 38 39 |  | 
| 39 40 | 
             
                def report()
         | 
| 40 41 | 
             
                  Testmgr::TestReport.instance.report()
         | 
| 42 | 
            +
            #      Testmgr::TestReport.instance.generateReport()
         | 
| 41 43 | 
             
                end
         | 
| 42 44 |  | 
| 43 45 | 
             
                def quit()
         | 
| 46 | 
            +
             | 
| 47 | 
            +
                  begin
         | 
| 48 | 
            +
                    Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " quit()"
         | 
| 49 | 
            +
             | 
| 50 | 
            +
             | 
| 51 | 
            +
                    Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " ===== Page Coverage ====="
         | 
| 52 | 
            +
                    Scoutui::Utils::TestUtils.instance.getPageCoverage().each do |_c|
         | 
| 53 | 
            +
                      Scoutui::Logger::LogMgr.instance.debug "   #{_c}"
         | 
| 54 | 
            +
                    end
         | 
| 55 | 
            +
             | 
| 56 | 
            +
                    metrics=Testmgr::TestReport.instance.getMetrics()
         | 
| 57 | 
            +
                    Scoutui::Logger::LogMgr.instance.info "Metrics => #{metrics}"
         | 
| 58 | 
            +
             | 
| 59 | 
            +
                    if Scoutui::Utils::TestUtils.instance.sauceEnabled?
         | 
| 60 | 
            +
                      job_id = @drv.session_id
         | 
| 61 | 
            +
             | 
| 62 | 
            +
                      SauceWhisk::Jobs.change_status job_id, metrics[:rc]
         | 
| 63 | 
            +
             | 
| 64 | 
            +
                      Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Update Sauce tests with job_id #{job_id} to #{metrics[:rc]}"
         | 
| 65 | 
            +
                    end
         | 
| 66 | 
            +
             | 
| 67 | 
            +
                  rescue => ex
         | 
| 68 | 
            +
                    Scoutui::Logger::LogMgr.instance.warn "Error during processing: #{$!}"
         | 
| 69 | 
            +
                    Scoutui::Logger::LogMgr.instance.warn "Backtrace:\n\t#{ex.backtrace.join("\n\t")}"
         | 
| 70 | 
            +
                  end
         | 
| 71 | 
            +
             | 
| 72 | 
            +
             | 
| 44 73 | 
             
                  @drv.quit()
         | 
| 45 74 | 
             
                end
         | 
| 46 75 |  | 
| @@ -49,6 +78,7 @@ module Scoutui::Commands | |
| 49 78 | 
             
                end
         | 
| 50 79 |  | 
| 51 80 | 
             
                def processCommand(_action, e=nil)
         | 
| 81 | 
            +
                  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " [enter]:processCommand(#{_action})"
         | 
| 52 82 | 
             
                  Scoutui::Commands::processCommand(_action, e, getDriver())
         | 
| 53 83 | 
             
                end
         | 
| 54 84 |  | 
| @@ -121,6 +151,8 @@ module Scoutui::Commands | |
| 121 151 | 
             
                      tmpCaps = caps
         | 
| 122 152 |  | 
| 123 153 | 
             
                      if caps.has_key?(:browser) && caps[:browser].match(/edge/i)
         | 
| 154 | 
            +
             | 
| 155 | 
            +
                        Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Capabilities[browser] : EDGE"
         | 
| 124 156 | 
             
                        caps = Selenium::WebDriver::Remote::Capabilities.edge()
         | 
| 125 157 | 
             
                      elsif caps.has_key?(:browser) && caps[:browser].match(/chrome/i)
         | 
| 126 158 | 
             
                        caps = Selenium::WebDriver::Remote::Capabilities.chrome()
         | 
| @@ -130,10 +162,15 @@ module Scoutui::Commands | |
| 130 162 | 
             
                        caps = Selenium::WebDriver::Remote::Capabilities.internet_explorer()
         | 
| 131 163 | 
             
                      end
         | 
| 132 164 |  | 
| 165 | 
            +
             | 
| 133 166 | 
             
                      tmpCaps.each_pair do |k, v|
         | 
| 167 | 
            +
                        Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " caps[#{k.to_s}] = #{v}"
         | 
| 134 168 | 
             
                        caps[k.to_s]=v
         | 
| 135 169 | 
             
                      end
         | 
| 136 170 |  | 
| 171 | 
            +
             | 
| 172 | 
            +
                      Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Remote Caps => #{caps}"
         | 
| 173 | 
            +
             | 
| 137 174 | 
             
                    elsif caps.has_key?(:deviceName) && caps[:deviceName].match(/(iphone|ipad)/i) && !caps[:deviceName].match(/simulator/i)
         | 
| 138 175 | 
             
                      caps = Selenium::WebDriver::Remote::Capabilities.iphone()
         | 
| 139 176 | 
             
                      caps['platform'] = 'OS X 10.10'
         | 
| @@ -183,12 +220,12 @@ module Scoutui::Commands | |
| 183 220 | 
             
                        @drv=Selenium::WebDriver.for :remote, :url => sauce_endpoint, :http_client => client, :desired_capabilities => caps # setup(caps)
         | 
| 184 221 | 
             
                      end
         | 
| 185 222 |  | 
| 186 | 
            -
                    rescue =>  | 
| 223 | 
            +
                    rescue => ex
         | 
| 187 224 | 
             
                      Scoutui::Logger::LogMgr.instance.debug "Error during processing: #{$!}"
         | 
| 188 225 | 
             
                      Scoutui::Logger::LogMgr.instance.debug "Backtrace:\n\t#{ex.backtrace.join("\n\t")}"
         | 
| 189 226 | 
             
                    end
         | 
| 190 227 |  | 
| 191 | 
            -
             | 
| 228 | 
            +
             | 
| 192 229 | 
             
                  else
         | 
| 193 230 | 
             
                    Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Create WebDriver: #{browserType.to_s}"
         | 
| 194 231 | 
             
                    @drv=Selenium::WebDriver.for browserType.to_sym, :profile => @profile
         |