onlyoffice_webdriver_wrapper 1.6.0 → 1.8.1
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/dimensions.rb +14 -0
- data/lib/onlyoffice_webdriver_wrapper/helpers/chrome_helper/chromedriver_bin/{chromedriver_linux_100 → chromedriver_linux_103} +0 -0
- data/lib/onlyoffice_webdriver_wrapper/helpers/chrome_helper/chromedriver_bin/chromedriver_mac +0 -0
- data/lib/onlyoffice_webdriver_wrapper/helpers/firefox_helper.rb +1 -1
- data/lib/onlyoffice_webdriver_wrapper/helpers/headless_helper/{headless_screenshot_patch.rb → headless_patch.rb} +23 -0
- data/lib/onlyoffice_webdriver_wrapper/helpers/headless_helper.rb +1 -1
- data/lib/onlyoffice_webdriver_wrapper/version.rb +1 -1
- data/lib/onlyoffice_webdriver_wrapper/webdriver/click_methods.rb +5 -7
- data/lib/onlyoffice_webdriver_wrapper/webdriver/wait_until_methods.rb +4 -4
- data/lib/onlyoffice_webdriver_wrapper/webdriver/webdriver_helper.rb +1 -1
- data/lib/onlyoffice_webdriver_wrapper/webdriver/webdriver_js_methods.rb +2 -2
- data/lib/onlyoffice_webdriver_wrapper/webdriver/webdriver_move_cursor_methods.rb +35 -16
- data/lib/onlyoffice_webdriver_wrapper/webdriver/webdriver_screenshot_helper.rb +2 -1
- data/lib/onlyoffice_webdriver_wrapper/webdriver/webdriver_tab_helper.rb +4 -3
- data/lib/onlyoffice_webdriver_wrapper/webdriver/webdriver_type_helper.rb +4 -4
- data/lib/onlyoffice_webdriver_wrapper/webdriver/webdriver_user_agent_helper.rb +8 -8
- data/lib/onlyoffice_webdriver_wrapper/webdriver.rb +13 -10
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 776391f3667781696f5c73f6b3839fa17ed3965deaaaa53e4c0717b4915f2ced
|
4
|
+
data.tar.gz: 5d9c932257c2e35e99464657ac3c00f8069a90d40bfc7ffc0d1e1c599ab3aee2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15a1d5affae01a3e6857ec9b7b592e89f9007e841f7a4d9c83043c1fc020b1086f6d9b59594f94239a47469d727db095d83187a3e2f9e25fd2caba632d958dbc
|
7
|
+
data.tar.gz: d313861c4bda34d5452b95e9caaf29a53c13899f53d16fb95d699c98ead637311ff28b67b8533a7718f746c6eeb576f078a8dd6df211f48f6f88d62a97288326
|
@@ -10,6 +10,15 @@ module OnlyofficeWebdriverWrapper
|
|
10
10
|
@top = top
|
11
11
|
end
|
12
12
|
|
13
|
+
# Compare two dimensions object
|
14
|
+
# @param [Object] other object
|
15
|
+
# @return [Boolean] result of comparison
|
16
|
+
def ==(other)
|
17
|
+
return false unless other.respond_to?(:left) && other.respond_to?(:top)
|
18
|
+
|
19
|
+
@left == other.left && @top == other.top
|
20
|
+
end
|
21
|
+
|
13
22
|
alias width left
|
14
23
|
alias height top
|
15
24
|
alias x left
|
@@ -19,5 +28,10 @@ module OnlyofficeWebdriverWrapper
|
|
19
28
|
def to_s
|
20
29
|
"Dimensions(left: #{@left}, top: #{@top})"
|
21
30
|
end
|
31
|
+
|
32
|
+
# @return [Dimensions] Center point of current dimension
|
33
|
+
def center
|
34
|
+
Dimensions.new(@left / 2, @top / 2)
|
35
|
+
end
|
22
36
|
end
|
23
37
|
end
|
Binary file
|
data/lib/onlyoffice_webdriver_wrapper/helpers/chrome_helper/chromedriver_bin/chromedriver_mac
CHANGED
Binary file
|
@@ -29,7 +29,7 @@ module OnlyofficeWebdriverWrapper
|
|
29
29
|
|
30
30
|
# @return [Array<String>] list of formats to save
|
31
31
|
def read_firefox_files_to_save
|
32
|
-
path_to_file = "#{Dir.pwd}/lib/onlyoffice_webdriver_wrapper/"\
|
32
|
+
path_to_file = "#{Dir.pwd}/lib/onlyoffice_webdriver_wrapper/" \
|
33
33
|
'helpers/firefox_helper/save_to_disk_files.list'
|
34
34
|
OnlyofficeFileHelper::FileHelper.read_array_from_file(path_to_file)
|
35
35
|
.join(', ')
|
@@ -21,3 +21,26 @@ class Headless
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
24
|
+
|
25
|
+
# Until https://github.com/leonid-shevtsov/headless/pull/106
|
26
|
+
# is released in stable version
|
27
|
+
class Headless
|
28
|
+
# Class for handling video records
|
29
|
+
class VideoRecorder
|
30
|
+
# Stop recording and save it
|
31
|
+
# @param [String] path to save
|
32
|
+
# @retunr [nil, String] path to result file or nil if error
|
33
|
+
def stop_and_save(path)
|
34
|
+
CliUtil.kill_process(@pid_file_path, :wait => true)
|
35
|
+
if File.exist? @tmp_file_path
|
36
|
+
begin
|
37
|
+
FileUtils.mkdir_p(File.dirname(path))
|
38
|
+
FileUtils.mv(@tmp_file_path, path)
|
39
|
+
rescue Errno::EINVAL
|
40
|
+
nil
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
@@ -3,7 +3,7 @@
|
|
3
3
|
require_relative 'headless_helper/real_display_tools'
|
4
4
|
require_relative 'headless_helper/ruby_helper'
|
5
5
|
require 'headless'
|
6
|
-
require_relative 'headless_helper/
|
6
|
+
require_relative 'headless_helper/headless_patch'
|
7
7
|
require_relative 'headless_helper/headless_video_recorder'
|
8
8
|
|
9
9
|
module OnlyofficeWebdriverWrapper
|
@@ -50,9 +50,8 @@ module OnlyofficeWebdriverWrapper
|
|
50
50
|
# @return [nil]
|
51
51
|
def click_on_locator_coordinates(xpath_name, right_by, down_by)
|
52
52
|
wait_until_element_visible(xpath_name)
|
53
|
-
|
54
|
-
|
55
|
-
@driver.action.move_to(element, right_by.to_i, down_by.to_i).click.perform
|
53
|
+
move_to_driver_action(xpath_name, right_by, down_by).perform
|
54
|
+
move_to_driver_action(xpath_name, right_by, down_by).click.perform
|
56
55
|
end
|
57
56
|
|
58
57
|
# Click on one of several which displayed
|
@@ -99,9 +98,8 @@ module OnlyofficeWebdriverWrapper
|
|
99
98
|
# @return [nil]
|
100
99
|
def right_click_on_locator_coordinates(xpath_name, right_by = nil, down_by = nil)
|
101
100
|
wait_until_element_visible(xpath_name)
|
102
|
-
|
103
|
-
|
104
|
-
@driver.action.move_to(element, right_by.to_i, down_by.to_i).context_click.perform
|
101
|
+
move_to_driver_action(xpath_name, right_by, down_by).perform
|
102
|
+
move_to_driver_action(xpath_name, right_by, down_by).context_click.perform
|
105
103
|
end
|
106
104
|
|
107
105
|
# Perform double_click on element
|
@@ -119,7 +117,7 @@ module OnlyofficeWebdriverWrapper
|
|
119
117
|
# @return [nil]
|
120
118
|
def double_click_on_locator_coordinates(xpath_name, right_by, down_by)
|
121
119
|
wait_until_element_visible(xpath_name)
|
122
|
-
|
120
|
+
move_to_driver_action(xpath_name, right_by, down_by).double_click.perform
|
123
121
|
end
|
124
122
|
end
|
125
123
|
end
|
@@ -71,8 +71,8 @@ module OnlyofficeWebdriverWrapper
|
|
71
71
|
begin
|
72
72
|
wait.until { get_element(xpath_name) }
|
73
73
|
rescue Selenium::WebDriver::Error::TimeoutError => e
|
74
|
-
timeout_message = "wait_until_element_present(#{xpath_name}) "\
|
75
|
-
'Selenium::WebDriver::Error::TimeoutError: '\
|
74
|
+
timeout_message = "wait_until_element_present(#{xpath_name}) " \
|
75
|
+
'Selenium::WebDriver::Error::TimeoutError: ' \
|
76
76
|
"timed out after #{timeout} seconds"
|
77
77
|
webdriver_error(e.class, timeout_message)
|
78
78
|
end
|
@@ -88,8 +88,8 @@ module OnlyofficeWebdriverWrapper
|
|
88
88
|
begin
|
89
89
|
wait.until { get_element(xpath_name) ? false : true }
|
90
90
|
rescue Selenium::WebDriver::Error::TimeoutError => e
|
91
|
-
timeout_message = "wait_until_element_present(#{xpath_name}) "\
|
92
|
-
'Selenium::WebDriver::Error::TimeoutError: '\
|
91
|
+
timeout_message = "wait_until_element_present(#{xpath_name}) " \
|
92
|
+
'Selenium::WebDriver::Error::TimeoutError: ' \
|
93
93
|
"timed out after #{timeout} seconds"
|
94
94
|
webdriver_error(e.class, timeout_message)
|
95
95
|
end
|
@@ -33,7 +33,7 @@ module OnlyofficeWebdriverWrapper
|
|
33
33
|
if @download_directory.start_with?(Dir.tmpdir)
|
34
34
|
FileUtils.remove_dir(@download_directory)
|
35
35
|
else
|
36
|
-
OnlyofficeLoggerHelper.log("Download directory #{@download_directory} is not at tmp dir. "\
|
36
|
+
OnlyofficeLoggerHelper.log("Download directory #{@download_directory} is not at tmp dir. " \
|
37
37
|
'It will be not deleted')
|
38
38
|
end
|
39
39
|
end
|
@@ -104,8 +104,8 @@ module OnlyofficeWebdriverWrapper
|
|
104
104
|
# @param [String] xpath of element to remove
|
105
105
|
# @return [String] result of javascript execution
|
106
106
|
def remove_element(xpath)
|
107
|
-
script = "element = #{dom_element_by_xpath(xpath)};"\
|
108
|
-
'if (element !== null) '\
|
107
|
+
script = "element = #{dom_element_by_xpath(xpath)};" \
|
108
|
+
'if (element !== null) ' \
|
109
109
|
'{element.parentNode.removeChild(element);};'
|
110
110
|
execute_javascript(script)
|
111
111
|
end
|
@@ -14,12 +14,9 @@ module OnlyofficeWebdriverWrapper
|
|
14
14
|
# * +y2+ - shift vector y coordinate
|
15
15
|
# * +mouse_release+ - release mouse after move
|
16
16
|
def drag_and_drop(xpath, x1, y1, x2, y2, mouse_release: true)
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
.move_to(canvas, x1.to_i, y1.to_i)
|
21
|
-
.click_and_hold
|
22
|
-
.move_by(x2, y2)
|
17
|
+
move_action = move_to_driver_action(xpath, x1, y1)
|
18
|
+
.click_and_hold
|
19
|
+
.move_by(x2, y2)
|
23
20
|
move_action = move_action.release if mouse_release
|
24
21
|
|
25
22
|
move_action.perform
|
@@ -33,15 +30,10 @@ module OnlyofficeWebdriverWrapper
|
|
33
30
|
# * +right_by+ - shift vector x coordinate
|
34
31
|
# * +down_by+ - shift vector y coordinate
|
35
32
|
def drag_and_drop_by(source, right_by, down_by = 0)
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
# @param [String, Selenium::WebDriver::Element] element xpath or webdriver element
|
41
|
-
# @return [nil]
|
42
|
-
def move_to_element(element)
|
43
|
-
element = get_element(element) if element.is_a?(String)
|
44
|
-
@driver.action.move_to(element).perform
|
33
|
+
shift_to_zero = move_to_shift_to_top_left(source)
|
34
|
+
@driver.action.drag_and_drop_by(get_element(source),
|
35
|
+
right_by - shift_to_zero.x,
|
36
|
+
down_by - shift_to_zero.y).perform
|
45
37
|
end
|
46
38
|
|
47
39
|
# Move cursor to element
|
@@ -60,7 +52,34 @@ module OnlyofficeWebdriverWrapper
|
|
60
52
|
# @return [nil]
|
61
53
|
def mouse_over(xpath_name, x_coordinate = 0, y_coordinate = 0)
|
62
54
|
wait_until_element_present(xpath_name)
|
63
|
-
|
55
|
+
move_to_driver_action(xpath_name, x_coordinate, y_coordinate).perform
|
56
|
+
end
|
57
|
+
|
58
|
+
private
|
59
|
+
|
60
|
+
# Since v4.3.0 of `webdriver` gem `move_to` method is moving
|
61
|
+
# from the center of the element
|
62
|
+
# Add additional negative shift if this version is used
|
63
|
+
def move_to_shift_to_top_left(xpath)
|
64
|
+
if Gem.loaded_specs['selenium-webdriver'].version >= Gem::Version.new('4.3.0')
|
65
|
+
element_size = element_size_by_js(xpath)
|
66
|
+
Dimensions.new(element_size.x / 2, element_size.y / 2)
|
67
|
+
else
|
68
|
+
Dimensions.new(0, 0)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# Generate action to move cursor to element
|
73
|
+
# @param [String] xpath xpath to move
|
74
|
+
# @param [Integer] right_by shift vector x coordinate
|
75
|
+
# @param [Integer] down_by shift vector y coordinate
|
76
|
+
# @return [Selenium::WebDriver::ActionBuilder] object to perform actions
|
77
|
+
def move_to_driver_action(xpath, right_by, down_by)
|
78
|
+
element = @driver.find_element(:xpath, xpath)
|
79
|
+
shift_to_zero = move_to_shift_to_top_left(xpath)
|
80
|
+
@driver.action.move_to(element,
|
81
|
+
right_by.to_i - shift_to_zero.x,
|
82
|
+
down_by.to_i - shift_to_zero.y)
|
64
83
|
end
|
65
84
|
end
|
66
85
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'fileutils'
|
3
4
|
require 'onlyoffice_s3_wrapper'
|
4
5
|
module OnlyofficeWebdriverWrapper
|
5
6
|
# Working with screenshots
|
@@ -25,7 +26,7 @@ module OnlyofficeWebdriverWrapper
|
|
25
26
|
begin
|
26
27
|
get_screenshot(path_to_screenshot)
|
27
28
|
cloud_screenshot = publish_screenshot(path_to_screenshot)
|
28
|
-
|
29
|
+
FileUtils.rm_rf(path_to_screenshot)
|
29
30
|
OnlyofficeLoggerHelper.log("upload screenshot: #{cloud_screenshot}")
|
30
31
|
return cloud_screenshot
|
31
32
|
rescue Errno::ENOENT => e
|
@@ -22,16 +22,17 @@ module OnlyofficeWebdriverWrapper
|
|
22
22
|
end
|
23
23
|
|
24
24
|
# Switch to popup window
|
25
|
+
# @param popup_appear_timeout [Integer] how much time to wait for popup window
|
25
26
|
# @param after_switch_timeout [Integer] wait after switch to window
|
26
27
|
# non-zero to workaround bug with page load hanging up after switch
|
27
28
|
# @return [void]
|
28
|
-
def switch_to_popup(after_switch_timeout: 3)
|
29
|
+
def switch_to_popup(after_switch_timeout: 3, popup_appear_timeout: 30)
|
29
30
|
counter = 0
|
30
|
-
while tab_count < 2 && counter <
|
31
|
+
while tab_count < 2 && counter < popup_appear_timeout
|
31
32
|
sleep 1
|
32
33
|
counter += 1
|
33
34
|
end
|
34
|
-
webdriver_error('switch_to_popup: Popup window not found') if counter >=
|
35
|
+
webdriver_error('switch_to_popup: Popup window not found') if counter >= popup_appear_timeout
|
35
36
|
list_of_handlers = @driver.window_handles
|
36
37
|
last_window_handler = list_of_handlers.last
|
37
38
|
@driver.switch_to.window(last_window_handler)
|
@@ -38,9 +38,9 @@ module OnlyofficeWebdriverWrapper
|
|
38
38
|
begin
|
39
39
|
element.clear
|
40
40
|
rescue Exception => e
|
41
|
-
webdriver_error(e.class, "Error in element.clear #{e} for "\
|
42
|
-
"type_to_locator(#{xpath_name}, #{text_to_send}, "\
|
43
|
-
"#{clear_content}, #{click_on_it}, "\
|
41
|
+
webdriver_error(e.class, "Error in element.clear #{e} for " \
|
42
|
+
"type_to_locator(#{xpath_name}, #{text_to_send}, " \
|
43
|
+
"#{clear_content}, #{click_on_it}, " \
|
44
44
|
"#{by_action}, #{by_element_send_key})")
|
45
45
|
end
|
46
46
|
end
|
@@ -73,7 +73,7 @@ module OnlyofficeWebdriverWrapper
|
|
73
73
|
element = get_element(xpath_name)
|
74
74
|
if element.nil?
|
75
75
|
webdriver_error(Selenium::WebDriver::Error::NoSuchElementError,
|
76
|
-
"type_to_input(#{xpath_name}, #{text_to_send}, "\
|
76
|
+
"type_to_input(#{xpath_name}, #{text_to_send}, " \
|
77
77
|
"#{clear_content}, #{click_on_it}): element not found")
|
78
78
|
end
|
79
79
|
element.clear if clear_content
|
@@ -4,20 +4,20 @@ module OnlyofficeWebdriverWrapper
|
|
4
4
|
# Module for working with webdriver useragent
|
5
5
|
module WebdriverUserAgentHelper
|
6
6
|
# @return [String] useragent for Android phone browser
|
7
|
-
USERAGENT_ANDROID_PHONE = 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MDB08M) '\
|
8
|
-
'AppleWebKit/537.36 (KHTML, like Gecko) '\
|
7
|
+
USERAGENT_ANDROID_PHONE = 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MDB08M) ' \
|
8
|
+
'AppleWebKit/537.36 (KHTML, like Gecko) ' \
|
9
9
|
'Chrome/51.0.2704.81 Mobile Safari/537.36'
|
10
10
|
# @return [String] useragent for iPhone browser
|
11
|
-
USERAGENT_IPHONE = 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_2 like Mac OS X) '\
|
12
|
-
'AppleWebKit/601.1.46 (KHTML, like Gecko) '\
|
11
|
+
USERAGENT_IPHONE = 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_2 like Mac OS X) ' \
|
12
|
+
'AppleWebKit/601.1.46 (KHTML, like Gecko) ' \
|
13
13
|
'Version/9.0 Mobile/13F69 Safari/601.1'
|
14
14
|
# @return [String] useragent for iPad Air 2 Safari browser
|
15
|
-
USERAGENT_IPAD_AIR_2_SAFARI = 'Mozilla/5.0 (iPad; CPU OS 10_0 like Mac OS X) '\
|
16
|
-
'AppleWebKit/602.1.50 (KHTML, like Gecko) '\
|
15
|
+
USERAGENT_IPAD_AIR_2_SAFARI = 'Mozilla/5.0 (iPad; CPU OS 10_0 like Mac OS X) ' \
|
16
|
+
'AppleWebKit/602.1.50 (KHTML, like Gecko) ' \
|
17
17
|
'Version/10.0 Mobile/14A5346a Safari/602.1'
|
18
18
|
# @return [String] useragent for Nexus 10 Chrome browser
|
19
|
-
USERAGENT_NEXUS_10_CHROME = 'Mozilla/5.0 (Linux; Android 4.3; Nexus 10 Build/JSS15Q) '\
|
20
|
-
'AppleWebKit/537.36 (KHTML, like Gecko) '\
|
19
|
+
USERAGENT_NEXUS_10_CHROME = 'Mozilla/5.0 (Linux; Android 4.3; Nexus 10 Build/JSS15Q) ' \
|
20
|
+
'AppleWebKit/537.36 (KHTML, like Gecko) ' \
|
21
21
|
'Chrome/48.0.2564.23 Safari/537.36'
|
22
22
|
|
23
23
|
# @return [String, nil] user agent string for current device
|
@@ -119,12 +119,13 @@ module OnlyofficeWebdriverWrapper
|
|
119
119
|
end
|
120
120
|
|
121
121
|
# Get index of element by it's text
|
122
|
-
# @param [String]
|
123
|
-
# @param [Array<
|
124
|
-
#
|
125
|
-
|
122
|
+
# @param [String] text to compare text
|
123
|
+
# @param [Array<PageObject::Elements::Element>] list_elements array with
|
124
|
+
# PageObject elements to find in
|
125
|
+
# @return [Integer, nil] nil if nothing found, index if found
|
126
|
+
def get_element_index(text, list_elements)
|
126
127
|
list_elements.each_with_index do |current, i|
|
127
|
-
return i if get_text(current) ==
|
128
|
+
return i if get_text(current) == text
|
128
129
|
end
|
129
130
|
nil
|
130
131
|
end
|
@@ -168,7 +169,7 @@ module OnlyofficeWebdriverWrapper
|
|
168
169
|
set_style_attribute("#{xpath_name}/button", 'display', 'inline-block')
|
169
170
|
set_style_attribute(xpath_name, 'display', 'block')
|
170
171
|
else
|
171
|
-
|
172
|
+
move_to_driver_action(xpath_name, horizontal_shift, vertical_shift).click.perform
|
172
173
|
end
|
173
174
|
end
|
174
175
|
|
@@ -181,11 +182,11 @@ module OnlyofficeWebdriverWrapper
|
|
181
182
|
# @return [void]
|
182
183
|
def action_on_locator_coordinates(xpath_name, right_by, down_by, action = :click, times = 1)
|
183
184
|
wait_until_element_visible(xpath_name)
|
184
|
-
|
185
|
-
(0...times).inject(@driver.action.move_to(element, right_by.to_i, down_by.to_i)) { |acc, _elem| acc.send(action) }.perform
|
185
|
+
(0...times).inject(move_to_driver_action(xpath_name, right_by, down_by)) { |acc, _elem| acc.send(action) }.perform
|
186
186
|
end
|
187
187
|
|
188
188
|
# Check if element present on page
|
189
|
+
# It may be visible or invisible, but should be present in DOM tree
|
189
190
|
# @param [String] xpath_name to find element
|
190
191
|
# @return [Boolean] result of check
|
191
192
|
def element_present?(xpath_name)
|
@@ -243,6 +244,7 @@ module OnlyofficeWebdriverWrapper
|
|
243
244
|
end
|
244
245
|
|
245
246
|
# Check if element visible on page
|
247
|
+
# It should be part of DOM and should be visible on current visible part of page
|
246
248
|
# @param [String] xpath_name element to find
|
247
249
|
# @return [Boolean] result of check
|
248
250
|
def element_visible?(xpath_name)
|
@@ -254,7 +256,8 @@ module OnlyofficeWebdriverWrapper
|
|
254
256
|
|
255
257
|
begin
|
256
258
|
visible = element.displayed?
|
257
|
-
rescue Exception
|
259
|
+
rescue Exception => e
|
260
|
+
OnlyofficeLoggerHelper.log("Element #{xpath_name} is not visible because of: #{e.message}")
|
258
261
|
visible = false
|
259
262
|
end
|
260
263
|
visible
|
@@ -295,7 +298,7 @@ module OnlyofficeWebdriverWrapper
|
|
295
298
|
# @param [String] xpath_several_elements to find objects
|
296
299
|
# @return [Array<String>] text of those elements
|
297
300
|
def get_text_of_several_elements(xpath_several_elements)
|
298
|
-
@driver.find_elements(:xpath, xpath_several_elements).
|
301
|
+
@driver.find_elements(:xpath, xpath_several_elements).filter_map { |element| element.text unless element.text == '' }
|
299
302
|
end
|
300
303
|
|
301
304
|
# Select value of combo box
|
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.8.1
|
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-
|
14
|
+
date: 2022-07-08 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: headless
|
@@ -275,14 +275,14 @@ 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_100
|
279
278
|
- lib/onlyoffice_webdriver_wrapper/helpers/chrome_helper/chromedriver_bin/chromedriver_linux_101
|
280
279
|
- lib/onlyoffice_webdriver_wrapper/helpers/chrome_helper/chromedriver_bin/chromedriver_linux_102
|
280
|
+
- lib/onlyoffice_webdriver_wrapper/helpers/chrome_helper/chromedriver_bin/chromedriver_linux_103
|
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
|
284
284
|
- lib/onlyoffice_webdriver_wrapper/helpers/headless_helper.rb
|
285
|
-
- lib/onlyoffice_webdriver_wrapper/helpers/headless_helper/
|
285
|
+
- lib/onlyoffice_webdriver_wrapper/helpers/headless_helper/headless_patch.rb
|
286
286
|
- lib/onlyoffice_webdriver_wrapper/helpers/headless_helper/headless_video_recorder.rb
|
287
287
|
- lib/onlyoffice_webdriver_wrapper/helpers/headless_helper/real_display_tools.rb
|
288
288
|
- lib/onlyoffice_webdriver_wrapper/helpers/headless_helper/ruby_helper.rb
|
@@ -325,14 +325,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
325
325
|
requirements:
|
326
326
|
- - ">="
|
327
327
|
- !ruby/object:Gem::Version
|
328
|
-
version: '2.
|
328
|
+
version: '2.7'
|
329
329
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
330
330
|
requirements:
|
331
331
|
- - ">="
|
332
332
|
- !ruby/object:Gem::Version
|
333
333
|
version: '0'
|
334
334
|
requirements: []
|
335
|
-
rubygems_version: 3.3.
|
335
|
+
rubygems_version: 3.3.17
|
336
336
|
signing_key:
|
337
337
|
specification_version: 4
|
338
338
|
summary: ONLYOFFICE Webdriver Wrapper Gem
|