thesis thesis - 27 days ago 18
Ruby Question

Run capybara in rake task

How can I run Capybara functionality in Rake task?

for example:

visit('http://google.com')


Thank you!

Answer

Try something like this in the task:

require 'capybara'
require 'capybara/dsl'

include Capybara::DSL
Capybara.current_driver = :selenium
page.visit("http://www.google.com")
puts(page.html)
Comments