aspose_slides_cloud 23.9.0 → 23.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -7
  3. data/README.md +4 -0
  4. data/aspose_slides_cloud.gemspec +0 -1
  5. data/docker-entrypoint.sh +1 -0
  6. data/lib/aspose_slides_cloud/api/slides_async_api.rb +273 -0
  7. data/lib/aspose_slides_cloud/api_client.rb +2 -1
  8. data/lib/aspose_slides_cloud/models/operation.rb +209 -0
  9. data/lib/aspose_slides_cloud/type_registry.rb +1 -0
  10. data/lib/aspose_slides_cloud/version.rb +1 -1
  11. data/lib/aspose_slides_cloud.rb +2 -0
  12. data/spec/api/slides_api_spec.rb +2016 -2016
  13. data/spec/api/slides_async_api_spec.rb +554 -0
  14. data/spec/spec_utils.rb +38 -7
  15. data/spec/use_cases/abstract_class_spec.rb +1 -1
  16. data/spec/use_cases/animation_spec.rb +28 -28
  17. data/spec/use_cases/async_api_spec.rb +82 -0
  18. data/spec/use_cases/chart_spec.rb +51 -51
  19. data/spec/use_cases/comment_spec.rb +17 -17
  20. data/spec/use_cases/create_spec.rb +22 -22
  21. data/spec/use_cases/font_spec.rb +24 -24
  22. data/spec/use_cases/header_footer_spec.rb +9 -9
  23. data/spec/use_cases/hyperlink_spec.rb +10 -10
  24. data/spec/use_cases/image_spec.rb +16 -16
  25. data/spec/use_cases/layout_slide_spec.rb +41 -41
  26. data/spec/use_cases/master_slide_spec.rb +40 -40
  27. data/spec/use_cases/math_spec.rb +15 -15
  28. data/spec/use_cases/merge_spec.rb +15 -15
  29. data/spec/use_cases/notes_slide_spec.rb +39 -39
  30. data/spec/use_cases/nullable_field_spec.rb +7 -7
  31. data/spec/use_cases/paragraph_spec.rb +38 -38
  32. data/spec/use_cases/pipeline_spec.rb +1 -1
  33. data/spec/use_cases/portion_spec.rb +34 -34
  34. data/spec/use_cases/property_spec.rb +38 -38
  35. data/spec/use_cases/section_spec.rb +16 -16
  36. data/spec/use_cases/shape_format_spec.rb +12 -12
  37. data/spec/use_cases/shape_spec.rb +87 -87
  38. data/spec/use_cases/slide_spec.rb +32 -32
  39. data/spec/use_cases/split_spec.rb +12 -12
  40. data/spec/use_cases/table_spec.rb +38 -38
  41. data/spec/use_cases/text_format_spec.rb +4 -4
  42. data/spec/use_cases/text_spec.rb +28 -28
  43. data/spec/use_cases/vba_spec.rb +10 -10
  44. data/spec/use_cases/watermark_spec.rb +36 -36
  45. data/testConfig.json +2 -1
  46. data/testRules.json +7 -0
  47. metadata +8 -24
  48. data/spec/use_cases/convert_spec.rb +0 -199
data/spec/spec_utils.rb CHANGED
@@ -22,11 +22,20 @@ SOFTWARE.
22
22
 
23
23
  module AsposeSlidesCloud
24
24
  class SpecUtils
25
+ def self.ensureOperationId()
26
+ unless @@operation_id
27
+ source_file = File.binread("TestData/test.pptx")
28
+ @@operation_id = SpecUtils.testSlidesAsyncApi.start_convert(source_file, AsposeSlidesCloud::ExportFormat::PDF, "password")
29
+ sleep(10)
30
+ end
31
+ end
32
+
25
33
  def self.initialize(method, name, value)
34
+ SpecUtils.ensureOperationId()
26
35
  if !@@is_initialized
27
36
  version = ""
28
37
  begin
