onlyoffice_documentserver_testing_framework 2.15.0 → 2.17.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: 7dcd99ee1b8704d781bbd13a5fdd439896cdad8ac31403cd2ef250152ccd4686
4
- data.tar.gz: d03b0951ff7fff5210a900224901d2280fbc7f101816ba13b5a464c7631ad390
3
+ metadata.gz: 0bcde4ab727049948a6242bbb9bbb77a287bb43e5f8f445ba6abb3d55ba480a0
4
+ data.tar.gz: 193c88c0aeee333aa8c4419eb0345379e7715e66cb38a5369f33b92ba26110e4
5
5
  SHA512:
6
- metadata.gz: ecbb1198ba4fd115b12c15dfdeda1afe5a385829b7b36a9f18e12e21ee7b9e0b52f37bafdc503384b4c0a68c97537933fa83d655629cb8cc02cc39d7f0e6a5d4
7
- data.tar.gz: 817911868d567352490171461e654efa4ee822460c1b4f1b83e3c53bcd03e2bac46b971612704f0982d33932dd597be17ddea8dad2b7aa34a18eec5f376d6ea0
6
+ metadata.gz: 27f6f645393b043c23a09975c0f4d8319b2bca3a332c06aad53bb91d76c005005a08903ae67cc1118adebdc276792808c78c23bd42535feac0786e40e6224675
7
+ data.tar.gz: 29b99c529db8a922807cf981b84e0b12be226a8b192d552924fdc955365cce81de5cac4f5cb2e6593751c9ac0b588723c4574c74f36bd663ef556f3c7d39bf38
@@ -47,10 +47,27 @@ module OnlyofficeDocumentserverTestingFramework
47
47
  # rubocop disable to not change interface of public method
48
48
  # rubocop:disable Style/OptionalBooleanParameter
49
49
  def open(to_open = true)
50
- return if to_open == active?
50
+ click if to_open != active?
51
+ close_tooltips
52
+ end
51
53
 
52
- click
54
+ # Close tooltips
55
+ # @return [Nothing]
56
+ def close_tooltips
57
+ click_on_button(close_tooltip_xpath) while visible?(tooltip_xpath)
53
58
  end
54
59
  # rubocop:enable Style/OptionalBooleanParameter
60
+
61
+ private
62
+
63
+ # @return [String] xpath to tooltip
64
+ def tooltip_xpath
65
+ "//div[contains(@class, 'synch-tip-root')]"
66
+ end
67
+
68
+ # @return [String] xpath to close button in tooltip
69
+ def close_tooltip_xpath
70
+ "#{tooltip_xpath}//div[@class = 'close']"
71
+ end
55
72
  end
56
73
  end
@@ -0,0 +1,42 @@
1
+ English
2
+ Arabic
3
+ Armenian
4
+ Azerbaijani
5
+ Basque
6
+ Belarusian
7
+ Bulgarian
8
+ Catalan
9
+ Chinese (Simplified)
10
+ Chinese (Traditional)
11
+ Czech
12
+ Danish
13
+ Dutch
14
+ Finnish
15
+ French
16
+ Galego
17
+ German
18
+ Greek
19
+ Hungarian
20
+ Indonesian
21
+ Italian
22
+ Japanese
23
+ Korean
24
+ Lao
25
+ Latvian
26
+ Malay (Malaysia)
27
+ Norwegian
28
+ Polish
29
+ Portuguese (Brazil)
30
+ Portuguese (Portugal)
31
+ Romanian
32
+ Russian
33
+ Serbian
34
+ Sinhala (Sri Lanka)
35
+ Slovak
36
+ Slovenian
37
+ Spanish
38
+ Swedish
39
+ Turkish
40
+ Ukrainian
41
+ Vietnamese
42
+ Test Language
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OnlyofficeDocumentserverTestingFramework
4
+ # Helper to handle password protected files on conversion step
5
+ module PasswordProtectedConversionHelper
6
+ # @return [String] xpath of password input
7
+ def xpath_input_password
8
+ '//input[@id="filePass"]'
9
+ end
10
+
11
+ # @return [String] xpath of enter button
12
+ def xpath_enter_password
13
+ '//div[@id="enterPass"]'
14
+ end
15
+
16
+ # @return [String] xpath of error message
17
+ def xpath_password_error
18
+ '//span[@class="errorPass"]'
19
+ end
20
+
21
+ # Waits until password is checked
22
+ # @return [Nothing]
23
+ def wait_to_check_password
24
+ @instance.webdriver.wait_until(5) do
25
+ !@instance.webdriver.get_attribute(@xpath_conversion_step, 'class').include?('current')
26
+ end
27
+ end
28
+
29
+ # @return [Boolean] check if incorrect password warning is shown
30
+ def incorrect_password_shown?
31
+ @instance.selenium.element_visible?(xpath_password_error)
32
+ end
33
+
34
+ # Handle password block
35
+ def handle_password_protection(password)
36
+ @instance.selenium.type_text(xpath_input_password, password)
37
+ @instance.selenium.click_on_locator(xpath_enter_password)
38
+ wait_to_check_password
39
+ @instance.webdriver.webdriver_error("Cannot open file with password: `#{password}`") if incorrect_password_shown?
40
+ OnlyofficeLoggerHelper.log('Entered password')
41
+ end
42
+ end
43
+ end
@@ -4,11 +4,13 @@ require_relative 'doc_test_site_functions/healthcheck_page'
4
4
  require_relative 'doc_test_site_functions/doc_test_file_list'
