'Testing' Moved Upload Actions to shared testing package (#4616)

* 'Testing' Moved Upload Actions to shared testing package

* Updated Upload Actionswith suggested changes

* Failing tests updated

* Resolving merge conflicts

* updating latest merge conflicts

* resolved merge conflicts

* update to fix previous issues with this.

* testing changes

* fix for failed travis test

* updates to fix failing travis test

* fixes file path error

* latest fix for failing travis test

* latest fix for failing travis test

* Fixing undefined rootPath

* fixes timing issues in content-services travis test

* resolves requested changes
This commit is contained in:
Alexa Fabian
2019-06-17 15:07:25 +01:00
committed by Eugenio Romano
parent 5f1caca5da
commit 725cf22956
60 changed files with 858 additions and 1028 deletions

View File

@@ -16,25 +16,24 @@
*/
import { browser } from 'protractor';
import { LoginPage } from '@alfresco/adf-testing';
import { LoginPage, UploadActions } from '@alfresco/adf-testing';
import { ViewerPage } from '../../pages/adf/viewerPage';
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import resources = require('../../util/resources');
import { FileModel } from '../../models/ACS/fileModel';
import { AcsUserModel } from '../../models/ACS/acsUserModel';
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { UploadActions } from '../../actions/ACS/upload.actions';
describe('Viewer', () => {
const viewerPage = new ViewerPage();
const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const uploadActions = new UploadActions();
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf.url
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
const acsUser = new AcsUserModel();
let txtFileUploaded;
@@ -44,18 +43,12 @@ describe('Viewer', () => {
});
beforeAll(async (done) => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: browser.params.testConfig.adf.url
});
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
txtFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, txtFileInfo.location, txtFileInfo.name, '-my-');
txtFileUploaded = await uploadActions.uploadFile(txtFileInfo.location, txtFileInfo.name, '-my-');
await loginPage.loginToContentServicesUsingUserModel(acsUser);
@@ -63,7 +56,7 @@ describe('Viewer', () => {
});
afterAll(async (done) => {
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, txtFileUploaded.entry.id);
await uploadActions.deleteFileOrFolder(txtFileUploaded.entry.id);
done();
});