onlyoffice_documentserver_testing_framework 2.3.0 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/onlyoffice_documentserver_testing_framework/test_instance_docs/doc_test_site_functions/file_reopen_helper.rb +7 -4
- data/lib/onlyoffice_documentserver_testing_framework/test_instance_docs/integration_example_api.rb +8 -3
- data/lib/onlyoffice_documentserver_testing_framework/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 405a46f279fa21de172b506c48de9ad2d063dae138faa975dc49197aceceda8b
|
4
|
+
data.tar.gz: 65c2da10f92316a9366b4fa7729d29cadeae8e589ff2d1f2639ef72aab5f0307
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb8706c808d4aca563cecddf7a47ff3dd2b17e0bc4bd39241971aeb685d92003deebf2260f463be2f188cd2f64d9fd2d884707ac4b3d76bd6aa778a63f7f5ea9
|
7
|
+
data.tar.gz: 17903cd60904387edc2d28d7b4e9884c40b1704ec921f2f8ffdfc949161eb99b88bdea1816846c85e1158e421a5903018673d5181b9f78467ddbd19721e88893
|
@@ -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
|
-
|
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,12 +16,13 @@ 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
|
25
|
+
@instance.webdriver.wait_until(timeout, "File `#{file_name}` is built") do
|
23
26
|
file_data = @instance.integration_example_api.file_data(file_name)
|
24
27
|
!file_data.nil? && file_data['pureContentLength'].to_i != size_before
|
25
28
|
end
|
data/lib/onlyoffice_documentserver_testing_framework/test_instance_docs/integration_example_api.rb
CHANGED
@@ -36,15 +36,20 @@ module OnlyofficeDocumentserverTestingFramework
|
|
36
36
|
end
|
37
37
|
|
38
38
|
# Delete file on server by name
|
39
|
-
# @param [String] file_name
|
39
|
+
# @param [String] file_name name of file to delete
|
40
|
+
# @param [Integer] sleep_after_delete how much time to sleep after file delete
|
41
|
+
# sometimes it took time to delete this file and it cannot be checked by `file_data`
|
42
|
+
# method, since file will be not created but you get inside old file
|
40
43
|
# @return [nil]
|
41
|
-
def delete_file(file_name)
|
44
|
+
def delete_file(file_name, sleep_after_delete: 3)
|
42
45
|
raise 'File name is not found on server' unless file_data(file_name)
|
43
46
|
|
44
47
|
url = URI::DEFAULT_PARSER.escape("#{@api_endpoint}/file?filename=#{file_name}")
|
45
48
|
request = Net::HTTP::Delete.new(url)
|
46
49
|
response = http_from_url(url).request(request)
|
47
|
-
JSON.parse(response.read_body)
|
50
|
+
result = JSON.parse(response.read_body)
|
51
|
+
sleep(sleep_after_delete)
|
52
|
+
result
|
48
53
|
end
|
49
54
|
|
50
55
|
# Get file data by it's name
|
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.
|
4
|
+
version: 2.5.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-
|
12
|
+
date: 2022-03-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: onlyoffice_logger_helper
|