29
- version = SpecUtils.api.download_file("TempTests/version.txt")
38
+ version = SpecUtils.testSlidesApi.download_file("TempTests/version.txt")
30
39
  rescue AsposeSlidesCloud::ApiError => e
31
40
  if e.code != 404
32
41
  fail "Could not read from storage"
@@ -36,10 +45,10 @@ module AsposeSlidesCloud
36
45
  Dir.entries(TEST_DATA_PATH).each { |f|
37
46
  if !File.directory? File.join(TEST_DATA_PATH, f)
38
47
  fd = File.binread(File.join(TEST_DATA_PATH, f))
39
- SpecUtils.api.upload_file("TempTests/" + f, fd)
48
+ SpecUtils.testSlidesApi.upload_file("TempTests/" + f, fd)
40
49
  end
41
50
  }
42
- SpecUtils.api.upload_file("TempTests/version.txt", EXPECTED_TEST_DATA_VERSION)
51
+ SpecUtils.testSlidesApi.upload_file("TempTests/version.txt", EXPECTED_TEST_DATA_VERSION)
43
52
  end
44
53
  @@is_initialized = true
45
54
  end
@@ -58,15 +67,16 @@ module AsposeSlidesCloud
58
67
  end
59
68
  files.each do |path, rule|
60
69
  if rule["Action"] == "Put"
61
- SpecUtils.api.copy_file("TempTests/" + rule['ActualName'], path)
70
+ SpecUtils.testSlidesApi.copy_file("TempTests/" + rule['ActualName'], path)
62
71
  elsif rule["Action"] == "Delete"
63
- SpecUtils.api.delete_file(path)
64
- SpecUtils.api.delete_folder(path)
72
+ SpecUtils.testSlidesApi.delete_file(path)
73
+ SpecUtils.testSlidesApi.delete_folder(path)
65
74
  end
66
75
  end
67
76
  end
68
77
 
69
78
  def self.get_param_value(name, method, type)
79
+ SpecUtils.ensureOperationId()
70
80
  value = nil
71
81
  SpecUtils.test_rules["Values"].each do |rule|
72
82
  if SpecUtils.good_rule?(rule, name, method, type) and rule.key?("Value")
@@ -178,6 +188,10 @@ module AsposeSlidesCloud
178
188
  else
179
189
  result = File.binread(File.join(AsposeSlidesCloud::SpecUtils::TEST_DATA_PATH, file_name))
180
190
  end
191
+ elsif template == "#OperationId"
192
+ return @@operation_id
193
+ elsif template == "#NewId"
194
+ return "96b0a57c-d9ae-453f-b56f-3b154eb10cda"
181
195
  else
182
196
  result = SpecUtils.replace(result, "%n", name)
183
197
  result = SpecUtils.replace(result, "%v", value)
@@ -207,7 +221,7 @@ module AsposeSlidesCloud
207
221
 
208
222
  @@test_rules = nil
209
223
 
210
- def self.api
224
+ def self.testSlidesApi
211
225
  unless @@api
212
226
  config = JSON.parse(File.read('testConfig.json'))
213
227
  configuration = AsposeSlidesCloud::Configuration.new
@@ -222,8 +236,25 @@ module AsposeSlidesCloud
222
236
  @@api
223
237
  end
224
238
 
239
+ def self.testSlidesAsyncApi
240
+ unless @@asyncApi
241
+ config = JSON.parse(File.read('testConfig.json'))
242
+ configuration = AsposeSlidesCloud::Configuration.new
243
+ configuration.base_url = config["AsyncBaseUrl"] ? config["AsyncBaseUrl"] : config["BaseUrl"]
244
+ configuration.auth_base_url = config["AuthBaseUrl"] ? config["AuthBaseUrl"] : config["BaseUrl"]
245
+ configuration.app_sid = config["ClientId"]
246
+ configuration.app_key = config["ClientSecret"]
247
+ configuration.debugging = config["Debug"]
248
+ configuration.verify_ssl = !config["AllowInsecureRequests"]
249
+ @@asyncApi = AsposeSlidesCloud::SlidesAsyncApi.new(configuration)
250
+ end
251
+ @@asyncApi
252
+ end
253
+
225
254
  @@api = nil