5
5
  require_relative 'doc_test_site_functions/doc_test_site_server_helper'
6
6
  require_relative 'doc_test_site_functions/file_reopen_helper'
7
+ require_relative 'doc_test_site_functions/password_protected_conversion_helper'
7
8
  # Class to work with test examples
8
9
  class DocTestSiteFunctions
9
10
  extend DocTestSiteServerHelper
10
11
  include PageObject
11
12
  include OnlyofficeDocumentserverTestingFramework::FileReopenHelper
13
+ include OnlyofficeDocumentserverTestingFramework::PasswordProtectedConversionHelper
12
14
 
13
15
  select_list(:user_list, xpath: '//*[@id="user"]')
14
16
  select_list(:language_list, xpath: '//*[@id="language"]')
@@ -96,6 +98,9 @@ class DocTestSiteFunctions
96
98
  OnlyofficeLoggerHelper.log("Waiting for file conversion for #{current_time} seconds")
97
99
  return true if @instance.selenium.get_attribute(@xpath_conversion_step, 'class').include?('done')
98
100
 
101
+ if @instance.selenium.element_visible?(xpath_input_password)
102
+ handle_password_protection(@instance.management.password)
103
+ end
99
104
  sleep 1
100
105
  check_error
101
106
  end
@@ -168,11 +173,10 @@ class DocTestSiteFunctions
168
173
 
169
174
  # @return [DocTestFileLIst] get file list
170
175
  def uploaded_file_list
171
- file_list = []
172
- (0...uploaded_file_count).each do |current_file_number|
173
- file_list << DocTestSiteFileListEntry.new(@instance,
174
- "#{@xpath_file_entry}[#{current_file_number + 1}]",
175
- @edit_modes_indexes)
176
+ file_list = (0...uploaded_file_count).map do |current_file_number|
177
+ DocTestSiteFileListEntry.new(@instance,
178
+ "#{@xpath_file_entry}[#{current_file_number + 1}]",
179
+ @edit_modes_indexes)
176
180
  end
177
181
  DocTestFileList.new(file_list)
178
182
  end
@@ -225,8 +229,10 @@ class DocTestSiteFunctions
225
229
 
226
230
  # @param [DocumentServerVersion] version of server
227
231
  # @return [Array<String>] list of supported languages
228
- def self.supported_languages(version = OnlyofficeDocumentserverTestingFramework::DocumentServerVersion.new(7, 4, 0))
229
- file = if version >= OnlyofficeDocumentserverTestingFramework::DocumentServerVersion.new(7, 4)
232
+ def self.supported_languages(version = OnlyofficeDocumentserverTestingFramework::DocumentServerVersion.new(8, 0, 0))
233
+ file = if version >= OnlyofficeDocumentserverTestingFramework::DocumentServerVersion.new(8, 0)
234
+ 'doc_test_site_languages_after_8_0.list'
235
+ elsif version >= OnlyofficeDocumentserverTestingFramework::DocumentServerVersion.new(7, 4)
230
236
  'doc_test_site_languages_after_7_4.list'
231
237
  elsif version >= OnlyofficeDocumentserverTestingFramework::DocumentServerVersion.new(7, 3)
232
238
  'doc_test_site_languages_after_7_3.list'
@@ -6,7 +6,7 @@ module OnlyofficeDocumentserverTestingFramework
6
6
  include SeleniumWrapper
7
7
 
8
8
  def initialize(instance)
9
- super(instance)
9
+ super
10
10
  @xpath_codepage_selector = '//*[contains(text(), "CSV")]/../..//div[@id="id-codepages-combo"]'
11
11
  end
12
12
 
@@ -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 = '2.15.0'
7
+ STRING = '2.17.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: 2.15.0
4
+ version: 2.17.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: 2023-11-03 00:00:00.000000000 Z
12
+ date: 2024-06-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: onlyoffice_logger_helper
@@ -82,7 +82,9 @@ files:
82
82
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/languages_list/doc_test_site_languages_after_7_2.list
83
83
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/languages_list/doc_test_site_languages_after_7_3.list
84
84
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/languages_list/doc_test_site_languages_after_7_4.list
85
+ - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/languages_list/doc_test_site_languages_after_8_0.list
85
86
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/languages_list/doc_test_site_languages_before_6_2.list
87
+ - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/password_protected_conversion_helper.rb
86
88
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/integration_example_api.rb
87
89
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/management.rb
88
90
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/management/loader_helper.rb
@@ -119,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
121
  - !ruby/object:Gem::Version
120
122
  version: '0'
121
123
  requirements: []
122
- rubygems_version: 3.4.21
124
+ rubygems_version: 3.5.13
123
125
  signing_key:
124
126
  specification_version: 4
125
127
  summary: ONLYOFFICE DocumentServer testing framework