onlyoffice_documentserver_testing_framework 0.6.3 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 04acc07cf491a9bc18639c27d3229024962ad61c906939ecf06336a74ebdf6de
4
- data.tar.gz: f1ae9c65bc037fa956ce79e52b419b2297399fa7d21e169df7023557a0fe405a
3
+ metadata.gz: 976f20d4a3c91861624c79b35a8672f5700a687dca62506398a77199745c599e
4
+ data.tar.gz: 113e81fbc57dd8a66f71c6062ffb6997dd45d93432bc9348d15330a52efe3001
5
5
  SHA512:
6
- metadata.gz: c837d734fd95c9e7c3a1294290cb90f549cb01ada4bb653b7bad53430e7de366ec541949249bf3b84ec80402e486bc80e60597ad21d2369da668553dc97646d5
7
- data.tar.gz: '0519b6fb0b316fb2a119b63b4df83c64f270cfdb9edd0ff43bb926e335e374455860fff1102d4c43aa0e40088f413c9fa961f78a3223dcc929bd073e8a1c0f72'
6
+ metadata.gz: e31abfd59e920898c8b665f9316fe15c7043e8f27ea3292791cda65d0592715107b35f7013341d3d9894c8a601b40d5b828bb064a2a916feb943c251ff9827ba
7
+ data.tar.gz: e10c8e148dff642c07950997d81af33d47498dc6cec5962eab224949872d3661e0fc3d217510158fee56bff498ddb4ccf33b2e176849dfc7ee4a5a430f8429c2
@@ -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')
@@ -4,6 +4,6 @@ module OnlyofficeDocumentserverTestingFramework
4
4
  # Module to hold version of Gem
5
5
  module Version
6
6
  # [String] version of gem
7
- STRING = '0.6.3'
7
+ STRING = '0.7.0'
8
8
  end
9
9
  end
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.6.3
4
+ version: 0.7.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: 2021-10-13 00:00:00.000000000 Z
12
+ date: 2021-12-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: onlyoffice_logger_helper
@@ -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.2.27
238
+ rubygems_version: 3.3.2
237
239
  signing_key:
238
240
  specification_version: 4
239
241
  summary: ONLYOFFICE DocumentServer testing framework