onlyoffice_documentserver_testing_framework 0.6.4 → 1.0.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/test_instance_docs/doc_test_site_functions/doc_test_file_list/doc_test_site_file_list_entry.rb +3 -4
- 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 +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17567e4fc1878b2daa5440e7f35dbaebfdc5d131063eb4ecfd5d59d0f0728969
|
4
|
+
data.tar.gz: cbc6e28420e32b836cc7519bb8b2e2f88291e1e3561f9c946377381eb7cf8bc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 713ff6238cc2716a92380e0e62330211055b87a43d7f4dbbbbe3ad89b1a67657e5870fc6ce0298a4ecb2e29683dae1ad9ded11bc023523309f81ce89f36045cb
|
7
|
+
data.tar.gz: 69465a34dd3760da08f8c61c11867b4dd8a24ef72cca11a7ff89183a1d30026a5dc50e102979003b58150f68dc758dff6f0b4511788b48a51b3b9ac13a99cd51
|
@@ -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: 1.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-01-21 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:
|
@@ -233,7 +235,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
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
|