I defined a module:
module Support
include Capybara::DSL
def self.do_something
click_link 'Questions'
end
end
It's situated at features/support/support.rb
My env.rb:
require 'capybara'
require 'cucumber'
require 'capybara/cucumber'
Capybara.app_host = "http://www.stackoverflow.com"
Capybara.run_server = false
Capybara.default_driver = :selenium
I invoke function of module in steps.rb:
Support::do_something
And I have exception:
undefined method `click_link' for Support:Module (NoMethodError)
How can I make Capybara available in Support module?
cucumber is a BDD tool that expresses testing scenarios in a business-readable, domain-specific language. capybara is an automated testing tool (often used) for ROR applications.
Capybara is an integration testing tool for rack based web applications. It simulates how a user would interact with a website.
Capybara should be extend
-ed, not include
-ed:
module Support
extend Capybara::DSL
def self.do_something
click_link 'Questions'
end
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With