mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
* '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
100 lines
3.6 KiB
TypeScript
100 lines
3.6 KiB
TypeScript
/*!
|
|
* @license
|
|
* Copyright 2019 Alfresco Software, Ltd.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
import { browser } from 'protractor';
|
|
import { LoginPage, StringUtil, UploadActions } from '@alfresco/adf-testing';
|
|
import { ViewerPage } from '../../../pages/adf/viewerPage';
|
|
import { ContentServicesPage } from '../../../pages/adf/contentServicesPage';
|
|
import CONSTANTS = require('../../../util/constants');
|
|
import resources = require('../../../util/resources');
|
|
import { FolderModel } from '../../../models/ACS/folderModel';
|
|
import { AcsUserModel } from '../../../models/ACS/acsUserModel';
|
|
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
|
|
|
|
describe('Viewer', () => {
|
|
|
|
const viewerPage = new ViewerPage();
|
|
const loginPage = new LoginPage();
|
|
const contentServicesPage = new ContentServicesPage();
|
|
let site;
|
|
const acsUser = new AcsUserModel();
|
|
|
|
const excelFolderInfo = new FolderModel({
|
|
'name': resources.Files.ADF_DOCUMENTS.EXCEL_FOLDER.folder_name,
|
|
'location': resources.Files.ADF_DOCUMENTS.EXCEL_FOLDER.folder_location
|
|
});
|
|
this.alfrescoJsApi = new AlfrescoApi({
|
|
provider: 'ECM',
|
|
hostEcm: browser.params.testConfig.adf.url
|
|
});
|
|
const uploadActions = new UploadActions(this.alfrescoJsApi);
|
|
|
|
beforeAll(async (done) => {
|
|
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
|
|
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
|
|
|
site = await this.alfrescoJsApi.core.sitesApi.createSite({
|
|
title: StringUtil.generateRandomString(8),
|
|
visibility: 'PUBLIC'
|
|
});
|
|
|
|
await this.alfrescoJsApi.core.sitesApi.addSiteMember(site.entry.id, {
|
|
id: acsUser.id,
|
|
role: CONSTANTS.CS_USER_ROLES.MANAGER
|
|
});
|
|
|
|
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
|
|
|
done();
|
|
});
|
|
describe('Excel Folder Uploaded', () => {
|
|
|
|
let uploadedExcels;
|
|
let excelFolderUploaded;
|
|
|
|
beforeAll(async (done) => {
|
|
excelFolderUploaded = await uploadActions.createFolder(excelFolderInfo.name, '-my-');
|
|
|
|
uploadedExcels = await uploadActions.uploadFolder(excelFolderInfo.location, excelFolderUploaded.entry.id);
|
|
|
|
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
|
contentServicesPage.goToDocumentList();
|
|
|
|
done();
|
|
});
|
|
|
|
afterAll(async (done) => {
|
|
await uploadActions.deleteFileOrFolder(excelFolderUploaded.entry.id);
|
|
done();
|
|
});
|
|
|
|
it('[C280008] Should be possible to open any Excel file', () => {
|
|
contentServicesPage.doubleClickRow('excel');
|
|
|
|
uploadedExcels.forEach((currentFile) => {
|
|
if (currentFile.entry.name !== '.DS_Store') {
|
|
contentServicesPage.doubleClickRow(currentFile.entry.name);
|
|
viewerPage.checkFileIsLoaded(currentFile.entry.name);
|
|
viewerPage.clickCloseButton();
|
|
}
|
|
});
|
|
});
|
|
|
|
});
|
|
|
|
});
|