onlyoffice_documentserver_testing_framework 2.6.0 → 2.8.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: 6967c2a133ff6880c81d2ecead2504ad6fcc569282fc44b7321a9b5aa10a4680
4
- data.tar.gz: 821bc1465b598a0537bcc9a2904064eedc5941c78f25f348993661707cadcf59
3
+ metadata.gz: 341504efd44e53df56234a60d803c6a00baee4350e78cd7c74a861009b8fd56c
4
+ data.tar.gz: 4665427fdc68fc72eb5cdafa1e032947c15f0d53f74bb5dadafae7c9a0c5aa04
5
5
  SHA512:
6
- metadata.gz: 0e1d61ea7d92e8277c41c796b93ef367a917ae7b1d815e99cd286f99d1c20d01255d0da237f668aceb2ca513550fbd17717235b212a6c904bac1c2d0ef392277
7
- data.tar.gz: eb394dea96fc4b12c51f00c24551b6f6dd152e8365a652b8816827a74bcdf6252ac5339f2acb5025ab435eca6a396ce6df924c9b2e6bb317bd0ad0aced5399e5
6
+ metadata.gz: edb27a38de4d8844ff5fa5d99a11189465749a83e7890888f23b70025151354e328b3bfc9b194032870ee028df84155d0872967058591ee7a1a788d00b9902d6
7
+ data.tar.gz: 07e47e22020a05fdf08ef96d95830ac92dff4c2e27f57f3c8ee2f623eb492cabf828c1b3cbecf0f0b48fcb1e226b3a5cc3848aac87dc63f73b3aed9ffea084f9
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OnlyofficeDocumentserverTestingFramework
4
+ # Meta class to describe editors tabs
5
+ class EditorTab
6
+ include SeleniumWrapper
7
+
8
+ def initialize(instance, tab_xpath: nil, tab_name: 'Default tab name')
9
+ @instance = instance
10
+ @xpath_insert_tab = tab_xpath
11
+ @tab_name = tab_name
12
+ end
13
+
14
+ # @return [True, False] is tab present
15
+ def present?
16
+ result = visible?(@xpath_insert_tab)
17
+ OnlyofficeLoggerHelper.log("#{@tab_name} Tab present?: #{result}")
18
+ result
19
+ end
20
+
21
+ # @return [True, False] if this tab opened
22
+ def active?
23
+ active = get_attribute(@xpath_insert_tab, 'class').include?('active')
24
+ OnlyofficeLoggerHelper.log("#{@tab_name} Tab active?: #{active}")
25
+ active
26
+ end
27
+
28
+ # Click on tab
29
+ # @return [Nothing]
30
+ def click
31
+ click_on_button(@xpath_insert_tab)
32
+ OnlyofficeLoggerHelper.log("Clicked on #{@tab_name} Tab")
33
+ sleep 2 # timeout for tab animation
34
+ end
35
+
36
+ # Double click on tab
37
+ # @return [Nothing]
38
+ def double_click
39
+ selenium_functions(:double_click, @xpath_insert_tab)
40
+ OnlyofficeLoggerHelper.log("Double Clicked on #{@tab_name} Tab")
41
+ sleep 2 # need time to toolbar to hide
42
+ end
43
+
44
+ # Open current tab
45
+ # @param [Boolean] to_open open or close this tab
46
+ # @return [Void]
47
+ # rubocop disable to not change interface of public method
48
+ # rubocop:disable Style/OptionalBooleanParameter
49
+ def open(to_open = true)
50
+ return if to_open == active?
51
+
52
+ click
53
+ end
54
+ # rubocop:enable Style/OptionalBooleanParameter
55
+ end
56
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'home_tab/editor_tab'
4
+
5
+ module OnlyofficeDocumentserverTestingFramework
6
+ # Class for Home tab actions
7
+ # https://user-images.githubusercontent.com/668524/28775382-4b8609d0-75fa-11e7-8bfd-a2de8e8a1332.png
8
+ class HomeTab < EditorTab
9
+ def initialize(instance, tab_xpath: '//a[@data-tab="home"]/..', tab_name: 'Home')
10
+ super
11
+ @instance = instance
12
+ @xpath_insert_tab = tab_xpath
13
+ @tab_name = tab_name
14
+ end
15
+ end
16
+ end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative 'doc_editor_top_toolbar/home_tab'
3
4
  require_relative 'doc_editor_top_toolbar/top_toolbar_users'
4
5
  require_relative 'doc_editor_top_toolbar/top_toolbar_document'
5
6
  require_relative 'doc_editor_top_toolbar/title_row'
@@ -25,5 +26,10 @@ module OnlyofficeDocumentserverTestingFramework
25
26
  def top_toolbar