255
+ @@asyncApi = nil
226
256
  @@is_initialized = false
257
+ @@operation_id = nil
227
258
 
228
259
  TEST_DATA_PATH = "TestData"
229
260
  EXPECTED_TEST_DATA_VERSION = "1"
@@ -26,7 +26,7 @@ describe 'UseCases' do
26
26
  describe 'Abstract Classes' do
27
27
  it 'base shape' do
28
28
  AsposeSlidesCloud::SpecUtils.initialize('GetSlideShape', nil, nil)
29
- o = AsposeSlidesCloud::SpecUtils.api.get_shape("test.pptx", 1, 1, "password", "TempSlidesSDK")
29
+ o = AsposeSlidesCloud::SpecUtils.testSlidesApi.get_shape("test.pptx", 1, 1, "password", "TempSlidesSDK")
30
30
  expect(o.text).to eq("1")
31
31
  end
32
32
 
@@ -30,24 +30,24 @@ describe 'UseCases' do
30
30
  password = "password"
31
31
  slide_index = 1
32
32
  watermark_text = "watermarkText"
33
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
33
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
34
34
 
35
- animation = AsposeSlidesCloud::SpecUtils.api.get_animation(file_name, slide_index, nil, nil, password, folder_name)
35
+ animation = AsposeSlidesCloud::SpecUtils.testSlidesApi.get_animation(file_name, slide_index, nil, nil, password, folder_name)
36
36
  expect(animation.main_sequence.length).to eq(1)
37
37
  expect(animation.interactive_sequences.length).to eq(1)
38
38
 
39
- animation = AsposeSlidesCloud::SpecUtils.api.get_animation(file_name, slide_index, 3, nil, password, folder_name)
39
+ animation = AsposeSlidesCloud::SpecUtils.testSlidesApi.get_animation(file_name, slide_index, 3, nil, password, folder_name)
40
40
  expect(animation.main_sequence.length).to eq(1)
41
41
  expect(animation.interactive_sequences.length).to eq(0)
42
42
 
43
- animation = AsposeSlidesCloud::SpecUtils.api.get_animation(file_name, slide_index, 3, 1, password, folder_name)
43
+ animation = AsposeSlidesCloud::SpecUtils.testSlidesApi.get_animation(file_name, slide_index, 3, 1, password, folder_name)
44
44
  expect(animation.main_sequence.length).to eq(0)
45
45
  end
46
46
 
47
47
  it 'set' do
48
48
  folder_name = "TempSlidesSDK"
49
49
  file_name = "test.pptx"
50
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
50
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
51
51
 
52
52
  dto = AsposeSlidesCloud::SlideAnimation.new
53
53
 
@@ -63,7 +63,7 @@ describe 'UseCases' do
63
63
  effect2.shape_index = 4
64
64
  dto.main_sequence = [ effect1, effect2 ]
65
65
  dto.interactive_sequences = []
66
- animation = AsposeSlidesCloud::SpecUtils.api.set_animation(file_name, 1, dto, "password", folder_name)
66
+ animation = AsposeSlidesCloud::SpecUtils.testSlidesApi.set_animation(file_name, 1, dto, "password", folder_name)
67
67
  expect(animation.main_sequence.length).to eq(dto.main_sequence.length)
68
68
  expect(animation.interactive_sequences.length).to eq(0)
69
69
  end
@@ -71,12 +71,12 @@ describe 'UseCases' do
71
71
  it 'create effect' do
72
72
  folder_name = "TempSlidesSDK"
73
73
  file_name = "test.pptx"
74
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
74
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
75
75
 
