frameworks-capybara 0.2.34 → 0.3.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +0 -6
- data/Gemfile.lock +50 -60
- data/README.rdoc +3 -22
- data/frameworks-capybara.gemspec +4 -17
- data/lib/frameworks/capybara.rb +13 -63
- data/lib/frameworks/cucumber.rb +25 -84
- data/lib/monkey-patches/capybara-mechanize-patches.rb +9 -36
- data/lib/monkey-patches/capybara-patches.rb +1 -7
- data/lib/monkey-patches/cucumber-patches.rb +1 -5
- data/lib/monkey-patches/mechanize-patches.rb +2 -123
- data/lib/monkey-patches/webdriver-patches.rb +2 -31
- data/lib/tasks/frameworks-tasks.rb +1 -1
- data/lib/version.rb +2 -1
- data/spec/frameworks_capybara_spec.rb +22 -191
- data/spec/frameworks_cucumber_spec.rb +3 -160
- data/spec/spec_helper.rb +0 -2
- metadata +37 -153
- data/.travis.yml +0 -8
- data/CHANGES +0 -47
- data/lib/monkey-patches/net-http-persistent-patches.rb +0 -72
- data/spec/capybara_mechanize_patches_spec.rb +0 -124
- data/spec/mock.default/prefs.js +0 -10
- data/spec/profiles.ini +0 -8
- data/spec/unit_test_monkeypatches.rb +0 -17
@@ -14,64 +14,39 @@ describe Frameworks::EnvHelper do
|
|
14
14
|
ENV['ENVIRONMENT'] = 'sandbox'
|
15
15
|
generate_base_urls
|
16
16
|
@base_url.should == 'http://pal.sandbox.dev.bbc.co.uk'
|
17
|
-
@ssl_base_url.should == 'https://ssl.sandbox.dev.bbc.co.uk'
|
18
17
|
@static_base_url.should == 'http://static.sandbox.dev.bbc.co.uk'
|
19
|
-
@m_base_url.should == 'http://m.sandbox.dev.bbc.co.uk'
|
20
|
-
@mobile_base_url.should == 'http://mobile.sandbox.dev.bbc.co.uk'
|
21
|
-
end
|
22
|
-
|
23
|
-
it "should be able to set a local system6 url" do
|
24
|
-
ENV['ENVIRONMENT'] = 'sandbox6'
|
25
|
-
generate_base_urls
|
26
|
-
@base_url.should == 'http://sandbox.bbc.co.uk'
|
27
|
-
@ssl_base_url.should == 'https://ssl.sandbox.bbc.co.uk'
|
28
|
-
@static_base_url.should == 'http://static.sandbox.bbc.co.uk'
|
29
|
-
@m_base_url.should == 'http://m.sandbox.bbc.co.uk'
|
30
|
-
@mobile_base_url.should == 'http://mobile.sandbox.bbc.co.uk'
|
31
18
|
end
|
32
19
|
|
33
20
|
it "should be able to set a base url" do
|
34
21
|
ENV['ENVIRONMENT'] = 'foo'
|
35
22
|
generate_base_urls
|
36
23
|
@base_url.should == 'http://www.foo.bbc.co.uk'
|
37
|
-
@ssl_base_url.should == 'https://ssl.foo.bbc.co.uk'
|
38
24
|
@static_base_url.should == 'http://static.foo.bbci.co.uk'
|
39
25
|
@open_base_url.should == 'http://open.foo.bbc.co.uk'
|
40
|
-
@m_base_url.should == 'http://m.foo.bbc.co.uk'
|
41
|
-
@mobile_base_url.should == 'http://mobile.foo.bbc.co.uk'
|
42
26
|
end
|
43
27
|
|
44
28
|
it "should set correct static base for www.live.bbc.co.uk" do
|
45
29
|
ENV['ENVIRONMENT'] = 'live'
|
46
30
|
generate_base_urls
|
47
31
|
@base_url.should == 'http://www.live.bbc.co.uk'
|
48
|
-
@ssl_base_url.should == 'https://ssl.live.bbc.co.uk'
|
49
32
|
@static_base_url.should == 'http://static.bbci.co.uk'
|
50
33
|
@open_base_url.should == 'http://open.live.bbc.co.uk'
|
51
|
-
@m_base_url.should == 'http://m.live.bbc.co.uk'
|
52
|
-
@mobile_base_url.should == 'http://mobile.live.bbc.co.uk'
|
53
34
|
end
|
54
35
|
|
55
36
|
it "should be able to set a base url and not be case sensitive" do
|
56
37
|
ENV['ENVIRONMENT'] = 'fOo'
|
57
38
|
generate_base_urls
|
58
39
|
@base_url.should == 'http://www.foo.bbc.co.uk'
|
59
|
-
@ssl_base_url.should == 'https://ssl.foo.bbc.co.uk'
|
60
40
|
@static_base_url.should == 'http://static.foo.bbci.co.uk'
|
61
41
|
@open_base_url.should == 'http://open.foo.bbc.co.uk'
|
62
|
-
@m_base_url.should == 'http://m.foo.bbc.co.uk'
|
63
|
-
@mobile_base_url.should == 'http://mobile.foo.bbc.co.uk'
|
64
42
|
end
|
65
43
|
|
66
44
|
it "should set correct static base for www.live.bbc.co.uk and not be case sensitive" do
|
67
45
|
ENV['ENVIRONMENT'] = 'LiVe'
|
68
46
|
generate_base_urls
|
69
47
|
@base_url.should == 'http://www.live.bbc.co.uk'
|
70
|
-
@ssl_base_url.should == 'https://ssl.live.bbc.co.uk'
|
71
48
|
@static_base_url.should == 'http://static.bbci.co.uk'
|
72
49
|
@open_base_url.should == 'http://open.live.bbc.co.uk'
|
73
|
-
@m_base_url.should == 'http://m.live.bbc.co.uk'
|
74
|
-
@mobile_base_url.should == 'http://mobile.live.bbc.co.uk'
|
75
50
|
end
|
76
51
|
|
77
52
|
|
@@ -80,172 +55,40 @@ describe Frameworks::EnvHelper do
|
|
80
55
|
ENV['WWW_LIVE'] = 'false'
|
81
56
|
generate_base_urls
|
82
57
|
@base_url.should == 'http://www.bbc.co.uk'
|
83
|
-
@ssl_base_url.should == 'https://ssl.bbc.co.uk'
|
84
|
-
@static_base_url.should == 'http://static.bbci.co.uk'
|
85
|
-
@open_base_url.should == 'http://open.bbc.co.uk'
|
86
|
-
@m_base_url.should == 'http://m.bbc.co.uk'
|
87
|
-
@mobile_base_url.should == 'http://mobile.bbc.co.uk'
|
88
|
-
end
|
89
|
-
|
90
|
-
it "should be able to set pal url and not be case sensitive" do
|
91
|
-
ENV['ENVIRONMENT'] = 'Live'
|
92
|
-
generate_base_urls
|
93
|
-
@base_url.should == 'http://www.live.bbc.co.uk'
|
94
|
-
@pal_base_url.should == 'http://pal.live.bbc.co.uk'
|
95
|
-
@ssl_base_url.should == 'https://ssl.live.bbc.co.uk'
|
96
|
-
@static_base_url.should == 'http://static.bbci.co.uk'
|
97
|
-
@open_base_url.should == 'http://open.live.bbc.co.uk'
|
98
|
-
@m_base_url.should == 'http://m.live.bbc.co.uk'
|
99
|
-
@mobile_base_url.should == 'http://mobile.live.bbc.co.uk'
|
100
|
-
end
|
101
|
-
|
102
|
-
it "pal url should still have environment even if asking for classic live url" do
|
103
|
-
ENV['ENVIRONMENT'] = 'Live'
|
104
|
-
ENV['WWW_LIVE'] = 'false'
|
105
|
-
generate_base_urls
|
106
|
-
@base_url.should == 'http://www.bbc.co.uk'
|
107
|
-
@pal_base_url.should == 'http://pal.live.bbc.co.uk'
|
108
|
-
@ssl_base_url.should == 'https://ssl.bbc.co.uk'
|
109
58
|
@static_base_url.should == 'http://static.bbci.co.uk'
|
110
59
|
@open_base_url.should == 'http://open.bbc.co.uk'
|
111
|
-
@m_base_url.should == 'http://m.bbc.co.uk'
|
112
|
-
@mobile_base_url.should == 'http://mobile.bbc.co.uk'
|
113
60
|
end
|
114
61
|
|
115
|
-
|
116
|
-
|
117
62
|
it "should be able to set scheme to ssl" do
|
118
63
|
ENV['SCHEME'] = 'https'
|
119
64
|
ENV['ENVIRONMENT'] = 'foo'
|
120
65
|
generate_base_urls
|
121
66
|
@base_url.should == 'https://www.foo.bbc.co.uk'
|
122
|
-
@ssl_base_url.should == 'https://ssl.foo.bbc.co.uk'
|
123
67
|
@static_base_url.should == 'https://static.foo.bbci.co.uk'
|
124
68
|
@open_base_url.should == 'https://open.foo.bbc.co.uk'
|
125
69
|
end
|
126
70
|
|
127
|
-
it "should be able to set proxy host
|
71
|
+
it "should be able to set proxy host correctly to use in tests using HTTP_PROXY env variable" do
|
128
72
|
ENV['ENVIRONMENT'] = 'foo'
|
129
|
-
ENV['HTTP_PROXY'] = 'http://mycache.co.uk:
|
73
|
+
ENV['HTTP_PROXY'] = 'http://mycache.co.uk:80'
|
130
74
|
generate_base_urls
|
131
75
|
@proxy_host.should == "mycache.co.uk"
|
132
|
-
@proxy_port.should == "8080"
|
133
76
|
end
|
134
77
|
|
135
78
|
it "should be able to set proxy host correctly to use in tests using http_proxy env variable" do
|
136
79
|
ENV['ENVIRONMENT'] = 'foo'
|
137
|
-
ENV['http_proxy'] = 'http://mycache.co.uk:
|
138
|
-
generate_base_urls
|
139
|
-
@proxy_host.should == "mycache.co.uk"
|
140
|
-
@proxy_port.should == "8080"
|
141
|
-
end
|
142
|
-
|
143
|
-
it "should be able to use 80 as default proxy port when none specified" do
|
144
|
-
ENV['ENVIRONMENT'] = 'foo'
|
145
|
-
ENV['http_proxy'] = 'http://mycache.co.uk'
|
146
|
-
generate_base_urls
|
147
|
-
@proxy_host.should == "mycache.co.uk"
|
148
|
-
@proxy_port.should == "80"
|
149
|
-
end
|
150
|
-
|
151
|
-
it "should be able to handle an environment variable which doesn't have the protocol" do
|
152
|
-
ENV['ENVIRONMENT'] = 'foo'
|
153
|
-
ENV['http_proxy'] = 'mycache.co.uk'
|
80
|
+
ENV['http_proxy'] = 'http://mycache.co.uk:80'
|
154
81
|
generate_base_urls
|
155
82
|
@proxy_host.should == "mycache.co.uk"
|
156
|
-
@proxy_port.should == "80"
|
157
|
-
end
|
158
|
-
|
159
|
-
it "should be able to have an empty http_proxy environment variable" do
|
160
|
-
ENV['ENVIRONMENT'] = 'foo'
|
161
|
-
ENV['http_proxy'] = ''
|
162
|
-
generate_base_urls
|
163
|
-
@proxy_host.should be_nil
|
164
|
-
@proxy_port.should be_nil
|
165
|
-
end
|
166
|
-
|
167
|
-
it "should be able to set a local url with expected domain" do
|
168
|
-
ENV['ENVIRONMENT'] = 'sandbox'
|
169
|
-
ENV['FW_BBC_DOMAIN'] = 'bbc.com'
|
170
|
-
generate_base_urls
|
171
|
-
@base_url.should == 'http://pal.sandbox.dev.bbc.com'
|
172
|
-
@ssl_base_url.should == 'https://ssl.sandbox.dev.bbc.com'
|
173
|
-
@static_base_url.should == 'http://static.sandbox.dev.bbc.com'
|
174
|
-
@m_base_url.should == 'http://m.sandbox.dev.bbc.com'
|
175
|
-
@mobile_base_url.should == 'http://mobile.sandbox.dev.bbc.com'
|
176
|
-
end
|
177
|
-
|
178
|
-
it "should be able to set a local system6 url with expected domain" do
|
179
|
-
ENV['ENVIRONMENT'] = 'sandbox6'
|
180
|
-
ENV['FW_BBC_DOMAIN'] = 'bbc.com'
|
181
|
-
generate_base_urls
|
182
|
-
@base_url.should == 'http://sandbox.bbc.com'
|
183
|
-
@ssl_base_url.should == 'https://ssl.sandbox.bbc.com'
|
184
|
-
@static_base_url.should == 'http://static.sandbox.bbc.com'
|
185
|
-
@m_base_url.should == 'http://m.sandbox.bbc.com'
|
186
|
-
@mobile_base_url.should == 'http://mobile.sandbox.bbc.com'
|
187
|
-
end
|
188
|
-
|
189
|
-
it "should be able to set a base url with expected domain" do
|
190
|
-
ENV['ENVIRONMENT'] = 'foo'
|
191
|
-
ENV['FW_BBC_DOMAIN'] = 'bbc.com'
|
192
|
-
generate_base_urls
|
193
|
-
@base_url.should == 'http://www.foo.bbc.com'
|
194
|
-
@ssl_base_url.should == 'https://ssl.foo.bbc.com'
|
195
|
-
@static_base_url.should == 'http://static.foo.bbci.co.uk'
|
196
|
-
@open_base_url.should == 'http://open.foo.bbc.com'
|
197
|
-
@m_base_url.should == 'http://m.foo.bbc.com'
|
198
|
-
@mobile_base_url.should == 'http://mobile.foo.bbc.com'
|
199
|
-
end
|
200
|
-
|
201
|
-
it "should set public facing live domain" do
|
202
|
-
ENV['ENVIRONMENT'] = 'live'
|
203
|
-
ENV['WWW_LIVE'] = 'false'
|
204
|
-
ENV['FW_BBC_DOMAIN'] = 'bbc.com'
|
205
|
-
generate_base_urls
|
206
|
-
@base_url.should == 'http://www.bbc.com'
|
207
|
-
@ssl_base_url.should == 'https://ssl.bbc.com'
|
208
|
-
@static_base_url.should == 'http://static.bbci.co.uk'
|
209
|
-
@open_base_url.should == 'http://open.bbc.com'
|
210
|
-
@m_base_url.should == 'http://m.bbc.com'
|
211
|
-
@mobile_base_url.should == 'http://mobile.bbc.com'
|
212
83
|
end
|
213
84
|
|
214
85
|
=begin
|
215
86
|
#don't want to push proxy addr online
|
216
87
|
it "should be able to validate xhtml online" do
|
217
88
|
@proxy_host = ''
|
218
|
-
@proxy_port = ''
|
219
89
|
xhtml = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><title>a</title></head><body><p>a</p></body></html>'
|
220
90
|
validate_online(xhtml)
|
221
91
|
end
|
222
|
-
|
223
|
-
it "should be able to report errors for invalid markup" do
|
224
|
-
@proxy_host = ''
|
225
|
-
@proxy_port = ''
|
226
|
-
xhtml = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><nosuchelement><title>a</title></head><body><p>a</p></body></html>'
|
227
|
-
expect {
|
228
|
-
validate_online(xhtml)
|
229
|
-
}.to raise_error(RuntimeError)
|
230
|
-
end
|
231
92
|
=end
|
232
|
-
end
|
233
|
-
|
234
|
-
describe "independent mechanize agent" do
|
235
|
-
include Frameworks::EnvHelper
|
236
|
-
|
237
|
-
it "should allow you to create an independent, configured mechanize object" do
|
238
|
-
ENV['HTTP_PROXY'] = 'http://mycache.co.uk:80'
|
239
|
-
agent = new_mechanize
|
240
|
-
agent.should be_a_kind_of Mechanize
|
241
|
-
agent.proxy_addr.should == 'mycache.co.uk'
|
242
|
-
end
|
243
|
-
|
244
|
-
it "the proxy should be separately configurable" do
|
245
|
-
agent = new_mechanize(http_proxy='http://mycache.co.uk:80')
|
246
|
-
agent.should be_a_kind_of Mechanize
|
247
|
-
agent.proxy_addr.should == 'mycache.co.uk'
|
248
|
-
end
|
249
|
-
|
250
93
|
end
|
251
94
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: frameworks-capybara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 15424039
|
5
|
+
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
- rc
|
11
|
+
- 1
|
12
|
+
version: 0.3.0.rc1
|
11
13
|
platform: ruby
|
12
14
|
authors:
|
13
15
|
- matt robbins
|
@@ -15,106 +17,28 @@ autorequire:
|
|
15
17
|
bindir: bin
|
16
18
|
cert_chain: []
|
17
19
|
|
18
|
-
date:
|
20
|
+
date: 2012-04-24 00:00:00 +01:00
|
19
21
|
default_executable:
|
20
22
|
dependencies:
|
21
23
|
- !ruby/object:Gem::Dependency
|
22
24
|
type: :runtime
|
23
|
-
|
24
|
-
version_requirements: &id001 !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 61
|
30
|
-
segments:
|
31
|
-
- 1
|
32
|
-
- 25
|
33
|
-
version: "1.25"
|
34
|
-
name: mime-types
|
35
|
-
requirement: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
type: :runtime
|
38
|
-
prerelease: false
|
39
|
-
version_requirements: &id002 !ruby/object:Gem::Requirement
|
25
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
40
26
|
none: false
|
41
27
|
requirements:
|
42
|
-
- -
|
28
|
+
- - ">="
|
43
29
|
- !ruby/object:Gem::Version
|
44
30
|
hash: 23
|
45
31
|
segments:
|
46
32
|
- 1
|
47
|
-
- 5
|
48
|
-
- 10
|
49
|
-
version: 1.5.10
|
50
|
-
name: nokogiri
|
51
|
-
requirement: *id002
|
52
|
-
- !ruby/object:Gem::Dependency
|
53
|
-
type: :runtime
|
54
|
-
prerelease: false
|
55
|
-
version_requirements: &id003 !ruby/object:Gem::Requirement
|
56
|
-
none: false
|
57
|
-
requirements:
|
58
|
-
- - ~>
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
hash: 41
|
61
|
-
segments:
|
62
33
|
- 0
|
63
|
-
- 9
|
64
|
-
- 9
|
65
|
-
version: 0.9.9
|
66
|
-
name: rubyzip
|
67
|
-
requirement: *id003
|
68
|
-
- !ruby/object:Gem::Dependency
|
69
|
-
type: :runtime
|
70
|
-
prerelease: false
|
71
|
-
version_requirements: &id004 !ruby/object:Gem::Requirement
|
72
|
-
none: false
|
73
|
-
requirements:
|
74
|
-
- - ">="
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
hash: 3
|
77
|
-
segments:
|
78
34
|
- 0
|
79
|
-
version:
|
80
|
-
name: selenium-webdriver
|
81
|
-
requirement: *id004
|
82
|
-
- !ruby/object:Gem::Dependency
|
83
|
-
type: :runtime
|
84
|
-
prerelease: false
|
85
|
-
version_requirements: &id005 !ruby/object:Gem::Requirement
|
86
|
-
none: false
|
87
|
-
requirements:
|
88
|
-
- - ~>
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
hash: 23
|
91
|
-
segments:
|
92
|
-
- 1
|
93
|
-
- 1
|
94
|
-
- 2
|
95
|
-
version: 1.1.2
|
35
|
+
version: 1.0.0
|
96
36
|
name: capybara
|
97
|
-
|
98
|
-
- !ruby/object:Gem::Dependency
|
99
|
-
type: :runtime
|
37
|
+
version_requirements: *id001
|
100
38
|
prerelease: false
|
101
|
-
version_requirements: &id006 !ruby/object:Gem::Requirement
|
102
|
-
none: false
|
103
|
-
requirements:
|
104
|
-
- - "="
|
105
|
-
- !ruby/object:Gem::Version
|
106
|
-
hash: 23
|
107
|
-
segments:
|
108
|
-
- 2
|
109
|
-
- 7
|
110
|
-
- 2
|
111
|
-
version: 2.7.2
|
112
|
-
name: mechanize
|
113
|
-
requirement: *id006
|
114
39
|
- !ruby/object:Gem::Dependency
|
115
40
|
type: :runtime
|
116
|
-
|
117
|
-
version_requirements: &id007 !ruby/object:Gem::Requirement
|
41
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
118
42
|
none: false
|
119
43
|
requirements:
|
120
44
|
- - ">="
|
@@ -125,48 +49,12 @@ dependencies:
|
|
125
49
|
- 3
|
126
50
|
- 0
|
127
51
|
version: 0.3.0
|
128
|
-
- - <
|
129
|
-
- !ruby/object:Gem::Version
|
130
|
-
hash: 23
|
131
|
-
segments:
|
132
|
-
- 1
|
133
|
-
- 0
|
134
|
-
- 0
|
135
|
-
version: 1.0.0
|
136
52
|
name: capybara-mechanize
|
137
|
-
|
138
|
-
- !ruby/object:Gem::Dependency
|
139
|
-
type: :runtime
|
53
|
+
version_requirements: *id002
|
140
54
|
prerelease: false
|
141
|
-
version_requirements: &id008 !ruby/object:Gem::Requirement
|
142
|
-
none: false
|
143
|
-
requirements:
|
144
|
-
- - ">="
|
145
|
-
- !ruby/object:Gem::Version
|
146
|
-
hash: 3
|
147
|
-
segments:
|
148
|
-
- 0
|
149
|
-
version: "0"
|
150
|
-
name: json
|
151
|
-
requirement: *id008
|
152
55
|
- !ruby/object:Gem::Dependency
|
153
56
|
type: :runtime
|
154
|
-
|
155
|
-
version_requirements: &id009 !ruby/object:Gem::Requirement
|
156
|
-
none: false
|
157
|
-
requirements:
|
158
|
-
- - ">="
|
159
|
-
- !ruby/object:Gem::Version
|
160
|
-
hash: 3
|
161
|
-
segments:
|
162
|
-
- 0
|
163
|
-
version: "0"
|
164
|
-
name: headless
|
165
|
-
requirement: *id009
|
166
|
-
- !ruby/object:Gem::Dependency
|
167
|
-
type: :runtime
|
168
|
-
prerelease: false
|
169
|
-
version_requirements: &id010 !ruby/object:Gem::Requirement
|
57
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
170
58
|
none: false
|
171
59
|
requirements:
|
172
60
|
- - ">="
|
@@ -176,11 +64,11 @@ dependencies:
|
|
176
64
|
- 0
|
177
65
|
version: "0"
|
178
66
|
name: capybara-celerity
|
179
|
-
|
67
|
+
version_requirements: *id003
|
68
|
+
prerelease: false
|
180
69
|
- !ruby/object:Gem::Dependency
|
181
70
|
type: :runtime
|
182
|
-
|
183
|
-
version_requirements: &id011 !ruby/object:Gem::Requirement
|
71
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
184
72
|
none: false
|
185
73
|
requirements:
|
186
74
|
- - ">="
|
@@ -190,11 +78,11 @@ dependencies:
|
|
190
78
|
- 0
|
191
79
|
version: "0"
|
192
80
|
name: w3c_validators
|
193
|
-
|
194
|
-
- !ruby/object:Gem::Dependency
|
195
|
-
type: :runtime
|
81
|
+
version_requirements: *id004
|
196
82
|
prerelease: false
|
197
|
-
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
type: :development
|
85
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
198
86
|
none: false
|
199
87
|
requirements:
|
200
88
|
- - ">="
|
@@ -206,11 +94,11 @@ dependencies:
|
|
206
94
|
- 5
|
207
95
|
version: 0.10.5
|
208
96
|
name: cucumber
|
209
|
-
|
97
|
+
version_requirements: *id005
|
98
|
+
prerelease: false
|
210
99
|
- !ruby/object:Gem::Dependency
|
211
100
|
type: :development
|
212
|
-
|
213
|
-
version_requirements: &id013 !ruby/object:Gem::Requirement
|
101
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
214
102
|
none: false
|
215
103
|
requirements:
|
216
104
|
- - ">="
|
@@ -220,11 +108,11 @@ dependencies:
|
|
220
108
|
- 0
|
221
109
|
version: "0"
|
222
110
|
name: rake
|
223
|
-
|
111
|
+
version_requirements: *id006
|
112
|
+
prerelease: false
|
224
113
|
- !ruby/object:Gem::Dependency
|
225
114
|
type: :development
|
226
|
-
|
227
|
-
version_requirements: &id014 !ruby/object:Gem::Requirement
|
115
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
228
116
|
none: false
|
229
117
|
requirements:
|
230
118
|
- - ">="
|
@@ -236,7 +124,8 @@ dependencies:
|
|
236
124
|
- 0
|
237
125
|
version: 1.0.0
|
238
126
|
name: rspec
|
239
|
-
|
127
|
+
version_requirements: *id007
|
128
|
+
prerelease: false
|
240
129
|
description: Gem to ease the pain of managing capybara driver config and provide a home for common utils and patches
|
241
130
|
email:
|
242
131
|
- mcrobbins@gmail.com
|
@@ -250,8 +139,6 @@ files:
|
|
250
139
|
- .document
|
251
140
|
- .gitignore
|
252
141
|
- .rspec
|
253
|
-
- .travis.yml
|
254
|
-
- CHANGES
|
255
142
|
- Gemfile
|
256
143
|
- Gemfile.lock
|
257
144
|
- LICENSE.txt
|
@@ -265,18 +152,13 @@ files:
|
|
265
152
|
- lib/monkey-patches/capybara-patches.rb
|
266
153
|
- lib/monkey-patches/cucumber-patches.rb
|
267
154
|
- lib/monkey-patches/mechanize-patches.rb
|
268
|
-
- lib/monkey-patches/net-http-persistent-patches.rb
|
269
155
|
- lib/monkey-patches/send-keys.rb
|
270
156
|
- lib/monkey-patches/webdriver-patches.rb
|
271
157
|
- lib/tasks/frameworks-tasks.rb
|
272
158
|
- lib/version.rb
|
273
|
-
- spec/capybara_mechanize_patches_spec.rb
|
274
159
|
- spec/frameworks_capybara_spec.rb
|
275
160
|
- spec/frameworks_cucumber_spec.rb
|
276
|
-
- spec/mock.default/prefs.js
|
277
|
-
- spec/profiles.ini
|
278
161
|
- spec/spec_helper.rb
|
279
|
-
- spec/unit_test_monkeypatches.rb
|
280
162
|
has_rdoc: true
|
281
163
|
homepage:
|
282
164
|
licenses: []
|
@@ -298,16 +180,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
298
180
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
299
181
|
none: false
|
300
182
|
requirements:
|
301
|
-
- - "
|
183
|
+
- - ">"
|
302
184
|
- !ruby/object:Gem::Version
|
303
|
-
hash:
|
185
|
+
hash: 25
|
304
186
|
segments:
|
305
|
-
-
|
306
|
-
|
187
|
+
- 1
|
188
|
+
- 3
|
189
|
+
- 1
|
190
|
+
version: 1.3.1
|
307
191
|
requirements: []
|
308
192
|
|
309
193
|
rubyforge_project:
|
310
|
-
rubygems_version: 1.
|
194
|
+
rubygems_version: 1.6.0
|
311
195
|
signing_key:
|
312
196
|
specification_version: 3
|
313
197
|
summary: Gem to ease the pain of managing capybara driver config and provide a home for common utils and patches
|
data/.travis.yml
DELETED
data/CHANGES
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
0.2.34
|
2
|
-
Improved validate_online method to disregard system/OS errors.
|
3
|
-
|
4
|
-
0.2.33
|
5
|
-
Specify different runtime dependencies depending on the ruby version.
|
6
|
-
|
7
|
-
0.2.32
|
8
|
-
Fix Ruby 1.9 RSpec test failures introduced in release 0.2.31
|
9
|
-
|
10
|
-
0.2.31
|
11
|
-
Added Firefox profile certificate handling via the FIREFOX_CERT_PATH and FIREFOX_CERT_PREFIX variables.
|
12
|
-
|
13
|
-
0.2.30
|
14
|
-
Fixed rake profiles listings to work with Ruby 1.9+
|
15
|
-
|
16
|
-
0.2.29
|
17
|
-
Updated add_cookie patch to use new http_cookie API, following Mechanize changes (see http://bit.ly/12Do1l7)
|
18
|
-
|
19
|
-
0.2.28
|
20
|
-
Updated Mechanize::CookieJar add patch to work with latest capybara-mechanize.
|
21
|
-
Added support for httpOnly cookie flag to capybara mechanize patch
|
22
|
-
|
23
|
-
0.2.27
|
24
|
-
Can now specify arguments passed to the browser via the BROWSER_CLI_ARGS environment variable.
|
25
|
-
|
26
|
-
0.2.25
|
27
|
-
Modified cucumber html report monkey patch to work with cucumber >= 1.3.0
|
28
|
-
|
29
|
-
0.2.24
|
30
|
-
Added FW_BBC_DOMAIN param in order to set the top level domain used for requests.
|
31
|
-
|
32
|
-
0.2.23
|
33
|
-
Updated capybara-mechanize patch to send referer header.
|
34
|
-
|
35
|
-
0.2.22
|
36
|
-
Update Centos6 sandbox DNS to sandbox.bbc.co.uk.
|
37
|
-
|
38
|
-
0.2.21
|
39
|
-
Add support for Centos6 sandbox.
|
40
|
-
Update Gemfile.lock to latest gem versions.
|
41
|
-
|
42
|
-
0.2.20
|
43
|
-
validate_online() now takes optional hash of parameters to pass to MarkupValidator.
|
44
|
-
Updated proxy handling to pick up port and to work without protocol or port.
|
45
|
-
|
46
|
-
0.2.19
|
47
|
-
Present production release.
|
@@ -1,72 +0,0 @@
|
|
1
|
-
#Adding no_proxy_host logic for Mechanize2 which uses this
|
2
|
-
#gem for it's HTTP client logic
|
3
|
-
#TODO: Grab from envirnment variable optionally, or provide list
|
4
|
-
class Net::HTTP::Persistent
|
5
|
-
|
6
|
-
##
|
7
|
-
# Creates a new connection for +uri+
|
8
|
-
def connection_for uri
|
9
|
-
Thread.current[@generation_key] ||= Hash.new { |h,k| h[k] = {} }
|
10
|
-
Thread.current[@ssl_generation_key] ||= Hash.new { |h,k| h[k] = {} }
|
11
|
-
Thread.current[@request_key] ||= Hash.new 0
|
12
|
-
Thread.current[@timeout_key] ||= Hash.new EPOCH
|
13
|
-
|
14
|
-
use_ssl = uri.scheme.downcase == 'https'
|
15
|
-
|
16
|
-
if use_ssl then
|
17
|
-
ssl_generation = @ssl_generation
|
18
|
-
|
19
|
-
ssl_cleanup ssl_generation
|
20
|
-
|
21
|
-
connections = Thread.current[@ssl_generation_key][ssl_generation]
|
22
|
-
else
|
23
|
-
generation = @generation
|
24
|
-
|
25
|
-
cleanup generation
|
26
|
-
|
27
|
-
connections = Thread.current[@generation_key][generation]
|
28
|
-
end
|
29
|
-
|
30
|
-
net_http_args = [uri.host, uri.port]
|
31
|
-
connection_id = net_http_args.join ':'
|
32
|
-
#
|
33
|
-
#Frameworks patch (and condition)
|
34
|
-
if @proxy_uri and !uri.host.include? 'sandbox' then
|
35
|
-
connection_id << @proxy_connection_id
|
36
|
-
net_http_args.concat @proxy_args
|
37
|
-
end
|
38
|
-
|
39
|
-
connection = connections[connection_id]
|
40
|
-
|
41
|
-
unless connection = connections[connection_id] then
|
42
|
-
connections[connection_id] = http_class.new(*net_http_args)
|
43
|
-
connection = connections[connection_id]
|
44
|
-
ssl connection if use_ssl
|
45
|
-
else
|
46
|
-
reset connection if expired? connection
|
47
|
-
end
|
48
|
-
|
49
|
-
unless connection.started? then
|
50
|
-
connection.set_debug_output @debug_output if @debug_output
|
51
|
-
connection.open_timeout = @open_timeout if @open_timeout
|
52
|
-
connection.read_timeout = @read_timeout if @read_timeout
|
53
|
-
|
54
|
-
connection.start
|
55
|
-
|
56
|
-
socket = connection.instance_variable_get :@socket
|
57
|
-
|
58
|
-
if socket then # for fakeweb
|
59
|
-
@socket_options.each do |option|
|
60
|
-
socket.io.setsockopt(*option)
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
connection
|
66
|
-
rescue Errno::ECONNREFUSED
|
67
|
-
raise Error, "connection refused: #{connection.address}:#{connection.port}"
|
68
|
-
rescue Errno::EHOSTDOWN
|
69
|
-
raise Error, "host down: #{connection.address}:#{connection.port}"
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|