class SeleniumRecord::NavigationItem
Base
model to be extended by all Selenium page objects
Public Class Methods
Public Instance Methods
before_load_dom()
click to toggle source
# File lib/selenium_record/navigation_item.rb, line 8 def before_load_dom before_navigate if respond_to? :before_navigate navigate unless current? end
click_link(*args)
click to toggle source
Calls superclass method
SeleniumRecord::Actions#click_link
# File lib/selenium_record/navigation_item.rb, line 13 def click_link(*args) super self end
reload()
click to toggle source
# File lib/selenium_record/navigation_item.rb, line 18 def reload find(link_active_locator).click wait_page_load self rescue => error if error.is_a? Selenium::WebDriver::Error::StaleElementReferenceError load_dom retry else raise end end
Private Instance Methods
current?()
click to toggle source
@return [Boolean] Marks whether the current browser page matches the new
new instantiated page object
# File lib/selenium_record/navigation_item.rb, line 65 def current? browser.find_element(link_active_locator) rescue Selenium::WebDriver::Error::NoSuchElementError false end
link_active_locator()
click to toggle source
# File lib/selenium_record/navigation_item.rb, line 59 def link_active_locator fail SUBCLASS_RESPONSABILITY end
link_inactive_locator()
click to toggle source
@param [String] Returns the xpath to be used to identify if the current
browser page matches this object
@raise [SubclassResponsabilityError] if subclasses don’t implement this
method
# File lib/selenium_record/navigation_item.rb, line 55 def link_inactive_locator fail SUBCLASS_RESPONSABILITY end