mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
'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:
committed by
Eugenio Romano
parent
5f1caca5da
commit
725cf22956
@@ -17,21 +17,16 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import { LoginPage } from '@alfresco/adf-testing';
|
||||
import { LoginPage, UploadActions, StringUtil, LocalStorageUtil, BrowserActions } from '@alfresco/adf-testing';
|
||||
import { SearchDialog } from '../pages/adf/dialog/searchDialog';
|
||||
import { ContentServicesPage } from '../pages/adf/contentServicesPage';
|
||||
import { ViewerPage } from '../pages/adf/viewerPage';
|
||||
import { SearchResultsPage } from '../pages/adf/searchResultsPage';
|
||||
|
||||
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||
import { FileModel } from '../models/ACS/fileModel';
|
||||
import { FolderModel } from '../models/ACS/folderModel';
|
||||
|
||||
import { Util } from '../util/util';
|
||||
import { StringUtil, LocalStorageUtil, BrowserActions } from '@alfresco/adf-testing';
|
||||
|
||||
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
||||
import { UploadActions } from '../actions/ACS/upload.actions';
|
||||
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
||||
import { SearchConfiguration } from './search.config';
|
||||
|
||||
@@ -54,7 +49,11 @@ describe('Search component - Search Bar', () => {
|
||||
const viewerPage = new ViewerPage();
|
||||
|
||||
const acsUser = new AcsUserModel();
|
||||
const uploadActions = new UploadActions();
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'ECM',
|
||||
hostEcm: browser.params.testConfig.adf.url
|
||||
});
|
||||
const uploadActions = new UploadActions(this.alfrescoJsApi);
|
||||
|
||||
const filename = StringUtil.generateRandomString(16);
|
||||
const firstFolderName = StringUtil.generateRandomString(16);
|
||||
@@ -82,16 +81,11 @@ describe('Search component - Search Bar', () => {
|
||||
|
||||
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);
|
||||
|
||||
const firstFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, firstFileModel.location, firstFileModel.name, '-my-');
|
||||
const firstFileUploaded = await uploadActions.uploadFile(firstFileModel.location, firstFileModel.name, '-my-');
|
||||
Object.assign(firstFileModel, firstFileUploaded.entry);
|
||||
|
||||
fileHighlightUploaded = await this.alfrescoJsApi.nodes.addNode('-my-', {
|
||||
@@ -105,9 +99,9 @@ describe('Search component - Search Bar', () => {
|
||||
|
||||
filesToDelete.push(fileHighlightUploaded);
|
||||
filesToDelete.push(firstFileUploaded);
|
||||
filesToDelete.push(await uploadActions.createFolder(this.alfrescoJsApi, firstFolderModel.name, '-my-'));
|
||||
filesToDelete.push(await uploadActions.createFolder(this.alfrescoJsApi, secondFolder.name, '-my-'));
|
||||
filesToDelete.push(await uploadActions.createFolder(this.alfrescoJsApi, thirdFolder.name, '-my-'));
|
||||
filesToDelete.push(await uploadActions.createFolder(firstFolderModel.name, '-my-'));
|
||||
filesToDelete.push(await uploadActions.createFolder(secondFolder.name, '-my-'));
|
||||
filesToDelete.push(await uploadActions.createFolder(thirdFolder.name, '-my-'));
|
||||
|
||||
await browser.driver.sleep(15000); // wait search index previous file/folder uploaded
|
||||
|
||||
@@ -119,7 +113,7 @@ describe('Search component - Search Bar', () => {
|
||||
afterAll(async (done) => {
|
||||
|
||||
filesToDelete.forEach(async (currentNode) => {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, currentNode.entry.id);
|
||||
await uploadActions.deleteFileOrFolder(currentNode.entry.id);
|
||||
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user