capybara 2.0.3 → 2.1.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/History.md +73 -0
- data/README.md +52 -5
- data/lib/capybara.rb +44 -62
- data/lib/capybara/cucumber.rb +4 -1
- data/lib/capybara/driver/base.rb +13 -9
- data/lib/capybara/driver/node.rb +18 -6
- data/lib/capybara/helpers.rb +111 -22
- data/lib/capybara/node/actions.rb +24 -19
- data/lib/capybara/node/base.rb +25 -32
- data/lib/capybara/node/document.rb +6 -2
- data/lib/capybara/node/element.rb +45 -7
- data/lib/capybara/node/finders.rb +48 -21
- data/lib/capybara/node/matchers.rb +38 -21
- data/lib/capybara/node/simple.rb +29 -7
- data/lib/capybara/query.rb +72 -26
- data/lib/capybara/rack_test/browser.rb +11 -3
- data/lib/capybara/rack_test/css_handlers.rb +8 -0
- data/lib/capybara/rack_test/driver.rb +11 -3
- data/lib/capybara/rack_test/form.rb +8 -1
- data/lib/capybara/rack_test/node.rb +92 -36
- data/lib/capybara/rails.rb +1 -2
- data/lib/capybara/result.rb +21 -37
- data/lib/capybara/rspec/matchers.rb +60 -31
- data/lib/capybara/selector.rb +46 -13
- data/lib/capybara/selenium/driver.rb +42 -6
- data/lib/capybara/selenium/node.rb +23 -5
- data/lib/capybara/session.rb +46 -11
- data/lib/capybara/spec/public/test.js +12 -0
- data/lib/capybara/spec/session/all_spec.rb +9 -8
- data/lib/capybara/spec/session/attach_file_spec.rb +14 -0
- data/lib/capybara/spec/session/check_spec.rb +14 -0
- data/lib/capybara/spec/session/choose_spec.rb +14 -0
- data/lib/capybara/spec/session/click_button_spec.rb +77 -1
- data/lib/capybara/spec/session/click_link_or_button_spec.rb +65 -0
- data/lib/capybara/spec/session/click_link_spec.rb +24 -0
- data/lib/capybara/spec/session/current_scope_spec.rb +29 -0
- data/lib/capybara/spec/session/fill_in_spec.rb +14 -0
- data/lib/capybara/spec/session/find_button_spec.rb +12 -0
- data/lib/capybara/spec/session/find_by_id_spec.rb +12 -1
- data/lib/capybara/spec/session/find_field_spec.rb +30 -0
- data/lib/capybara/spec/session/find_link_spec.rb +12 -0
- data/lib/capybara/spec/session/find_spec.rb +258 -16
- data/lib/capybara/spec/session/first_spec.rb +25 -8
- data/lib/capybara/spec/session/has_css_spec.rb +2 -2
- data/lib/capybara/spec/session/has_field_spec.rb +10 -2
- data/lib/capybara/spec/session/has_selector_spec.rb +9 -0
- data/lib/capybara/spec/session/has_text_spec.rb +96 -0
- data/lib/capybara/spec/session/has_title_spec.rb +47 -0
- data/lib/capybara/spec/session/node_spec.rb +43 -0
- data/lib/capybara/spec/session/reset_session_spec.rb +10 -2
- data/lib/capybara/spec/session/save_page_spec.rb +30 -0
- data/lib/capybara/spec/session/select_spec.rb +65 -0
- data/lib/capybara/spec/session/text_spec.rb +31 -0
- data/lib/capybara/spec/session/title_spec.rb +16 -0
- data/lib/capybara/spec/session/uncheck_spec.rb +14 -0
- data/lib/capybara/spec/session/unselect_spec.rb +42 -0
- data/lib/capybara/spec/session/visit_spec.rb +3 -3
- data/lib/capybara/spec/session/within_frame_spec.rb +14 -0
- data/lib/capybara/spec/session/within_spec.rb +3 -3
- data/lib/capybara/spec/spec_helper.rb +6 -1
- data/lib/capybara/spec/views/form.erb +39 -2
- data/lib/capybara/spec/views/frame_child.erb +9 -0
- data/lib/capybara/spec/views/frame_parent.erb +8 -0
- data/lib/capybara/spec/views/with_base_tag.erb +10 -0
- data/lib/capybara/spec/views/with_count.erb +7 -0
- data/lib/capybara/spec/views/with_hover.erb +17 -0
- data/lib/capybara/spec/views/with_html.erb +21 -2
- data/lib/capybara/spec/views/with_js.erb +5 -0
- data/lib/capybara/spec/views/with_scope.erb +6 -1
- data/lib/capybara/spec/views/with_title.erb +1 -0
- data/lib/capybara/spec/views/within_frames.erb +1 -0
- data/lib/capybara/version.rb +1 -1
- data/spec/basic_node_spec.rb +75 -24
- data/spec/dsl_spec.rb +2 -1
- data/spec/rack_test_spec.rb +4 -3
- data/spec/rspec/matchers_spec.rb +105 -17
- data/spec/server_spec.rb +8 -8
- data/spec/spec_helper.rb +2 -1
- metadata +83 -23
- metadata.gz.sig +0 -0
data.tar.gz.sig
ADDED
Binary file
|
data/History.md
CHANGED
@@ -1,3 +1,76 @@
|
|
1
|
+
# Version 2.1.0
|
2
|
+
|
3
|
+
Release date: Unreleased
|
4
|
+
|
5
|
+
### Changed
|
6
|
+
|
7
|
+
* Hard version requirement on Ruby >= 1.9.3. Capybara will no longer install
|
8
|
+
on 1.8.7. [Felix Schäfer]
|
9
|
+
* Capybara no longer depends on the `selenium-webdriver` gem. Add it to
|
10
|
+
your Gemfile if you wish to use the Selenium driver. [Jonas Nicklas]
|
11
|
+
* `Capybara.ignore_hidden_elements` defaults to `true`. [Jonas Nicklas]
|
12
|
+
* In case of multiple matches `smart` matching is used by default. Set
|
13
|
+
`Capybara.match = :one` to revert to old behaviour. [Jonas Nicklas].
|
14
|
+
* Options in select boxes use smart matching and no longer need to match
|
15
|
+
exactly. Set `Capybara.exact_options = false` to revert to old behaviour.
|
16
|
+
[Jonas Nicklas].
|
17
|
+
* Visibility of text depends on `Capybara.ignore_hidden_elements` instead of
|
18
|
+
always returning only visible text. Set `Capybara.visible_text_only = true`
|
19
|
+
to revert to old behaviour. [Jonas Nicklas]
|
20
|
+
* Cucumber cleans up session after scenario instead. This is consistent with
|
21
|
+
RSpec and makes more sense, since we raise server errors in `reset!`.
|
22
|
+
[Jonas Nicklas]
|
23
|
+
|
24
|
+
### Added
|
25
|
+
|
26
|
+
* All actions (`click_link`, `fill_in`, etc...) and finders now take an options
|
27
|
+
hash, which is passed through to `find`. [Jonas Nicklas]
|
28
|
+
* CSS selectors are sent straight through to driver instead of being converted
|
29
|
+
to XPath first. Enables the use of some pseudo selectors, such as `invalid`
|
30
|
+
in some drivers. [Thomas Walpole]
|
31
|
+
* `Capybara.asset_host` option, which inserts a `base` tag into the page on
|
32
|
+
`save_and_open_page`, eases debugging with the Rails asset pipeline.
|
33
|
+
[Steve Hull]
|
34
|
+
* `exact` option, can specify whether to match substrings or entire text.
|
35
|
+
[Jonas Nicklas]
|
36
|
+
* `match` option, can specify behaviour in case of multiple matches.
|
37
|
+
[Jonas Nicklas]
|
38
|
+
* `wait` option, can specify how long to wait for a given action/finder.
|
39
|
+
[Jonas Nicklas]
|
40
|
+
* Config option which disables bubbling of errors raised inside server.
|
41
|
+
[Jonas Nicklas]
|
42
|
+
* `text` now takes a parameter which makes it possible to return either all
|
43
|
+
text or only visible text. The default depends on
|
44
|
+
`Capybara.ignore_hidden_elements`. `Capybara.visible_text_only` option is
|
45
|
+
available for compatibility. [Jonas Nicklas]
|
46
|
+
* `has_content?` and `has_text?` now take the same count options as `has_selector?`
|
47
|
+
[Andrey Botalov]
|
48
|
+
* `current_scope` is now public API, returns the current element when `within`
|
49
|
+
is used. [Martijn Walraven]
|
50
|
+
* `find("input").disabled?` returns true if a node is disabled. [Ben Lovell]
|
51
|
+
* Find disabled fields and buttons with `:disabled => false`. [Jonas Nicklas]
|
52
|
+
* `find("input").hover` moves the mouse to the element in supported drivers.
|
53
|
+
[Thomas Walpole]
|
54
|
+
* RackTest driver now support `form` attribute on form elements.
|
55
|
+
[Thomas Walpole]
|
56
|
+
* `page.title` returns the page title. [Terry Progetto]
|
57
|
+
* `has_title?` matcher to assert on page title. [Jonas Nicklas]
|
58
|
+
* The gem is now signed with a certicficate. The public key is available in the
|
59
|
+
repo. [Jonas Nicklas]
|
60
|
+
* `:select` and `:textarea` are valid options for the `:type` filter on `find_field`
|
61
|
+
and `has_field?`. [Yann Plancqueel]
|
62
|
+
|
63
|
+
### Fixed
|
64
|
+
|
65
|
+
* Fixed race conditions when synchronizing across multiple nodes [Jonas Nicklas]
|
66
|
+
* Fixed race conditions in deeply nested selectors [Jonas Nicklas]
|
67
|
+
* Use posix character class for whitespace replace, solves various encoding
|
68
|
+
problems on Ruby 2.0.0 and JRuby. [Jonas Nicklas]
|
69
|
+
* Fix issue with `within_frame`, where selecting multiple nested frames didn't
|
70
|
+
work as intended. [Thomas Walpole]
|
71
|
+
* RackTest no longer fills in readonly textareas. [Thomas Walpole]
|
72
|
+
* Don't use autoload to load files, require them directly instead. [Jonas Nicklas]
|
73
|
+
|
1
74
|
# Version 2.0.2
|
2
75
|
|
3
76
|
Release date: 2012-12-31
|
data/README.md
CHANGED
@@ -26,7 +26,7 @@ GitHub): http://groups.google.com/group/ruby-capybara
|
|
26
26
|
To install, type
|
27
27
|
|
28
28
|
```bash
|
29
|
-
|
29
|
+
gem install capybara
|
30
30
|
```
|
31
31
|
|
32
32
|
If you are using Rails, add this line to your test helper file:
|
@@ -102,11 +102,13 @@ describe "the signup process", :type => :feature do
|
|
102
102
|
end
|
103
103
|
|
104
104
|
it "signs me in" do
|
105
|
+
visit '/sessions/new'
|
105
106
|
within("#session") do
|
106
107
|
fill_in 'Login', :with => 'user@example.com'
|
107
108
|
fill_in 'Password', :with => 'password'
|
108
109
|
end
|
109
110
|
click_link 'Sign in'
|
111
|
+
page.should have_content 'Success'
|
110
112
|
end
|
111
113
|
end
|
112
114
|
```
|
@@ -131,21 +133,25 @@ feature "Signing up" do
|
|
131
133
|
end
|
132
134
|
|
133
135
|
scenario "Signing in with correct credentials" do
|
136
|
+
visit '/sessions/new'
|
134
137
|
within("#session") do
|
135
138
|
fill_in 'Login', :with => 'user@example.com'
|
136
139
|
fill_in 'Password', :with => 'caplin'
|
137
140
|
end
|
138
141
|
click_link 'Sign in'
|
142
|
+
page.should have_content 'Success'
|
139
143
|
end
|
140
144
|
|
141
145
|
given(:other_user) { User.make(:email => 'other@example.com', :password => 'rous') }
|
142
146
|
|
143
147
|
scenario "Signing in as another user" do
|
148
|
+
visit '/sessions/new'
|
144
149
|
within("#session") do
|
145
150
|
fill_in 'Login', :with => other_user.email
|
146
151
|
fill_in 'Password', :with => other_user.password
|
147
152
|
end
|
148
153
|
click_link 'Sign in'
|
154
|
+
page.should have_content 'Invalid email or password'
|
149
155
|
end
|
150
156
|
end
|
151
157
|
```
|
@@ -401,7 +407,6 @@ certain elements, and working with and manipulating those elements.
|
|
401
407
|
```ruby
|
402
408
|
page.has_selector?('table tr')
|
403
409
|
page.has_selector?(:xpath, '//table/tr')
|
404
|
-
page.has_no_selector?(:content)
|
405
410
|
|
406
411
|
page.has_xpath?('//table/tr')
|
407
412
|
page.has_css?('table tr.foo')
|
@@ -416,7 +421,6 @@ You can use these with RSpec's magic matchers:
|
|
416
421
|
```ruby
|
417
422
|
page.should have_selector('table tr')
|
418
423
|
page.should have_selector(:xpath, '//table/tr')
|
419
|
-
page.should have_no_selector(:content)
|
420
424
|
|
421
425
|
page.should have_xpath('//table/tr')
|
422
426
|
page.should have_css('table tr.foo')
|
@@ -524,6 +528,49 @@ Finally, in drivers that support it, you can save a screenshot:
|
|
524
528
|
page.save_screenshot('screenshot.png')
|
525
529
|
```
|
526
530
|
|
531
|
+
## Matching
|
532
|
+
|
533
|
+
It is possible to customize how Capybara finds elements. At your disposal
|
534
|
+
are two options, `Capybara.exact` and `Capybara.match`.
|
535
|
+
|
536
|
+
### Exactness
|
537
|
+
|
538
|
+
`Capybara.exact` and the `exact` option work together with the `is` expression
|
539
|
+
inside the XPath gem. When `exact` is true, all `is` expressions match exactly,
|
540
|
+
when it is false, they allow substring matches. Many of the selectors built into
|
541
|
+
Capybara use the `is` expression. This way you can specify whether you want to
|
542
|
+
allow substring matches or not. `Capybara.exact` is false by default.
|
543
|
+
|
544
|
+
For example:
|
545
|
+
|
546
|
+
```ruby
|
547
|
+
click_link("Password") # also matches "Password confirmation"
|
548
|
+
Capybara.exact = true
|
549
|
+
click_link("Password") # does not match "Password confirmation"
|
550
|
+
click_link("Password", exact: false) # can be overridden
|
551
|
+
```
|
552
|
+
|
553
|
+
### Strategy
|
554
|
+
|
555
|
+
Using `Capybara.match` and the equivalent `match` option, you can control how
|
556
|
+
Capybara behaves when multiple elements all match a query. There are currently
|
557
|
+
four different strategies built into Capybara:
|
558
|
+
|
559
|
+
1. **first:** Just picks the first element that matches.
|
560
|
+
2. **one:** Raises an error if more than one element matches.
|
561
|
+
3. **smart:** If `exact` is `true`, raises an error if more than one element
|
562
|
+
matches, just like `one`. If `exact` is `false`, it will first try to find
|
563
|
+
an exact match. An error is raised if more than one element is found. If no
|
564
|
+
element is found, a new search is performed which allows partial matches. If
|
565
|
+
that search returns multiple matches, an error is raised.
|
566
|
+
4. **prefer_exact:** If multiple matches are found, some of which are exact,
|
567
|
+
and some of which are not, then the first exactly matching element is
|
568
|
+
returned.
|
569
|
+
|
570
|
+
The default for `Capybara.match` is `:smart`. To emulate the behaviour in
|
571
|
+
Capybara 2.0.x, set `Capybara.match` to `:one`. To emulate the behaviour in
|
572
|
+
Capybara 1.x, set `Capybara.match` to `:prefer_exact`.
|
573
|
+
|
527
574
|
## Transactions and database setup
|
528
575
|
|
529
576
|
Some Capybara drivers need to run against an actual HTTP server. Capybara takes
|
@@ -575,7 +622,7 @@ page.should have_content('baz')
|
|
575
622
|
If clicking on the *foo* link triggers an asynchronous process, such as
|
576
623
|
an Ajax request, which, when complete will add the *bar* link to the page,
|
577
624
|
clicking on the *bar* link would be expected to fail, since that link doesn't
|
578
|
-
exist yet. However Capybara is smart
|
625
|
+
exist yet. However Capybara is smart enough to retry finding the link for a
|
579
626
|
brief period of time before giving up and throwing an error. The same is true of
|
580
627
|
the next line, which looks for the content *baz* on the page; it will retry
|
581
628
|
looking for that content for a brief time. You can adjust how long this period
|
@@ -648,7 +695,7 @@ This enables its use in unsupported testing frameworks, and for general-purpose
|
|
648
695
|
## Calling remote servers
|
649
696
|
|
650
697
|
Normally Capybara expects to be testing an in-process Rack application, but you
|
651
|
-
can also use it to talk to a web server running anywhere on the
|
698
|
+
can also use it to talk to a web server running anywhere on the internet, by
|
652
699
|
setting app_host:
|
653
700
|
|
654
701
|
```ruby
|
data/lib/capybara.rb
CHANGED
@@ -15,10 +15,10 @@ module Capybara
|
|
15
15
|
class InfiniteRedirectError < CapybaraError; end
|
16
16
|
|
17
17
|
class << self
|
18
|
-
attr_accessor :
|
19
|
-
attr_accessor :server_host, :server_port
|
18
|
+
attr_accessor :asset_host, :app_host, :run_server, :default_host, :always_include_port
|
19
|
+
attr_accessor :server_host, :server_port, :exact, :match, :exact_options, :visible_text_only
|
20
20
|
attr_accessor :default_selector, :default_wait_time, :ignore_hidden_elements
|
21
|
-
attr_accessor :save_and_open_page_path, :automatic_reload
|
21
|
+
attr_accessor :save_and_open_page_path, :automatic_reload, :raise_server_errors
|
22
22
|
attr_writer :default_driver, :current_driver, :javascript_driver, :session_name
|
23
23
|
attr_accessor :app
|
24
24
|
|
@@ -33,9 +33,10 @@ module Capybara
|
|
33
33
|
#
|
34
34
|
# === Configurable options
|
35
35
|
#
|
36
|
-
# [
|
36
|
+
# [asset_host = String] The hostname for a server from which assets can be loaded, used by save_and_open_page
|
37
37
|
# [app_host = String] The default host to use when giving a relative URL to visit
|
38
38
|
# [always_include_port = Boolean] Whether the Rack server's port should automatically be inserted into every visited URL (Default: false)
|
39
|
+
# [asset_host = String] Where dynamic assets are hosted - will be prepended to relative asset locations if present (Default: nil)
|
39
40
|
# [run_server = Boolean] Whether to start a Rack server for the given Rack app (Default: true)
|
40
41
|
# [default_selector = :css/:xpath] Methods which take a selector use the given type by default (Default: CSS)
|
41
42
|
# [default_wait_time = Integer] The number of seconds to wait for asynchronous processes to finish (Default: 2)
|
@@ -88,20 +89,12 @@ module Capybara
|
|
88
89
|
# page.find('table#myTable').has_selector?(:row, 3)
|
89
90
|
# within(:row, 3) { page.should have_content('$100.000') }
|
90
91
|
#
|
91
|
-
#
|
92
|
-
# values. This way you don't have to explicitly specify that you are looking for a row, or
|
93
|
-
# an id. Let's say we want Capybara to treat any Symbols sent into methods like find to be
|
94
|
-
# treated as though they were element ids. We could achieve this like so:
|
92
|
+
# Here is another example:
|
95
93
|
#
|
96
94
|
# Capybara.add_selector(:id) do
|
97
95
|
# xpath { |id| XPath.descendant[XPath.attr(:id) == id.to_s] }
|
98
|
-
# match { |value| value.is_a?(Symbol) }
|
99
96
|
# end
|
100
97
|
#
|
101
|
-
# Now we can retrieve elements by id like this:
|
102
|
-
#
|
103
|
-
# find(:post_123)
|
104
|
-
#
|
105
98
|
# Note that this particular selector already ships with Capybara.
|
106
99
|
#
|
107
100
|
# @param [Symbol] name The name of the selector to add
|
@@ -124,7 +117,7 @@ module Capybara
|
|
124
117
|
# Rack::Handler::Mongrel.run(app, :Port => port)
|
125
118
|
# end
|
126
119
|
#
|
127
|
-
# By default, Capybara will try to run
|
120
|
+
# By default, Capybara will try to run webrick.
|
128
121
|
#
|
129
122
|
# @yield [app, port] This block recieves a rack app and port and should run a Rack handler
|
130
123
|
#
|
@@ -294,53 +287,38 @@ module Capybara
|
|
294
287
|
self.default_driver = nil
|
295
288
|
self.current_driver = nil
|
296
289
|
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
end
|
330
|
-
end
|
331
|
-
end
|
332
|
-
|
333
|
-
module RackTest
|
334
|
-
autoload :Driver, 'capybara/rack_test/driver'
|
335
|
-
autoload :Node, 'capybara/rack_test/node'
|
336
|
-
autoload :Form, 'capybara/rack_test/form'
|
337
|
-
autoload :Browser, 'capybara/rack_test/browser'
|
338
|
-
end
|
339
|
-
|
340
|
-
module Selenium
|
341
|
-
autoload :Node, 'capybara/selenium/node'
|
342
|
-
autoload :Driver, 'capybara/selenium/driver'
|
343
|
-
end
|
290
|
+
module Driver; end
|
291
|
+
module RackTest; end
|
292
|
+
module Selenium; end
|
293
|
+
|
294
|
+
require 'capybara/helpers'
|
295
|
+
require 'capybara/session'
|
296
|
+
require 'capybara/dsl'
|
297
|
+
require 'capybara/server'
|
298
|
+
require 'capybara/selector'
|
299
|
+
require 'capybara/query'
|
300
|
+
require 'capybara/result'
|
301
|
+
require 'capybara/version'
|
302
|
+
|
303
|
+
require 'capybara/node/finders'
|
304
|
+
require 'capybara/node/matchers'
|
305
|
+
require 'capybara/node/actions'
|
306
|
+
require 'capybara/node/simple'
|
307
|
+
require 'capybara/node/base'
|
308
|
+
require 'capybara/node/element'
|
309
|
+
require 'capybara/node/document'
|
310
|
+
|
311
|
+
require 'capybara/driver/base'
|
312
|
+
require 'capybara/driver/node'
|
313
|
+
|
314
|
+
require 'capybara/rack_test/driver'
|
315
|
+
require 'capybara/rack_test/node'
|
316
|
+
require 'capybara/rack_test/form'
|
317
|
+
require 'capybara/rack_test/browser'
|
318
|
+
require 'capybara/rack_test/css_handlers.rb'
|
319
|
+
|
320
|
+
require 'capybara/selenium/node'
|
321
|
+
require 'capybara/selenium/driver'
|
344
322
|
end
|
345
323
|
|
346
324
|
Capybara.configure do |config|
|
@@ -349,9 +327,13 @@ Capybara.configure do |config|
|
|
349
327
|
config.server {|app, port| Capybara.run_default_server(app, port)}
|
350
328
|
config.default_selector = :css
|
351
329
|
config.default_wait_time = 2
|
352
|
-
config.ignore_hidden_elements =
|
330
|
+
config.ignore_hidden_elements = true
|
353
331
|
config.default_host = "http://www.example.com"
|
354
332
|
config.automatic_reload = true
|
333
|
+
config.match = :smart
|
334
|
+
config.exact = false
|
335
|
+
config.raise_server_errors = true
|
336
|
+
config.visible_text_only = false
|
355
337
|
end
|
356
338
|
|
357
339
|
Capybara.register_driver :rack_test do |app|
|
data/lib/capybara/cucumber.rb
CHANGED
data/lib/capybara/driver/base.rb
CHANGED
@@ -7,7 +7,11 @@ class Capybara::Driver::Base
|
|
7
7
|
raise NotImplementedError
|
8
8
|
end
|
9
9
|
|
10
|
-
def
|
10
|
+
def find_xpath(query)
|
11
|
+
raise NotImplementedError
|
12
|
+
end
|
13
|
+
|
14
|
+
def find_css(query)
|
11
15
|
raise NotImplementedError
|
12
16
|
end
|
13
17
|
|
@@ -16,31 +20,31 @@ class Capybara::Driver::Base
|
|
16
20
|
end
|
17
21
|
|
18
22
|
def execute_script(script)
|
19
|
-
raise Capybara::NotSupportedByDriverError
|
23
|
+
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#execute_script'
|
20
24
|
end
|
21
25
|
|
22
26
|
def evaluate_script(script)
|
23
|
-
raise Capybara::NotSupportedByDriverError
|
27
|
+
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#evaluate_script'
|
24
28
|
end
|
25
29
|
|
26
30
|
def save_screenshot(path, options={})
|
27
|
-
raise Capybara::NotSupportedByDriverError
|
31
|
+
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#save_screenshot'
|
28
32
|
end
|
29
33
|
|
30
34
|
def response_headers
|
31
|
-
raise Capybara::NotSupportedByDriverError
|
35
|
+
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#response_headers'
|
32
36
|
end
|
33
37
|
|
34
38
|
def status_code
|
35
|
-
raise Capybara::NotSupportedByDriverError
|
39
|
+
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#status_code'
|
36
40
|
end
|
37
41
|
|
38
|
-
def within_frame(
|
39
|
-
raise Capybara::NotSupportedByDriverError
|
42
|
+
def within_frame(frame_handle)
|
43
|
+
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#within_frame'
|
40
44
|
end
|
41
45
|
|
42
46
|
def within_window(handle)
|
43
|
-
raise Capybara::NotSupportedByDriverError
|
47
|
+
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#within_window'
|
44
48
|
end
|
45
49
|
|
46
50
|
def invalid_element_errors
|
data/lib/capybara/driver/node.rb
CHANGED
@@ -8,7 +8,11 @@ module Capybara
|
|
8
8
|
@native = native
|
9
9
|
end
|
10
10
|
|
11
|
-
def
|
11
|
+
def all_text
|
12
|
+
raise NotImplementedError
|
13
|
+
end
|
14
|
+
|
15
|
+
def visible_text
|
12
16
|
raise NotImplementedError
|
13
17
|
end
|
14
18
|
|
@@ -37,6 +41,10 @@ module Capybara
|
|
37
41
|
raise NotImplementedError
|
38
42
|
end
|
39
43
|
|
44
|
+
def hover
|
45
|
+
raise NotImplementedError
|
46
|
+
end
|
47
|
+
|
40
48
|
def drag_to(element)
|
41
49
|
raise NotImplementedError
|
42
50
|
end
|
@@ -57,22 +65,26 @@ module Capybara
|
|
57
65
|
raise NotImplementedError
|
58
66
|
end
|
59
67
|
|
68
|
+
def disabled?
|
69
|
+
raise NotImplementedError
|
70
|
+
end
|
71
|
+
|
60
72
|
def path
|
61
|
-
raise NotSupportedByDriverError
|
73
|
+
raise NotSupportedByDriverError, 'Capybara::Driver::Node#path'
|
62
74
|
end
|
63
|
-
|
75
|
+
|
64
76
|
def trigger(event)
|
65
|
-
raise NotSupportedByDriverError
|
77
|
+
raise NotSupportedByDriverError, 'Capybara::Driver::Node#trigger'
|
66
78
|
end
|
67
79
|
|
68
80
|
def inspect
|
69
81
|
%(#<#{self.class} tag="#{tag_name}" path="#{path}">)
|
70
|
-
rescue NotSupportedByDriverError
|
82
|
+
rescue NotSupportedByDriverError, 'Capybara::Driver::Node#inspect'
|
71
83
|
%(#<#{self.class} tag="#{tag_name}">)
|
72
84
|
end
|
73
85
|
|
74
86
|
def ==(other)
|
75
|
-
raise NotSupportedByDriverError
|
87
|
+
raise NotSupportedByDriverError, 'Capybara::Driver::Node#=='
|
76
88
|
end
|
77
89
|
end
|
78
90
|
end
|