76
76
  dto = AsposeSlidesCloud::Effect.new
77
77
  dto.type = "Blast"
78
78
  dto.shape_index = 3
79
- animation = AsposeSlidesCloud::SpecUtils.api.create_animation_effect(file_name, 1, dto, "password", folder_name)
79
+ animation = AsposeSlidesCloud::SpecUtils.testSlidesApi.create_animation_effect(file_name, 1, dto, "password", folder_name)
80
80
  expect(animation.main_sequence.length).to eq(2)
81
81
  expect(animation.interactive_sequences.length).to eq(1)
82
82
  end
@@ -84,7 +84,7 @@ describe 'UseCases' do
84
84
  it 'create interactive sequence' do
85
85
  folder_name = "TempSlidesSDK"
86
86
  file_name = "test.pptx"
87
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
87
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
88
88
 
89
89
  dto = AsposeSlidesCloud::InteractiveSequence.new
90
90
  dto.trigger_shape_index = 2
@@ -92,7 +92,7 @@ describe 'UseCases' do
92
92
  effect.type = "Blast"
93
93
  effect.shape_index = 3
94
94
  dto.effects = [ effect ]
95
- animation = AsposeSlidesCloud::SpecUtils.api.create_animation_interactive_sequence(file_name, 1, dto, "password", folder_name)
95
+ animation = AsposeSlidesCloud::SpecUtils.testSlidesApi.create_animation_interactive_sequence(file_name, 1, dto, "password", folder_name)
96
96
  expect(animation.main_sequence.length).to eq(1)
97
97
  expect(animation.interactive_sequences.length).to eq(2)
98
98
  end
@@ -100,12 +100,12 @@ describe 'UseCases' do
100
100
  it 'create interactive sequence effect' do
101
101
  folder_name = "TempSlidesSDK"
102
102
  file_name = "test.pptx"
103
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
103
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
104
104
 
105
105
  dto = AsposeSlidesCloud::Effect.new
106
106
  dto.type = "Blast"
107
107
  dto.shape_index = 3
108
- animation = AsposeSlidesCloud::SpecUtils.api.create_animation_interactive_sequence_effect(file_name, 1, 1, dto, "password", folder_name)
108
+ animation = AsposeSlidesCloud::SpecUtils.testSlidesApi.create_animation_interactive_sequence_effect(file_name, 1, 1, dto, "password", folder_name)
109
109
  expect(animation.main_sequence.length).to eq(1)
110
110
  expect(animation.interactive_sequences.length).to eq(1)
111
111
  end
@@ -113,12 +113,12 @@ describe 'UseCases' do
113
113
  it 'update effect' do
114
114
  folder_name = "TempSlidesSDK"
115
115
  file_name = "test.pptx"
116
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
116
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
117
117
 
118
118
  dto = AsposeSlidesCloud::Effect.new
119
119
  dto.type = "Blast"
120
120
  dto.shape_index = 3
121
- animation = AsposeSlidesCloud::SpecUtils.api.update_animation_effect(file_name, 1, 1, dto, "password", folder_name)
121
+ animation = AsposeSlidesCloud::SpecUtils.testSlidesApi.update_animation_effect(file_name, 1, 1, dto, "password", folder_name)
122
122
  expect(animation.main_sequence.length).to eq(1)
123
123
  expect(animation.interactive_sequences.length).to eq(1)
124
124
  end
@@ -126,12 +126,12 @@ describe 'UseCases' do
126
126
  it 'update interactive sequence effect' do
127
127
  folder_name = "TempSlidesSDK"
128
128
  file_name = "test.pptx"
129
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
129
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
130
130
 
131
131
  dto = AsposeSlidesCloud::Effect.new
132
132
  dto.type = "Blast"
133
133
  dto.shape_index = 3
