The capy command to run the script written in Capybara DSL.
$ gem install capy
$ capy
Write script
# example.capy
visit 'http://www.wikipedia.org/'
fill_in 'search', :with => 'ruby'
click_on ' → '
stop
and
$ capy example.capy
Change the browser:
$ capy -b firefox example.capy
Using the webkit:
$ gem install capybara-webkit
and capy with '-w' option
$ capy -w example.capy
import 'examples/google_search.capy'
within_frame('IFRAME_ID') do
click_on 'link'
end
take_screenshot
or
take_screenshot 'foo.png'
# example.js
location 'http://www.wikipedia.org/'
...
run capy with '-j' option
$ capy -j example.js
See also the examples.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
- write spec