onlyoffice_documentserver_testing_framework 2.5.0 → 2.7.1

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: 405a46f279fa21de172b506c48de9ad2d063dae138faa975dc49197aceceda8b
4
- data.tar.gz: 65c2da10f92316a9366b4fa7729d29cadeae8e589ff2d1f2639ef72aab5f0307
3
+ metadata.gz: c98c0385a7174e452ef41b48d7b0bdb05a52fa30e13e3d1b01c53c84dd557fac
4
+ data.tar.gz: bb5936eec38055273da3f6a4dab539d8a0535c86a003a72e4fd6111f46cdda08
5
5
  SHA512:
6
- metadata.gz: cb8706c808d4aca563cecddf7a47ff3dd2b17e0bc4bd39241971aeb685d92003deebf2260f463be2f188cd2f64d9fd2d884707ac4b3d76bd6aa778a63f7f5ea9
7
- data.tar.gz: 17903cd60904387edc2d28d7b4e9884c40b1704ec921f2f8ffdfc949161eb99b88bdea1816846c85e1158e421a5903018673d5181b9f78467ddbd19721e88893
6
+ metadata.gz: 2f354452f0b040424089f5121d12f25e7c57737e37bc4fb4ed501aa59a3563dfe05e9ee6d9aac8fa379ee5e2110a9f575c2c3ee6890bd1d22581797e779cfb5b
7
+ data.tar.gz: 504679d10ec82b4551d512df5815fea7f26b3ec702e90d7e3ffdc6a60f89669414ff926a4fcfc86222f59a0dc1b7ed628b0169df5fe61e2228bec32b8ea9efd0
@@ -18,9 +18,10 @@ class DocTestSiteFileListEntry
18
18
  # @return [String] View mode url
19
19
  attr_accessor :view_mode_url
20
20
 
21
- def initialize(instance, xpath)
21
+ def initialize(instance, xpath, edit_modes_indexes)
22
22
  @instance = instance
23
23
  @xpath_line = xpath
24
+ @edit_modes_indexes = edit_modes_indexes
24
25
  @file_name = fetch_file_name
25
26
  @embedded_url = fetch_embedded_url
26
27
  @review_mode_url = fetch_review_mode_url
@@ -44,7 +45,7 @@ class DocTestSiteFileListEntry
44
45
 
45
46
  # @return [String] url on review mode
46
47
  def fetch_review_mode_url
47
- xpath_review = "#{@xpath_line}/td[#{mode_indexes[:review_mode]}]/a"
48
+ xpath_review = "#{@xpath_line}/td[#{@edit_modes_indexes[:review_mode]}]/a"
48
49
  return nil unless @instance.selenium.element_present?(xpath_review)
49
50
 
50
51
  url = @instance.selenium.get_attribute(xpath_review, 'href')
@@ -54,7 +55,7 @@ class DocTestSiteFileListEntry
54
55
 
55
56
  # @return [String] url on review mode
56
57
  def fetch_comment_mode_url
57
- xpath_comment = "#{@xpath_line}/td[#{mode_indexes[:comment_mode]}]/a"
58
+ xpath_comment = "#{@xpath_line}/td[#{@edit_modes_indexes[:comment_mode]}]/a"
58
59
  return nil unless @instance.selenium.element_present?(xpath_comment)
59
60
 
60
61
  url = @instance.selenium.get_attribute(xpath_comment, 'href')
@@ -64,7 +65,7 @@ class DocTestSiteFileListEntry
64
65
 
65
66
  # @return [String] url on fill forms mode
66
67
  def fetch_fill_forms_mode_url
67
- xpath_comment = "#{@xpath_line}/td[#{mode_indexes[:fill_forms]}]/a"
68
+ xpath_comment = "#{@xpath_line}/td[#{@edit_modes_indexes[:fill_forms]}]/a"
68
69
  return nil unless @instance.selenium.element_present?(xpath_comment)
69
70
 
70
71
  url = @instance.selenium.get_attribute(xpath_comment, 'href')
@@ -74,7 +75,7 @@ class DocTestSiteFileListEntry
74
75
 
75
76
  # @return [String] url on fill forms mode
76
77
  def fetch_only_fill_forms_mode_url
77
- link_xpath = "#{@xpath_line}/td[#{mode_indexes[:only_fill_forms]}]/a"
78
+ link_xpath = "#{@xpath_line}/td[#{@edit_modes_indexes[:only_fill_forms]}]/a"
78
79
  return nil unless @instance.selenium.element_present?(link_xpath)
79
80
 
80
81
  url = @instance.selenium.get_attribute(link_xpath, 'href')
@@ -84,7 +85,7 @@ class DocTestSiteFileListEntry
84
85
 
85
86
  # @return [String] url on viewer mode
86
87
  def fetch_view_mode_url
87
- xpath_comments = "#{@xpath_line}/td[#{mode_indexes[:view_mode]}]/a"
88
+ xpath_comments = "#{@xpath_line}/td[#{@edit_modes_indexes[:view_mode]}]/a"
88
89
  return nil unless @instance.selenium.element_present?(xpath_comments)
89
90
 
