onlyoffice_documentserver_testing_framework 0.4.0 → 0.6.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: b2f0e384aaf5f05aaf133c491887d0fe18c3b4aff8764fb6a42b8ddabebd254e
4
- data.tar.gz: 56460aeb5843ec7a90253689900acd28872538de6fbcd1f2f7690aec17312fd2
3
+ metadata.gz: 7fb3eaa11a510e38c00fe930fd22388d9110387f4517d33166377e28b2506ea4
4
+ data.tar.gz: 9367abe146b37036e84241728f73218a92964c6b43182f9bba3ec125551e0c81
5
5
  SHA512:
6
- metadata.gz: 1572605a7eb60fed3af42504c9f417952ac40d903401227e95621e4832760044160e5d0cd1f6d9d888022347b46d038686f57d9c26d11c0cce594d9de1e734a3
7
- data.tar.gz: f18920028c97639400ecff72c1bb8d6e5fdda70871934e2940a9917f404a7f1de2cbcfa715a4a833ddb0e0b3edeef7bacef15aec1d05a660fc4e66ed0efa5a96
6
+ metadata.gz: c419445c585a34bfcc4c6cc8de39fb530e8ccb68e2092289e0b6e5482fa78158c2107b666b02f5e9864512756d0c7eed5f02f0469b78eeb41afbbeb2f06cf82c
7
+ data.tar.gz: c6dfd6f43927c8e5625ec35f8986a546ceec1baad292bd3a094727755a14abbd8bc54242f94548de026904244689241c6540f924843e167be260d32083a61896
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'doc_editor_top_toolbar/top_toolbar_users'
4
+ require_relative 'doc_editor_top_toolbar/title_row'
4
5
 
5
6
  module OnlyofficeDocumentserverTestingFramework
6
7
  # Top Toolbar of Doc Editor
@@ -9,6 +10,11 @@ module OnlyofficeDocumentserverTestingFramework
9
10
  @instance = instance
10
11
  end
11
12
 
13
+ # @return [TitleRow] class for methods in title row
14
+ def title_row
15
+ @title_row ||= TitleRow.new(@instance)
16
+ end
17
+
12
18
  # @return [TopToolbarUsers] icon for top toolbar users
13
19
  def users
14
20
  @users ||= TopToolbarUsers.new(@instance)
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OnlyofficeDocumentserverTestingFramework
4
+ # Module for description of title row
5
+ # https://user-images.githubusercontent.com/668524/114713496-db20f900-9d39-11eb-8adc-8ed79a8e6c12.png
6
+ class TitleRow
7
+ include SeleniumWrapper
8
+
9
+ def initialize(instance)
10
+ @instance = instance
11
+ @xpath_document_name = '//*[(@id="rib-doc-name") or (@id="title-doc-name")]'
12
+ end
13
+
14
+ # @param [Boolean] with_extension be included
15
+ # @return [String] current document name
16
+ def document_name(with_extension: true)
17
+ doc_name = raw_document_name
18
+ doc_name.chop! if document_unsaved?(doc_name)
19
+ doc_name = File.basename(doc_name, '.*') unless with_extension
20
+ doc_name
21
+ end
22
+
23
+ # Check if current document unsaved
24
+ # @param [String] name of file
25
+ # @return [Boolean] result of check
26
+ def document_unsaved?(name = nil)
27
+ name[-1] == '*'
28
+ end
29
+
30
+ private
31
+
32
+ # @return [String] raw data from document name
33
+ def raw_document_name
34
+ text = selenium_functions(:get_text_by_js, @xpath_document_name)
35
+ OnlyofficeLoggerHelper.log("Get document name from header: #{text}")
36
+ text
37
+ end
38
+ end
39
+ end
@@ -235,8 +235,8 @@ class DocTestSiteFunctions
235
235
  'doc_test_site_languages_before_6_2.list'
236
236
  end
237
237
  File.readlines("#{File.expand_path('..', __dir__)}"\
238
- '/test_instance_docs/doc_test_site_functions/'\
239
- "#{file}")
238
+ '/test_instance_docs/doc_test_site_functions/'\
239
+ "#{file}")
240
240
  .map(&:strip)
241
241
  end
242
242
  end
@@ -17,9 +17,11 @@ module OnlyofficeDocumentserverTestingFramework
17
17
  @xpath_iframe_count = 1
18
18
  # Don't mixup iframe with help
19
19
  @xpath_iframe = '//iframe[not(contains(@src, "/help/")) and '\
20
- 'not(contains(@id, "fileFrame"))]'
20
+ 'not(contains(@id, "fileFrame"))]'
21
21
  @alert_dialog_xpath = '//div[@role="alertdialog"]'
22
22
  @alert_dialog_span_xpath = "#{@alert_dialog_xpath}/div/div/div/span"
23
+ @xpath_window_modal = "//div[contains(@class, 'asc-window modal')]"
24
+ @xpath_anonymous_user_name_input = '//div[@id="id-dlg-username-caption"]'
23
25
  end
