Class: CapybaraPageObject::Page
- Extended by:
- ClassMethods
- Includes:
- Collections, InstanceMethods
- Defined in:
- lib/capybara-page-object/page.rb
Instance Attribute Summary
Attributes inherited from Node
Class Method Summary collapse
Instance Method Summary collapse
- #forms ⇒ Object
-
#tables ⇒ Object
TODO why doesn’t this work when in the module?.
Methods included from ClassMethods
Methods included from InstanceMethods
#path, #root_path, #visit_path
Methods included from Collections
Methods inherited from Node
#classes, element, field, from_string, #initialize
Methods included from Delegators
Constructor Details
This class inherits a constructor from CapybaraPageObject::Node
Class Method Details
.component(name, &block) ⇒ Object
68 69 70 |
# File 'lib/capybara-page-object/page.rb', line 68 def self.component(name, &block) define_method(name, &block) end |
.path(p) ⇒ Object
64 65 66 |
# File 'lib/capybara-page-object/page.rb', line 64 def self.path(p) define_method(:path) { p } end |
Instance Method Details
#forms ⇒ Object
57 58 59 60 61 62 |
# File 'lib/capybara-page-object/page.rb', line 57 def forms all('form').each_with_object({}) do |e, hash| f = CapybaraPageObject::Form.new(e) hash[f.key] = f end end |
#tables ⇒ Object
TODO why doesn’t this work when in the module?
50 51 52 53 54 55 |
# File 'lib/capybara-page-object/page.rb', line 50 def tables all('table').each_with_object({}) do |e, hash| t = CapybaraPageObject::Table.new(e) hash[t.key] = t end end |