'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

@@ -18,15 +18,13 @@
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
import { browser } from 'protractor';
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
import { ApiService, LoginSSOPage } from '@alfresco/adf-testing';
import { UploadActions } from '../../actions/ACS/upload.actions';
import { ApiService, LoginSSOPage, UploadActions, IdentityService, SettingsPage, StringUtil, UserModel } from '@alfresco/adf-testing';
import { FileModel } from '../../models/ACS/fileModel';
import { ViewerPage } from '../../pages/adf/viewerPage';
import resources = require('../../util/resources');
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import * as path from 'path';
import { Util } from '../../util/util';
import { IdentityService, SettingsPage, StringUtil, UserModel } from '@alfresco/adf-testing';
describe('SSO in ADF using ACS and AIS, Download Directive, Viewer, DocumentList, implicitFlow true', () => {
@@ -38,7 +36,7 @@ describe('SSO in ADF using ACS and AIS, Download Directive, Viewer, DocumentList
const viewerPage = new ViewerPage();
let silentLogin;
let implicitFlow;
const uploadActions = new UploadActions();
const firstPdfFileModel = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
'location': resources.Files.ADF_DOCUMENTS.PDF_B.file_location
@@ -66,7 +64,7 @@ describe('SSO in ADF using ACS and AIS, Download Directive, Viewer, DocumentList
redirectUriLogout: '/logout'
}
});
const uploadActions = new UploadActions(this.alfrescoJsApi);
const downloadedPngFile = path.join(__dirname, 'downloads', pngFileModel.name);
const downloadedMultipleFiles = path.join(__dirname, 'downloads', 'archive.zip');
const folderName = StringUtil.generateRandomString(5);
@@ -85,10 +83,10 @@ describe('SSO in ADF using ACS and AIS, Download Directive, Viewer, DocumentList
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
folder = await uploadActions.createFolder(this.alfrescoJsApi, folderName, '-my-');
folder = await uploadActions.createFolder(folderName, '-my-');
pdfUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, firstPdfFileModel.location, firstPdfFileModel.name, folder.entry.id);
pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, folder.entry.id);
pdfUploadedFile = await uploadActions.uploadFile(firstPdfFileModel.location, firstPdfFileModel.name, folder.entry.id);
pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, folder.entry.id);
silentLogin = false;
implicitFlow = true;
@@ -110,7 +108,7 @@ describe('SSO in ADF using ACS and AIS, Download Directive, Viewer, DocumentList
afterAll(async (done) => {
try {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, folder.entry.id);
await uploadActions.deleteFileOrFolder(folder.entry.id);
await identityService.deleteIdentityUser(acsUser.id);
} catch (error) {
}