Class: SeleniumRecord::NavigationItem
- Defined in:
- lib/selenium_record/navigation_item.rb
Overview
Base model to be extended by all Selenium page objects
Constant Summary
Constants included from Waits
Constants included from Core
Instance Attribute Summary
Attributes inherited from Base
#browser, #object, #parent_el, #root_el
Class Method Summary collapse
-
.navigate_to(key) ⇒ Object
Class method to create the ‘before_navigate’ hook defining the title of the page.
Instance Method Summary collapse
Methods inherited from Base
#create_record, #create_record_for_action, #exist?, extract_klass, #initialize
Methods included from ComponentAutoload
component_loader, extract_group, extract_namespace, extract_options, included, #method_missing, #modal_for, #panel_for, #pill_for, #tab_for, #view_for
Methods included from Translations
Methods included from Theme
#dropdown_menu_xpath, #dropdown_xpath, #find_headline, #modal_header_xpath, #section_xpath, #select_option_xpath, #select_xpath
Methods included from Html
Methods included from Axis
#after?, #before?, #following_sibling_elements, #ordered?, #preceding_sibling_elements
Methods included from Preconditions
#when_clickable, #when_hidden, #when_modal_present, #when_present
Methods included from Waits
included, #wait_displayed, #wait_fade_in, #wait_hidden, #wait_js_inactive, #wait_page_load
Methods included from Scopes
Methods included from ActionBuilder
Methods included from Actions
#accept_popup, #choose_menu, choose_option, #clear, #click, #click_on, #click_wait, #fill, #focus, #pop_last, #select_from_chosen, #submit, #textarea_content
Methods included from Lookup
included, #lookup, #lookup_sequence, #lookup_step
Methods included from Core
#find, #find!, #find_elements, #first_last, #load_dom, #load_dom!
Methods included from Configuration
Constructor Details
This class inherits a constructor from SeleniumRecord::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class SeleniumRecord::ComponentAutoload
Class Method Details
.navigate_to(key) ⇒ Object
Class method to create the ‘before_navigate’ hook defining the title of the page
35 36 37 38 39 |
# File 'lib/selenium_record/navigation_item.rb', line 35 def self.navigate_to(key) define_method :before_navigate do @title = trans key end end |
Instance Method Details
#before_load_dom ⇒ Object
8 9 10 11 |
# 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) ⇒ Object
13 14 15 16 |
# File 'lib/selenium_record/navigation_item.rb', line 13 def click_link(*args) super self end |
#reload ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# 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 |