Class: Testable::Page
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
The ‘Page` class wraps an HTML page with an application-specific API.
Attributes inherited from Node
Class Method Summary collapse
Instance Method Summary collapse
- #current? ⇒ Boolean
-
#initialize(node: Capybara.current_session, path: nil) ⇒ Page
constructor
A new instance of Page.
- #visit ⇒ Object
Methods inherited from Node
#method_missing, #respond_to_missing?
Methods included from DSL
Constructor Details
#initialize(node: Capybara.current_session, path: nil) ⇒ Page
Returns a new instance of Page.
15 16 17 18 |
# File 'lib/testable/capybara/page.rb', line 15 def initialize(node: Capybara.current_session, path: nil) @node = node @path = path end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Testable::Node
Instance Attribute Details
#path ⇒ Object (readonly)
The ‘Page` class wraps an HTML page with an application-specific API. This can be extended to define an API for manipulating the pages of the web application.
9 10 11 |
# File 'lib/testable/capybara/page.rb', line 9 def path @path end |
Class Method Details
.visit ⇒ Object
11 12 13 |
# File 'lib/testable/capybara/page.rb', line 11 def self.visit new.visit end |
Instance Method Details
#current? ⇒ Boolean
25 26 27 |
# File 'lib/testable/capybara/page.rb', line 25 def current? @node.current_path == path end |
#visit ⇒ Object
20 21 22 23 |
# File 'lib/testable/capybara/page.rb', line 20 def visit @node.visit(path) self end |