onlyoffice_documentserver_testing_framework 2.8.0 → 2.11.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 341504efd44e53df56234a60d803c6a00baee4350e78cd7c74a861009b8fd56c
4
- data.tar.gz: 4665427fdc68fc72eb5cdafa1e032947c15f0d53f74bb5dadafae7c9a0c5aa04
3
+ metadata.gz: 55a2459e9a085a04258ca443ebf12015c9172da446bc02f66b23412ff5c0f73d
4
+ data.tar.gz: afb457e1bbd206f22eac136925ae60db2ef15bb66f827fce604d21c5318f58a9
5
5
  SHA512:
6
- metadata.gz: edb27a38de4d8844ff5fa5d99a11189465749a83e7890888f23b70025151354e328b3bfc9b194032870ee028df84155d0872967058591ee7a1a788d00b9902d6
7
- data.tar.gz: 07e47e22020a05fdf08ef96d95830ac92dff4c2e27f57f3c8ee2f623eb492cabf828c1b3cbecf0f0b48fcb1e226b3a5cc3848aac87dc63f73b3aed9ffea084f9
6
+ metadata.gz: b75a9dbf49c2e1dbc50c534e8ae6dcabfa208f6b2f7997e226ecd361c7437c2afc534b1b4a30c675f3a2887139c515fa9f46218a5b4194260ac1b192239dabc4
7
+ data.tar.gz: cfe0e6f4783d8e5f3b141d680b5d626909a9129795016990d8a86e639afe73c49a46694bec278eb1cf70fc51312be7e13eeb18cd3c69d0a9aa5a94fc15a45e53
@@ -6,8 +6,8 @@ module SeleniumWrapperJsErrors
6
6
  def ignored_errors
7
7
  return @ignored_errors if @ignored_errors
8
8
 
