Sha256: 5d90144ef9b454a65f6195dffa9dd6ee15f8edf628ede2706cafa7f60b6502e7

Contents?: true

Size: 946 Bytes

Versions: 1

Compression:

Stored size: 946 Bytes

Contents

require 'eyes_selenium'
require 'selenium-webdriver'


module Scoutui::Base


  class QBrowser

    attr_accessor :driver

    def initialize()
    end

    def self.wait_for_exist(drv, xpath, _timeout=30)
      puts __FILE__ + (__LINE__).to_s + " wait_for_exist(#{xpath}"
      rc=nil
      begin
        Selenium::WebDriver::Wait.new(timeout: _timeout).until { drv.find_element(:xpath => xpath) }
        rc=drv.find_element(:xpath => xpath)
      rescue => ex
        ;
      end
      rc
    end

    def self.getObject(drv, xpath, _timeout=30)
      rc=nil
      begin
        Selenium::WebDriver::Wait.new(timeout: _timeout).until { drv.find_element(:xpath => xpath).displayed? }
        rc=drv.find_element(:xpath => xpath)
      rescue => ex
        ;
      end
      rc
    end

    def wait_for(seconds)
      Selenium::WebDriver::Wait.new(timeout: seconds).until { yield }
    end

    def driver
      @driver
    end



  end


end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
scoutui-0.1.2 lib/scoutui/base/q_browser.rb