capybara-webkit 1.4.1 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 776f7b813939278baf6bbc2064faaa21237ce02b
4
- data.tar.gz: f9b9712e3594049e0749ece691b185045908946c
3
+ metadata.gz: b3e42d4678023063942b9966f2ca08001363a3c2
4
+ data.tar.gz: 9d80735bf7b20fd0e64329985f28097ba0774d33
5
5
  SHA512:
6
- metadata.gz: ad454ce63d42b586f1a0eab271a1ff801aab0cd78eead690a9a51ac9c3e85684bba58f9e7f76da1f169479d3ff48215f641c7fb41ab385693f49247a5d8c6fdb
7
- data.tar.gz: a15ec0a814e50c402519dd6c0d46a1d8d3a5ac0d9eb98e6403e29ef9bd025a67a5211515b837b1a733320246d8e5fc68430e7b775ec2d815f8620de25ba7cc38
6
+ metadata.gz: f9d695309b9b677688cecec39a235a5c0556d9b0c72e12a89ff2578ec34bacdb03720fd1a624187383bdaaaaf17659ffad1e579a5245f57e4289d8d8ebbd93c7
7
+ data.tar.gz: 2e643305242c83c92843c1642f12d0a3a74331a02e84b2ba140a2a9482f4cf7053fe4670cc93399f4407ed0f3c645782f165265950ad5be1a1a73ba91035c325
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capybara-webkit (1.4.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.4.1)
21
+ childprocess (0.5.5)
22
22
  ffi (~> 1.0, >= 1.0.11)
23
23
  diff-lcs (1.2.4)
24
- ffi (1.9.3)
25
- ffi (1.9.3-java)
26
- ffi (1.9.3-x86-mingw32)
27
- json (1.8.1)
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.1)
37
- multi_json (1.8.4)
38
- nokogiri (1.6.4)
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.2)
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.0)
55
- selenium-webdriver (2.39.0)
56
- childprocess (>= 0.2.5)
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.4)
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.0.7)
68
+ websocket (1.2.1)
69
69
  xpath (2.0.0)
70
70
  nokogiri (~> 1.3)
71
71
 
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2012 thoughtbot, inc.
1
+ Copyright (c) 2010-2015 thoughtbot, inc.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
data/NEWS.md CHANGED
@@ -1,3 +1,8 @@
1
+ New for 1.5.0:
2
+
3
+ * Fixes for OpenBSD
4
+ * Disable web page and object memory cache
5
+
1
6
  New for 1.4.1:
2
7
 
3
8
  * Do not consider data URIs unknown.
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. It was written by [thoughtbot, inc](http://thoughtbot.com/community) with the help of numerous [contributions from the open source community](https://github.com/thoughtbot/capybara-webkit/contributors).
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' implementation.
173
+ Code for rendering the current webpage to a PNG is borrowed from Phantom.js'
174
+ implementation.
153
175
 
154
- ![thoughtbot](http://thoughtbot.com/images/tm/logo.png)
176
+ ![thoughtbot](https://thoughtbot.com/logo.png)
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
- License
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
- capybara-webkit is Copyright (c) 2010-2014 thoughtbot, inc. It is free software, and may be redistributed under the terms specified in the LICENSE file.
185
+ [community]: https://thoughtbot.com/community?utm_source=github
186
+ [hire]: https://thoughtbot.com/hire-us?utm_source=github
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- capybara-webkit (1.4.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.3)
21
+ childprocess (0.5.5)
22
22
  ffi (~> 1.0, >= 1.0.11)
23
23
  diff-lcs (1.2.5)
24
- ffi (1.9.3)
25
- json (1.8.1)
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.10.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.4)
50
- selenium-webdriver (2.42.0)
51
- childprocess (>= 0.5.0)
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.4)
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.0.7)
61
+ websocket (1.2.1)
62
62
  xpath (2.0.0)
63
63
  nokogiri (~> 1.3)
64
64
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- capybara-webkit (1.4.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.3)
21
+ childprocess (0.5.5)
22
22
  ffi (~> 1.0, >= 1.0.11)
23
23
  diff-lcs (1.2.5)
24
- ffi (1.9.3)
25
- json (1.8.1)
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.10.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.6)
50
- selenium-webdriver (2.42.0)
51
- childprocess (>= 0.5.0)
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.4)
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.0.7)
61
+ websocket (1.2.1)
62
62
  xpath (2.0.0)
63
63
  nokogiri (~> 1.3)
64
64
 
@@ -1,7 +1,7 @@
1
1
  module Capybara
2
2
  module Driver
3
3
  class Webkit
4
- VERSION = '1.4.1'.freeze
4
+ VERSION = '1.5.0'.freeze
5
5
  end
6
6
  end
7
7
  end
@@ -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} -spec #{spec} #{configs}")
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
 
@@ -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)
@@ -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.
@@ -1,6 +1,8 @@
1
1
  #include "StdinNotifier.h"
2
2
 
3
3
  #include <QTcpServer>
4
+ #include <QSocketNotifier>
5
+ #include <iostream>
4
6
 
5
7
  StdinNotifier::StdinNotifier(QObject *parent) : QObject(parent) {
6
8
  m_notifier = new QSocketNotifier(fileno(stdin), QSocketNotifier::Read, this);
@@ -1,5 +1,6 @@
1
1
  #ifndef _WEBPAGE_H
2
2
  #define _WEBPAGE_H
3
+ #include <QtGlobal>
3
4
  #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
4
5
  #include <QtWebKitWidgets>
5
6
  #else
@@ -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.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-01-27 00:00:00.000000000 Z
16
+ date: 2015-03-27 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: capybara