9
- @ignored_errors = File.readlines("#{File.expand_path('..', __dir__)}"\
10
- '/selenium_wrapper/selenium_wrapper_js_errors'\
9
+ @ignored_errors = File.readlines("#{File.expand_path('..', __dir__)}" \
10
+ '/selenium_wrapper/selenium_wrapper_js_errors' \
11
11
  '/ignored_errors.list')
12
12
  .map(&:strip)
13
13
  end
@@ -91,8 +91,8 @@ module OnlyofficeDocumentserverTestingFramework
91
91
  # @param xpath [String] xpath to click
92
92
  # @return [nil]
93
93
  def click_on_displayed_button(xpath)
94
- selenium_functions :wait_element, xpath
95
- selenium_functions :click_on_displayed, xpath
94
+ selenium_functions(:wait_until_element_visible, xpath)
95
+ selenium_functions(:click_on_displayed, xpath)
96
96
  end
97
97
 
98
98
  # Is line enabled
@@ -116,13 +116,6 @@ module OnlyofficeDocumentserverTestingFramework
116
116
  selenium_functions(:get_attribute, xpath, 'class').include?('disabled')
117
117
  end
118
118
 
119
- # Move to element
120
- # @param xpath [String] xpath to move
121
- # @return [nil]
122
- def move_to_element(xpath)
123
- selenium_functions :move_to_element_by_locator, xpath
124
- end
125
-
126
119
  # Remove element
127
120
  # @param xpath [String] xpath to remove
128
121
  # @return [nil]
@@ -27,6 +27,15 @@ module OnlyofficeDocumentserverTestingFramework
27
27
  name[-1] == '*'
28
28
  end
29
29
 
30
+ # Rename current document
31
+ # @param [String] new_name to rename
32
+ # @return [nil]
33
+ def rename(new_name)
34
+ selenium_functions(:type_to_locator, @xpath_document_name, "#{new_name}\n", true, true)
35
+ OnlyofficeLoggerHelper.log("Renamed document to `#{new_name}` name")
36
+ OnlyofficeLoggerHelper.sleep_and_log('Wait for rename to complete', 5)
37
+ end
38
+
30
39
  private
31
40
 
32
41
  # @return [String] raw data from document name
@@ -7,7 +7,7 @@ module OnlyofficeDocumentserverTestingFramework
7
7
  # @param [Integer] timeout for wait for file to build
8
8
  # @return [Boolean] result of opening
9
9
  def reopen_after_autosave(timeout: 30)
10
- url = @instance.selenium.get_url
10
+ url = @instance.selenium.current_url
11
11
  leave_file_and_build_it(timeout: timeout)
12
12
  @instance.webdriver.open(url)
13
13
  @instance.management.wait_for_operation_with_round_status_canvas
@@ -0,0 +1,38 @@
1
+ English
2
+ Armenian
3
+ Azerbaijani
4
+ Basque
5
+ Belarusian
6
+ Bulgarian
7
+ Catalan
8
+ Chinese (People's Republic of China)
9
+ Chinese (Traditional, Taiwan)
10
+ Czech
11
+ Danish
12
+ Dutch
13
+ Finnish
14
+ French
15
+ Galego
16
+ German
17
+ Greek
18
+ Hungarian
19
+ Indonesian
20
+ Italian
21
+ Japanese
22
+ Korean
23
+ Latvian
24
+ Lao
25
+ Malay (Malaysia)
26
+ Norwegian
27
+ Polish
28
+ Portuguese (Brazil)
29
+ Portuguese (Portugal)
30
+ Romanian
31
+ Russian
32
+ Slovak
33
+ Slovenian
34
+ Spanish
35
+ Swedish
36
+ Turkish
37
+ Ukrainian
38
+ Vietnamese
@@ -21,11 +21,11 @@ class DocTestSiteFunctions
21
21
  @xpath_conversion_step = '//*[@id="step2"]'
22
22
  @xpath_editor_scripts_step = '//*[@id="step3"]'
23
23
  @xpath_file_entry = '//*[@class="stored-list"]//table/tbody/tr'
24
- @xpath_create_doc = '//*[contains(@class, "try-editor document")]|'\
24
+ @xpath_create_doc = '//*[contains(@class, "try-editor document")]|' \
25
25
  '//*[contains(@class, "try-editor word")]'
26
- @xpath_create_workbook = '//*[contains(@class, "try-editor spreadsheet")]|'\
26
+ @xpath_create_workbook = '//*[contains(@class, "try-editor spreadsheet")]|' \
27
27
  '//*[contains(@class, "try-editor cell")]'
28
- @xpath_create_presentation = '//*[contains(@class, "try-editor presentation")]|'\
28
+ @xpath_create_presentation = '//*[contains(@class, "try-editor presentation")]|' \
29
29
  '//*[contains(@class, "try-editor slide")]'
30
30
  @edit_modes_indexes = edit_modes_indexes
31
31
  end
@@ -57,7 +57,7 @@ class DocTestSiteFunctions
57
57
  # Upload file to portal
58
58
  # @param [String] file_path like as '/mnt/data_share/Files/DOCX/empty.docx'
59
59
  def upload_file(file_path)
60
- file_path_absolute = file_path.gsub('~', ENV['HOME'])
60
+ file_path_absolute = file_path.gsub('~', Dir.home)
61
61
  @instance.selenium.type_to_locator('//*[@id="fileupload"]', file_path_absolute, false, false, false, true)
62
62
  wait_loading_file
63
63
  wait_conversion
@@ -72,7 +72,7 @@ class DocTestSiteFunctions
72
72
 
73
73
  return if error_message.empty?
74
74
 
75
- @instance.selenium.webdriver_error('Error while uploading document. '\
75
+ @instance.selenium.webdriver_error('Error while uploading document. ' \
76
76
  "Error message: #{error_message}")
77
77
  end
78
78
 
@@ -150,7 +150,7 @@ class DocTestSiteFunctions
150
150
  # Get url of document which opened in editor
151
151
  # @return [String] url
152
152
  def current_document_storage_url
153
- page_source = @instance.selenium.get_page_source
153
+ page_source = @instance.selenium.page_source
154
154
  url_line = page_source.scan(/"?url"?: ".*$/).first
155
155
  url_line.delete('"').gsub('url: ', '').chop
156
156
  end
@@ -224,16 +224,18 @@ class DocTestSiteFunctions
224
224
 
225
225
  # @param [DocumentServerVersion] version of server
226
226
  # @return [Array<String>] list of supported languages
227
- def self.supported_languages(version = OnlyofficeDocumentserverTestingFramework::DocumentServerVersion.new(6, 2, 0))
228
- file = if version >= OnlyofficeDocumentserverTestingFramework::DocumentServerVersion.new(7, 1)
227
+ def self.supported_languages(version = OnlyofficeDocumentserverTestingFramework::DocumentServerVersion.new(7, 1, 0))
228
+ file = if version >= OnlyofficeDocumentserverTestingFramework::DocumentServerVersion.new(7, 2)
229
+ 'doc_test_site_languages_after_7_2.list'
230
+ elsif version >= OnlyofficeDocumentserverTestingFramework::DocumentServerVersion.new(7, 1)
229
231
  'doc_test_site_languages_after_7_1.list'
230
232
  elsif version >= OnlyofficeDocumentserverTestingFramework::DocumentServerVersion.new(6, 2)
231
233
  'doc_test_site_languages_after_6_2.list'
232
234
  else
233
235
  'doc_test_site_languages_before_6_2.list'
234
236
  end
235
- File.readlines("#{File.expand_path('..', __dir__)}"\
236
- '/test_instance_docs/doc_test_site_functions/'\
237
+ File.readlines("#{File.expand_path('..', __dir__)}" \
238
+ '/test_instance_docs/doc_test_site_functions/' \
237
239
  "languages_list/#{file}")
238
240
  .map(&:strip)
239
241
  end
@@ -244,9 +246,9 @@ class DocTestSiteFunctions
244
246
  # @return [Hash] name with index
245
247
  def default_modes_indexes
246
248
  {
247
- comment_mode: 4,
248
- review_mode: 5,
249
- fill_forms: 7,
249
+ comment_mode: 2,
250
+ review_mode: 4,
251
+ fill_forms: 6,
250
252
  view_mode: 8,
251
253
  embedded: 10
252
254
  }
@@ -14,7 +14,7 @@ module OnlyofficeDocumentserverTestingFramework
14
14
 
15
15
  # @return [Boolean] is `File not found` message shown
16
16
  def file_not_found_message?
17
- message_xpath = '//div[contains(@class, "tooltip-inner") and '\
17
+ message_xpath = '//div[contains(@class, "tooltip-inner") and ' \
18
18
  'contains(text(),"The required file was not found")]'
19
19
  @instance.selenium.select_frame
20
20
  error_on_loading = @instance.selenium.element_visible?(message_xpath)
@@ -22,7 +22,7 @@ module OnlyofficeDocumentserverTestingFramework
22
22
  @instance = instance
23
23
  @xpath_iframe_count = 1
24
24
  # Don't mixup iframe with help
25
- @xpath_iframe = '//iframe[not(contains(@src, "/help/")) and '\
25
+ @xpath_iframe = '//iframe[not(contains(@src, "/help/")) and ' \
26
26
  'not(contains(@id, "fileFrame"))]'
27
27
  @alert_dialog_xpath = '//div[@role="alertdialog"]'
28
28
  @alert_dialog_span_xpath = "#{@alert_dialog_xpath}/div/div/div/span"
@@ -33,7 +33,7 @@ module OnlyofficeDocumentserverTestingFramework
33
33
  # @return [Boolean] check if loader present
34
34
  def loading_present?
35
35
  if @instance.webdriver.alert_exists?
36
- raise 'Service Unavailable. There is alert while loading docs: '\
36
+ raise 'Service Unavailable. There is alert while loading docs: ' \
37
37
  "\"#{@instance.webdriver.alert_text}\""
38
38
  end
39
39
 
@@ -76,7 +76,7 @@ module OnlyofficeDocumentserverTestingFramework
76
76
  while timer < timeout && !loading_present?
77
77
  sleep 1
78
78
  timer += 1
79
- OnlyofficeLoggerHelper.log('Waiting for start loading of documents. '\
79
+ OnlyofficeLoggerHelper.log('Waiting for start loading of documents. ' \
80
80
  "Waiting for #{timer} seconds of #{timeout}")
81
81
  end
82
82
  return unless timer == timeout
@@ -98,8 +98,8 @@ module OnlyofficeDocumentserverTestingFramework
98
98
  while loading_present?
99
99
  sleep(1)
100
100
  current_wait_time += 1
101
- OnlyofficeLoggerHelper.log('Waiting for Round Status for '\
102
- "#{current_wait_time} of "\
101
+ OnlyofficeLoggerHelper.log('Waiting for Round Status for ' \
102
+ "#{current_wait_time} of " \
103
103
  "#{timeout_in_seconds} timeout")
104
104
  @instance.doc_editor.windows.txt_options.txt_options = 'Unicode (UTF-8)'
105
105
  @instance.spreadsheet_editor.windows.csv_option.csv_options = options
@@ -174,8 +174,8 @@ module OnlyofficeDocumentserverTestingFramework
174
174
  # Add js code to handle JS errors
175
175
  # @return [nil]
176
176
  def add_error_handler
177
- js_handler = 'window.jsErrors = [];'\
178
- 'window.onerror = function(errorMessage) '\
177
+ js_handler = 'window.jsErrors = [];' \
178
+ 'window.onerror = function(errorMessage) ' \
179
179
  '{window.jsErrors[window.jsErrors.length] = errorMessage;}'
180
180
  @instance.selenium.select_frame @instance.management.xpath_iframe
181
181
  @instance.selenium.execute_javascript(js_handler)
@@ -185,7 +185,7 @@ module OnlyofficeDocumentserverTestingFramework
185
185
  # @return [Symbol] editor typo of opened document
186
186
  def editor_type
187
187
  @instance.selenium.select_top_frame
188
- url = selenium_functions(:get_url)
188
+ url = selenium_functions(:current_url)
189
189
  case url
190
190
  when /documenteditor/
191
191
  :document
@@ -72,7 +72,7 @@ module OnlyofficeDocumentserverTestingFramework
72
72
  def env_options
73
73
  return @env_options if @env_options
74
74
 
75
- raw_options = ENV['ONLYOFFICE_DS_TESTING_OPTIONS'] || '{}'
75
+ raw_options = ENV.fetch('ONLYOFFICE_DS_TESTING_OPTIONS', '{}')
76
76
  @env_options = JSON.parse(raw_options)
77
77
  @env_options['IgnoredJSErrors'] = [] unless @env_options['IgnoredJSErrors']
78
78
  @env_options
@@ -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.8.0'
7
+ STRING = '2.11.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.8.0
4
+ version: 2.11.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: 2022-04-14 00:00:00.000000000 Z
12
+ date: 2022-08-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: onlyoffice_logger_helper
@@ -32,6 +32,9 @@ dependencies:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
34
  version: '1'
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: 1.10.0
35
38
  type: :runtime
36
39
  prerelease: false
37
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -39,6 +42,9 @@ dependencies:
39
42
  - - "~>"
40
43
  - !ruby/object:Gem::Version
41
44
  version: '1'
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 1.10.0
42
48
  - !ruby/object:Gem::Dependency
43
49
  name: overcommit
44
50
  requirement: !ruby/object:Gem::Requirement
@@ -205,6 +211,7 @@ files:
205
211
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/healthcheck_page.rb
206
212
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/languages_list/doc_test_site_languages_after_6_2.list
207
213
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/languages_list/doc_test_site_languages_after_7_1.list
214
+ - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/languages_list/doc_test_site_languages_after_7_2.list
208
215
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/languages_list/doc_test_site_languages_before_6_2.list
209
216
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/integration_example_api.rb
210
217
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/management.rb
@@ -241,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
241
248
  - !ruby/object:Gem::Version
242
249
  version: '0'
243
250
  requirements: []
244
- rubygems_version: 3.3.7
251
+ rubygems_version: 3.3.20
245
252
  signing_key:
246
253
  specification_version: 4
247
254
  summary: ONLYOFFICE DocumentServer testing framework