2323*/
2424
2525import { expect } from "chai" ;
26- import { Given , Then } from "cucumber" ;
26+ import { Given , Then } from "@cucumber/ cucumber" ;
2727import * as BaseTest from "../../../test/baseTest" ;
2828import { DeleteFileRequest , DownloadFileRequest } from "../../../src/api" ;
2929
3030Given ( / ^ I h a v e u p l o a d e d d o c u m e n t w i t h n a m e ( .* ) a n d s u b f o l d e r i s ( .* ) t o s t o r a g e $ / , { timeout : 60000 } , async function ( documentName , folder ) {
3131
32- const wordsApi = BaseTest . initializeWordsApi ( ) ;
33-
3432 const remotePath = BaseTest . remoteBaseFolder + folder ;
3533 const localPath = BaseTest . localBaseTestDataFolder + folder + documentName ;
3634
37- const result = await wordsApi . uploadFileToStorage ( remotePath + documentName , localPath ) ;
35+ const result = await this . wordsApi . uploadFileToStorage ( remotePath + documentName , localPath ) ;
3836 expect ( result . response . statusMessage ) . to . equal ( "OK" ) ;
3937} ) ;
4038
4139Given ( / ^ T h e r e i s n o f i l e ( .* ) o n s t o r a g e i n ( .* ) f o l d e r $ / , { timeout : 60000 } , async function ( documentName , folder ) {
4240
43- const wordsApi = BaseTest . initializeWordsApi ( ) ;
44-
4541 let remotePath = BaseTest . remoteBaseFolder + folder + documentName ;
4642 if ( folder === "output" ) {
4743 remotePath = BaseTest . remoteBaseTestOutFolder + documentName ;
@@ -50,14 +46,12 @@ Given(/^There is no file (.*) on storage in (.*) folder$/, {timeout: 60000}, asy
5046 const request = new DeleteFileRequest ( ) ;
5147 request . path = remotePath ;
5248
53- const result = await wordsApi . deleteFile ( request ) ;
49+ const result = await this . wordsApi . deleteFile ( request ) ;
5450 expect ( result . statusMessage ) . to . equal ( "OK" ) ;
5551} ) ;
5652
5753Then ( / ^ d o c u m e n t ( .* ) i s e x i s t e d o n s t o r a g e i n ( .* ) f o l d e r $ / , { timeout : 60000 } , async function ( documentName , folder ) {
5854
59- const wordsApi = BaseTest . initializeWordsApi ( ) ;
60-
6155 let remotePath = BaseTest . remoteBaseFolder + folder + documentName ;
6256
6357 if ( folder === "output" ) {
@@ -67,6 +61,6 @@ Then(/^document (.*) is existed on storage in (.*) folder$/, {timeout: 60000}, a
6761 const request = new DownloadFileRequest ( ) ;
6862 request . path = remotePath ;
6963
70- const result = await wordsApi . downloadFile ( request ) ;
64+ const result = await this . wordsApi . downloadFile ( request ) ;
7165 expect ( result . response . statusMessage ) . to . equal ( "OK" ) ;
7266} ) ;
0 commit comments