terminus 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +72 -0
  3. data/lib/capybara/driver/terminus.rb +14 -4
  4. data/lib/terminus.rb +2 -1
  5. data/lib/terminus/browser.rb +30 -7
  6. data/lib/terminus/client.rb +1 -1
  7. data/lib/terminus/client/phantomjs.rb +1 -1
  8. data/lib/terminus/connector.rb +120 -3
  9. data/lib/terminus/controller.rb +1 -1
  10. data/lib/terminus/node.rb +17 -3
  11. data/lib/terminus/proxy.rb +6 -4
  12. data/lib/terminus/proxy/external.rb +14 -9
  13. data/lib/terminus/public/compiled/terminus-min.js +3 -3
  14. data/lib/terminus/public/compiled/terminus.js +62 -17
  15. data/lib/terminus/public/loader.js +2 -1
  16. data/lib/terminus/public/terminus.js +62 -17
  17. data/lib/terminus/views/bootstrap.erb +3 -3
  18. data/lib/terminus/views/index.erb +1 -1
  19. metadata +40 -85
  20. data/README.rdoc +0 -56
  21. data/lib/terminus/connector/server.rb +0 -142
  22. data/lib/terminus/connector/socket_handler.rb +0 -72
  23. data/spec/1.1/reports/android.txt +0 -874
  24. data/spec/1.1/reports/chrome.txt +0 -880
  25. data/spec/1.1/reports/firefox.txt +0 -879
  26. data/spec/1.1/reports/opera.txt +0 -880
  27. data/spec/1.1/reports/phantomjs.txt +0 -874
  28. data/spec/1.1/reports/safari.txt +0 -880
  29. data/spec/1.1/spec_helper.rb +0 -31
  30. data/spec/1.1/terminus_driver_spec.rb +0 -24
  31. data/spec/1.1/terminus_session_spec.rb +0 -19
  32. data/spec/2.0/reports/android.txt +0 -815
  33. data/spec/2.0/reports/chrome.txt +0 -806
  34. data/spec/2.0/reports/firefox.txt +0 -812
  35. data/spec/2.0/reports/opera.txt +0 -806
  36. data/spec/2.0/reports/phantomjs.txt +0 -803
  37. data/spec/2.0/reports/safari.txt +0 -806
  38. data/spec/2.0/spec_helper.rb +0 -21
  39. data/spec/2.0/terminus_spec.rb +0 -25
