Module: EPO::PageObject
- Defined in:
- lib/epo.rb
Instance Attribute Summary collapse
-
#dr ⇒ Object
readonly
Returns the value of attribute dr.
-
#ui_methods ⇒ Object
readonly
Returns the value of attribute ui_methods.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #initialize(dr, domain) ⇒ Object
-
#make_timestamp ⇒ Object
navigate_to.
-
#method_missing(m, *param, &blk) ⇒ Object
make_timestamp.
- #navigate_to(path = '', timestamp = false) ⇒ Object
-
#valid_driver?(dr) ⇒ Boolean
initialize.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *param, &blk) ⇒ Object
make_timestamp
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/epo.rb', line 27 def method_missing m, *param, &blk if VERY_SIMPLE_DSL.any? {|dsl| m.match Regexp.new(dsl)} if m[m.length - 1] == 's' return @dr.find_elements *param else return @dr.find_element *param end #if end #if @dr.send(m, *param, &blk) if @dr.respond_to?(m) end |
Instance Attribute Details
#dr ⇒ Object (readonly)
Returns the value of attribute dr.
5 6 7 |
# File 'lib/epo.rb', line 5 def dr @dr end |
#ui_methods ⇒ Object (readonly)
Returns the value of attribute ui_methods.
5 6 7 |
# File 'lib/epo.rb', line 5 def ui_methods @ui_methods end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
5 6 7 |
# File 'lib/epo.rb', line 5 def url @url end |
Instance Method Details
#initialize(dr, domain) ⇒ Object
6 7 8 9 |
# File 'lib/epo.rb', line 6 def initialize dr, domain valid_driver? dr @dr, @domain = dr, domain end |
#make_timestamp ⇒ Object
navigate_to
23 24 25 |
# File 'lib/epo.rb', line 23 def "?#{Time.now.to_f.to_s}" end |
#navigate_to(path = '', timestamp = false) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/epo.rb', line 15 def navigate_to path = '', =false if @dr.get(@domain + path + ) else @dr.get(@domain + path) end #if end |
#valid_driver?(dr) ⇒ Boolean
initialize
11 12 13 |
# File 'lib/epo.rb', line 11 def valid_driver? dr raise NotValidDriverError unless dr.is_a?(Selenium::WebDriver::Driver) end |