Class: Capybara::Driver::MechanicalCuke

Inherits:
Base
  • Object
show all
Includes:
MechanicalCuke
Defined in:
lib/mechanical-cuke/capybara.rb

Defined Under Namespace

Classes: Node

Instance Method Summary collapse

Methods included from MechanicalCuke

#basic_auth, configure, #current_page, #get, #mechanize, #response_body

Constructor Details

#initialize(app) ⇒ MechanicalCuke

Returns a new instance of MechanicalCuke.



88
89
# File 'lib/mechanical-cuke/capybara.rb', line 88

def initialize(app)
end

Instance Method Details

#bodyObject Also known as: source



78
79
80
# File 'lib/mechanical-cuke/capybara.rb', line 78

def body
  current_page.body
end

#current_urlObject



84
85
86
# File 'lib/mechanical-cuke/capybara.rb', line 84

def current_url
  current_page.uri.to_s
end

#find(locator) ⇒ Object



91
92
93
# File 'lib/mechanical-cuke/capybara.rb', line 91

def find(locator)
  current_page.search(locator).map { |node| Node.new(self, node) }
end

#formObject



95
96
97
# File 'lib/mechanical-cuke/capybara.rb', line 95

def form
  current_page.forms.first
end

#visit(path) ⇒ Object



74
75
76
# File 'lib/mechanical-cuke/capybara.rb', line 74

def visit(path)
  get path
end