90
91
  url = @instance.selenium.get_attribute(xpath_comments, 'href')
@@ -94,22 +95,11 @@ class DocTestSiteFileListEntry
94
95
 
95
96
  # @return [String] url on embedded file
96
97
  def fetch_embedded_url
97
- url = @instance.selenium.get_attribute("#{@xpath_line}/td[#{mode_indexes[:embedded]}]/a", 'href')
98
+ xpath_embedded = "#{@xpath_line}/td[#{@edit_modes_indexes[:embedded]}]/a"
99
+ return nil unless @instance.selenium.element_present?(xpath_embedded)
100
+
101
+ url = @instance.selenium.get_attribute(xpath_embedded, 'href')
98
102
  OnlyofficeLoggerHelper.log("Got embedded #{@xpath_line} url: #{url}")
99
103
  url
100
104
  end
101
-
102
- private
103
-
104
- # Indexes of different modes
105
- # @return [Hash] name with index
106
- def mode_indexes
107
- {
108
- comment_mode: 4,
109
- review_mode: 5,
110
- fill_forms: 7,
111
- view_mode: 8,
112
- embedded: 10
113
- }
114
- end
115
105
  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
@@ -13,7 +13,7 @@ class DocTestSiteFunctions
13
13
  select_list(:user_list, xpath: '//*[@id="user"]')
14
14
  select_list(:language_list, xpath: '//*[@id="language"]')
15
15
 
16
- def initialize(instance)
16
+ def initialize(instance, edit_modes_indexes = default_modes_indexes)
17
17
  super(instance.webdriver.driver)
18
18
  @instance = instance
19
19
  @xpath_begin_view = '//*[@id="beginView"]'
@@ -27,6 +27,7 @@ class DocTestSiteFunctions
27
27
  '//*[contains(@class, "try-editor cell")]'
28
28
  @xpath_create_presentation = '//*[contains(@class, "try-editor presentation")]|'\
29
29
  '//*[contains(@class, "try-editor slide")]'
30
+ @edit_modes_indexes = edit_modes_indexes
30
31
  end
31
32
 
32
33
  # Waiting for load of page
@@ -168,7 +169,9 @@ class DocTestSiteFunctions
168
169
  def uploaded_file_list
169
170
  file_list = []
170
171
  (0...uploaded_file_count).each do |current_file_number|
171
- file_list << DocTestSiteFileListEntry.new(@instance, "#{@xpath_file_entry}[#{current_file_number + 1}]")
172
+ file_list << DocTestSiteFileListEntry.new(@instance,
173
+ "#{@xpath_file_entry}[#{current_file_number + 1}]",
174
+ @edit_modes_indexes)
172
175
  end
173
176
  DocTestFileList.new(file_list)
174
177
  end
@@ -222,14 +225,30 @@ class DocTestSiteFunctions
222
225
  # @param [DocumentServerVersion] version of server
223
226
  # @return [Array<String>] list of supported languages
224
227
  def self.supported_languages(version = OnlyofficeDocumentserverTestingFramework::DocumentServerVersion.new(6, 2, 0))
225
- 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)
226
231
  'doc_test_site_languages_after_6_2.list'
227
232
  else
228
233
  'doc_test_site_languages_before_6_2.list'
229
234
  end
230
235
  File.readlines("#{File.expand_path('..', __dir__)}"\
231
236
  '/test_instance_docs/doc_test_site_functions/'\
232
- "#{file}")
237
+ "languages_list/#{file}")
233
238
  .map(&:strip)
234
239
  end
240
+
241
+ private
242
+
243
+ # Indexes of different modes
244
+ # @return [Hash] name with index
245
+ def default_modes_indexes
246
+ {
247
+ comment_mode: 4,
248
+ review_mode: 5,
249
+ fill_forms: 7,
250
+ view_mode: 8,
251
+ embedded: 10
252
+ }
253
+ end
235
254
  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.5.0'
7
+ STRING = '2.7.1'
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.5.0
4
+ version: 2.7.1
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-04 00:00:00.000000000 Z
12
+ date: 2022-04-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: onlyoffice_logger_helper
@@ -198,11 +198,12 @@ files:
198
198
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions.rb
199
199
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_file_list.rb
200
200
  - 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
201
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/doc_test_site_server_helper.rb
204
202
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/file_reopen_helper.rb
205
203
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/healthcheck_page.rb
204
+ - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/languages_list/doc_test_site_languages_after_6_2.list
205
+ - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/languages_list/doc_test_site_languages_after_7_1.list
206
+ - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/languages_list/doc_test_site_languages_before_6_2.list
206
207
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/integration_example_api.rb
207
208
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/management.rb
208
209
  - lib/onlyoffice_documentserver_testing_framework/test_instance_docs/management/loader_helper.rb
@@ -238,7 +239,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
239
  - !ruby/object:Gem::Version
239
240
  version: '0'
240
241
  requirements: []
241
- rubygems_version: 3.3.7
242
+ rubygems_version: 3.3.11
242
243
  signing_key:
243
244
  specification_version: 4
244
245
  summary: ONLYOFFICE DocumentServer testing framework