README.rdoc in frameworks-capybara-0.0.10 vs README.rdoc in frameworks-capybara-0.0.11

- old
+ new

@@ -2,11 +2,11 @@ Gem to simplify the configuration of Capybara when using multiple drivers, also exposes other useful utility methods. Although utilising Capybara's API to run tests is extremely simple the configuration and setup of the tool can be a little confusing, particularly if you want to avoid ending up with a spaghetti like env.rb file -The principle behind this gem is to factor out all the common setup code for registering Capybara drivers and allow the user to pass all configuration options through Cucumber's command line interface (and typically using cucumber.yml to make this even easier). +The principle behind this gem is to factor out all the common setup code for registering Capybara drivers and allow the user to pass all configuration options through Cucumber's command line interface (typically using cucumber.yml to make this easier). Below are the current drivers that can be registered: * Selenium-Webdriver (Selenium2) - LOCAL: This can be used to drive 'in-browser' tests runnong on your local machine in IE, Firefox and Chrome (and any other browsers as and when they are added into the Selenium-Webdriver project) @@ -15,11 +15,11 @@ * Celerity: This can be used to drive 'headless' tests. Celerity is a ruby wrapper for HTMLUnit and as such provides support for Javascript, though this is commonly quite fragile. To be added in the near future: -* Mechanize-Caybara: There is a Caybara driver for mechanize which has recent;y surfaced on Github. Many people still enjoy using Mechanize as despite its lack of support for Javascrit, it offers a much faster 'headless' option over Celerity. Once we have tested this driver and checked its robustness we will add an option to use it via this gem. +* Mechanize-Caybara: There is a Caybara driver for mechanize which has recently surfaced on Github. Many people still enjoy using Mechanize as despite its lack of support for Javascrit, it offers a much faster 'headless' option over Celerity. Once we have tested this driver and checked its robustness we will add an option to use it via this gem. How to use this gem in your project: In your env.rb simply add: @@ -27,17 +27,44 @@ The following environment variables can be set to configure your tests: ENVIRONMENT - this must be one of either 'sandbox', 'int', 'test', 'stage', 'live' BROWSER - this must be one of either 'ie', 'firefox', 'chrome', 'headless', 'remote' - PROXY_URL - url of proxy if required e.g. 'http://proxyhost:80' + PROXY_URL - url of proxy if required e.g. 'http://proxyhost:80', when running a headless browser this sets the proxy for the browser itself, when running a remote browser this sets the proxy for the client which will connect to the remote selenium server PLATFORM - used when specifying remote test on a grid that provides a choice of platforms, this must be one of either 'WINDOWS' or 'LINUX' REMOTE_BROWSER - used when specifying remote test, must be one of either 'ie', 'firefox', 'chrome', 'headless', 'remote' - REMOTE_BROWSER_PROXY - used when specifying remote test, sets proxy on remote browser (Firefox only at present, other browsers must have proxies set appropriately on remote machine) + REMOTE_BROWSER_PROXY_URL - used when specifying remote test, sets proxy on remote browser (Firefox only at present, other browsers must have proxies set appropriately on remote machine) + REMOTE_BROWSER_VERSION - used when specifying remote test on a grid the provides a choice of browser versions for a given browser REMOTE_URL - URL of remote Selenium-Webdriver server e.g. http://yourremotehost:4444/wd/hub FIREFOX_PROFILE - specify a firefox profile to use when running in-browser tests (local or remote) + CELERITY_JS_ENABLED (string - 'true', 'false') - determines whether Celerity (HTMLUnit) attempts to execute javascript +Here is a sample cucumber.yml: + + <%intenv='ENVIRONMENT=int'%> + <%testenv='ENVIRONMENT=test'%> + <%stageenv='ENVIRONMENT=stage'%> + <%liveenv='ENVIRONMENT=live'%> + <%sandboxenv='ENVIRONMENT=sandbox'%> + <%browser_headless='BROWSER=headless'%> + <%browser_ie='BROWSER=ie'%> + <%browser_firefox='BROWSER=firefox'%> + <%browser_chrome='BROWSER=chrome'%> + <%browser_remote='BROWSER=remote'%> + <%proxy_on='PROXY_URL=http://proxyhost:proxyport'%> + <%sauce_remote_url='REMOTE_URL=http://mykey@ondemand.saucelabs.com:80/wd/hub'%> + <%demo_feature='features/demo.feature'%> + + firefox-local: <%=browser_firefox%> <%=testenv%> FIREFOX_PROFILE=default <%=no_stage_tests%> <%=no_xhtml_tests%> <%=demo_feature%> + chrome-local: <%=browser_chrome%> <%=testenv%> <%=no_stage_tests%> <%=no_xhtml_tests%> <%=demo_feature%> + ie-local: <%=browser_ie%> <%=testenv%> <%=no_stage_tests%> <%=no_xhtml_tests%> <%=demo_feature%> + headless-local-proxy: <%=browser_headless%> <%=testenv%> <%=proxy_on%> <%=no_stage_tests%> <%=no_xhtml_tests%> <%=demo_feature%> + headless-local-noproxy: <%=browser_headless%> <%=testenv%> <%=no_stage_tests%> <%=no_xhtml_tests%> <%=demo_feature%> + saucelabs-proxy: <%=browser_remote%> <%=testenv%> <%=proxy_on%> FIREFOX_PROFILE=default PLATFORM=WINDOWS <%=sauce_remote_url%> <%=no_stage_tests%> <%=no_xhtml_tests%> REMOTE_BROWSER=firefox <%=demo_feature%> + saucelabs-noproxy: <%=browser_remote%> <%=testenv%> FIREFOX_PROFILE=default PLATFORM=WINDOWS <%=sauce_remote_url%> <%=no_stage_tests%> <%=no_xhtml_tests%> REMOTE_BROWSER=firefox <%=demo_feature%> + + This gem also sets up a number of 'base urls' for you to use in your tests, these are set based on the ENVIRONMENT variable you set when running cucumber tests (either from the comand line or in cucumber.yml), the following URLs are set: @base_url @base_static_url @base_open_url @@ -52,8 +79,7 @@ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally. * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it. == Copyright -Copyright (c) 2011 mcrmfc. See LICENSE.txt for -further details. +See LICENSE.txt for further details.