onlyoffice_documentserver_testing_framework 2.5.0 → 2.6.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: 405a46f279fa21de172b506c48de9ad2d063dae138faa975dc49197aceceda8b
4
- data.tar.gz: 65c2da10f92316a9366b4fa7729d29cadeae8e589ff2d1f2639ef72aab5f0307
3
+ metadata.gz: 6967c2a133ff6880c81d2ecead2504ad6fcc569282fc44b7321a9b5aa10a4680
4
+ data.tar.gz: 821bc1465b598a0537bcc9a2904064eedc5941c78f25f348993661707cadcf59
5
5
  SHA512:
6
- metadata.gz: cb8706c808d4aca563cecddf7a47ff3dd2b17e0bc4bd39241971aeb685d92003deebf2260f463be2f188cd2f64d9fd2d884707ac4b3d76bd6aa778a63f7f5ea9
7
- data.tar.gz: 17903cd60904387edc2d28d7b4e9884c40b1704ec921f2f8ffdfc949161eb99b88bdea1816846c85e1158e421a5903018673d5181b9f78467ddbd19721e88893
6
+ metadata.gz: 0e1d61ea7d92e8277c41c796b93ef367a917ae7b1d815e99cd286f99d1c20d01255d0da237f668aceb2ca513550fbd17717235b212a6c904bac1c2d0ef392277
7
+ data.tar.gz: eb394dea96fc4b12c51f00c24551b6f6dd152e8365a652b8816827a74bcdf6252ac5339f2acb5025ab435eca6a396ce6df924c9b2e6bb317bd0ad0aced5399e5
@@ -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
@@ -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
@@ -232,4 +235,18 @@ class DocTestSiteFunctions
232
235
  "#{file}")
233
236
  .map(&:strip)
234
237
  end
238
+
239
+ private
240
+
241
+ # Indexes of different modes
242
+ # @return [Hash] name with index
243
+ def default_modes_indexes
244
+ {
245
+ comment_mode: 4,
246
+ review_mode: 5,
247
+ fill_forms: 7,
248
+ view_mode: 8,
249
+ embedded: 10
250
+ }
251
+ end
235
252
  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.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: 2.5.0
4
+ version: 2.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: 2022-03-04 00:00:00.000000000 Z
12
+ date: 2022-03-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: onlyoffice_logger_helper