134
- animation = AsposeSlidesCloud::SpecUtils.api.update_animation_interactive_sequence_effect(file_name, 1, 1, 1, dto, "password", folder_name)
134
+ animation = AsposeSlidesCloud::SpecUtils.testSlidesApi.update_animation_interactive_sequence_effect(file_name, 1, 1, 1, dto, "password", folder_name)
135
135
  expect(animation.main_sequence.length).to eq(1)
136
136
  expect(animation.interactive_sequences.length).to eq(1)
137
137
  end
@@ -139,8 +139,8 @@ describe 'UseCases' do
139
139
  it 'delete' do
140
140
  folder_name = "TempSlidesSDK"
141
141
  file_name = "test.pptx"
142
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
143
- animation = AsposeSlidesCloud::SpecUtils.api.delete_animation(file_name, 1, "password", folder_name)
142
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
143
+ animation = AsposeSlidesCloud::SpecUtils.testSlidesApi.delete_animation(file_name, 1, "password", folder_name)
144
144
  expect(animation.main_sequence.length).to eq(0)
145
145
  expect(animation.interactive_sequences.length).to eq(0)
146
146
  end
@@ -148,8 +148,8 @@ describe 'UseCases' do
148
148
  it 'delete main sequence' do
149
149
  folder_name = "TempSlidesSDK"
150
150
  file_name = "test.pptx"
151
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
152
- animation = AsposeSlidesCloud::SpecUtils.api.delete_animation_main_sequence(file_name, 1, "password", folder_name)
151
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
152
+ animation = AsposeSlidesCloud::SpecUtils.testSlidesApi.delete_animation_main_sequence(file_name, 1, "password", folder_name)
153
153
  expect(animation.main_sequence.length).to eq(0)
154
154
  expect(animation.interactive_sequences.length).to eq(1)
155
155
  end
@@ -157,8 +157,8 @@ describe 'UseCases' do
157
157
  it 'delete main sequence effect' do
158
158
  folder_name = "TempSlidesSDK"
159
159
  file_name = "test.pptx"
160
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
161
- animation = AsposeSlidesCloud::SpecUtils.api.delete_animation_effect(file_name, 1, 1, "password", folder_name)
160
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
161
+ animation = AsposeSlidesCloud::SpecUtils.testSlidesApi.delete_animation_effect(file_name, 1, 1, "password", folder_name)
162
162
  expect(animation.main_sequence.length).to eq(0)
163
163
  expect(animation.interactive_sequences.length).to eq(1)
164
164
  end
@@ -166,8 +166,8 @@ describe 'UseCases' do
166
166
  it 'delete interactive sequences' do
167
167
  folder_name = "TempSlidesSDK"
168
168
  file_name = "test.pptx"
169
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
170
- animation = AsposeSlidesCloud::SpecUtils.api.delete_animation_interactive_sequences(file_name, 1, "password", folder_name)
169
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
170
+ animation = AsposeSlidesCloud::SpecUtils.testSlidesApi.delete_animation_interactive_sequences(file_name, 1, "password", folder_name)
171
171
  expect(animation.main_sequence.length).to eq(1)
172
172
  expect(animation.interactive_sequences.length).to eq(0)
173
173
  end
@@ -175,8 +175,8 @@ describe 'UseCases' do
175
175
  it 'delete interactive sequence' do
176
176
  folder_name = "TempSlidesSDK"
177
177
  file_name = "test.pptx"
178
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
179
- animation = AsposeSlidesCloud::SpecUtils.api.delete_animation_interactive_sequence(file_name, 1, 1, "password", folder_name)
178
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
179
+ animation = AsposeSlidesCloud::SpecUtils.testSlidesApi.delete_animation_interactive_sequence(file_name, 1, 1, "password", folder_name)
180
180
  expect(animation.main_sequence.length).to eq(1)
181
181
  expect(animation.interactive_sequences.length).to eq(0)
182
182
  end
@@ -184,8 +184,8 @@ describe 'UseCases' do
184
184
  it 'delete interactive sequence effect' do
185
185
  folder_name = "TempSlidesSDK"
