onlyoffice_documentserver_testing_framework 0.6.5 → 2.0.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_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 +2 -3
- 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: c72ba66430f3566a860144c7355df76a6f1f91900751078f8f218085d5cfd5a8
|
4
|
+
data.tar.gz: ff17ac6de96f7b63299471f41d9fdd96d15c6a4429477d6c1bfc7f1b5e6286b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2675328bef0e271782a726f91d06e96d1941bd0ed3cb392cc388a3e2b792a03d3b8f63ace5b1f4b1f3445f739351aff9dc9a1a8e2a6cd573f2846ff455421ad
|
7
|
+
data.tar.gz: 0c5e854eabebf8400aa54cb16de07e518b0f8cb6d450a5d44ab146e0bf569d337760999c2f9a2c4069bd6eebe8dedc1b6172f4cbcdd2bab64ca6b0a0d99034ab
|
@@ -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"
|
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: 0.
|
4
|
+
version: 2.0.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-02 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
|