Class: EasyAutomation::Page
- Inherits:
-
Selenium::WebPage
- Object
- Selenium::WebPage
- EasyAutomation::Page
- Defined in:
- lib/easy_automation/page.rb
Instance Attribute Summary collapse
-
#elements ⇒ Object
readonly
Returns all elements for current page.
Instance Method Summary collapse
-
#go_back ⇒ Object
it goes back one place in history.
-
#html ⇒ Object
Gets body text.
-
#initialize(browser, path) ⇒ Page
constructor
Default constructor.
-
#refresh ⇒ Object
Refresh current page and waits to be loaded.
-
#title ⇒ Object
Returns page title.
-
#wait_page_load ⇒ Object
Waits for page to load.
Constructor Details
#initialize(browser, path) ⇒ Page
Default constructor
13 14 15 16 17 |
# File 'lib/easy_automation/page.rb', line 13 def initialize(browser, path) @elements = LoadData.load_xpath_elements(self.class.to_s, path) super(browser, @elements.title) @browser = browser end |
Instance Attribute Details
#elements ⇒ Object (readonly)
Returns all elements for current page
61 62 63 |
# File 'lib/easy_automation/page.rb', line 61 def elements @elements end |
Instance Method Details
#go_back ⇒ Object
it goes back one place in history
45 46 47 48 |
# File 'lib/easy_automation/page.rb', line 45 def go_back browser.browser.go_back() self.wait_page_load end |
#html ⇒ Object
Gets body text
24 25 26 |
# File 'lib/easy_automation/page.rb', line 24 def html browser.html() end |
#refresh ⇒ Object
Refresh current page and waits to be loaded
53 54 55 56 |
# File 'lib/easy_automation/page.rb', line 53 def refresh browser.browser.refresh self.wait_page_load end |
#title ⇒ Object
Returns page title
31 32 33 |
# File 'lib/easy_automation/page.rb', line 31 def title browser.title end |
#wait_page_load ⇒ Object
Waits for page to load
38 39 40 |
# File 'lib/easy_automation/page.rb', line 38 def wait_page_load browser.wait_for_load end |