onlyoffice_documentserver_testing_framework 0.6.5 → 2.0.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: 97b640378012bd99e89692ff09085eba8b859e5d34e3cc9f653e2d034882e90f
4
- data.tar.gz: 14309f537961557a608213302497b7b5bcaad0c1bf4f7e7b4cf00dc0c035ad63
3
+ metadata.gz: c72ba66430f3566a860144c7355df76a6f1f91900751078f8f218085d5cfd5a8
4
+ data.tar.gz: ff17ac6de96f7b63299471f41d9fdd96d15c6a4429477d6c1bfc7f1b5e6286b4
5
5
  SHA512:
6
- metadata.gz: 0f8073ccbf0694f24ca5eee2ceda4550d4acb19a37307f178e6bd326c3e97959189772ab323ab84700e906b496f11dea7cbe37ac48a5b6aba918cb5e834f1d39
7
- data.tar.gz: dbe4f8c5f2981d3f4c332e9b8ae58a485bcd08f157436138758e1c11f74634f27bb2b3dab042c7be77122a102d4ca870d775d9a1f175d9e216f37ad7926be5db
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
 
@@ -107,9 +107,8 @@ class DocTestSiteFileListEntry
107
107
  {
108
108
  comment_mode: 4,
109
109
  review_mode: 5,
110
- fill_forms: 6,
111
- only_fill_forms: 7,
112
- view_mode: 9,
110
+ fill_forms: 7,
111
+ view_mode: 8,
113
112
  embedded: 10
114
113
  }
115
114
  end
@@ -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.5'
7
+ STRING = '2.0.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.5
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: 2021-10-14 00:00:00.000000000 Z
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: '0'
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: '0'
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.5'
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.2.27
238
+ rubygems_version: 3.3.4
237
239
  signing_key:
238
240
  specification_version: 4
239
241
  summary: ONLYOFFICE DocumentServer testing framework