onlyoffice_webdriver_wrapper 1.5.0 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- 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_102 +0 -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 +6 -4
- 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 +8 -6
- data/lib/onlyoffice_webdriver_wrapper/webdriver/webdriver_move_cursor_methods.rb +23 -12
- 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 +15 -9
- metadata +7 -7
- data/lib/onlyoffice_webdriver_wrapper/helpers/chrome_helper/chromedriver_bin/chromedriver_linux_98 +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb66b9cb0b1d1d9c2c1b073c87c8448f219ab606167cf04fc07098fb1b9ab52c
|
4
|
+
data.tar.gz: dcc8a129fd4bb6c1bf03cb3c7512e02307b1c468a57692b0cccfaf367013a810
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d291a4d9e4cb76071c29f99ff9e406aed808acadd2da20b8a4809da3104ec6787632a46049af95def7b6ea631a1a345f180e7313297089fc369d13ffa43eefe
|
7
|
+
data.tar.gz: 79450930ff1f94e966076dd0ad4c34ea8a88ca746b373dd6505dfc7f1f888b2cd8fb6deac3f2f96d46d763ead26d60dee27bddbe40e1a60540ff0cbc79f89052
|
@@ -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
|
data/lib/onlyoffice_webdriver_wrapper/helpers/chrome_helper/chromedriver_bin/chromedriver_linux_102
ADDED
Binary file
|
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
|
@@ -51,8 +51,9 @@ module OnlyofficeWebdriverWrapper
|
|
51
51
|
def click_on_locator_coordinates(xpath_name, right_by, down_by)
|
52
52
|
wait_until_element_visible(xpath_name)
|
53
53
|
element = @driver.find_element(:xpath, xpath_name)
|
54
|
-
|
55
|
-
@driver.action.move_to(element, right_by.to_i, down_by.to_i).
|
54
|
+
shift_to_zero = move_to_shift_to_top_left(xpath_name)
|
55
|
+
@driver.action.move_to(element, right_by.to_i - shift_to_zero.x, down_by.to_i - shift_to_zero.y).perform
|
56
|
+
@driver.action.move_to(element, right_by.to_i - shift_to_zero.x, down_by.to_i - shift_to_zero.y).click.perform
|
56
57
|
end
|
57
58
|
|
58
59
|
# Click on one of several which displayed
|
@@ -100,8 +101,9 @@ module OnlyofficeWebdriverWrapper
|
|
100
101
|
def right_click_on_locator_coordinates(xpath_name, right_by = nil, down_by = nil)
|
101
102
|
wait_until_element_visible(xpath_name)
|
102
103
|
element = @driver.find_element(:xpath, xpath_name)
|
103
|
-
|
104
|
-
@driver.action.move_to(element, right_by.to_i, down_by.to_i).
|
104
|
+
shift_to_zero = move_to_shift_to_top_left(xpath_name)
|
105
|
+
@driver.action.move_to(element, right_by.to_i - shift_to_zero.x, down_by.to_i - shift_to_zero.y).perform
|
106
|
+
@driver.action.move_to(element, right_by.to_i - shift_to_zero.x, down_by.to_i - shift_to_zero.y).context_click.perform
|
105
107
|
end
|
106
108
|
|
107
109
|
# Perform double_click on element
|
@@ -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
|
@@ -30,12 +30,14 @@ module OnlyofficeWebdriverWrapper
|
|
30
30
|
end
|
31
31
|
|
32
32
|
# Type to locator by javascript
|
33
|
-
# @param [String]
|
33
|
+
# @param [String] xpath to find object where to type
|
34
34
|
# @param [String] text to type
|
35
35
|
# @return [void]
|
36
|
-
def type_to_locator_by_javascript(
|
37
|
-
escaped_text = text.gsub('\\', '\\\\\\\\')
|
38
|
-
|
36
|
+
def type_to_locator_by_javascript(xpath, text)
|
37
|
+
escaped_text = text.gsub('\\', '\\\\\\\\')
|
38
|
+
.gsub('"', '\\"')
|
39
|
+
.gsub("\n", '\\n')
|
40
|
+
execute_javascript("#{dom_element_by_xpath(xpath)}.value=\"#{escaped_text}\";")
|
39
41
|
end
|
40
42
|
|
41
43
|
# Get text in object by xpath
|
@@ -102,8 +104,8 @@ module OnlyofficeWebdriverWrapper
|
|
102
104
|
# @param [String] xpath of element to remove
|
103
105
|
# @return [String] result of javascript execution
|
104
106
|
def remove_element(xpath)
|
105
|
-
script = "element = #{dom_element_by_xpath(xpath)};"\
|
106
|
-
'if (element !== null) '\
|
107
|
+
script = "element = #{dom_element_by_xpath(xpath)};" \
|
108
|
+
'if (element !== null) ' \
|
107
109
|
'{element.parentNode.removeChild(element);};'
|
108
110
|
execute_javascript(script)
|
109
111
|
end
|
@@ -15,9 +15,10 @@ module OnlyofficeWebdriverWrapper
|
|
15
15
|
# * +mouse_release+ - release mouse after move
|
16
16
|
def drag_and_drop(xpath, x1, y1, x2, y2, mouse_release: true)
|
17
17
|
canvas = get_element(xpath)
|
18
|
-
|
18
|
+
shift_to_zero = move_to_shift_to_top_left(xpath)
|
19
19
|
move_action = @driver.action
|
20
|
-
.move_to(canvas, x1.to_i
|
20
|
+
.move_to(canvas, x1.to_i - shift_to_zero.x,
|
21
|
+
y1.to_i - shift_to_zero.y)
|
21
22
|
.click_and_hold
|
22
23
|
.move_by(x2, y2)
|
23
24
|
move_action = move_action.release if mouse_release
|
@@ -33,15 +34,10 @@ module OnlyofficeWebdriverWrapper
|
|
33
34
|
# * +right_by+ - shift vector x coordinate
|
34
35
|
# * +down_by+ - shift vector y coordinate
|
35
36
|
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
|
37
|
+
shift_to_zero = move_to_shift_to_top_left(source)
|
38
|
+
@driver.action.drag_and_drop_by(get_element(source),
|
39
|
+
right_by - shift_to_zero.x,
|
40
|
+
down_by - shift_to_zero.y).perform
|
45
41
|
end
|
46
42
|
|
47
43
|
# Move cursor to element
|
@@ -60,7 +56,22 @@ module OnlyofficeWebdriverWrapper
|
|
60
56
|
# @return [nil]
|
61
57
|
def mouse_over(xpath_name, x_coordinate = 0, y_coordinate = 0)
|
62
58
|
wait_until_element_present(xpath_name)
|
63
|
-
|
59
|
+
shift_to_zero = move_to_shift_to_top_left(xpath_name)
|
60
|
+
@driver.action.move_to(@driver.find_element(:xpath, xpath_name),
|
61
|
+
x_coordinate.to_i - shift_to_zero.x,
|
62
|
+
y_coordinate.to_i - shift_to_zero.y).perform
|
63
|
+
end
|
64
|
+
|
65
|
+
# Since v4.3.0 of `webdriver` gem `move_to` method is moving
|
66
|
+
# from the center of the element
|
67
|
+
# Add additional negative shift if this version is used
|
68
|
+
def move_to_shift_to_top_left(xpath)
|
69
|
+
if Gem.loaded_specs['selenium-webdriver'].version >= Gem::Version.new('4.3.0')
|
70
|
+
element_size = element_size_by_js(xpath)
|
71
|
+
Dimensions.new(element_size.x / 2, element_size.y / 2)
|
72
|
+
else
|
73
|
+
Dimensions.new(0, 0)
|
74
|
+
end
|
64
75
|
end
|
65
76
|
end
|
66
77
|
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,8 @@ 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
|
+
shift_to_zero = move_to_shift_to_top_left(xpath_name)
|
173
|
+
@driver.action.move_to(element, horizontal_shift - shift_to_zero.x, vertical_shift - shift_to_zero.y).click.perform
|
172
174
|
end
|
173
175
|
end
|
174
176
|
|
@@ -182,7 +184,10 @@ module OnlyofficeWebdriverWrapper
|
|
182
184
|
def action_on_locator_coordinates(xpath_name, right_by, down_by, action = :click, times = 1)
|
183
185
|
wait_until_element_visible(xpath_name)
|
184
186
|
element = @driver.find_element(:xpath, xpath_name)
|
185
|
-
|
187
|
+
shift_to_zero = move_to_shift_to_top_left(xpath_name)
|
188
|
+
(0...times).inject(@driver.action.move_to(element,
|
189
|
+
right_by.to_i - shift_to_zero.x,
|
190
|
+
down_by.to_i - shift_to_zero.y)) { |acc, _elem| acc.send(action) }.perform
|
186
191
|
end
|
187
192
|
|
188
193
|
# Check if element present on page
|
@@ -254,7 +259,8 @@ module OnlyofficeWebdriverWrapper
|
|
254
259
|
|
255
260
|
begin
|
256
261
|
visible = element.displayed?
|
257
|
-
rescue Exception
|
262
|
+
rescue Exception => e
|
263
|
+
OnlyofficeLoggerHelper.log("Element #{xpath_name} is not visible because of: #{e.message}")
|
258
264
|
visible = false
|
259
265
|
end
|
260
266
|
visible
|
@@ -295,7 +301,7 @@ module OnlyofficeWebdriverWrapper
|
|
295
301
|
# @param [String] xpath_several_elements to find objects
|
296
302
|
# @return [Array<String>] text of those elements
|
297
303
|
def get_text_of_several_elements(xpath_several_elements)
|
298
|
-
@driver.find_elements(:xpath, xpath_several_elements).
|
304
|
+
@driver.find_elements(:xpath, xpath_several_elements).filter_map { |element| element.text unless element.text == '' }
|
299
305
|
end
|
300
306
|
|
301
307
|
# 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.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-
|
14
|
+
date: 2022-07-07 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
|
-
- lib/onlyoffice_webdriver_wrapper/helpers/chrome_helper/chromedriver_bin/
|
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
|