26
27
  @top_toolbar = TopToolbarDocument.new(@instance)
27
28
  end
29
+
30
+ # @return [HomeTab] home tab
31
+ def home_tab
32
+ @home_tab ||= HomeTab.new(@instance)
33
+ end
28
34
  end
29
35
  end
@@ -0,0 +1,33 @@
1
+ English
2
+ Azerbaijani
3
+ Belarusian
4
+ Bulgarian
5
+ Catalan
6
+ Chinese
7
+ Czech
8
+ Danish
9
+ Dutch
10
+ Finnish
11
+ French
12
+ Galego
13
+ German
14
+ Greek
15
+ Hungarian
16
+ Indonesian
17
+ Italian
18
+ Japanese
19
+ Korean
20
+ Latvian
21
+ Lao
22
+ Norwegian
23
+ Polish
24
+ Portuguese
25
+ Romanian
26
+ Russian
27
+ Slovak
28
+ Slovenian
29
+ Spanish
30
+ Swedish
31
+ Turkish
32
+ Ukrainian
33
+ Vietnamese
@@ -225,14 +225,16 @@ class DocTestSiteFunctions
225
225
  # @param [DocumentServerVersion] version of server
226
226
  # @return [Array<String>] list of supported languages
227
227
  def self.supported_languages(version = OnlyofficeDocumentserverTestingFramework::DocumentServerVersion.new(6, 2, 0))
228
- file = if version >= OnlyofficeDocumentserverTestingFramework::DocumentServerVersion.new(6, 2)
228
+ file = if version >= OnlyofficeDocumentserverTestingFramework::DocumentServerVersion.new(7, 1)
229
+ 'doc_test_site_languages_after_7_1.list'
230
+ elsif version >= OnlyofficeDocumentserverTestingFramework::DocumentServerVersion.new(6, 2)
229
231
  'doc_test_site_languages_after_6_2.list'
230
232
  else
231
233
  'doc_test_site_languages_before_6_2.list'
232
234
  end
233
235
  File.readlines("#{File.expand_path('..', __dir__)}"\
234
236
  '/test_instance_docs/doc_test_site_functions/'\
235
- "#{file}")
237
+ "languages_list/#{file}")
236
238
  .map(&:strip)
237
239
  end
238
240
 
@@ -223,5 +223,21 @@ module OnlyofficeDocumentserverTestingFramework
223
223
  name ||= @instance.doc_editor.top_toolbar.top_toolbar.document_name
224
224
  name[-1] == '*'
225
225
  end
226
+
227
+ # Check if opened document is in viewer
228
+ # @return [true, false] true if viewer, false if editor
229
+ def viewer?
230
+ canvas_loaded = canvas_editor?
231
+ tabs_present = @instance.doc_editor.top_toolbar.home_tab.present?
232
+ result = canvas_loaded && !tabs_present
233
+ OnlyofficeLoggerHelper.log("viewer?: #{result}")
234
+ result
235
+ end
236
+
237
+ # Check if opened editor is canvas editor
238
+ # @return [true, false] true if canvas, false if not canvas
239
+ def canvas_editor?
240
+ visible?('//*[@id="id_viewer"]') || visible?('//*[@id="ws-canvas"]')
241
+ end
226
242
  end
227
243
  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 = '2.6.0'
7
+ STRING = '2.8.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.6.0
4
+ version: 2.8.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-03-13 00:00:00.000000000 Z
12
+ date: 2022-04-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: onlyoffice_logger_helper
@@ -189,6 +189,8 @@ 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/home_tab.rb
193
+ - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_editor/doc_editor_top_toolbar/home_tab/editor_tab.rb
192
194
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_editor/doc_editor_top_toolbar/title_row.rb
193
195
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_editor/doc_editor_top_toolbar/top_toolbar_document.rb
194
196
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_editor/doc_editor_top_toolbar/top_toolbar_users.rb
@@ -198,11 +200,12 @@ files:
198
200
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions.rb
199
201
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list.rb
200
202
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list/doc_test_site_file_list_entry.rb
201
- - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_site_languages_after_6_2.list
202
- - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_site_languages_before_6_2.list
203
203
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_site_server_helper.rb
204
204
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/file_reopen_helper.rb
205
205
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/healthcheck_page.rb
206
+ - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/languages_list/doc_test_site_languages_after_6_2.list
207
+ - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/languages_list/doc_test_site_languages_after_7_1.list
208
+ - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/languages_list/doc_test_site_languages_before_6_2.list
206
209
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/integration_example_api.rb
207
210
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/management.rb
208
211
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/management/loader_helper.rb