onlyoffice_webdriver_wrapper 1.10.1 → 1.11.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/lib/onlyoffice_webdriver_wrapper/helpers/bin/geckodriver +0 -0
- data/lib/onlyoffice_webdriver_wrapper/helpers/chrome_helper/chrome_version_helper.rb +5 -3
- data/lib/onlyoffice_webdriver_wrapper/helpers/chrome_helper/chromedriver_bin/{chromedriver_linux_102 → chromedriver_linux_105} +0 -0
- data/lib/onlyoffice_webdriver_wrapper/helpers/chrome_helper/chromedriver_bin/chromedriver_mac +0 -0
- data/lib/onlyoffice_webdriver_wrapper/version.rb +1 -1
- data/lib/onlyoffice_webdriver_wrapper/webdriver/wait_until_methods.rb +3 -18
- data/lib/onlyoffice_webdriver_wrapper/webdriver/webdriver_js_methods.rb +1 -1
- data/lib/onlyoffice_webdriver_wrapper/webdriver.rb +2 -12
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72e6c203a606a12d451ab746ca13b41642f717c2e296446923849029fcb9d8a6
|
4
|
+
data.tar.gz: 7cefdc7a70b4119b95f62c8b6ac8ec264831de9e764b1d78104599d86eb62778
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dda0bcec308916e29b9b17312e839096242b1fcd7a75cd1262e5dd8feff5b621268d777be6d4f2db543ccc7bfc65f09db6675e840a59fc6744d3388b8438ac88
|
7
|
+
data.tar.gz: af6d0cfeae8483462f7939bd258898aa0f6c196bc311528998c7f684a34f7fd715c01f7eae4438ed5569b95917cfa50e5b9d3bd3476bb6a65eb2ef9b2ab8e5ec
|
Binary file
|
@@ -20,10 +20,12 @@ module OnlyofficeWebdriverWrapper
|
|
20
20
|
@chrome_version = unknown_chrome_version
|
21
21
|
end
|
22
22
|
|
23
|
+
# @param [Symbol] force_os force OS for chrome version (`:linux` or `:mac`),
|
24
|
+
# if empty - will try to autodetect current os
|
23
25
|
# @return [String] path to chromedriver
|
24
|
-
def chromedriver_path
|
25
|
-
return default_mac if OSHelper.mac?
|
26
|
-
return default_linux if chrome_version == unknown_chrome_version
|
26
|
+
def chromedriver_path(force_os = nil)
|
27
|
+
return default_mac if OSHelper.mac? || force_os == :mac
|
28
|
+
return default_linux if (chrome_version == unknown_chrome_version) || force_os == :linux
|
27
29
|
|
28
30
|
chromedriver_path_cur_chrome
|
29
31
|
end
|
Binary file
|
data/lib/onlyoffice_webdriver_wrapper/helpers/chrome_helper/chromedriver_bin/chromedriver_mac
CHANGED
Binary file
|
@@ -33,7 +33,7 @@ module OnlyofficeWebdriverWrapper
|
|
33
33
|
# @param [String] xpath_name to find object
|
34
34
|
# @param [Integer] timeout How much to wait
|
35
35
|
# @raise [StandardError] error if element not found for timeout
|
36
|
-
# @return [
|
36
|
+
# @return [Boolean] true if element is visible after some timeout
|
37
37
|
def wait_until_element_visible(xpath_name, timeout = 15)
|
38
38
|
wait_until_element_present(xpath_name)
|
39
39
|
time = 0
|
@@ -41,24 +41,9 @@ module OnlyofficeWebdriverWrapper
|
|
41
41
|
sleep(1)
|
42
42
|
time += 1
|
43
43
|
end
|
44
|
-
return unless time >= timeout
|
45
|
-
|
46
|
-
webdriver_error("Element #{xpath_name} not visible for #{timeout} seconds")
|
47
|
-
end
|
44
|
+
return true unless time >= timeout
|
48
45
|
|
49
|
-
|
50
|
-
# @param [String] xpath_name xpath of element
|
51
|
-
# @param [Integer] period_of_wait how much time sleep each iteration of wait
|
52
|
-
# @param [Integer] critical_time maximum time for wait for element
|
53
|
-
# @return [nil]
|
54
|
-
def wait_element(xpath_name, period_of_wait = 1, critical_time = 3)
|
55
|
-
wait_until_element_present(xpath_name)
|
56
|
-
time = 0
|
57
|
-
until element_visible?(xpath_name)
|
58
|
-
sleep(period_of_wait)
|
59
|
-
time += 1
|
60
|
-
return if time == critical_time
|
61
|
-
end
|
46
|
+
webdriver_error("Element `#{xpath_name}` not visible for #{timeout} seconds")
|
62
47
|
end
|
63
48
|
|
64
49
|
# Wait until some element present
|
@@ -16,7 +16,7 @@ module OnlyofficeWebdriverWrapper
|
|
16
16
|
# Usually this mean browser hang up or some modular
|
17
17
|
# window is blocking browser for execution of any code
|
18
18
|
# in that case performing `webdriver_error` only cause forever loop
|
19
|
-
# since webdriver_error trying to
|
19
|
+
# since webdriver_error trying to current_url or make screenshots
|
20
20
|
raise(e.class, "Timeout Error #{e} happened while executing #{script}")
|
21
21
|
rescue StandardError => e
|
22
22
|
webdriver_error(e, "Exception #{e} in execute_javascript: #{script}")
|
@@ -30,7 +30,7 @@ require_relative 'webdriver/webdriver_browser_log_helper'
|
|
30
30
|
|
31
31
|
# Namespace of this gem
|
32
32
|
module OnlyofficeWebdriverWrapper
|
33
|
-
#
|
33
|
+
# Class for working with webdriver, main class of project
|
34
34
|
class WebDriver
|
35
35
|
include ChromeHelper
|
36
36
|
include ClickMethods
|
@@ -110,16 +110,7 @@ module OnlyofficeWebdriverWrapper
|
|
110
110
|
# @param [Integer] vertical_shift y value
|
111
111
|
# @return [void]
|
112
112
|
def open_dropdown_selector(xpath_name, horizontal_shift = 30, vertical_shift = 0)
|
113
|
-
|
114
|
-
if @browser == :firefox || @browser == :safari
|
115
|
-
set_style_attribute("#{xpath_name}/button", 'display', 'none')
|
116
|
-
set_style_attribute(xpath_name, 'display', 'inline')
|
117
|
-
element.click
|
118
|
-
set_style_attribute("#{xpath_name}/button", 'display', 'inline-block')
|
119
|
-
set_style_attribute(xpath_name, 'display', 'block')
|
120
|
-
else
|
121
|
-
move_to_driver_action(xpath_name, horizontal_shift, vertical_shift).click.perform
|
122
|
-
end
|
113
|
+
move_to_driver_action(xpath_name, horizontal_shift, vertical_shift).click.perform
|
123
114
|
end
|
124
115
|
|
125
116
|
# Perform an action on coordinate
|
@@ -222,7 +213,6 @@ module OnlyofficeWebdriverWrapper
|
|
222
213
|
exception = RuntimeError
|
223
214
|
end
|
224
215
|
select_top_frame
|
225
|
-
current_url = get_url
|
226
216
|
raise exception, "#{error_message}\n\nPage address: #{current_url}\n\nError #{webdriver_screenshot}"
|
227
217
|
end
|
228
218
|
|
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: 1.
|
4
|
+
version: 1.11.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: 2022-08-
|
14
|
+
date: 2022-08-31 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: headless
|
@@ -275,9 +275,9 @@ files:
|
|
275
275
|
- lib/onlyoffice_webdriver_wrapper/helpers/bin/geckodriver
|
276
276
|
- lib/onlyoffice_webdriver_wrapper/helpers/chrome_helper.rb
|
277
277
|
- lib/onlyoffice_webdriver_wrapper/helpers/chrome_helper/chrome_version_helper.rb
|
278
|
-
- lib/onlyoffice_webdriver_wrapper/helpers/chrome_helper/chromedriver_bin/chromedriver_linux_102
|
279
278
|
- lib/onlyoffice_webdriver_wrapper/helpers/chrome_helper/chromedriver_bin/chromedriver_linux_103
|
280
279
|
- lib/onlyoffice_webdriver_wrapper/helpers/chrome_helper/chromedriver_bin/chromedriver_linux_104
|
280
|
+
- lib/onlyoffice_webdriver_wrapper/helpers/chrome_helper/chromedriver_bin/chromedriver_linux_105
|
281
281
|
- lib/onlyoffice_webdriver_wrapper/helpers/chrome_helper/chromedriver_bin/chromedriver_mac
|
282
282
|
- lib/onlyoffice_webdriver_wrapper/helpers/firefox_helper.rb
|
283
283
|
- lib/onlyoffice_webdriver_wrapper/helpers/firefox_helper/save_to_disk_files.list
|
@@ -335,7 +335,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
335
335
|
- !ruby/object:Gem::Version
|
336
336
|
version: '0'
|
337
337
|
requirements: []
|
338
|
-
rubygems_version: 3.3.
|
338
|
+
rubygems_version: 3.3.21
|
339
339
|
signing_key:
|
340
340
|
specification_version: 4
|
341
341
|
summary: ONLYOFFICE Webdriver Wrapper Gem
|