poltergeist 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +77 -40
- data/lib/capybara/poltergeist.rb +11 -11
- data/lib/capybara/poltergeist/browser.rb +35 -12
- data/lib/capybara/poltergeist/client.rb +9 -12
- data/lib/capybara/poltergeist/client/agent.coffee +99 -6
- data/lib/capybara/poltergeist/client/browser.coffee +57 -79
- data/lib/capybara/poltergeist/client/compiled/agent.js +179 -19
- data/lib/capybara/poltergeist/client/compiled/browser.js +109 -81
- data/lib/capybara/poltergeist/client/compiled/connection.js +8 -1
- data/lib/capybara/poltergeist/client/compiled/main.js +75 -34
- data/lib/capybara/poltergeist/client/compiled/node.js +32 -39
- data/lib/capybara/poltergeist/client/compiled/web_page.js +118 -41
- data/lib/capybara/poltergeist/client/main.coffee +11 -23
- data/lib/capybara/poltergeist/client/node.coffee +16 -33
- data/lib/capybara/poltergeist/client/web_page.coffee +57 -26
- data/lib/capybara/poltergeist/driver.rb +36 -6
- data/lib/capybara/poltergeist/errors.rb +4 -15
- data/lib/capybara/poltergeist/json.rb +25 -0
- data/lib/capybara/poltergeist/network_traffic.rb +6 -0
- data/lib/capybara/poltergeist/network_traffic/request.rb +26 -0
- data/lib/capybara/poltergeist/network_traffic/response.rb +40 -0
- data/lib/capybara/poltergeist/node.rb +10 -6
- data/lib/capybara/poltergeist/version.rb +1 -1
- data/lib/capybara/poltergeist/web_socket_server.rb +3 -0
- metadata +112 -23
@@ -1,14 +1,14 @@
|
|
1
1
|
module Capybara::Poltergeist
|
2
2
|
class Node < Capybara::Driver::Node
|
3
|
-
attr_reader :page_id
|
3
|
+
attr_reader :page_id, :id
|
4
4
|
|
5
5
|
def initialize(driver, page_id, id)
|
6
|
-
super(driver,
|
6
|
+
super(driver, self)
|
7
|
+
|
7
8
|
@page_id = page_id
|
9
|
+
@id = id
|
8
10
|
end
|
9
11
|
|
10
|
-
alias id native
|
11
|
-
|
12
12
|
def browser
|
13
13
|
driver.browser
|
14
14
|
end
|
@@ -52,10 +52,10 @@ module Capybara::Poltergeist
|
|
52
52
|
when 'file'
|
53
53
|
command :select_file, value
|
54
54
|
else
|
55
|
-
command :set, value
|
55
|
+
command :set, value.to_s
|
56
56
|
end
|
57
57
|
elsif tag_name == 'textarea'
|
58
|
-
command :set, value
|
58
|
+
command :set, value.to_s
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
@@ -95,5 +95,9 @@ module Capybara::Poltergeist
|
|
95
95
|
def trigger(event)
|
96
96
|
command :trigger, event
|
97
97
|
end
|
98
|
+
|
99
|
+
def ==(other)
|
100
|
+
command :equals, other.id
|
101
|
+
end
|
98
102
|
end
|
99
103
|
end
|
@@ -125,7 +125,10 @@ module Capybara::Poltergeist
|
|
125
125
|
# Block until the next message is available from the Web Socket.
|
126
126
|
# Raises Errno::EWOULDBLOCK if timeout is reached.
|
127
127
|
def receive
|
128
|
+
start = Time.now
|
129
|
+
|
128
130
|
until handler.message?
|
131
|
+
raise Errno::EWOULDBLOCK if (Time.now - start) >= timeout
|
129
132
|
IO.select([socket], [], [], timeout) or raise Errno::EWOULDBLOCK
|
130
133
|
data = socket.recv(RECV_SIZE)
|
131
134
|
break if data.empty?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: poltergeist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,22 +9,27 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-07-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capybara
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '1.
|
21
|
+
version: '1.1'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.1'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: multi_json
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ~>
|
@@ -32,10 +37,15 @@ dependencies:
|
|
32
37
|
version: '1.0'
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '1.0'
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: childprocess
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ~>
|
@@ -43,10 +53,15 @@ dependencies:
|
|
43
53
|
version: '0.3'
|
44
54
|
type: :runtime
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.3'
|
47
62
|
- !ruby/object:Gem::Dependency
|
48
63
|
name: http_parser.rb
|
49
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
50
65
|
none: false
|
51
66
|
requirements:
|
52
67
|
- - ~>
|
@@ -54,10 +69,15 @@ dependencies:
|
|
54
69
|
version: 0.5.3
|
55
70
|
type: :runtime
|
56
71
|
prerelease: false
|
57
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 0.5.3
|
58
78
|
- !ruby/object:Gem::Dependency
|
59
79
|
name: faye-websocket
|
60
|
-
requirement:
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
61
81
|
none: false
|
62
82
|
requirements:
|
63
83
|
- - ~>
|
@@ -68,10 +88,18 @@ dependencies:
|
|
68
88
|
version: 0.4.4
|
69
89
|
type: :runtime
|
70
90
|
prerelease: false
|
71
|
-
version_requirements:
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
none: false
|
93
|
+
requirements:
|
94
|
+
- - ~>
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.4'
|
97
|
+
- - ! '>='
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: 0.4.4
|
72
100
|
- !ruby/object:Gem::Dependency
|
73
101
|
name: rspec
|
74
|
-
requirement:
|
102
|
+
requirement: !ruby/object:Gem::Requirement
|
75
103
|
none: false
|
76
104
|
requirements:
|
77
105
|
- - ~>
|
@@ -79,10 +107,15 @@ dependencies:
|
|
79
107
|
version: '2.8'
|
80
108
|
type: :development
|
81
109
|
prerelease: false
|
82
|
-
version_requirements:
|
110
|
+
version_requirements: !ruby/object:Gem::Requirement
|
111
|
+
none: false
|
112
|
+
requirements:
|
113
|
+
- - ~>
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '2.8'
|
83
116
|
- !ruby/object:Gem::Dependency
|
84
117
|
name: sinatra
|
85
|
-
requirement:
|
118
|
+
requirement: !ruby/object:Gem::Requirement
|
86
119
|
none: false
|
87
120
|
requirements:
|
88
121
|
- - ~>
|
@@ -90,10 +123,15 @@ dependencies:
|
|
90
123
|
version: '1.0'
|
91
124
|
type: :development
|
92
125
|
prerelease: false
|
93
|
-
version_requirements:
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
none: false
|
128
|
+
requirements:
|
129
|
+
- - ~>
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '1.0'
|
94
132
|
- !ruby/object:Gem::Dependency
|
95
133
|
name: rake
|
96
|
-
requirement:
|
134
|
+
requirement: !ruby/object:Gem::Requirement
|
97
135
|
none: false
|
98
136
|
requirements:
|
99
137
|
- - ~>
|
@@ -101,10 +139,15 @@ dependencies:
|
|
101
139
|
version: 0.9.2
|
102
140
|
type: :development
|
103
141
|
prerelease: false
|
104
|
-
version_requirements:
|
142
|
+
version_requirements: !ruby/object:Gem::Requirement
|
143
|
+
none: false
|
144
|
+
requirements:
|
145
|
+
- - ~>
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: 0.9.2
|
105
148
|
- !ruby/object:Gem::Dependency
|
106
149
|
name: image_size
|
107
|
-
requirement:
|
150
|
+
requirement: !ruby/object:Gem::Requirement
|
108
151
|
none: false
|
109
152
|
requirements:
|
110
153
|
- - ~>
|
@@ -112,7 +155,44 @@ dependencies:
|
|
112
155
|
version: '1.0'
|
113
156
|
type: :development
|
114
157
|
prerelease: false
|
115
|
-
version_requirements:
|
158
|
+
version_requirements: !ruby/object:Gem::Requirement
|
159
|
+
none: false
|
160
|
+
requirements:
|
161
|
+
- - ~>
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
version: '1.0'
|
164
|
+
- !ruby/object:Gem::Dependency
|
165
|
+
name: coffee-script
|
166
|
+
requirement: !ruby/object:Gem::Requirement
|
167
|
+
none: false
|
168
|
+
requirements:
|
169
|
+
- - ~>
|
170
|
+
- !ruby/object:Gem::Version
|
171
|
+
version: 2.2.0
|
172
|
+
type: :development
|
173
|
+
prerelease: false
|
174
|
+
version_requirements: !ruby/object:Gem::Requirement
|
175
|
+
none: false
|
176
|
+
requirements:
|
177
|
+
- - ~>
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: 2.2.0
|
180
|
+
- !ruby/object:Gem::Dependency
|
181
|
+
name: guard-coffeescript
|
182
|
+
requirement: !ruby/object:Gem::Requirement
|
183
|
+
none: false
|
184
|
+
requirements:
|
185
|
+
- - ~>
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: 1.0.0
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
none: false
|
192
|
+
requirements:
|
193
|
+
- - ~>
|
194
|
+
- !ruby/object:Gem::Version
|
195
|
+
version: 1.0.0
|
116
196
|
description: PhantomJS driver for Capybara
|
117
197
|
email:
|
118
198
|
- j@jonathanleighton.com
|
@@ -128,6 +208,9 @@ files:
|
|
128
208
|
- lib/capybara/poltergeist/errors.rb
|
129
209
|
- lib/capybara/poltergeist/util.rb
|
130
210
|
- lib/capybara/poltergeist/web_socket_server.rb
|
211
|
+
- lib/capybara/poltergeist/json.rb
|
212
|
+
- lib/capybara/poltergeist/network_traffic/request.rb
|
213
|
+
- lib/capybara/poltergeist/network_traffic/response.rb
|
131
214
|
- lib/capybara/poltergeist/version.rb
|
132
215
|
- lib/capybara/poltergeist/spawn.rb
|
133
216
|
- lib/capybara/poltergeist/driver.rb
|
@@ -144,6 +227,7 @@ files:
|
|
144
227
|
- lib/capybara/poltergeist/client/browser.coffee
|
145
228
|
- lib/capybara/poltergeist/client/agent.coffee
|
146
229
|
- lib/capybara/poltergeist/node.rb
|
230
|
+
- lib/capybara/poltergeist/network_traffic.rb
|
147
231
|
- LICENSE
|
148
232
|
- README.md
|
149
233
|
homepage: http://github.com/jonleighton/poltergeist
|
@@ -158,17 +242,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
158
242
|
- - ! '>='
|
159
243
|
- !ruby/object:Gem::Version
|
160
244
|
version: '0'
|
245
|
+
segments:
|
246
|
+
- 0
|
247
|
+
hash: 557027964753938347
|
161
248
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
162
249
|
none: false
|
163
250
|
requirements:
|
164
251
|
- - ! '>='
|
165
252
|
- !ruby/object:Gem::Version
|
166
253
|
version: '0'
|
254
|
+
segments:
|
255
|
+
- 0
|
256
|
+
hash: 557027964753938347
|
167
257
|
requirements: []
|
168
258
|
rubyforge_project:
|
169
|
-
rubygems_version: 1.8.
|
259
|
+
rubygems_version: 1.8.24
|
170
260
|
signing_key:
|
171
261
|
specification_version: 3
|
172
262
|
summary: PhantomJS driver for Capybara
|
173
263
|
test_files: []
|
174
|
-
has_rdoc:
|