capybara-webkit 1.4.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +15 -15
- data/LICENSE +1 -1
- data/NEWS.md +5 -0
- data/README.md +32 -7
- data/gemfiles/2.3.gemfile.lock +10 -10
- data/gemfiles/2.4.gemfile.lock +10 -10
- data/lib/capybara/webkit/version.rb +1 -1
- data/lib/capybara_webkit_builder.rb +3 -18
- data/spec/capybara_webkit_builder_spec.rb +0 -12
- data/spec/driver_spec.rb +20 -2
- data/spec/spec_helper.rb +12 -0
- data/src/StdinNotifier.cpp +2 -0
- data/src/WebPage.h +1 -0
- data/src/WebPageManager.cpp +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3e42d4678023063942b9966f2ca08001363a3c2
|
4
|
+
data.tar.gz: 9d80735bf7b20fd0e64329985f28097ba0774d33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9d695309b9b677688cecec39a235a5c0556d9b0c72e12a89ff2578ec34bacdb03720fd1a624187383bdaaaaf17659ffad1e579a5245f57e4289d8d8ebbd93c7
|
7
|
+
data.tar.gz: 2e643305242c83c92843c1642f12d0a3a74331a02e84b2ba140a2a9482f4cf7053fe4670cc93399f4407ed0f3c645782f165265950ad5be1a1a73ba91035c325
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
capybara-webkit (1.
|
4
|
+
capybara-webkit (1.5.0)
|
5
5
|
capybara (>= 2.3.0, < 2.5.0)
|
6
6
|
json
|
7
7
|
|
@@ -18,13 +18,13 @@ GEM
|
|
18
18
|
rack (>= 1.0.0)
|
19
19
|
rack-test (>= 0.5.4)
|
20
20
|
xpath (~> 2.0)
|
21
|
-
childprocess (0.
|
21
|
+
childprocess (0.5.5)
|
22
22
|
ffi (~> 1.0, >= 1.0.11)
|
23
23
|
diff-lcs (1.2.4)
|
24
|
-
ffi (1.9.
|
25
|
-
ffi (1.9.
|
26
|
-
ffi (1.9.
|
27
|
-
json (1.8.
|
24
|
+
ffi (1.9.8)
|
25
|
+
ffi (1.9.8-java)
|
26
|
+
ffi (1.9.8-x86-mingw32)
|
27
|
+
json (1.8.2)
|
28
28
|
launchy (2.4.2)
|
29
29
|
addressable (~> 2.3)
|
30
30
|
launchy (2.4.2-java)
|
@@ -33,14 +33,14 @@ GEM
|
|
33
33
|
mime-types (2.4.3)
|
34
34
|
mini_magick (3.2.1)
|
35
35
|
subexec (~> 0.0.4)
|
36
|
-
mini_portile (0.6.
|
37
|
-
multi_json (1.
|
38
|
-
nokogiri (1.6.
|
36
|
+
mini_portile (0.6.2)
|
37
|
+
multi_json (1.11.0)
|
38
|
+
nokogiri (1.6.6.2)
|
39
39
|
mini_portile (~> 0.6.0)
|
40
40
|
rack (1.5.2)
|
41
41
|
rack-protection (1.3.2)
|
42
42
|
rack
|
43
|
-
rack-test (0.6.
|
43
|
+
rack-test (0.6.3)
|
44
44
|
rack (>= 1.0)
|
45
45
|
rake (0.9.2)
|
46
46
|
rspec (2.14.1)
|
@@ -51,12 +51,12 @@ GEM
|
|
51
51
|
rspec-expectations (2.14.1)
|
52
52
|
diff-lcs (>= 1.1.3, < 2.0)
|
53
53
|
rspec-mocks (2.14.3)
|
54
|
-
rubyzip (1.1.
|
55
|
-
selenium-webdriver (2.
|
56
|
-
childprocess (
|
54
|
+
rubyzip (1.1.7)
|
55
|
+
selenium-webdriver (2.45.0)
|
56
|
+
childprocess (~> 0.5)
|
57
57
|
multi_json (~> 1.0)
|
58
58
|
rubyzip (~> 1.0)
|
59
|
-
websocket (~> 1.0
|
59
|
+
websocket (~> 1.0)
|
60
60
|
sinatra (1.3.5)
|
61
61
|
rack (~> 1.4)
|
62
62
|
rack-protection (~> 1.3)
|
@@ -65,7 +65,7 @@ GEM
|
|
65
65
|
ffi
|
66
66
|
subexec (0.0.4)
|
67
67
|
tilt (1.3.3)
|
68
|
-
websocket (1.
|
68
|
+
websocket (1.2.1)
|
69
69
|
xpath (2.0.0)
|
70
70
|
nokogiri (~> 1.3)
|
71
71
|
|
data/LICENSE
CHANGED
data/NEWS.md
CHANGED
data/README.md
CHANGED
@@ -142,20 +142,45 @@ page.driver.allow_url 'example.com/*.js'
|
|
142
142
|
Contributing
|
143
143
|
------------
|
144
144
|
|
145
|
-
See the CONTRIBUTING document.
|
145
|
+
See the [CONTRIBUTING] document.
|
146
|
+
Thank you, [contributors]!
|
147
|
+
|
148
|
+
[CONTRIBUTING]: CONTRIBUTING.md
|
149
|
+
[contributors]: https://github.com/thoughtbot/capybara-webkit/graphs/contributors
|
150
|
+
|
151
|
+
Need Help?
|
152
|
+
----------
|
153
|
+
|
154
|
+
We offer 1-on-1 coaching. We can help you install Qt, set up Capybara, get
|
155
|
+
started writing integration tests, and track down slow or erratic tests. [Get in
|
156
|
+
touch].
|
157
|
+
|
158
|
+
[Get in touch]: http://coaching.thoughtbot.com/rails/?utm_source=github
|
159
|
+
|
160
|
+
License
|
161
|
+
-------
|
162
|
+
|
163
|
+
capybara-webkit is Copyright (c) 2010-2015 thoughtbot, inc. It is free software,
|
164
|
+
and may be redistributed under the terms specified in the [LICENSE] file.
|
165
|
+
|
166
|
+
[LICENSE]: /LICENSE
|
146
167
|
|
147
168
|
About
|
148
169
|
-----
|
149
170
|
|
150
|
-
The capybara WebKit driver is maintained by Joe Ferris and Matt Horan.
|
171
|
+
The capybara WebKit driver is maintained by Joe Ferris and Matt Horan.
|
151
172
|
|
152
|
-
Code for rendering the current webpage to a PNG is borrowed from Phantom.js'
|
173
|
+
Code for rendering the current webpage to a PNG is borrowed from Phantom.js'
|
174
|
+
implementation.
|
153
175
|
|
154
|
-

|
155
177
|
|
178
|
+
capybara-webkit is maintained and funded by thoughtbot, inc.
|
156
179
|
The names and logos for thoughtbot are trademarks of thoughtbot, inc.
|
157
180
|
|
158
|
-
|
159
|
-
|
181
|
+
We love open source software!
|
182
|
+
See [our other projects][community]
|
183
|
+
or [hire us][hire] to help build your product.
|
160
184
|
|
161
|
-
|
185
|
+
[community]: https://thoughtbot.com/community?utm_source=github
|
186
|
+
[hire]: https://thoughtbot.com/hire-us?utm_source=github
|
data/gemfiles/2.3.gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../
|
3
3
|
specs:
|
4
|
-
capybara-webkit (1.
|
4
|
+
capybara-webkit (1.5.0)
|
5
5
|
capybara (>= 2.3.0, < 2.5.0)
|
6
6
|
json
|
7
7
|
|
@@ -18,18 +18,18 @@ GEM
|
|
18
18
|
rack (>= 1.0.0)
|
19
19
|
rack-test (>= 0.5.4)
|
20
20
|
xpath (~> 2.0)
|
21
|
-
childprocess (0.5.
|
21
|
+
childprocess (0.5.5)
|
22
22
|
ffi (~> 1.0, >= 1.0.11)
|
23
23
|
diff-lcs (1.2.5)
|
24
|
-
ffi (1.9.
|
25
|
-
json (1.8.
|
24
|
+
ffi (1.9.8)
|
25
|
+
json (1.8.2)
|
26
26
|
launchy (2.4.2)
|
27
27
|
addressable (~> 2.3)
|
28
28
|
mime-types (2.3)
|
29
29
|
mini_magick (3.7.0)
|
30
30
|
subexec (~> 0.2.1)
|
31
31
|
mini_portile (0.6.0)
|
32
|
-
multi_json (1.
|
32
|
+
multi_json (1.11.0)
|
33
33
|
nokogiri (1.6.2.1)
|
34
34
|
mini_portile (= 0.6.0)
|
35
35
|
rack (1.5.2)
|
@@ -46,19 +46,19 @@ GEM
|
|
46
46
|
rspec-expectations (2.14.5)
|
47
47
|
diff-lcs (>= 1.1.3, < 2.0)
|
48
48
|
rspec-mocks (2.14.6)
|
49
|
-
rubyzip (1.1.
|
50
|
-
selenium-webdriver (2.
|
51
|
-
childprocess (
|
49
|
+
rubyzip (1.1.7)
|
50
|
+
selenium-webdriver (2.45.0)
|
51
|
+
childprocess (~> 0.5)
|
52
52
|
multi_json (~> 1.0)
|
53
53
|
rubyzip (~> 1.0)
|
54
|
-
websocket (~> 1.0
|
54
|
+
websocket (~> 1.0)
|
55
55
|
sinatra (1.4.5)
|
56
56
|
rack (~> 1.4)
|
57
57
|
rack-protection (~> 1.4)
|
58
58
|
tilt (~> 1.3, >= 1.3.4)
|
59
59
|
subexec (0.2.3)
|
60
60
|
tilt (1.4.1)
|
61
|
-
websocket (1.
|
61
|
+
websocket (1.2.1)
|
62
62
|
xpath (2.0.0)
|
63
63
|
nokogiri (~> 1.3)
|
64
64
|
|
data/gemfiles/2.4.gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../
|
3
3
|
specs:
|
4
|
-
capybara-webkit (1.
|
4
|
+
capybara-webkit (1.5.0)
|
5
5
|
capybara (>= 2.3.0, < 2.5.0)
|
6
6
|
json
|
7
7
|
|
@@ -18,18 +18,18 @@ GEM
|
|
18
18
|
rack (>= 1.0.0)
|
19
19
|
rack-test (>= 0.5.4)
|
20
20
|
xpath (~> 2.0)
|
21
|
-
childprocess (0.5.
|
21
|
+
childprocess (0.5.5)
|
22
22
|
ffi (~> 1.0, >= 1.0.11)
|
23
23
|
diff-lcs (1.2.5)
|
24
|
-
ffi (1.9.
|
25
|
-
json (1.8.
|
24
|
+
ffi (1.9.8)
|
25
|
+
json (1.8.2)
|
26
26
|
launchy (2.4.2)
|
27
27
|
addressable (~> 2.3)
|
28
28
|
mime-types (2.4.3)
|
29
29
|
mini_magick (3.7.0)
|
30
30
|
subexec (~> 0.2.1)
|
31
31
|
mini_portile (0.6.0)
|
32
|
-
multi_json (1.
|
32
|
+
multi_json (1.11.0)
|
33
33
|
nokogiri (1.6.3.1)
|
34
34
|
mini_portile (= 0.6.0)
|
35
35
|
rack (1.5.2)
|
@@ -46,19 +46,19 @@ GEM
|
|
46
46
|
rspec-expectations (2.14.5)
|
47
47
|
diff-lcs (>= 1.1.3, < 2.0)
|
48
48
|
rspec-mocks (2.14.6)
|
49
|
-
rubyzip (1.1.
|
50
|
-
selenium-webdriver (2.
|
51
|
-
childprocess (
|
49
|
+
rubyzip (1.1.7)
|
50
|
+
selenium-webdriver (2.45.0)
|
51
|
+
childprocess (~> 0.5)
|
52
52
|
multi_json (~> 1.0)
|
53
53
|
rubyzip (~> 1.0)
|
54
|
-
websocket (~> 1.0
|
54
|
+
websocket (~> 1.0)
|
55
55
|
sinatra (1.4.5)
|
56
56
|
rack (~> 1.4)
|
57
57
|
rack-protection (~> 1.4)
|
58
58
|
tilt (~> 1.3, >= 1.3.4)
|
59
59
|
subexec (0.2.3)
|
60
60
|
tilt (1.4.1)
|
61
|
-
websocket (1.
|
61
|
+
websocket (1.2.1)
|
62
62
|
xpath (2.0.0)
|
63
63
|
nokogiri (~> 1.3)
|
64
64
|
|
@@ -16,32 +16,17 @@ module CapybaraWebkitBuilder
|
|
16
16
|
ENV['QMAKE'] || default_qmake_binary
|
17
17
|
end
|
18
18
|
|
19
|
-
def spec
|
20
|
-
ENV['SPEC'] || os_spec
|
21
|
-
end
|
22
|
-
|
23
19
|
def default_qmake_binary
|
24
20
|
case RbConfig::CONFIG['host_os']
|
25
21
|
when /freebsd/
|
26
22
|
"qmake-qt4"
|
23
|
+
when /openbsd/
|
24
|
+
"qmake-qt5"
|
27
25
|
else
|
28
26
|
"qmake"
|
29
27
|
end
|
30
28
|
end
|
31
29
|
|
32
|
-
def os_spec
|
33
|
-
case RbConfig::CONFIG['host_os']
|
34
|
-
when /linux/
|
35
|
-
"linux-g++"
|
36
|
-
when /freebsd/
|
37
|
-
"freebsd-g++"
|
38
|
-
when /mingw32/
|
39
|
-
"win32-g++"
|
40
|
-
else
|
41
|
-
"macx-g++"
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
30
|
def sh(command)
|
46
31
|
system(command)
|
47
32
|
success = $?.exitstatus == SUCCESS_STATUS
|
@@ -56,7 +41,7 @@ module CapybaraWebkitBuilder
|
|
56
41
|
def makefile(*configs)
|
57
42
|
configs += default_configs
|
58
43
|
configs = configs.map { |config| config.shellescape}.join(" ")
|
59
|
-
sh("#{qmake_bin}
|
44
|
+
sh("#{qmake_bin} #{configs}")
|
60
45
|
end
|
61
46
|
|
62
47
|
def qmake
|
@@ -16,12 +16,6 @@ describe CapybaraWebkitBuilder do
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
it "will use the env variable for #os_spec" do
|
20
|
-
with_env_vars("SPEC" => "fake_os_spec") do
|
21
|
-
builder.spec.should == "fake_os_spec"
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
19
|
it "defaults the #make_bin" do
|
26
20
|
with_env_vars("MAKE_BIN" => nil) do
|
27
21
|
builder.make_bin.should == 'make'
|
@@ -33,11 +27,5 @@ describe CapybaraWebkitBuilder do
|
|
33
27
|
builder.qmake_bin.should == 'qmake'
|
34
28
|
end
|
35
29
|
end
|
36
|
-
|
37
|
-
it "defaults #spec to the #os_specs" do
|
38
|
-
with_env_vars("SPEC" => nil) do
|
39
|
-
builder.spec.should == builder.os_spec
|
40
|
-
end
|
41
|
-
end
|
42
30
|
end
|
43
31
|
|
data/spec/driver_spec.rb
CHANGED
@@ -2070,6 +2070,24 @@ describe Capybara::Webkit::Driver do
|
|
2070
2070
|
end
|
2071
2071
|
end
|
2072
2072
|
|
2073
|
+
context "caching app" do
|
2074
|
+
let(:driver) do
|
2075
|
+
etag_value = SecureRandom.hex
|
2076
|
+
|
2077
|
+
driver_for_app do
|
2078
|
+
get '/' do
|
2079
|
+
etag etag_value
|
2080
|
+
end
|
2081
|
+
end
|
2082
|
+
end
|
2083
|
+
|
2084
|
+
it "does not cache responses" do
|
2085
|
+
visit '/'
|
2086
|
+
visit '/'
|
2087
|
+
expect(driver.status_code).to eq(200)
|
2088
|
+
end
|
2089
|
+
end
|
2090
|
+
|
2073
2091
|
context "offline application cache" do
|
2074
2092
|
let(:driver) do
|
2075
2093
|
@visited = []
|
@@ -2550,7 +2568,7 @@ CACHE MANIFEST
|
|
2550
2568
|
end
|
2551
2569
|
end
|
2552
2570
|
|
2553
|
-
describe "url blacklisting" do
|
2571
|
+
describe "url blacklisting", skip_if_offline: true do
|
2554
2572
|
let(:driver) do
|
2555
2573
|
driver_for_app do
|
2556
2574
|
get "/" do
|
@@ -2633,7 +2651,7 @@ CACHE MANIFEST
|
|
2633
2651
|
end
|
2634
2652
|
end
|
2635
2653
|
|
2636
|
-
describe "url whitelisting" do
|
2654
|
+
describe "url whitelisting", skip_if_offline: true do
|
2637
2655
|
it_behaves_like "output writer" do
|
2638
2656
|
let(:driver) do
|
2639
2657
|
driver_for_html(<<-HTML, browser)
|
data/spec/spec_helper.rb
CHANGED
@@ -23,12 +23,24 @@ Capybara.register_driver :reusable_webkit do |app|
|
|
23
23
|
Capybara::Webkit::Driver.new(app, :browser => $webkit_browser)
|
24
24
|
end
|
25
25
|
|
26
|
+
def has_internet?
|
27
|
+
require 'resolv'
|
28
|
+
dns_resolver = Resolv::DNS.new
|
29
|
+
begin
|
30
|
+
dns_resolver.getaddress("example.com")
|
31
|
+
true
|
32
|
+
rescue Resolv::ResolvError => e
|
33
|
+
false
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
26
37
|
RSpec.configure do |c|
|
27
38
|
Capybara::SpecHelper.configure(c)
|
28
39
|
|
29
40
|
c.filter_run_excluding :skip_on_windows => !(RbConfig::CONFIG['host_os'] =~ /mingw32/).nil?
|
30
41
|
c.filter_run_excluding :skip_on_jruby => !defined?(::JRUBY_VERSION).nil?
|
31
42
|
c.filter_run_excluding :selenium_compatibility => (Capybara::VERSION =~ /^2\.4\./).nil?
|
43
|
+
c.filter_run_excluding :skip_if_offline => !has_internet?
|
32
44
|
|
33
45
|
# We can't support outerWidth and outerHeight without a visible window.
|
34
46
|
# We focus the next window instead of failing when closing windows.
|
data/src/StdinNotifier.cpp
CHANGED
data/src/WebPage.h
CHANGED
data/src/WebPageManager.cpp
CHANGED
@@ -29,6 +29,10 @@ WebPageManager::WebPageManager(QObject *parent) : QObject(parent) {
|
|
29
29
|
m_networkAccessManager =
|
30
30
|
new NetworkAccessManager(m_blacklistedRequestHandler, this);
|
31
31
|
m_networkAccessManager->setCookieJar(m_cookieJar);
|
32
|
+
|
33
|
+
QWebSettings::setMaximumPagesInCache(0);
|
34
|
+
QWebSettings::setObjectCacheCapacities(0, 0, 0);
|
35
|
+
|
32
36
|
createPage()->setFocus();
|
33
37
|
}
|
34
38
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capybara-webkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thoughtbot
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2015-
|
16
|
+
date: 2015-03-27 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: capybara
|