onlyoffice_webdriver_wrapper 0.20.0 → 0.21.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf1d04d0d68408caeefbbbc278a3846e65eb13a48ff9a2f014c914688bda5989
|
4
|
+
data.tar.gz: fb5f54d8ba4cd4b948bb040e0bc8e735258d353df70b951445de5f4980d34a09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c9b65b7f3831919e103c38bac5536dc9962998f69c77dce6f2d2baec9927a57bdc20924806b56051df2c89161ffd02445c43f804d18d0f5adfd7555b92ae17d
|
7
|
+
data.tar.gz: 4e47f77df9c7f1b4310eb96c5359b63abf75302b2001ca480cd0506924293d9b4d79c986c673774ddcee6e3a43119c1be7c12304363916ed7dcca61c8a4a2d68
|
@@ -4,6 +4,9 @@ require 'onlyoffice_s3_wrapper'
|
|
4
4
|
module OnlyofficeWebdriverWrapper
|
5
5
|
# Working with screenshots
|
6
6
|
module WebdriverScreenshotHelper
|
7
|
+
# @return [String] content type of png image
|
8
|
+
SCREENSHOT_CONTENT_TYPE = 'image/png'
|
9
|
+
|
7
10
|
# @return [OnlyofficeS3Wrapper::AmazonS3Wrapper] s3 wrapper
|
8
11
|
def amazon_s3_wrapper
|
9
12
|
@amazon_s3_wrapper ||= OnlyofficeS3Wrapper::AmazonS3Wrapper.new(bucket_name: 'webdriver-wrapper-screenshots',
|
@@ -18,7 +21,7 @@ module OnlyofficeWebdriverWrapper
|
|
18
21
|
def get_screenshot_and_upload(path_to_screenshot = "#{screenshot_folder}/#{StringHelper.generate_random_string}.png")
|
19
22
|
begin
|
20
23
|
get_screenshot(path_to_screenshot)
|
21
|
-
cloud_screenshot =
|
24
|
+
cloud_screenshot = publish_screenshot(path_to_screenshot)
|
22
25
|
File.delete(path_to_screenshot) if File.exist?(path_to_screenshot)
|
23
26
|
OnlyofficeLoggerHelper.log("upload screenshot: #{cloud_screenshot}")
|
24
27
|
return cloud_screenshot
|
@@ -49,14 +52,14 @@ module OnlyofficeWebdriverWrapper
|
|
49
52
|
if @headless.headless_instance.nil?
|
50
53
|
system_screenshot("/tmp/#{screenshot_name}.png")
|
51
54
|
begin
|
52
|
-
link =
|
55
|
+
link = publish_screenshot("/tmp/#{screenshot_name}.png")
|
53
56
|
rescue Exception => e
|
54
57
|
OnlyofficeLoggerHelper.log("Error in get screenshot: #{e}. System screenshot #{link}")
|
55
58
|
end
|
56
59
|
else
|
57
60
|
@headless.take_screenshot("/tmp/#{screenshot_name}.png")
|
58
61
|
begin
|
59
|
-
link =
|
62
|
+
link = publish_screenshot("/tmp/#{screenshot_name}.png")
|
60
63
|
rescue Exception => e
|
61
64
|
OnlyofficeLoggerHelper.log("Error in get screenshot: #{e}. Headless screenshot #{link}")
|
62
65
|
end
|
@@ -64,5 +67,16 @@ module OnlyofficeWebdriverWrapper
|
|
64
67
|
end
|
65
68
|
"screenshot: #{link}"
|
66
69
|
end
|
70
|
+
|
71
|
+
private
|
72
|
+
|
73
|
+
# Publish screenshot
|
74
|
+
# @param [String] path to file
|
75
|
+
# @return [String] publis internet link to file
|
76
|
+
def publish_screenshot(path)
|
77
|
+
amazon_s3_wrapper.upload_file_and_make_public(path,
|
78
|
+
nil,
|
79
|
+
SCREENSHOT_CONTENT_TYPE)
|
80
|
+
end
|
67
81
|
end
|
68
82
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onlyoffice_webdriver_wrapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.21.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ONLYOFFICE
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2021-12-
|
14
|
+
date: 2021-12-10 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: headless
|
@@ -62,6 +62,9 @@ dependencies:
|
|
62
62
|
- - "~>"
|
63
63
|
- !ruby/object:Gem::Version
|
64
64
|
version: '0'
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: 0.5.0
|
65
68
|
type: :runtime
|
66
69
|
prerelease: false
|
67
70
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -69,6 +72,9 @@ dependencies:
|
|
69
72
|
- - "~>"
|
70
73
|
- !ruby/object:Gem::Version
|
71
74
|
version: '0'
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 0.5.0
|
72
78
|
- !ruby/object:Gem::Dependency
|
73
79
|
name: page-object
|
74
80
|
requirement: !ruby/object:Gem::Requirement
|