class LegoTechSelenium::Driver
Public Class Methods
Pass in an instance of the driver @param The driver from Selenium Webdriver class
# File lib/ui/driver/Driver.rb, line 8 def initialize(driver) @driver = driver @wait = Selenium::WebDriver::Wait.new(:timeout => 15) end
Public Instance Methods
Function used to get the Selenium WebDriver @return [Selenium::WebDriver] Selenium webdriver
# File lib/ui/driver/Driver.rb, line 51 def get_selenium_driver @driver end
Function used to get the wait object @return [Selenium::WebDriver::Wait] Wait object that does a wait for the object to appear in the DOM
# File lib/ui/driver/Driver.rb, line 45 def get_wait @wait end
Function used to override the overall wait in order to find an element within the DOM @param wait_time [Number] represents how long to wait until an error is thrown
# File lib/ui/driver/Driver.rb, line 39 def set_element_find_wait(wait_time) @wait = Selenium::WebDriver::Wait.new(:timeout => wait_time) end
Set the amount of time the driver should wait when searching for elements. @param implicit_wait seconds for implicit wait
# File lib/ui/driver/Driver.rb, line 15 def set_implicit_wait(implicit_wait) @driver.manage.timeouts.implicit_wait = implicit_wait end
Sets the amount of time to wait for a page load to complete before throwing an error. @param page_load seconds to wait for page to load
# File lib/ui/driver/Driver.rb, line 21 def set_page_load(page_load) @driver.manage.timeouts.page_load = page_load end
Sets the amount of time to wait for an asynchronous script to finish execution before throwing an error. @param script_time seconds to wait for script to complete
# File lib/ui/driver/Driver.rb, line 27 def set_script_timeout(script_timeout) @driver.manage.timeouts.script_timeout = script_timeout end