mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACA-3023]Refactor APS1 PO and ACS API calls of ADF testing package (#5629)
* Change the uploadFile method from ADF testing package * Fix lint * no message * Fix a part of the tests * Fix last tests * Fix test * Fix tests * Fix test
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import * as path from 'path';
|
||||
import * as fs from 'fs';
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
@@ -29,8 +28,7 @@ export class UploadActions {
|
||||
}
|
||||
|
||||
async uploadFile(fileLocation, fileName, parentFolderId): Promise<any> {
|
||||
const pathFile = path.join(browser.params.rootPath + '/e2e' + fileLocation);
|
||||
const file = fs.createReadStream(pathFile);
|
||||
const file = fs.createReadStream(fileLocation);
|
||||
|
||||
return this.alfrescoJsApi.upload.uploadFile(
|
||||
file,
|
||||
@@ -70,8 +68,7 @@ export class UploadActions {
|
||||
}
|
||||
|
||||
async uploadFolder(sourcePath, folder) {
|
||||
const absolutePath = 'e2e/' + sourcePath;
|
||||
const files = fs.readdirSync(path.join(browser.params.rootPath, absolutePath));
|
||||
const files = fs.readdirSync(sourcePath);
|
||||
let uploadedFiles;
|
||||
const promises = [];
|
||||
|
||||
|
@@ -37,7 +37,7 @@ export class AttachFileWidgetCloudPage {
|
||||
await browser.setFileDetector(new remote.FileDetector());
|
||||
const uploadButton = this.widget.element(by.css(`a input`));
|
||||
await BrowserVisibility.waitUntilElementIsPresent(uploadButton);
|
||||
await uploadButton.sendKeys(browser.params.rootPath + '/e2e' + fileLocation);
|
||||
await uploadButton.sendKeys(fileLocation);
|
||||
await BrowserVisibility.waitUntilElementIsPresent(uploadButton);
|
||||
}
|
||||
|
||||
|
@@ -96,6 +96,10 @@ export class StartProcessPage {
|
||||
await BrowserActions.click(this.cancelProcessButton);
|
||||
}
|
||||
|
||||
async isCancelProcessButtonEnabled(): Promise<boolean> {
|
||||
return this.cancelProcessButton.isEnabled();
|
||||
}
|
||||
|
||||
async clickFormStartProcessButton(): Promise<void> {
|
||||
await BrowserActions.click(this.formStartProcessButton);
|
||||
}
|
||||
|
Reference in New Issue
Block a user