mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Merge branch 'master' of git://github.com/jnicklas/capybara
This commit is contained in:
commit
29f6fc8aed
3 changed files with 17 additions and 13 deletions
16
README.rdoc
16
README.rdoc
|
@ -66,11 +66,15 @@ You can change the driver temporarily:
|
|||
Capybara.current_driver = :culerity
|
||||
Capybara.use_default_driver
|
||||
|
||||
You can do this in Before and After blocks to temporarily switch to a different
|
||||
driver. Note that switching driver creates a new session, so you may not be able
|
||||
to switch in the middle of a Scenario.
|
||||
|
||||
== Cucumber and Tags
|
||||
|
||||
Capybara sets up some {tags}[http://wiki.github.com/aslakhellesoy/cucumber/tags]
|
||||
for you to use in Cucumber. Often you'll want to use run only some scenarios
|
||||
with a driver that supports JavaScript, Capybara makes this easy: simply tag the
|
||||
for you to use in Cucumber. Often you'll want to run only some scenarios with a
|
||||
driver that supports JavaScript, Capybara makes this easy: simply tag the
|
||||
scenario (or feature) with <tt>@javascript</tt>:
|
||||
|
||||
@javascript
|
||||
|
@ -82,8 +86,8 @@ You can change which driver Capybara uses for JavaScript:
|
|||
|
||||
Capybara.javascript_driver = :culerity
|
||||
|
||||
There are also explicit <tt>@selenium</tt>, <tt>@culerity</tt> and <tt>@rack_test</tt> tags set up
|
||||
for you.
|
||||
There are also explicit <tt>@selenium</tt>, <tt>@culerity</tt> and
|
||||
<tt>@rack_test</tt> tags set up for you.
|
||||
|
||||
== The API
|
||||
|
||||
|
@ -190,8 +194,8 @@ moving from Webrat and used CSS a lot, or simply generally prefer CSS:
|
|||
{default_url_options}[https://gist.github.com/643a758320a2926bd2ed] in Rails
|
||||
for example.
|
||||
|
||||
* The <tt>set_hidden_field</tt> method from Webrat is not implemented, since it doesn't
|
||||
work in any of the browser based drivers (Culerity, Selenium)
|
||||
* The <tt>set_hidden_field</tt> method from Webrat is not implemented, since it
|
||||
doesn't work in any of the browser based drivers (Culerity, Selenium)
|
||||
|
||||
* Access to session, request and response from the test is not possible. Maybe
|
||||
we'll do response headers at some point in the future, but the others really
|
||||
|
|
|
@ -11,6 +11,10 @@ class Capybara::Driver::Base
|
|||
raise "Not implemented"
|
||||
end
|
||||
|
||||
def evaluate_script(script)
|
||||
raise Capybara::NotSupportedByDriverError
|
||||
end
|
||||
|
||||
def wait?
|
||||
false
|
||||
end
|
||||
|
|
|
@ -44,9 +44,9 @@ module Capybara
|
|||
end
|
||||
|
||||
def drag(source_locator, target_locator)
|
||||
source = find(source_locator)
|
||||
source = wait_for(source_locator)
|
||||
raise Capybara::ElementNotFound, "drag source '#{source_locator}' not found on page" unless source
|
||||
target = find(target_locator)
|
||||
target = wait_for(target_locator)
|
||||
raise Capybara::ElementNotFound, "drag target '#{target_locator}' not found on page" unless target
|
||||
source.drag_to(target)
|
||||
end
|
||||
|
@ -171,11 +171,7 @@ module Capybara
|
|||
end
|
||||
|
||||
def evaluate_script(script)
|
||||
begin
|
||||
driver.evaluate_script(script)
|
||||
rescue NoMethodError
|
||||
raise NotSupportedByDriverError
|
||||
end
|
||||
driver.evaluate_script(script)
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Reference in a new issue