Skip to content

Commit 3a56f1e

Browse files
Merge remote-tracking branch 'origin/master' into release
2 parents fd0f781 + 1ffec34 commit 3a56f1e

18 files changed

+715
-939
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ Feel free to explore the [Developer's Guide](https://docs.aspose.cloud/display/w
1616
- Add & remove watermarks and protection.
1717
- Read & write access to Document Object Model.
1818

19+
## Enhancements in Version 21.11
20+
21+
22+
1923
## Enhancements in Version 21.10
2024

2125
- Removed 'GraphicsQualityOptions' image save option as it no longer supported.

bdd/features/conversion/saveAs.feature

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ Scenario Outline: Convert document with specified encoding form storage and save
3232
And I have specified encoding <LoadEncoding>
3333
When I execute conversion from storage (POST SaveAs)
3434
Then document <OutPath> is existed on storage in <SubFolder> folder
35-
And symbols are encoded properly
3635

3736
Examples:
3837
| DocName | DestFormat | OutPath | LoadEncoding | SubFolder |

bdd/steps/common/storageSteps.ts

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,18 @@ import { Given, Then } from "cucumber";
2727
import * as BaseTest from "../../../test/baseTest";
2828
import { DeleteFileRequest, DownloadFileRequest } from "../../../src/api";
2929

30-
Given(/^I have uploaded document with name (.*) and subfolder is (.*) to storage$/, function (documentName, folder, callback) {
30+
Given(/^I have uploaded document with name (.*) and subfolder is (.*) to storage$/, {timeout: 60000}, async function (documentName, folder) {
3131

3232
const wordsApi = BaseTest.initializeWordsApi();
3333

3434
const remotePath = BaseTest.remoteBaseFolder + folder;
3535
const localPath = BaseTest.localBaseTestDataFolder + folder + documentName;
3636

37-
wordsApi.uploadFileToStorage(remotePath + documentName, localPath)
38-
.then((result) => {
39-
expect(result.response.statusMessage).to.equal("OK");
40-
callback();
41-
});
37+
const result = await wordsApi.uploadFileToStorage(remotePath + documentName, localPath);
38+
expect(result.response.statusMessage).to.equal("OK");
4239
});
4340

44-
Given(/^There is no file (.*) on storage in (.*) folder$/, function (documentName, folder, callback) {
41+
Given(/^There is no file (.*) on storage in (.*) folder$/, {timeout: 60000}, async function (documentName, folder) {
4542

4643
const wordsApi = BaseTest.initializeWordsApi();
4744

@@ -53,14 +50,11 @@ Given(/^There is no file (.*) on storage in (.*) folder$/, function (documentNam
5350
const request = new DeleteFileRequest();
5451
request.path = remotePath;
5552

56-
wordsApi.deleteFile(request)
57-
.then((result) => {
58-
expect(result.statusMessage).to.equal("OK");
59-
callback();
60-
});
53+
const result = await wordsApi.deleteFile(request);
54+
expect(result.statusMessage).to.equal("OK");
6155
});
6256

63-
Then(/^document (.*) is existed on storage in (.*) folder$/, function (documentName, folder, callback) {
57+
Then(/^document (.*) is existed on storage in (.*) folder$/, {timeout: 60000}, async function (documentName, folder) {
6458

6559
const wordsApi = BaseTest.initializeWordsApi();
6660

@@ -73,9 +67,6 @@ Then(/^document (.*) is existed on storage in (.*) folder$/, function (documentN
7367
const request = new DownloadFileRequest();
7468
request.path = remotePath;
7569

76-
wordsApi.downloadFile(request).
77-
then((result) => {
78-
expect(result.response.statusMessage).to.equal("OK");
79-
callback();
80-
});
70+
const result = await wordsApi.downloadFile(request);
71+
expect(result.response.statusMessage).to.equal("OK");
8172
});

bdd/steps/conversions/getAlternateDocumentSteps.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,11 @@ import { When } from "cucumber";
2626
import { GetDocumentWithFormatRequest } from "../../../src/model/model";
2727
import * as BaseTest from "../../../test/baseTest";
2828

29-
When(/^I execute conversion from storage \(GET document with format\)$/, function() {
29+
When(/^I execute conversion from storage \(GET document with format\)$/, {timeout: 60000}, async function() {
3030
const wordsApi = BaseTest.initializeWordsApi();
3131
const request = new GetDocumentWithFormatRequest(this.request);
3232

33-
return wordsApi.getDocumentWithFormat(request)
34-
.then((result) => {
35-
this.response = result;
36-
});
33+
const result = await wordsApi.getDocumentWithFormat(request);
34+
this.response = result;
35+
return result;
3736
});

bdd/steps/conversions/putConvertSteps.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,16 @@ import * as fs from "fs";
2727
import { ConvertDocumentRequest } from "../../../src/model/model";
2828
import * as BaseTest from "../../../test/baseTest";
2929

30-
Given(/^I have specified document (.*) to send it in request body$/, function(documentName) {
30+
Given(/^I have specified document (.*) to send it in request body$/, {timeout: 60000}, function(documentName) {
3131
const localPath = BaseTest.localBaseTestDataFolder + "DocumentActions/ConvertDocument/" + documentName;
3232
this.request.document = fs.readFileSync(localPath);
3333
});
3434

35-
When(/^I execute conversion \(PUT convert\)$/, function() {
35+
When(/^I execute conversion \(PUT convert\)$/, async function() {
3636
const wordsApi = BaseTest.initializeWordsApi();
3737
const request = new ConvertDocumentRequest(this.request);
3838

39-
return wordsApi.convertDocument(request)
40-
.then((result) => {
41-
this.response = result;
42-
});
39+
const result = await wordsApi.convertDocument(request);
40+
this.response = result;
41+
return result;
4342
});

bdd/steps/conversions/saveAsSteps.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,25 @@ Given(/^I have specified destFileName (.*)$/, function(destFileName) {
3939
this.request.saveOptionsData.fileName = destFileName;
4040
});
4141

42-
When(/^I execute conversion from storage \(POST SaveAs\)$/, function() {
42+
When(/^I execute conversion from storage \(POST SaveAs\)$/, {timeout: 60000}, async function() {
4343
const wordsApi = BaseTest.initializeWordsApi();
4444
const request = new SaveAsRequest(this.request);
4545

46-
return wordsApi.saveAs(request)
47-
.then((result) => {
48-
this.response = result;
49-
});
46+
const result = await wordsApi.saveAs(request)
47+
this.response = result;
48+
49+
return result;
5050
});
5151

52-
Then(/^symbols are encoded properly$/, function() {
52+
Then(/^symbols of document (.*) in (.*) are encoded properly$/, {timeout: 60000}, async function(_documentName, _folder) {
53+
5354
const wordsApi = BaseTest.initializeWordsApi();
5455
const request = new GetRunsRequest({
5556
folder: BaseTest.remoteBaseFolder + "DocumentActions/ConvertDocument/out/saveas",
5657
name: "TableDocumentDoc.doc",
5758
paragraphPath: null
5859
});
5960

60-
wordsApi.getRuns(request).then((result) => {
61-
expect(result.body.runs.list[0].text).to.equal("строка");
62-
});
61+
const result = await wordsApi.getRuns(request);
62+
expect(result.body.runs.list[0].text).to.equal("строка");
6363
});

bdd/steps/mailMerge/postExecuteTemplateSteps.ts

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import * as BaseTest from "../../../test/baseTest";
3030

3131
const testFolder = "DocumentActions/MailMerge/";
3232

33-
Given(/^I have specified a template file name (.*) in storage$/, function(templateName, callback) {
33+
Given(/^I have specified a template file name (.*) in storage$/, {timeout: 60000}, async function(templateName) {
3434

3535
const worsApi = BaseTest.initializeWordsApi();
3636

@@ -40,37 +40,31 @@ Given(/^I have specified a template file name (.*) in storage$/, function(templa
4040
this.request.name = templateName;
4141
this.request.folder = remotePath.slice(0, -1);
4242

43-
worsApi.uploadFileToStorage(remotePath + templateName, localPath)
44-
.then((result) => {
45-
expect(result.response.statusMessage).to.equal("OK");
46-
callback();
47-
});
43+
const result = await worsApi.uploadFileToStorage(remotePath + templateName, localPath)
44+
expect(result.response.statusMessage).to.equal("OK");
4845
});
4946

5047
Given(/^I have specified a body (.*)$/, function(fileWithBodyContent) {
5148
this.request.data = fs.readFileSync(BaseTest.localBaseTestDataFolder + testFolder + fileWithBodyContent);
5249
});
5350

54-
When(/^I execute template$/, function() {
51+
When(/^I execute template$/, {timeout: 60000}, async function() {
5552
const wordsApi = BaseTest.initializeWordsApi();
5653
const request = new ExecuteMailMergeRequest(this.request);
5754

58-
return wordsApi.executeMailMerge(request)
59-
.then((result) => {
60-
this.response = result;
61-
});
55+
const result = await wordsApi.executeMailMerge(request)
56+
this.response = result;
57+
return result;
6258
});
6359

64-
Then(/^image should be rendered$/, function(callback) {
60+
Then(/^image should be rendered$/, {timeout: 60000}, async function() {
6561
const wordsApi = BaseTest.initializeWordsApi();
6662
const request = new GetDocumentDrawingObjectsRequest({
6763
folder: BaseTest.remoteBaseFolder + "DocumentActions/MailMerge",
6864
name: "ExecuteTemplateWithImagesResult.doc",
6965
nodePath: null
7066
});
7167

72-
wordsApi.getDocumentDrawingObjects(request).then((result) => {
73-
expect(result.body.drawingObjects.list.length).to.greaterThan(0);
74-
callback();
75-
});
68+
const result = await wordsApi.getDocumentDrawingObjects(request);
69+
expect(result.body.drawingObjects.list.length).to.greaterThan(0);
7670
});

bdd/steps/mailMerge/putExecuteMailMergeSteps.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,11 @@ import { When } from "cucumber";
2626
import { ExecuteMailMergeOnlineRequest } from "../../../src/model/model";
2727
import * as BaseTest from "../../../test/baseTest";
2828

29-
When(/^I execute mail merge online$/, function() {
29+
When(/^I execute mail merge online$/, {timeout: 60000}, async function() {
3030
const wordsApi = BaseTest.initializeWordsApi();
3131
const request = new ExecuteMailMergeOnlineRequest(this.request);
3232

33-
return wordsApi.executeMailMergeOnline(request)
34-
.then((result) => {
35-
this.response = result;
36-
});
33+
const result = await wordsApi.executeMailMergeOnline(request)
34+
this.response = result;
35+
return result;
3736
});

bdd/steps/mailMerge/putExecuteTemplateSteps.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ import * as BaseTest from "../../../test/baseTest";
2929

3030
const testFolder = "DocumentActions/MailMerge/";
3131

32-
Given(/^I have specified a template file (.*) in request$/, function(templateName) {
32+
Given(/^I have specified a template file (.*) in request$/, {timeout: 60000}, function(templateName) {
3333
this.request.template = fs.readFileSync(BaseTest.localBaseTestDataFolder + testFolder + templateName);
3434
});
3535

36-
When(/^I execute template online$/, function() {
36+
When(/^I execute template online$/, async function() {
3737
const wordsApi = BaseTest.initializeWordsApi();
3838
const request = new ExecuteMailMergeOnlineRequest(this.request);
3939

40-
return wordsApi.executeMailMergeOnline(request)
41-
.then((result) => {
42-
this.response = result;
43-
});
40+
const result = await wordsApi.executeMailMergeOnline(request)
41+
this.response = result;
42+
43+
return result;
4444
});

0 commit comments

Comments
 (0)