percy-capybara 2.4.2 → 2.4.3
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 787ce577bbcab20de79c69d3605c60de4b04ffa9
|
4
|
+
data.tar.gz: 99820b82e25583e093ab9902c3642edc41fc811f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1172af0a6cffff598252e2a86b81b5811b9ee41cf7fb87a32a788ec71fee286afa87c9f8164fdb51ae581d543c0580cb7b64a4f2f168bbcd52ac8f576bc82fef
|
7
|
+
data.tar.gz: 5b9857602fb38d55c12fe8072e5ffa2c15eff55ea30c17fdce449ed7477c1cdd62d7f21bb2c8dff9553fcd0a54351f4c7369d7692f6ef2ff066fbc36f6918969
|
@@ -82,18 +82,24 @@ module Percy
|
|
82
82
|
iframe_url = iframe_element[:src]
|
83
83
|
root_page_host = page.current_host
|
84
84
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
85
|
+
begin
|
86
|
+
page.within_frame(iframe_element) do
|
87
|
+
next unless page.current_host == root_page_host
|
88
|
+
path = URI.parse(iframe_url).path
|
89
|
+
content = page.body
|
90
|
+
sha = Digest::SHA256.hexdigest(content)
|
91
|
+
resources <<
|
92
|
+
Percy::Client::Resource.new(
|
93
|
+
path,
|
94
|
+
content: content,
|
95
|
+
sha: sha,
|
96
|
+
mimetype: 'text/html',
|
97
|
+
)
|
98
|
+
end
|
99
|
+
rescue StandardError => e
|
100
|
+
# Skip frame not found errors. This library doesn't explicitly depend on Poltergeist,
|
101
|
+
# so we check the string class name.
|
102
|
+
raise e unless e.class.to_s == 'Capybara::Poltergeist::FrameNotFound'
|
97
103
|
end
|
98
104
|
end
|
99
105
|
|
@@ -6,6 +6,15 @@ class RackAppWithIframe
|
|
6
6
|
end
|
7
7
|
end
|
8
8
|
|
9
|
+
# Mock dependency on Poltergeist so we can test an error class.
|
10
|
+
module Capybara
|
11
|
+
module Poltergeist
|
12
|
+
class Error < StandardError; end
|
13
|
+
class ClientError < Error; end
|
14
|
+
class FrameNotFound < ClientError; end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
9
18
|
RSpec.describe Percy::Capybara::Loaders::BaseLoader do
|
10
19
|
let(:loader) { described_class.new }
|
11
20
|
|
@@ -36,6 +45,14 @@ RSpec.describe Percy::Capybara::Loaders::BaseLoader do
|
|
36
45
|
expect(last_resource.mimetype).to eq('text/html')
|
37
46
|
expect(last_resource.content).to include('Inside iframe')
|
38
47
|
end
|
48
|
+
it 'skips poltergeist frame not found errors' do
|
49
|
+
visit '/test-iframe.html'
|
50
|
+
|
51
|
+
expect(page).to receive(:within_frame).twice.and_raise(Capybara::Poltergeist::FrameNotFound)
|
52
|
+
loader = described_class.new(page: page)
|
53
|
+
resources = loader.iframes_resources
|
54
|
+
expect(resources.size).to eq(0)
|
55
|
+
end
|
39
56
|
end
|
40
57
|
describe '#build_resources' do
|
41
58
|
it 'raises a NotImplementedError' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: percy-capybara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Perceptual Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: percy-client
|