@progress/kendo-e2e
Version:
Kendo UI end-to-end test utilities.
48 lines (47 loc) • 3.27 kB
TypeScript
export declare const defaultDownloadPath: string;
export declare function exist(filePath: string): Promise<boolean>;
/**
* Asynchronously reads the content of a file located at the specified file path
* and returns it as either a string or a Buffer.
*
* @param {string} fileName - The name of the file to read.
* @param {string} [filePath=defaultDownloadPath] - Default: defaultDownloadPath. The directory path where the file is located.
* @param {BufferEncoding} [bufferEncoding] - Optional. The encoding to use when reading the file content.
* @param {number} [maxWaitMs=20000] - Default: 20sec. The maximum time, in milliseconds, to wait for the
* file to become available. If the file is not found within this timeout, an error will be thrown.
*/
export declare function getFileContent(fileName: string, filePath?: string, bufferEncoding?: BufferEncoding, maxWaitMs?: number): Promise<string | Buffer>;
/**
* Copies the content of a source file to a new target file and custom file extension.
*
* @param {string} sourceFileName - The name of the source file to copy.
* @param {string} targetFileName - The name of the target file to create.
* @param {string} [filePathSource=defaultDownloadPath] - Default: defaultDownloadPath. The directory path where the file is located.
* @param {string} filePathTarget - Default: defaultDownloadPath. The directory path where the file should be saved.
* @param {BufferEncoding} [bufferEncoding] - Optional. The encoding to use when reading the file content.
*/
export declare function copyFile(sourceFileName: string, targetFileName: string, filePathSource?: string, filePathTarget?: string, bufferEncoding?: BufferEncoding): Promise<void>;
/**
* Removes Creation date metadata from a file content buffer via RegEx.
*
* @param {Buffer} fileContentBuffer - The file content buffer.
* @param {BufferEncoding} [bufferEncoding] - Optional. The encoding to use when reading the file content.
* @param {RegExp} [additionalPattern] - Optional. An optional regular expression pattern to match additional metadata.
*/
export declare function removeCreationDateMetadataFromFile(fileContentBuffer: any, bufferEncoding?: BufferEncoding, additionalPattern?: any): Promise<Buffer>;
/**
* Compare the content of two files to check if they are identical using Buffer.compare() method.
*
* @param {string} filePathExpectedResult - The path to the first file.
* @param {string} filePathActualResult - The path to the second file.
* @param {boolean} removeCreationDate - Default: true. RegEx to remove the creation date metadata.
* @param {BufferEncoding} [bufferEncoding] - Optional. The encoding to use when reading the file content.
*/
export declare function compareTwoFiles(filePathExpectedResult: any, filePathActualResult: any, removeCreationDate?: boolean, bufferEncoding?: any): Promise<boolean>;
/**
* Deletes a file from the file system if it exists. If the file is not found - print message and continue with no error.
*
* @param {string} fileName - The file name to be deleted.
* @param {string} [filePath=defaultDownloadPath] - Default: defaultDownloadPath. The directory path where the file is located.
*/
export declare function deleteFileIfExists(fileName: any, filePath?: string): Promise<void>;