Last active
August 29, 2015 14:07
-
-
Save mtsmfm/2748e8cc82fc10622f08 to your computer and use it in GitHub Desktop.
Capybara minimal sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source 'https://rubygems.org' | |
| gem 'capybara' | |
| gem 'poltergeist', require: 'capybara/poltergeist' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| GEM | |
| remote: https://rubygems.org/ | |
| specs: | |
| capybara (2.4.3) | |
| mime-types (>= 1.16) | |
| nokogiri (>= 1.3.3) | |
| rack (>= 1.0.0) | |
| rack-test (>= 0.5.4) | |
| xpath (~> 2.0) | |
| cliver (0.3.2) | |
| mime-types (2.4.1) | |
| mini_portile (0.6.0) | |
| multi_json (1.10.1) | |
| nokogiri (1.6.3.1) | |
| mini_portile (= 0.6.0) | |
| poltergeist (1.5.1) | |
| capybara (~> 2.1) | |
| cliver (~> 0.3.1) | |
| multi_json (~> 1.0) | |
| websocket-driver (>= 0.2.0) | |
| rack (1.5.2) | |
| rack-test (0.6.2) | |
| rack (>= 1.0) | |
| websocket-driver (0.3.5) | |
| xpath (2.0.0) | |
| nokogiri (~> 1.3) | |
| PLATFORMS | |
| ruby | |
| DEPENDENCIES | |
| capybara | |
| poltergeist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'bundler' | |
| Bundler.require | |
| Capybara.run_server = false | |
| Capybara.current_driver = :poltergeist | |
| include Capybara::DSL | |
| Capybara.app_host = 'http://www.yahoo.co.jp' | |
| visit '/' | |
| fill_in :srchtxt, with: 'hoge' | |
| click_on :srchbtn | |
| p all('a').map {|e| e[:href] } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment