onlyoffice_documentserver_testing_framework 2.2.0 → 2.4.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: 71d976cf3ab5dee10b20ed7bc7d16e8cbe9319d504417aa94a2e5ec06585270b
4
- data.tar.gz: 29e69cdc7d450c67550da9c842aff868d68d0533deb63789cad9d6f64219cb9f
3
+ metadata.gz: 0f74cb36c08ce0c13f7805732784fd67768f2ebf74d2c44e126433b5e2e7541f
4
+ data.tar.gz: 7d824945bf257daf01fa9d002fc6653bb44d066e26ca1b6984b97ad059d03ca9
5
5
  SHA512:
6
- metadata.gz: afeb754c66e26b38fedb9dac48de03ad78e8e888b0cf191a12a7f442fb03432c1cb619d0f0fe22f093db8f26e7dd6757287a1c8b5fd15954eddcbb943e1e44bb
7
- data.tar.gz: 6a1bb7d6f359e4378f2840771d1cb5d36a43d0b91a718e07a43d58b765d4b037c1918d20c79bd355a3aa219886d3bc9067d26ac78e69db5366640e8bbd7654f2
6
+ metadata.gz: 67efa48bf9e7f71c80f152c4f27cc02db052d72cc5357bafb4ed103c56aa0e86e3221b3adc7edbf4f0941ffa1d3c5f539babc620120ab970340621444a4b9898
7
+ data.tar.gz: 80fb3f4f04d40ad40dec2161ea92ebd59d7c67cc447056ccf11223d9b11b67f82cfda5582a1624906531a3907bc3f9c21e351856da2bc839a56b73835dedd901
@@ -4,9 +4,11 @@ module OnlyofficeDocumentserverTestingFramework
4
4
  # Module for Reopen file related methods
5
5
  module FileReopenHelper
6
6
  # Perform reopen after autosave
7
- def reopen_after_autosave
7
+ # @param [Integer] timeout for wait for file to build
8
+ # @return [Boolean] result of opening
9
+ def reopen_after_autosave(timeout: 30)
8
10
  url = @instance.selenium.get_url
9
- leave_file_and_build_it
11
+ leave_file_and_build_it(timeout: timeout)
10
12
  @instance.webdriver.open(url)
11
13
  @instance.management.wait_for_operation_with_round_status_canvas
12
14
  end
@@ -14,13 +16,15 @@ module OnlyofficeDocumentserverTestingFramework
14
16
  private
15
17
 
16
18
  # Leave current opened file and wait until it's builder
19
+ # @param [Integer] timeout for wait for file to build
17
20
  # @return [nil]
18
- def leave_file_and_build_it
21
+ def leave_file_and_build_it(timeout: 30)
19
22
  file_name = @instance.management.document_name
20
23
  size_before = @instance.integration_example_api.file_data(file_name)['pureContentLength'].to_i
21
24
  @instance.go_to_base_url
22
- @instance.webdriver.wait_until do
23
- @instance.integration_example_api.file_data(file_name)['pureContentLength'].to_i != size_before
25
+ @instance.webdriver.wait_until(timeout, "File #{file_name} is not built in #{timeout}") do
26
+ file_data = @instance.integration_example_api.file_data(file_name)
27
+ !file_data.nil? && file_data['pureContentLength'].to_i != size_before
24
28
  end
25
29
  OnlyofficeLoggerHelper.log("File: `#{file_name}` was built after editing")
26
30
  end
@@ -6,9 +6,12 @@ require 'net/http'
6
6
  module OnlyofficeDocumentserverTestingFramework
7
7
  # Class for working with integration example api
8
8
  class IntegrationExampleApi
9
- def initialize(instance)
9
+ # @return [String] url of api endpoint
10
+ attr_reader :api_endpoint
11
+
12
+ def initialize(instance, api_endpoint: "#{instance.doc_server_base_url}/example")
10
13
  @instance = instance
11
- @api_endpoint = "#{@instance.doc_server_base_url}/example"
14
+ @api_endpoint = api_endpoint
12
15
  end
13
16
 
14
17
  # @return [Array<Hash>] list of file on example
@@ -38,7 +41,7 @@ module OnlyofficeDocumentserverTestingFramework
38
41
  def delete_file(file_name)
39
42
  raise 'File name is not found on server' unless file_data(file_name)
40
43
 
41
- url = URI("#{@api_endpoint}/file?filename=#{file_name}")
44
+ url = URI::DEFAULT_PARSER.escape("#{@api_endpoint}/file?filename=#{file_name}")
42
45
  request = Net::HTTP::Delete.new(url)
43
46
  response = http_from_url(url).request(request)
44
47
  JSON.parse(response.read_body)
@@ -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.2.0'
7
+ STRING = '2.4.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.2.0
4
+ version: 2.4.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-02-08 00:00:00.000000000 Z
12
+ date: 2022-02-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: onlyoffice_logger_helper
@@ -238,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
238
  - !ruby/object:Gem::Version
239
239
  version: '0'
240
240
  requirements: []
241
- rubygems_version: 3.3.4
241
+ rubygems_version: 3.3.7
242
242
  signing_key:
243
243
  specification_version: 4
244
244
  summary: ONLYOFFICE DocumentServer testing framework