@@ -34,15 +34,15 @@ Capybara has 2 main parts
34
34
* imporant methods
35
35
* ` #visit `
36
36
* ` #current_path `
37
- * delegates many methods to ` Capybara::Document `
37
+ * delegates many methods to ` Capybara::Document ` so essentially you can
38
+ think of a Session as having a superset of the Document|Element API
38
39
* ` page ` in your test is an instance of ` Capybara::Session `
39
40
* ` Capybara::Document `
40
41
* represents the HTML document
41
42
* ` Capybara::Result `
42
- * A Result represents a collection of ` Capybara::Element ` on the page. It
43
+ * A Result represents a collection of ` Capybara::Node:: Element ` on the page. It
43
44
is possible to interact with this collection similar to an ` Array `
44
- because it implements Enumerable and offers the following Array methods
45
- through delegation
45
+ because it implements Enumerable and offers Array methods through delegation
46
46
* ` Capybara::Node::Base `
47
47
* ` Capybara::Node::Element `
48
48
* ` Capybara::Query `
@@ -96,11 +96,11 @@ Element and Document are both children of Node::Base. They share 3 kinds of meth
96
96
* => They inherit ` find ` wait behaviour
97
97
3 . Matchers
98
98
* these methods fall into 2 categories:
99
- 1 . predicate methods
100
- * return true|false
101
- 2 . asserts
99
+ 1 . asserts
102
100
* return true if pass
103
101
* return Capybara::ExpectationNotMet if fail
102
+ 2 . predicate methods
103
+ * return true|false
104
104
* examples
105
105
1 . ` #assert_no_selector `
106
106
2 . ` #assert_no_text `
@@ -132,6 +132,7 @@ Element and Document are both children of Node::Base. They share 3 kinds of meth
132
132
4 . Node methods
133
133
* These are stubbed out in capybara but must be implemented by whatever driver you use
134
134
* It seems like drivers subclass Driver::Node
135
+ * The "action" methods above use #find to get the Node::Element and then manipulate it with these
135
136
* => they have a different implementation in different drivers
136
137
* Examples:
137
138
1 . ` ==(other) `
@@ -157,6 +158,88 @@ Element and Document are both children of Node::Base. They share 3 kinds of meth
157
158
21 . ` visible? `
158
159
22 . ` visible_text `
159
160
161
+
162
+
163
+ ## Drivers
164
+
165
+ Inheritance Heirarchy
166
+
167
+ ```
168
+ Object
169
+ Capybara::Driver::Base
170
+ RackTest::Driver
171
+ Selenium::Driver
172
+ Capybara::Driver::Node
173
+ RackTest::Node
174
+ Selenium::Node
175
+ ```
176
+
177
+ * Driver::Base methods:
178
+ ```
179
+ accept_modal
180
+ browser_initialized?
181
+ close_window
182
+ current_url
183
+ current_window_handle
184
+ dismiss_modal
185
+ evaluate_script
186
+ execute_script
187
+ find_css
188
+ find_xpath
189
+ go_back
190
+ go_forward
191
+ html
192
+ invalid_element_errors
193
+ maximize_window
194
+ needs_server?
195
+ no_such_window_error
196
+ open_new_window
197
+ reset!
198
+ resize_window_to
199
+ response_headers
200
+ save_screenshot
201
+ status_code
202
+ switch_to_window
203
+ visit
204
+ wait?
205
+ window_handles
206
+ window_size
207
+ within_frame
208
+ within_window
209
+ ```
210
+ * Driver::Node methods
211
+ ```
212
+ =
213
+ []
214
+ all_text
215
+ checked?
216
+ click
217
+ disabled?
218
+ double_click
219
+ drag_to
220
+ hover
221
+ initialize
222
+ inspect
223
+ path
224
+ right_click
225
+ select_option
226
+ selected?
227
+ set
228
+ tag_name
229
+ trigger
230
+ unselect_option
231
+ value
232
+ visible?
233
+ visible_text
234
+ ```
235
+
236
+
237
+
238
+ You can get at the current driver (which will have real implementations of these methods) via `page.driver`
239
+
240
+
241
+ # Getting stuff from a Capybara::Node::Element
242
+
160
243
If you have an instance of Capybara::Node::Element, how do you find out stuff about it
161
244
162
245
```ruby
0 commit comments