@@ -1,56 +0,0 @@
1
- = Terminus
2
-
3
- {Terminus}[http://terminus.jcoglan.com] is a {Capybara}[https://github.com/jnicklas/capybara]
4
- driver for real browsers. It lets you control your application in any browser on
5
- any device (including {PhantomJS}[http://phantomjs.org/]), without needing
6
- browser plugins. This allows several types of testing to be automated:
7
-
8
- * Cross-browser testing
9
- * Headless testing
10
- * Multi-browser interaction e.g. messaging apps
11
- * Testing on remote machines, phones, iPads etc
12
-
13
-
14
- == Running the example
15
-
16
- Install the dependencies and boot the Terminus server, then open
17
- {http://localhost:70004/}[http://localhost:70004/] in your browser.
18
-
19
- bundle install
20
- bundle exec bin/terminus
21
-
22
- With your browser open, start an IRB session and begin controlling the app:
23
-
24
- $ irb -r ./example/app
25
- >> extend Capybara::DSL
26
- >> visit '/'
27
- >> click_link 'Sign up!'
28
- >> fill_in 'Username', :with => 'jcoglan'
29
- >> fill_in 'Password', :with => 'hello'
30
- >> choose 'Web scale'
31
- >> click_button 'Go!'
32
-
33
-
34
- == License
35
-
36
- (The MIT License)
37
-
38
- Copyright (c) 2010-2012 James Coglan
39
-
40
- Permission is hereby granted, free of charge, to any person obtaining a copy of
41
- this software and associated documentation files (the 'Software'), to deal in
42
- the Software without restriction, including without limitation the rights to use,
43
- copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
44
- Software, and to permit persons to whom the Software is furnished to do so,
45
- subject to the following conditions:
46
-
47
- The above copyright notice and this permission notice shall be included in all
48
- copies or substantial portions of the Software.
49
-
50
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
51
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
52
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
53
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
54
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
55
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
56
-
@@ -1,142 +0,0 @@
1
- # Based on code from the Poltergeist project
2
- # https://github.com/jonleighton/poltergeist
3
- #
4
- # Copyright (c) 2011 Jonathan Leighton
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- # SOFTWARE.
23
-
24
- module Terminus
25
- module Connector
26
-
27
- class Server
28
- RECV_SIZE = 1024
29
- BIND_TIMEOUT = 5
30
-
31
- def initialize(browser, timeout = BIND_TIMEOUT)
32
- @browser = browser
33
- @skips = 0
34
- @server = start_server
35
- @timeout = timeout
36
- reset
37
- end
38
-
39
- def reset
40
- @closing = false
41
- @env = nil
42
- @handler = nil
43
- @parser = Http::Parser.new
44
- @socket = nil
45
- end
46
-
47
- def connected?
48
- not @socket.nil?
49
- end
50
-
51
- def port
52
- @server.addr[1]
53
- end
54
-
55
- def request(message)
56
- @browser.debug(:send, @browser.id, message)
57
- accept unless connected?
58
- @socket.write(@handler.encode(message))
59
- true while @closing && receive
60
- result = receive
61
- @browser.debug(:recv, @browser.id, result)
62
- reset if result.nil?
63
- result
64
- rescue Errno::ECONNRESET, Errno::EPIPE, Errno::EWOULDBLOCK
65
- reset
66
- nil
67
- end
68
-
69
- def drain_socket
70
- @closing = true if @socket
71
- end
72
-
73
- private
74
-
75
- def start_server
76
- time = Time.now
77
- TCPServer.open(0)
78
- rescue Errno::EADDRINUSE
79
- if (Time.now - time) < BIND_TIMEOUT
80
- sleep(0.01)
81
- retry
82
- else
83
- raise
84
- end
85
- end
86
-
87
- def accept
88
- @skips.times { @server.accept.close }
89
- @socket = @server.accept
90
- while line = @socket.gets
91
- @parser << line
92
- break if line == "\r\n"
93
- end
94
- if line.nil?
95
- accept
96
- @skips += 1
97
- else
98
- @handler = SocketHandler.new(self, env)
99
- @socket.write(@handler.handshake_response)
100
- @browser.debug(:accept, @browser.id, @handler.url)
101
- end
102
- end
103
-
104
- def env
105
- @env ||= begin
106
- env = {'REQUEST_METHOD' => @parser.http_method}
107
- @parser.headers.each do |header, value|
108
- env['HTTP_' + header.upcase.gsub('-', '_')] = value
109
- end
110
- if env['HTTP_SEC_WEBSOCKET_KEY1']
111
- env['rack.input'] = StringIO.new(@socket.read(8))
112
- end
113
- env
114
- end
115
- end
116
-
117
- def receive
118
- @browser.debug(:receive, @browser.id)
119
- start = Time.now
120
-
121
- until @handler.message?
122
- raise Errno::EWOULDBLOCK if (Time.now - start) >= @timeout
123
- IO.select([@socket], [], [], @timeout) or raise Errno::EWOULDBLOCK
124
- data = @socket.recv(RECV_SIZE)
125
- break if data.empty?
126
- @handler << data
127
- break if @handler.nil?
128
- end
129
- @handler && @handler.next_message
130
- end
131
-
132
- def close
133
- [server, socket].compact.each do |s|
134
- s.close_read
135
- s.close_write
136
- end
137
- end
138
- end
139
-
140
- end
141
- end
142
-
@@ -1,72 +0,0 @@
1
- # Based on code from the Poltergeist project
2
- # https://github.com/jonleighton/poltergeist
3
- #
4
- # Copyright (c) 2011 Jonathan Leighton
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- # SOFTWARE.
23
-
24
- module Terminus
25
- module Connector
26
-
27
- class SocketHandler
28
- attr_reader :env
29
-
30
- def initialize(server, env)
31
- @server = server
32
- @env = env
33
- @parser = Faye::WebSocket.parser(env).new(self)
34
- @messages = []
35
- end
36
-
37
- def url
38
- "ws://#{env['HTTP_HOST']}/"
39
- end
40
-
41
- def handshake_response
42
- @parser.handshake_response
43
- end
44
-
45
- def <<(data)
46
- @parser.parse(data)
47
- end
48
-
49
- def encode(message)
50
- @parser.frame(Faye::WebSocket.encode(message))
51
- end
52
-
53
- def receive(message)
54
- @messages << message
55
- end
56
-
57
- def message?
58
- @messages.any?
59
- end
60
-
61
- def next_message
62
- @messages.shift
63
- end
64
-
65
- def close(*args)
66
- @server.reset
67
- end
68
- end
69
-
70
- end
71
- end
72
-
@@ -1,874 +0,0 @@
1
-
2
- Capybara::Session
3
- with non-existant driver
4
- should raise an error
5
-
6
- Capybara::Driver::Terminus
7
- it should behave like driver
8
- #visit
9
- should move to another page
10
- should show the correct URL
11
- #body
12
- should return text reponses
13
- should return the full response html
14
- encoding of response between ascii and utf8
15
- should be valid with html entities
16
- should be valid without html entities
17
- #find
18
- with xpath selector
19
- should extract node texts
20
- should extract node attributes
21
- should extract boolean node attributes
22
- should allow retrieval of the value
23
- should not swallow extra newlines in textarea
24
- should allow assignment of field value
25
- should extract node tag name
26
- should extract node visibility
27
- should extract node checked state
28
- should extract node selected state
29
- should return document text on /html selector
30
- it should behave like driver with javascript support
31
- #find
32
- should find dynamically changed nodes
33
- #drag_to
34
- should drag and drop an object
35
- #evaluate_script
36
- should return the value of the executed script
37
- it should behave like driver with resynchronization support
38
- #find
39
- with synchronization turned on
40
- should wait for all ajax requests to finish
41
- with resynchronization turned off
42
- should not wait for ajax requests to finish
43
- with short synchronization timeout
44
- should raise an error
45
- it should behave like driver with header support
46
- should make headers available through response_headers
47
- it should behave like driver with status code support
48
- should make the status code available through status_code
49
- it should behave like driver with frame support
50
- #within_frame
51
- should find the div in frameOne
52
- should find the div in FrameTwo
53
- should find the text div in the main window after finding text in frameOne
54
- should find the text div in the main window after finding text in frameTwo
55
- it should behave like driver with cookies support
56
- #reset!
57
- should set and clean cookies
58
- it should behave like driver with infinite redirect detection
59
- should follow 5 redirects
60
- should not follow more than 5 redirects
61
-
62
- Capybara::Session
63
- with terminus driver
64
- it should behave like session
65
- should encode complex field names, like array[][value]
66
- #visit
67
- should fetch a response from the driver
68
- #body
69
- should return the unmodified page body
70
- #html
71
- should return the unmodified page body
72
- #source
73
- should return the unmodified page source
74
- #reset_session!
75
- removes cookies
76
- resets current host
77
- resets current path
78
- resets page body
79
- it should behave like all
80
- #all
81
- should find all elements using the given locator
82
- should return an empty array when nothing was found
83
- should accept an XPath instance
84
- with css selectors
85
- should find all elements using the given selector
86
- should find all elements when given a list of selectors
87
- with xpath selectors
88
- should find the first element using the given locator
89
- with css as default selector
90
- should find the first element using the given locator
91
- with visible filter
92
- should only find visible nodes
93
- should only find invisible nodes
94
- within a scope
95
- should find any element using the given locator
96
- it should behave like first
97
- #first
98
- should find the first element using the given locator
99
- should return nil when nothing was found
100
- should accept an XPath instance
101
- with css selectors
102
- should find the first element using the given selector
103
- with xpath selectors
104
- should find the first element using the given locator
105
- with css as default selector
106
- should find the first element using the given locator
107
- with visible filter
108
- should only find visible nodes if true given
109
- should include invisible nodes if false given
110
- with prefer visible elements
111
- should find invisible elements if no visible element exists
112
- should prefer visible elements over invisible elements
113
- should return the first invisible element if no visible elements exist
114
- find visible links normally
115
- without prefer visible elements
116
- should find invisible elements if no visible element exists
117
- should not prefer visible elements over invisible elements
118
- within a scope
119
- should find the first element using the given locator
120
- it should behave like attach_file
121
- #attach_file
122
- with normal form
123
- should set a file path by id (FAILED - 1)
124
- should set a file path by label (FAILED - 2)
125
- with multipart form
126
- should set a file path by id (FAILED - 3)
127
- should set a file path by label (FAILED - 4)
128
- should not break if no file is submitted
129
- should send content type text/plain when uploading a text file (FAILED - 5)
130
- should send content type image/jpeg when uploading an image (FAILED - 6)
131
- should not break when using HTML5 multiple file input (FAILED - 7)
132
- with a locator that doesn't exist
133
- should raise an error
134
- with a path that doesn't exist
135
- should raise an error
136
- it should behave like check
137
- #check
138
- should check a checkbox by id
139
- should check a checkbox by label
140
- 'checked' attribute
141
- should be true if checked
142
- should be false if unchecked
143
- checking
144
- should not change an already checked checkbox
145
- should check an unchecked checkbox
146
- unchecking
147
- should not change an already unchecked checkbox
148
- should uncheck a checked checkbox
149
- with a locator that doesn't exist
150
- should raise an error
151
- it should behave like choose
152
- #choose
153
- should choose a radio button by id
154
- should choose a radio button by label
155
- with a locator that doesn't exist
156
- should raise an error
157
- it should behave like click_link_or_button
158
- #click
159
- should click on a link
160
- should click on a button
161
- should click on a button with no type attribute
162
- should be aliased as click_on
163
- with a locator that doesn't exist
164
- should raise an error
165
- it should behave like click_button
166
- #click_button
167
- should serialize and send valueless buttons that were clicked
168
- should not send image buttons that were not clicked
169
- should serialize and send GET forms
170
- should follow redirects
171
- should post pack to the same URL when no action given
172
- should post pack to the same URL when blank action given
173
- with multiple values with the same name
174
- should use the latest given value
175
- with a form that has a relative url as an action
176
- should post to the correct url
177
- with a form that has no action specified
178
- should post to the correct url
179
- with value given on a submit button
180
- on a form with HTML5 fields
181
- should serialise and submit search fields
182
- should serialise and submit email fields
183
- should serialise and submit url fields
184
- should serialise and submit tel fields
185
- should serialise and submit color fields
186
- on an HTML4 form
187
- should serialize and submit text fields
188
- should escape fields when submitting
189
- should serialize and submit password fields
190
- should serialize and submit hidden fields
191
- should not serialize fields from other forms
192
- should submit the button that was clicked, but not other buttons
193
- should serialize radio buttons
194
- should serialize check boxes
195
- should serialize text areas
196
- should serialize select tag with values
197
- should serialize select tag without values
198
- should serialize first option for select tag with no selection
199
- should not serialize a select tag without options
200
- should not submit disabled fields
201
- with id given on a submit button
202
- should submit the associated form
203
- should work with partial matches
204
- with title given on a submit button
205
- should submit the associated form
206
- should work with partial matches
207
- with alt given on an image button
208
- should submit the associated form
209
- should work with partial matches
210
- with value given on an image button
211
- should submit the associated form
212
- should work with partial matches
213
- with id given on an image button
214
- should submit the associated form
215
- with title given on an image button
216
- should submit the associated form
217
- should work with partial matches
218
- with text given on a button defined by <button> tag
219
- should submit the associated form
220
- should work with partial matches
221
- should prefer exact matches over partial matches
222
- with id given on a button defined by <button> tag
223
- should submit the associated form
224
- should serialize and send GET forms
225
- with value given on a button defined by <button> tag
226
- should submit the associated form
227
- should work with partial matches
228
- should prefer exact matches over partial matches
229
- with title given on a button defined by <button> tag
230
- should submit the associated form
231
- should work with partial matches
232
- with a locator that doesn't exist
233
- should raise an error
234
- it should behave like click_link
235
- #click_link
236
- should follow relative links
237
- should follow redirects
238
- should follow redirects
239
- should add query string to current URL with naked query string
240
- should do nothing on anchor links
241
- should do nothing on URL+anchor links for the same page
242
- should follow link on URL+anchor links for a different page
243
- raise an error with links with no href
244
- with id given
245
- should take user to the linked page
246
- with text given
247
- should take user to the linked page
248
- should accept partial matches
249
- should prefer exact matches over partial matches
250
- with title given
251
- should take user to the linked page
252
- should accept partial matches
253
- should prefer exact matches over partial matches
254
- with alternative text given to a contained image
255
- should take user to the linked page
256
- should take user to the linked page
257
- should prefer exact matches over partial matches
258
- with a locator that doesn't exist
259
- should raise an error
260
- it should behave like fill_in
261
- #fill_in
262
- should fill in a text field by id
263
- should fill in a text field by name
264
- should fill in a text field by label without for (FAILED - 8)
265
- should fill in a url field by label without for
266
- should favour exact label matches over partial matches
267
- should fill in a textarea by id
268
- should fill in a textarea by label
269
- should fill in a textarea by name
270
- should fill in a password field by id
271
- should fill in a field with a custom type
272
- should fill in a field without a type
273
- should fill in a text field respecting its maxlength attribute
274
- should fill in a password field by name
275
- should fill in a password field by label
276
- should fill in a password field by name
277
- should prefer exact matches over partial matches
278
- should throw an exception if a hash containing 'with' is not provided
279
- with ignore_hidden_fields
280
- should not find a hidden field
281
- with a locator that doesn't exist
282
- should raise an error
283
- it should behave like find_button
284
- #find_button
285
- should find any field
286
- should raise error if the field doesn't exist
287
- it should behave like find_field
288
- #find_field
289
- should find any field
290
- should raise error if the field doesn't exist
291
- should be aliased as 'field_labeled' for webrat compatibility
292
- it should behave like find_link
293
- #find_link
294
- should find any field
295
- should raise error if the field doesn't exist
296
- it should behave like find_by_id
297
- #find_by_id
298
- should find any element by id
299
- should raise error if no element with id is found
300
- it should behave like find
301
- #find
302
- should find the first element using the given locator
303
- should find the first element using the given locator and options
304
- should raise ElementNotFound with specified fail message if nothing was found
305
- should raise ElementNotFound with a useful default message if nothing was found
306
- should accept an XPath instance and respect the order of paths
307
- the returned node
308
- should act like a session object
309
- should scope CSS selectors
310
- should have a reference to its parent if there is one
311
- with css selectors
312
- should find the first element using the given locator
313
- with id selectors
314
- should find the first element using the given locator
315
- with xpath selectors
316
- should find the first element using the given locator
317
- with custom selector
318
- should use the custom selector
319
- with custom selector with :for option
320
- should use the selector when it matches the :for option
321
- with custom selector with failure_message option
322
- should raise an error with the failure message if the element is not found
323
- should pass the selector as the second argument
324
- with css as default selector
325
- should find the first element using the given locator
326
- within a scope
327
- should find the first element using the given locator
328
- it should behave like has_content
329
- #has_content?
330
- should be true if the given content is on the page at least once
331
- should be true if scoped to an element which has the content
332
- should be false if scoped to an element which does not have the content
333
- should ignore tags
334
- should ignore extra whitespace and newlines
335
- should be false if the given content is not on the page
336
- should handle single quotes in the content
337
- should handle double quotes in the content
338
- should handle mixed single and double quotes in the content
339
- #has_no_content?
340
- should be false if the given content is on the page at least once
341
- should be false if scoped to an element which has the content
342
- should be true if scoped to an element which does not have the content
343
- should ignore tags
344
- should be true if the given content is not on the page
345
- should handle single quotes in the content
346
- should handle double quotes in the content
347
- should handle mixed single and double quotes in the content
348
- it should behave like has_css
349
- #has_css?
350
- should be true if the given selector is on the page
351
- should be false if the given selector is not on the page
352
- should respect scopes
353
- with between
354
- should be true if the content occurs within the range given
355
- should be false if the content occurs more or fewer times than range
356
- should be false if the content isn't on the page at all
357
- with count
358
- should be true if the content is on the page the given number of times
359
- should be false if the content occurs the given number of times
360
- should be false if the content isn't on the page at all
361
- should coerce count to an integer
362
- with maximum
363
- should be true when content occurs same or fewer times than given
364
- should be false when content occurs more times than given
365
- should be false if the content isn't on the page at all
366
- should coerce maximum to an integer
367
- with minimum
368
- should be true when content occurs same or more times than given
369
- should be false when content occurs fewer times than given
370
- should be false if the content isn't on the page at all
371
- should coerce minimum to an integer
372
- with text
373
- should discard all matches where the given string is not contained
374
- should discard all matches where the given regexp is not matched
375
- #has_no_css?
376
- should be false if the given selector is on the page
377
- should be true if the given selector is not on the page
378
- should respect scopes
379
- with between
380
- should be false if the content occurs within the range given
381
- should be true if the content occurs more or fewer times than range
382
- should be true if the content isn't on the page at all
383
- with count
384
- should be false if the content is on the page the given number of times
385
- should be true if the content is on the page the given number of times
386
- should be true if the content isn't on the page at all
387
- should coerce count to an integer
388
- with maximum
389
- should be false when content occurs same or fewer times than given
390
- should be true when content occurs more times than given
391
- should be true if the content isn't on the page at all
392
- should coerce maximum to an integer
393
- with minimum
394
- should be false when content occurs more times than given
395
- should be true when content occurs fewer times than given
396
- should be true if the content isn't on the page at all
397
- should coerce minimum to an integer
398
- with text
399
- should discard all matches where the given string is not contained
400
- should discard all matches where the given regexp is not matched
401
- it should behave like has_css
402
- #has_css?
403
- should be true if the given selector is on the page
404
- should be false if the given selector is not on the page
405
- should respect scopes
406
- with between
407
- should be true if the content occurs within the range given
408
- should be false if the content occurs more or fewer times than range
409
- should be false if the content isn't on the page at all
410
- with count
411
- should be true if the content is on the page the given number of times
412
- should be false if the content occurs the given number of times
413
- should be false if the content isn't on the page at all
414
- should coerce count to an integer
415
- with maximum
416
- should be true when content occurs same or fewer times than given
417
- should be false when content occurs more times than given
418
- should be false if the content isn't on the page at all
419
- should coerce maximum to an integer
420
- with minimum
421
- should be true when content occurs same or more times than given
422
- should be false when content occurs fewer times than given
423
- should be false if the content isn't on the page at all
424
- should coerce minimum to an integer
425
- with text
426
- should discard all matches where the given string is not contained
427
- should discard all matches where the given regexp is not matched
428
- #has_no_css?
429
- should be false if the given selector is on the page
430
- should be true if the given selector is not on the page
431
- should respect scopes
432
- with between
433
- should be false if the content occurs within the range given
434
- should be true if the content occurs more or fewer times than range
435
- should be true if the content isn't on the page at all
436
- with count
437
- should be false if the content is on the page the given number of times
438
- should be true if the content is on the page the given number of times
439
- should be true if the content isn't on the page at all
440
- should coerce count to an integer
441
- with maximum
442
- should be false when content occurs same or fewer times than given
443
- should be true when content occurs more times than given
444
- should be true if the content isn't on the page at all
445
- should coerce maximum to an integer
446
- with minimum
447
- should be false when content occurs more times than given
448
- should be true when content occurs fewer times than given
449
- should be true if the content isn't on the page at all
450
- should coerce minimum to an integer
451
- with text
452
- should discard all matches where the given string is not contained
453
- should discard all matches where the given regexp is not matched
454
- it should behave like has_selector
455
- #has_selector?
456
- should be true if the given selector is on the page
457
- should be false if the given selector is not on the page
458
- should use default selector
459
- should respect scopes
460
- with count
461
- should be true if the content is on the page the given number of times
462
- should be false if the content is on the page the given number of times
463
- should be false if the content isn't on the page at all
464
- with text
465
- should discard all matches where the given string is not contained
466
- should discard all matches where the given regexp is not matched
467
- #has_no_selector?
468
- should be false if the given selector is on the page
469
- should be true if the given selector is not on the page
470
- should use default selector
471
- should respect scopes
472
- with count
473
- should be false if the content is on the page the given number of times
474
- should be true if the content is on the page the wrong number of times
475
- should be true if the content isn't on the page at all
476
- with text
477
- should discard all matches where the given string is contained
478
- should discard all matches where the given regexp is matched
479
- it should behave like has_xpath
480
- #has_xpath?
481
- should be true if the given selector is on the page
482
- should be false if the given selector is not on the page
483
- should use xpath even if default selector is CSS
484
- should respect scopes
485
- with count
486
- should be true if the content is on the page the given number of times
487
- should be false if the content is on the page the given number of times
488
- should be false if the content isn't on the page at all
489
- with text
490
- should discard all matches where the given string is not contained
491
- should discard all matches where the given regexp is not matched
492
- #has_no_xpath?
493
- should be false if the given selector is on the page
494
- should be true if the given selector is not on the page
495
- should use xpath even if default selector is CSS
496
- should respect scopes
497
- with count
498
- should be false if the content is on the page the given number of times
499
- should be true if the content is on the page the wrong number of times
500
- should be true if the content isn't on the page at all
501
- with text
502
- should discard all matches where the given string is contained
503
- should discard all matches where the given regexp is matched
504
- it should behave like has_link
505
- #has_link?
506
- should be true if the given link is on the page
507
- should be false if the given link is not on the page
508
- #has_no_link?
509
- should be false if the given link is on the page
510
- should be true if the given link is not on the page
511
- it should behave like has_button
512
- #has_button?
513
- should be true if the given button is on the page
514
- should be false if the given button is not on the page
515
- #has_no_button?
516
- should be true if the given button is on the page
517
- should be false if the given button is not on the page
518
- it should behave like has_field
519
- #has_field
520
- should be true if the field is on the page
521
- should be false if the field is not on the page
522
- with value
523
- should be true if a field with the given value is on the page
524
- should be false if the given field is not on the page
525
- should be true after the field has been filled in with the given value
526
- should be false after the field has been filled in with a different value
527
- #has_no_field
528
- should be false if the field is on the page
529
- should be true if the field is not on the page
530
- with value
531
- should be false if a field with the given value is on the page
532
- should be true if the given field is not on the page
533
- should be false after the field has been filled in with the given value
534
- should be true after the field has been filled in with a different value
535
- #has_checked_field?
536
- should be true if a checked field is on the page
537
- should be false if an unchecked field is on the page
538
- should be false if no field is on the page
539
- should be true after an unchecked checkbox is checked
540
- should be false after a checked checkbox is unchecked
541
- should be true after an unchecked radio button is chosen
542
- should be false after another radio button in the group is chosen
543
- #has_no_checked_field?
544
- should be false if a checked field is on the page
545
- should be true if an unchecked field is on the page
546
- should be true if no field is on the page
547
- #has_unchecked_field?
548
- should be false if a checked field is on the page
549
- should be true if an unchecked field is on the page
550
- should be false if no field is on the page
551
- should be false after an unchecked checkbox is checked
552
- should be true after a checked checkbox is unchecked
553
- should be false after an unchecked radio button is chosen
554
- should be true after another radio button in the group is chosen
555
- #has_no_unchecked_field?
556
- should be true if a checked field is on the page
557
- should be false if an unchecked field is on the page
558
- should be true if no field is on the page
559
- it should behave like has_select
560
- #has_select?
561
- should be true if the field is on the page
562
- should be false if the field is not on the page
563
- with selected value
564
- should be true if a field with the given value is on the page
565
- should be false if the given field is not on the page
566
- should be true after the given value is selected
567
- should be false after a different value is selected
568
- should be true after the given values are selected
569
- should be false after one of the values is unselected
570
- with options
571
- should be true if a field with the given options is on the page
572
- should be false if the given field is not on the page
573
- #has_no_select?
574
- should be false if the field is on the page
575
- should be true if the field is not on the page
576
- with selected value
577
- should be false if a field with the given value is on the page
578
- should be true if the given field is not on the page
579
- should be false after the given value is selected
580
- should be true after a different value is selected
581
- should be false after the given values are selected
582
- should be true after one of the values is unselected
583
- with options
584
- should be false if a field with the given options is on the page
585
- should be true if the given field is not on the page
586
- it should behave like has_table
587
- #has_table?
588
- should be true if the field is on the page
589
- should be false if the field is not on the page
590
- with rows
591
- should be true if a table with the given rows is on the page
592
- should be true if the given rows are incomplete
593
- should be false if the given table is not on the page
594
- should be false if the given rows contain incorrect elements
595
- should be false if the given rows are incorrectly ordered
596
- should be false if the only some of the given rows are correct
597
- should be false if the given rows are out of order
598
- #has_no_table?
599
- should be false if the field is on the page
600
- should be true if the field is not on the page
601
- with rows
602
- should be false if a table with the given rows is on the page
603
- should be false if the given rows are incomplete
604
- should be true if the given table is not on the page
605
- should be true if the given rows contain incorrect elements
606
- should be true if the given rows are incorrectly ordered
607
- should be true if the only some of the given rows are correct
608
- should be true if the given rows are out of order
609
- it should behave like select
610
- #select
611
- should return value of the first option
612
- should return value of the selected option
613
- should return the value attribute rather than content if present
614
- should select an option from a select box by id
615
- should select an option from a select box by label
616
- should select an option without giving a select box
617
- should favour exact matches to option labels
618
- should escape quotes
619
- should obey from
620
- show match labels with preceding or trailing whitespace
621
- with a locator that doesn't exist
622
- should raise an error
623
- with an option that doesn't exist
624
- should raise an error
625
- with multiple select
626
- should return an empty value
627
- should return value of the selected options
628
- should select one option
629
- should select multiple options
630
- should remain selected if already selected
631
- should return value attribute rather than content if present
632
- it should behave like text
633
- #text
634
- should print the text of the page
635
- with css as default selector
636
- should print the text of the page
637
- it should behave like uncheck
638
- #uncheck
639
- should uncheck a checkbox by id
640
- should uncheck a checkbox by label
641
- it should behave like unselect
642
- #unselect
643
- with multiple select
644
- should unselect an option from a select box by id
645
- should unselect an option without a select box
646
- should unselect an option from a select box by label
647
- should favour exact matches to option labels
648
- should escape quotes
649
- with single select
650
- should raise an error
651
- with a locator that doesn't exist
652
- should raise an error
653
- with an option that doesn't exist
654
- should raise an error
655
- it should behave like within
656
- #within
657
- with CSS selector
658
- should click links in the given scope
659
- should assert content in the given scope
660
- should accept additional options
661
- with XPath selector
662
- should click links in the given scope
663
- with the default selector
664
- should use XPath
665
- with Node rather than selector
666
- should click links in the given scope
667
- with the default selector set to CSS
668
- should use CSS
669
- with click_link
670
- should click links in the given scope
671
- should raise an error if the scope is not found on the page
672
- should restore the scope when an error is raised
673
- with nested scopes
674
- should respect the inner scope
675
- should respect the outer scope
676
- with forms
677
- should fill in a field and click a button
678
- #within_fieldset
679
- should restrict scope to a fieldset given by id
680
- should restrict scope to a fieldset given by legend
681
- #within_table
682
- should restrict scope to a fieldset given by id
683
- should restrict scope to a fieldset given by legend
684
- it should behave like current_url
685
- #current_url
686
- should return the current url
687
- #current_path
688
- should show the correct location
689
- it should behave like current_host
690
- #current_host
691
- is affected by visiting a page directly
692
- returns to the app host when visiting a relative url
693
- is affected by setting Capybara.app_host
694
- is unaffected by following a relative link
695
- is affected by following an absolute link
696
- is unaffected by posting through a relative form
697
- is affected by posting through an absolute form
698
- is affected by following a redirect
699
- it should behave like session with headers support
700
- #response_headers
701
- should return response headers
702
- it should behave like session with javascript support
703
- all JS specs
704
- Node#drag_to
705
- should drag and drop an object
706
- Node#reload
707
- without automatic reload
708
- should reload the current context of the node
709
- should reload a parent node
710
- should not automatically reload
711
- with automatic reload
712
- should reload the current context of the node automatically
713
- should reload a parent node automatically
714
- should reload a node automatically when using find
715
- should not reload nodes which haven't been found
716
- should reload nodes with options
717
- #find
718
- should allow triggering of custom JS events
719
- #body
720
- should return the current state of the page
721
- #source
722
- should return the original, unmodified source of the page
723
- #evaluate_script
724
- should evaluate the given script and return whatever it produces
725
- #execute_script
726
- should execute the given script and return nothing
727
- #find
728
- should wait for asynchronous load
729
- with frozen time
730
- raises an error suggesting that Capybara is stuck in time
731
- #wait_until
732
- should wait for block to return true
733
- should raise Capybara::TimeoutError if block doesn't return true within timeout
734
- should accept custom timeout in seconds
735
- should default to Capybara.default_wait_time before timeout
736
- #click_link_or_button
737
- should wait for asynchronous load
738
- #click_link
739
- should wait for asynchronous load
740
- #click_button
741
- should wait for asynchronous load
742
- #fill_in
743
- should wait for asynchronous load
744
- #check
745
- should trigger associated events
746
- #has_xpath?
747
- should wait for content to appear
748
- #has_no_xpath?
749
- should wait for content to disappear
750
- #has_css?
751
- should wait for content to appear
752
- #has_no_xpath?
753
- should wait for content to disappear
754
- #has_content?
755
- should wait for content to appear
756
- #has_no_content?
757
- should wait for content to disappear
758
- it should behave like session with status code support
759
- #status_code
760
- should return response codes
761
-
762
- Failures:
763
-
764
- 1) Capybara::Session with terminus driver it should behave like session it should behave like attach_file #attach_file with normal form should set a file path by id
765
- Failure/Error: @session.attach_file "form_image", __FILE__
766
- Capybara::NotSupportedByDriverError:
767
- Capybara::NotSupportedByDriverError
768
- Shared Example Group: "attach_file" called from ./vendor/capybara/1.1/lib/capybara/spec/session.rb:88
769
- # ./lib/terminus/node.rb:66:in `set'
770
- # ./vendor/capybara/1.1/lib/capybara/node/element.rb:79:in `block in set'
771
- # ./vendor/capybara/1.1/lib/capybara/node/base.rb:54:in `wait_until'
772
- # ./vendor/capybara/1.1/lib/capybara/node/element.rb:79:in `set'
773
- # ./vendor/capybara/1.1/lib/capybara/node/actions.rb:158:in `attach_file'
774
- # (eval):2:in `attach_file'
775
- # ./vendor/capybara/1.1/lib/capybara/spec/session/attach_file_spec.rb:12:in `block (4 levels) in <top (required)>'
776
-
777
- 2) Capybara::Session with terminus driver it should behave like session it should behave like attach_file #attach_file with normal form should set a file path by label
778
- Failure/Error: @session.attach_file "Image", __FILE__
779
- Capybara::NotSupportedByDriverError:
780
- Capybara::NotSupportedByDriverError
781
- Shared Example Group: "attach_file" called from ./vendor/capybara/1.1/lib/capybara/spec/session.rb:88
782
- # ./lib/terminus/node.rb:66:in `set'
783
- # ./vendor/capybara/1.1/lib/capybara/node/element.rb:79:in `block in set'
784
- # ./vendor/capybara/1.1/lib/capybara/node/base.rb:54:in `wait_until'
785
- # ./vendor/capybara/1.1/lib/capybara/node/element.rb:79:in `set'
786
- # ./vendor/capybara/1.1/lib/capybara/node/actions.rb:158:in `attach_file'
787
- # (eval):2:in `attach_file'
788
- # ./vendor/capybara/1.1/lib/capybara/spec/session/attach_file_spec.rb:18:in `block (4 levels) in <top (required)>'
789
-
790
- 3) Capybara::Session with terminus driver it should behave like session it should behave like attach_file #attach_file with multipart form should set a file path by id
791
- Failure/Error: @session.attach_file "form_document", @test_file_path
792
- Capybara::NotSupportedByDriverError:
793
- Capybara::NotSupportedByDriverError
794
- Shared Example Group: "attach_file" called from ./vendor/capybara/1.1/lib/capybara/spec/session.rb:88
795
- # ./lib/terminus/node.rb:66:in `set'
796
- # ./vendor/capybara/1.1/lib/capybara/node/element.rb:79:in `block in set'
797
- # ./vendor/capybara/1.1/lib/capybara/node/base.rb:54:in `wait_until'
798
- # ./vendor/capybara/1.1/lib/capybara/node/element.rb:79:in `set'
799
- # ./vendor/capybara/1.1/lib/capybara/node/actions.rb:158:in `attach_file'
800
- # (eval):2:in `attach_file'
801
- # ./vendor/capybara/1.1/lib/capybara/spec/session/attach_file_spec.rb:26:in `block (4 levels) in <top (required)>'
802
-
803
- 4) Capybara::Session with terminus driver it should behave like session it should behave like attach_file #attach_file with multipart form should set a file path by label
804
- Failure/Error: @session.attach_file "Document", @test_file_path
805
- Capybara::NotSupportedByDriverError:
806
- Capybara::NotSupportedByDriverError
807
- Shared Example Group: "attach_file" called from ./vendor/capybara/1.1/lib/capybara/spec/session.rb:88
808
- # ./lib/terminus/node.rb:66:in `set'
809
- # ./vendor/capybara/1.1/lib/capybara/node/element.rb:79:in `block in set'
810
- # ./vendor/capybara/1.1/lib/capybara/node/base.rb:54:in `wait_until'
811
- # ./vendor/capybara/1.1/lib/capybara/node/element.rb:79:in `set'
812
- # ./vendor/capybara/1.1/lib/capybara/node/actions.rb:158:in `attach_file'
813
- # (eval):2:in `attach_file'
814
- # ./vendor/capybara/1.1/lib/capybara/spec/session/attach_file_spec.rb:32:in `block (4 levels) in <top (required)>'
815
-
816
- 5) Capybara::Session with terminus driver it should behave like session it should behave like attach_file #attach_file with multipart form should send content type text/plain when uploading a text file
817
- Failure/Error: @session.attach_file "Document", @test_file_path
818
- Capybara::NotSupportedByDriverError:
819
- Capybara::NotSupportedByDriverError
820
- Shared Example Group: "attach_file" called from ./vendor/capybara/1.1/lib/capybara/spec/session.rb:88
821
- # ./lib/terminus/node.rb:66:in `set'
822
- # ./vendor/capybara/1.1/lib/capybara/node/element.rb:79:in `block in set'
823
- # ./vendor/capybara/1.1/lib/capybara/node/base.rb:54:in `wait_until'
824
- # ./vendor/capybara/1.1/lib/capybara/node/element.rb:79:in `set'
825
- # ./vendor/capybara/1.1/lib/capybara/node/actions.rb:158:in `attach_file'
826
- # (eval):2:in `attach_file'
827
- # ./vendor/capybara/1.1/lib/capybara/spec/session/attach_file_spec.rb:43:in `block (4 levels) in <top (required)>'
828
-
829
- 6) Capybara::Session with terminus driver it should behave like session it should behave like attach_file #attach_file with multipart form should send content type image/jpeg when uploading an image
830
- Failure/Error: @session.attach_file "Document", @test_jpg_file_path
831
- Capybara::NotSupportedByDriverError:
832
- Capybara::NotSupportedByDriverError
833
- Shared Example Group: "attach_file" called from ./vendor/capybara/1.1/lib/capybara/spec/session.rb:88
834
- # ./lib/terminus/node.rb:66:in `set'
835
- # ./vendor/capybara/1.1/lib/capybara/node/element.rb:79:in `block in set'
836
- # ./vendor/capybara/1.1/lib/capybara/node/base.rb:54:in `wait_until'
837
- # ./vendor/capybara/1.1/lib/capybara/node/element.rb:79:in `set'
838
- # ./vendor/capybara/1.1/lib/capybara/node/actions.rb:158:in `attach_file'
839
- # (eval):2:in `attach_file'
840
- # ./vendor/capybara/1.1/lib/capybara/spec/session/attach_file_spec.rb:49:in `block (4 levels) in <top (required)>'
841
-
842
- 7) Capybara::Session with terminus driver it should behave like session it should behave like attach_file #attach_file with multipart form should not break when using HTML5 multiple file input
843
- Failure/Error: @session.attach_file "Multiple Documents", @test_file_path
844
- Capybara::NotSupportedByDriverError:
845
- Capybara::NotSupportedByDriverError
846
- Shared Example Group: "attach_file" called from ./vendor/capybara/1.1/lib/capybara/spec/session.rb:88
847
- # ./lib/terminus/node.rb:66:in `set'
848
- # ./vendor/capybara/1.1/lib/capybara/node/element.rb:79:in `block in set'
849
- # ./vendor/capybara/1.1/lib/capybara/node/base.rb:54:in `wait_until'
850
- # ./vendor/capybara/1.1/lib/capybara/node/element.rb:79:in `set'
851
- # ./vendor/capybara/1.1/lib/capybara/node/actions.rb:158:in `attach_file'
852
- # (eval):2:in `attach_file'
853
- # ./vendor/capybara/1.1/lib/capybara/spec/session/attach_file_spec.rb:55:in `block (4 levels) in <top (required)>'
854
-
855
- 8) Capybara::Session with terminus driver it should behave like session it should behave like fill_in #fill_in should fill in a text field by label without for
856
- Failure/Error: extract_results(@session)['street'].should == 'Avenue Q'
857
- expected: "Avenue Q"
858
- got: "Sesame street 66" (using ==)
859
- Shared Example Group: "fill_in" called from ./vendor/capybara/1.1/lib/capybara/spec/session.rb:94
860
- # ./vendor/capybara/1.1/lib/capybara/spec/session/fill_in_spec.rb:22:in `block (3 levels) in <top (required)>'
861
-
862
- Finished in 55 minutes 27.8 seconds
863
- 509 examples, 8 failures
864
-
865
- Failed examples:
866
-
867
- rspec ./vendor/capybara/1.1/lib/capybara/spec/session/attach_file_spec.rb:11 # Capybara::Session with terminus driver it should behave like session it should behave like attach_file #attach_file with normal form should set a file path by id
868
- rspec ./vendor/capybara/1.1/lib/capybara/spec/session/attach_file_spec.rb:17 # Capybara::Session with terminus driver it should behave like session it should behave like attach_file #attach_file with normal form should set a file path by label
869
- rspec ./vendor/capybara/1.1/lib/capybara/spec/session/attach_file_spec.rb:25 # Capybara::Session with terminus driver it should behave like session it should behave like attach_file #attach_file with multipart form should set a file path by id
870
- rspec ./vendor/capybara/1.1/lib/capybara/spec/session/attach_file_spec.rb:31 # Capybara::Session with terminus driver it should behave like session it should behave like attach_file #attach_file with multipart form should set a file path by label
871
- rspec ./vendor/capybara/1.1/lib/capybara/spec/session/attach_file_spec.rb:42 # Capybara::Session with terminus driver it should behave like session it should behave like attach_file #attach_file with multipart form should send content type text/plain when uploading a text file
872
- rspec ./vendor/capybara/1.1/lib/capybara/spec/session/attach_file_spec.rb:48 # Capybara::Session with terminus driver it should behave like session it should behave like attach_file #attach_file with multipart form should send content type image/jpeg when uploading an image
873
- rspec ./vendor/capybara/1.1/lib/capybara/spec/session/attach_file_spec.rb:54 # Capybara::Session with terminus driver it should behave like session it should behave like attach_file #attach_file with multipart form should not break when using HTML5 multiple file input
874
- rspec ./vendor/capybara/1.1/lib/capybara/spec/session/fill_in_spec.rb:19 # Capybara::Session with terminus driver it should behave like session it should behave like fill_in #fill_in should fill in a text field by label without for