24
26
 
25
27
  # @return [Boolean] check if loader present
@@ -38,7 +40,7 @@ module OnlyofficeDocumentserverTestingFramework
38
40
  loader5 = @instance.selenium.element_visible?('//*[@id="loading-mask"]')
39
41
  loader6 = @instance.selenium.element_visible?('//*[@class="modals-mask"]')
40
42
  loader7 = @instance.selenium.element_visible?('//*[@class="asc-loadmask"]')
41
- loader8 = @instance.selenium.element_visible?(@xpath_window_modal)
43
+ loader8 = loading_blocking_modal_dialog?
42
44
  mobile_loader = wait_for_mobile_loading if main_frame_mobile_element_visible?
43
45
  @instance.selenium.select_top_frame
44
46
  loading = loader1 || loader2 || loader3 ||
@@ -57,6 +59,7 @@ module OnlyofficeDocumentserverTestingFramework
57
59
  def wait_for_mobile_loading
58
60
  @instance.selenium.element_visible?('//*[contains(@class,"modal-preloader")]') ||
59
61
  @instance.selenium.element_visible?('//*[contains(@class,"loader-page")]') ||
62
+ @instance.selenium.element_visible?('//div[contains(@class, "dialog-preloader")]') ||
60
63
  @instance.selenium.get_element('//*[contains(@class,"iScrollVerticalScrollbar")]').nil?
61
64
  end
62
65
 
@@ -77,6 +80,8 @@ module OnlyofficeDocumentserverTestingFramework
77
80
 
78
81
  # Wait for operation with round status in canvas editor
79
82
  # @param [Integer] timeout_in_seconds count of seconds to wait
83
+ # @param [Hash] options additional options
84
+ # @option options [Integer] :additional_wait additional after file open. 0 by default
80
85
  def wait_for_operation_with_round_status_canvas(timeout_in_seconds = 300, options = {})
81
86
  result = true
82
87
  OnlyofficeLoggerHelper.log('Start waiting for Round Status')
@@ -88,8 +93,8 @@ module OnlyofficeDocumentserverTestingFramework
88
93
  sleep(1)
89
94
  current_wait_time += 1
90
95
  OnlyofficeLoggerHelper.log('Waiting for Round Status for '\
91
- "#{current_wait_time} of "\
92
- "#{timeout_in_seconds} timeout")
96
+ "#{current_wait_time} of "\
97
+ "#{timeout_in_seconds} timeout")
93
98
  @instance.doc_editor.windows.txt_options.txt_options = 'Unicode (UTF-8)'
94
99
  @instance.spreadsheet_editor.windows.csv_option.csv_options = options
95
100
 
@@ -130,6 +135,7 @@ module OnlyofficeDocumentserverTestingFramework
130
135
  @instance.selenium.execute_javascript('window.onbeforeunload = null') # OFF POPUP WINDOW
131
136
  @instance.selenium.select_top_frame
132
137
  add_error_handler
138
+ sleep(options.fetch(:additional_wait, 0))
133
139
  result
134
140
  end
135
141
 
@@ -202,5 +208,13 @@ module OnlyofficeDocumentserverTestingFramework
202
208
  @instance.selenium.webdriver_error "Unknown editor type for url: #{url}"
203
209
  end
204
210
  end
211
+
212
+ # @return [True, False] is there is loading blocking modals dialog
213
+ def loading_blocking_modal_dialog?
214
+ return false unless @instance.selenium.element_visible?(@xpath_window_modal)
215
+ return false if @instance.selenium.element_visible?(@xpath_anonymous_user_name_input)
216
+
217
+ true
218
+ end
205
219
  end
206
220
  end
@@ -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.4.0'
7
+ STRING = '0.6.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.4.0
4
+ version: 0.6.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-04-02 00:00:00.000000000 Z
12
+ date: 2021-07-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: onlyoffice_logger_helper
@@ -189,6 +189,7 @@ files:
189
189
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/common_editor/editor_windows.rb
190
190
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_editor.rb
191
191
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_editor/doc_editor_top_toolbar.rb
192
+ - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_editor/doc_editor_top_toolbar/title_row.rb
192
193
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_editor/doc_editor_top_toolbar/top_toolbar_users.rb
193
194
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_editor/doc_editor_windows.rb
194
195
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_editor/doc_editor_windows/txt_options.rb
@@ -225,14 +226,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
225
226
  requirements:
226
227
  - - ">="
227
228
  - !ruby/object:Gem::Version
228
- version: '2.4'
229
+ version: '2.5'
229
230
  required_rubygems_version: !ruby/object:Gem::Requirement
230
231
  requirements:
231
232
  - - ">="
232
233
  - !ruby/object:Gem::Version
233
234
  version: '0'
234
235
  requirements: []
235
- rubygems_version: 3.2.14
236
+ rubygems_version: 3.2.22
236
237
  signing_key:
237
238
  specification_version: 4
238
239
  summary: ONLYOFFICE DocumentServer testing framework