186
186
  file_name = "test.pptx"
187
- AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
188
- animation = AsposeSlidesCloud::SpecUtils.api.delete_animation_interactive_sequence_effect(file_name, 1, 1, 1, "password", folder_name)
187
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
188
+ animation = AsposeSlidesCloud::SpecUtils.testSlidesApi.delete_animation_interactive_sequence_effect(file_name, 1, 1, 1, "password", folder_name)
189
189
  expect(animation.main_sequence.length).to eq(1)
190
190
  expect(animation.interactive_sequences.length).to eq(1)
191
191
  end
@@ -0,0 +1,82 @@
1
+ =begin
2
+ Copyright (c) 2019 Aspose Pty Ltd
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
21
+ =end
22
+
23
+ require 'spec_helper'
24
+
25
+ describe 'UseCases' do
26
+ describe 'AsyncApi' do
27
+ it 'async convert' do
28
+ sleep_timeout = 3
29
+ max_tries = 10
30
+ source = File.binread("TestData/test.pptx")
31
+ operation_id = AsposeSlidesCloud::SpecUtils.testSlidesAsyncApi.start_convert(source, AsposeSlidesCloud::ExportFormat::PDF, "password")
32
+ for i in 1 .. max_tries do
33
+ sleep(sleep_timeout)
34
+ operation = AsposeSlidesCloud::SpecUtils.testSlidesAsyncApi.get_operation_status(operation_id)
35
+ if operation.status != 'Created' and operation.status != 'Enqueued' and operation.status != 'Started'
36
+ break
37
+ end
38
+ end
39
+ expect(operation.status).to eq('Finished')
40
+ expect(operation.error).to be_nil
41
+
42
+ converted = AsposeSlidesCloud::SpecUtils.testSlidesAsyncApi.get_operation_result(operation_id)
43
+ expect(converted.size).to be > 0
44
+ end
45
+
46
+ it 'async download presentation' do
47
+ sleep_timeout = 3
48
+ max_tries = 10
49
+ folder_name = "TempSlidesSDK"
50
+ file_name = "test.pdf"
51
+ AsposeSlidesCloud::SpecUtils.testSlidesApi.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
52
+ operation_id = AsposeSlidesCloud::SpecUtils.testSlidesAsyncApi.start_download_presentation(file_name, AsposeSlidesCloud::ExportFormat::PDF, nil, "password", folder_name)
53
+ for i in 1 .. max_tries do
54
+ sleep(sleep_timeout)
55
+ operation = AsposeSlidesCloud::SpecUtils.testSlidesAsyncApi.get_operation_status(operation_id)
56
+ if operation.status != 'Created' and operation.status != 'Enqueued' and operation.status != 'Started'
57
+ break
58
+ end
59
+ end
60
+ expect(operation.status).to eq('Finished')
61
+ expect(operation.error).to be_nil
62
+
63
+ converted = AsposeSlidesCloud::SpecUtils.testSlidesAsyncApi.get_operation_result(operation_id)
64
+ expect(converted.size).to be > 0
65
+ end
66
+
67
+ it 'async bad operation' do
68
+ sleep_timeout = 3
69
+ max_tries = 10
70
+ operation_id = AsposeSlidesCloud::SpecUtils.testSlidesAsyncApi.start_download_presentation("IDoNotExist.pptx", AsposeSlidesCloud::ExportFormat::PDF)
71
+ for i in 1 .. max_tries do
72
+ sleep(sleep_timeout)
73
+ operation = AsposeSlidesCloud::SpecUtils.testSlidesAsyncApi.get_operation_status(operation_id)
74
+ if operation.status != 'Created' and operation.status != 'Enqueued' and operation.status != 'Started'
75
+ break
76
+ end
77
+ end
78
+ expect(operation.status).to eq('Failed')
79
+ expect(operation.error).not_to be_nil
80
+ end
81
+ end
82
+ end