onlyoffice_documentserver_testing_framework 0.6.6 → 2.1.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_documentserver_testing_framework/selenium_wrapper.rb +2 -2
- data/lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list/doc_test_site_file_list_entry.rb +1 -2
- data/lib/onlyoffice_documentserver_testing_framework/test_instance_docs/management/password_protected_helper.rb +33 -0
- data/lib/onlyoffice_documentserver_testing_framework/test_instance_docs/management.rb +5 -0
- data/lib/onlyoffice_documentserver_testing_framework/version.rb +1 -1
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 341d7258f91b8315d7b02b0ea984a88b99f36a80bcd89ed3368380384cf7ee7d
|
4
|
+
data.tar.gz: 3b906bca0dfaa59d28fc565caf9a41b4e520920f8257df0064bd2d8b692023ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4cbc2dda83e7443ec7f5d7ece25e99ae18989638c9753d248fff8f77e0361272fbf7e72b6eb48111e4dd3f8a362744fe6fe86a8bc50e2cf2bad40c264d95419b
|
7
|
+
data.tar.gz: 3b712586bb36f05741e6ad618e025d94dfe677b10cc29fcf0113f98377779692266a298e73adfbb69ebd9736fbb13d0412b8b61a354d280488229fb118dd1a1b
|
@@ -11,9 +11,9 @@ module OnlyofficeDocumentserverTestingFramework
|
|
11
11
|
# @param name [Symbol] function to call
|
12
12
|
# @param arguments [Hash] list of arguments
|
13
13
|
# @return [Object] result of method
|
14
|
-
def selenium_functions(name, *arguments)
|
14
|
+
def selenium_functions(name, *arguments, **options)
|
15
15
|
select_frame do
|
16
|
-
@instance.selenium.send name, *arguments
|
16
|
+
@instance.selenium.send name, *arguments, **options
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OnlyofficeDocumentserverTestingFramework
|
4
|
+
# Helper to handle password protected files
|
5
|
+
module PasswordProtectedHelper
|
6
|
+
# @return [String] xpath of password input
|
7
|
+
def xpath_input_password
|
8
|
+
'//div[@id="id-password-txt"]//input'
|
9
|
+
end
|
10
|
+
|
11
|
+
# @return [String] xpath of ok in protected file dialog
|
12
|
+
def xpath_ok_password
|
13
|
+
"#{xpath_input_password}/../../../../../..//button[@result='ok']"
|
14
|
+
end
|
15
|
+
|
16
|
+
# @return [Boolean] check if incorrect password warning is shown
|
17
|
+
def incorrect_password_shown?
|
18
|
+
error_xpath = "#{xpath_input_password}/.."
|
19
|
+
|
20
|
+
@instance.webdriver.get_attribute(error_xpath, 'class').include?('error')
|
21
|
+
end
|
22
|
+
|
23
|
+
# Handle some more alert dialogs
|
24
|
+
def handle_password_protection(password)
|
25
|
+
return unless @instance.selenium.element_visible?(xpath_input_password)
|
26
|
+
|
27
|
+
@instance.webdriver.webdriver_error("Cannot open file with password: `#{password}`") if incorrect_password_shown?
|
28
|
+
|
29
|
+
@instance.selenium.type_text(xpath_input_password, password)
|
30
|
+
@instance.selenium.click_on_locator(xpath_ok_password)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -1,16 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative 'management/loader_helper'
|
4
|
+
require_relative 'management/password_protected_helper'
|
4
5
|
module OnlyofficeDocumentserverTestingFramework
|
5
6
|
# Class for management main methods
|
6
7
|
class Management
|
7
8
|
include SeleniumWrapper
|
8
9
|
include LoaderHelper
|
10
|
+
include PasswordProtectedHelper
|
9
11
|
|
10
12
|
# @return [Integer] count of iframes to go into
|
11
13
|
attr_accessor :xpath_iframe_count
|
12
14
|
# @return [String] xpath to single iframe
|
13
15
|
attr_accessor :xpath_iframe
|
16
|
+
# Set file password
|
17
|
+
attr_accessor :password
|
14
18
|
|
15
19
|
def initialize(instance)
|
16
20
|
@instance = instance
|
@@ -107,6 +111,7 @@ module OnlyofficeDocumentserverTestingFramework
|
|
107
111
|
@instance.selenium.webdriver_error('Timeout for render file')
|
108
112
|
end
|
109
113
|
handle_alert_dialog
|
114
|
+
handle_password_protection(password)
|
110
115
|
@instance.selenium.select_top_frame
|
111
116
|
if permission_denied_message?
|
112
117
|
@instance.selenium.webdriver_error('There is not enough access rights for document')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onlyoffice_documentserver_testing_framework
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ONLYOFFICE
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-02-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: onlyoffice_logger_helper
|
@@ -31,14 +31,14 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
34
|
+
version: '1'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '
|
41
|
+
version: '1'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: overcommit
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -204,6 +204,7 @@ files:
|
|
204
204
|
- lib/onlyoffice_documentserver_testing_framework/test_instance_docs/integration_example_api.rb
|
205
205
|
- lib/onlyoffice_documentserver_testing_framework/test_instance_docs/management.rb
|
206
206
|
- lib/onlyoffice_documentserver_testing_framework/test_instance_docs/management/loader_helper.rb
|
207
|
+
- lib/onlyoffice_documentserver_testing_framework/test_instance_docs/management/password_protected_helper.rb
|
207
208
|
- lib/onlyoffice_documentserver_testing_framework/test_instance_docs/presentation_editor.rb
|
208
209
|
- lib/onlyoffice_documentserver_testing_framework/test_instance_docs/spreadsheet_editor.rb
|
209
210
|
- lib/onlyoffice_documentserver_testing_framework/test_instance_docs/spreadsheet_editor/spreadsheet_windows.rb
|
@@ -218,6 +219,7 @@ metadata:
|
|
218
219
|
documentation_uri: https://www.rubydoc.info/gems/onlyoffice_documentserver_testing_framework
|
219
220
|
homepage_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_documentserver_testing_framework
|
220
221
|
source_code_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_documentserver_testing_framework
|
222
|
+
rubygems_mfa_required: 'true'
|
221
223
|
post_install_message:
|
222
224
|
rdoc_options: []
|
223
225
|
require_paths:
|
@@ -226,14 +228,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
226
228
|
requirements:
|
227
229
|
- - ">="
|
228
230
|
- !ruby/object:Gem::Version
|
229
|
-
version: '2.
|
231
|
+
version: '2.7'
|
230
232
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
231
233
|
requirements:
|
232
234
|
- - ">="
|
233
235
|
- !ruby/object:Gem::Version
|
234
236
|
version: '0'
|
235
237
|
requirements: []
|
236
|
-
rubygems_version: 3.
|
238
|
+
rubygems_version: 3.3.4
|
237
239
|
signing_key:
|
238
240
|
specification_version: 4
|
239
241
|
summary: ONLYOFFICE DocumentServer testing framework
|