eyes_core 3.16.6 → 3.16.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/applitools/connectivity/server_connector.rb +15 -16
- data/lib/applitools/core/eyes_base.rb +1 -1
- data/lib/applitools/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cf31bf1fdae6c75e1517e0db4839a6d0331fc4afd3a5d86fc01299a8e84bd53
|
4
|
+
data.tar.gz: 1a001a48cf3a381e02855554d7b959e618877a0644c8135059bd9e27feb3836c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c37a84a9a9c967d7282bb1ed8c8491cf134d961708fb7f4ad9b15004c1d932ec2d169276fae359097435e03f6a87465c7962293560cf348ea4de3cb0e7642d4
|
7
|
+
data.tar.gz: a8a3a376b24994573285ec88d1c789e08c1e3a3b6b106ebc9f595315f300edd482e97aa5c4eb05d5fef0f7aae8b2b1ebcf9b41bf21f03ef3d4a599cc15ece583
|
@@ -68,23 +68,31 @@ module Applitools::Connectivity
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def put_screenshot(rendering_info, screenshot)
|
71
|
+
put_data(rendering_info, screenshot.image.to_blob, 'image/png', 'screenshot')
|
72
|
+
end
|
73
|
+
|
74
|
+
def put_dom(rendering_info, dom_data)
|
75
|
+
put_data(rendering_info, dom_data, 'application/octet-stream', 'dom data')
|
76
|
+
end
|
77
|
+
|
78
|
+
def put_data(rendering_info, data, content_type, log_message_entity)
|
71
79
|
uuid = SecureRandom.uuid
|
72
80
|
upload_path = URI.parse(rendering_info.results_url.gsub(/__random__/, uuid))
|
73
81
|
retry_count = 3
|
74
82
|
wait = 0.5
|
75
83
|
loop do
|
76
|
-
raise ScreenshotUploadError, "Error uploading
|
77
|
-
Applitools::EyesLogger.info("Trying to upload
|
84
|
+
raise ScreenshotUploadError, "Error uploading #{log_message_entity} (#{upload_path})" if retry_count <= 0
|
85
|
+
Applitools::EyesLogger.info("Trying to upload #{log_message_entity} (#{upload_path})...")
|
78
86
|
begin
|
79
87
|
response = dummy_put(
|
80
88
|
upload_path,
|
81
|
-
body:
|
89
|
+
body: data,
|
82
90
|
headers: {
|
83
91
|
'x-ms-blob-type': 'BlockBlob',
|
84
92
|
'X-Auth-Token': rendering_info.access_token
|
85
93
|
},
|
86
94
|
query: URI.decode_www_form(upload_path.query).to_h,
|
87
|
-
content_type:
|
95
|
+
content_type: content_type
|
88
96
|
)
|
89
97
|
break if response.status == HTTP_STATUS_CODES[:created]
|
90
98
|
Applitools::EyesLogger.info("Failed. Retrying in #{wait} seconds")
|
@@ -279,23 +287,14 @@ module Applitools::Connectivity
|
|
279
287
|
Applitools::TestResults.new(response)
|
280
288
|
end
|
281
289
|
|
282
|
-
def post_dom_json(dom_data)
|
290
|
+
def post_dom_json(dom_data, rendering_info)
|
283
291
|
Applitools::EyesLogger.debug 'About to send captured DOM...'
|
284
|
-
# request_body = Oj.dump(dom_data)
|
285
292
|
request_body = dom_data
|
286
293
|
Applitools::EyesLogger.debug request_body
|
287
294
|
processed_request_body = yield(request_body) if block_given?
|
288
|
-
|
289
|
-
endpoint_url + 'data',
|
290
|
-
body: processed_request_body.nil? ? request_body : processed_request_body,
|
291
|
-
content_type: 'application/octet-stream'
|
292
|
-
)
|
293
|
-
|
295
|
+
location = put_dom(rendering_info, processed_request_body)
|
294
296
|
Applitools::EyesLogger.debug 'Done!'
|
295
|
-
|
296
|
-
Applitools::EyesLogger.debug 'Server response headers:'
|
297
|
-
Applitools::EyesLogger.debug res.headers.inspect
|
298
|
-
res.headers['location']
|
297
|
+
location
|
299
298
|
end
|
300
299
|
|
301
300
|
private
|
@@ -618,7 +618,7 @@ module Applitools
|
|
618
618
|
unless captured_dom_data.empty?
|
619
619
|
begin
|
620
620
|
logger.info 'Processing DOM..'
|
621
|
-
dom_url = server_connector.post_dom_json(captured_dom_data) do |json|
|
621
|
+
dom_url = server_connector.post_dom_json(captured_dom_data, runner.rendering_info(server_connector)) do |json|
|
622
622
|
io = StringIO.new
|
623
623
|
gz = Zlib::GzipWriter.new(io)
|
624
624
|
gz.write(json.encode('UTF-8'))
|
data/lib/applitools/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eyes_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.16.
|
4
|
+
version: 3.16.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Applitools Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oily_png
|