Skip to content
This repository

Capybara Script Runner

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 examples
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 capy.gemspec
README.md

Capy

The capy command to run the script written in Capybara DSL.

Installation

$ gem install capy

Usage

Capy Shell

$ capy

Running Script

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 other files

import 'examples/google_search.capy'

To access the elements within IFrame

within_frame('IFRAME_ID') do
  click_on 'link'
end

Take Screenshot

take_screenshot

or

take_screenshot 'foo.png'

JavaScript Mode

# example.js

location 'http://www.wikipedia.org/'
...

run capy with '-j' option

$ capy -j example.js

See also the examples.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

TODO

  • write spec
Something went wrong with that request. Please try again.