[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:
Cristina Jalba
2020-04-23 11:49:41 +03:00
committed by GitHub
parent 7fa9b59082
commit 098b9881eb
57 changed files with 160 additions and 116 deletions

View File

@@ -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 = [];

View File

@@ -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);
}

View File

@@ -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);
}