[ADF-3331] Automated tests for Viewer Component (#3615)

* Automation tests for Viewer Component - Content Services

* Deleting alfresco-ng2-components.iml

* Updating Viewer Page for failing tests

* Adding tests for Viewer Component and some minor changes on Viewer Component - Content Services

* Removing some lines used to test

* Automation tests for Viewer component and Viewer component - Integration with Router + minor changes on tests for Viewer Component - Content Services

* Correcting an import + some improvement to the code

* Correcting tests for opening different file extensions

* Removing a console.log I forgot

* Refactoring the test in Viewer Component

* Refacotring using lint

* Adding browser refresh after each file type

* Moving tests to proper folder

* Minor changes

* remove faulty BE files from e2e

* fix test viewer

* fix process service tests

* fix test

* fix process test

* fix lint
timeout decrease

* increase some timeouts to fix CS e2e

* lint fix
This commit is contained in:
Marouan Bentaleb
2018-09-25 21:58:22 +01:00
committed by Eugenio Romano
parent bb6bb4fe0f
commit 5a6d8d8a2a
67 changed files with 2176 additions and 99 deletions

View File

@@ -70,16 +70,16 @@ jobs:
script: rm -rf ./node_modules/@alfresco; node ./scripts/download-build-lib-in-cs.js -u "$E2E_USERNAME" -p "$E2E_PASSWORD" --host "$E2E_HOST" -f $TRAVIS_BUILD_NUMBER || exit 1; npm run build:dist || exit 1; node ./scripts/upload-build-in-cs.js -u "$E2E_USERNAME" -p "$E2E_PASSWORD" --host "$E2E_HOST" -f $TRAVIS_BUILD_NUMBER || exit 1 script: rm -rf ./node_modules/@alfresco; node ./scripts/download-build-lib-in-cs.js -u "$E2E_USERNAME" -p "$E2E_PASSWORD" --host "$E2E_HOST" -f $TRAVIS_BUILD_NUMBER || exit 1; npm run build:dist || exit 1; node ./scripts/upload-build-in-cs.js -u "$E2E_USERNAME" -p "$E2E_PASSWORD" --host "$E2E_HOST" -f $TRAVIS_BUILD_NUMBER || exit 1
- stage: e2e Test # Test core - stage: e2e Test # Test core
env: STAGE=core env: STAGE=core
script: node ./scripts/download-build-in-cs.js --username "$E2E_USERNAME" --password "$E2E_PASSWORD" --host "$E2E_HOST" --folder $TRAVIS_BUILD_NUMBER; ./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder core --skip-lint --use-dist script: node ./scripts/download-build-in-cs.js --username "$E2E_USERNAME" --password "$E2E_PASSWORD" --host "$E2E_HOST" --folder $TRAVIS_BUILD_NUMBER; ./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder core --skip-lint --use-dist --timeout 10000
- stage: e2e Test # Test process-services - stage: e2e Test # Test process-services
env: STAGE=process-services env: STAGE=process-services
script: node ./scripts/download-build-in-cs.js --username "$E2E_USERNAME" --password "$E2E_PASSWORD" --host "$E2E_HOST" --folder $TRAVIS_BUILD_NUMBER; ./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder process-services --skip-lint --use-dist script: node ./scripts/download-build-in-cs.js --username "$E2E_USERNAME" --password "$E2E_PASSWORD" --host "$E2E_HOST" --folder $TRAVIS_BUILD_NUMBER; ./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder process-services --skip-lint --use-dist --timeout 10000
- stage: e2e Test # Test content-services - stage: e2e Test # Test content-services
env: STAGE=content-services env: STAGE=content-services
script: node ./scripts/download-build-in-cs.js --username "$E2E_USERNAME" --password "$E2E_PASSWORD" --host "$E2E_HOST" --folder $TRAVIS_BUILD_NUMBER; ./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder content-services --skip-lint --use-dist script: node ./scripts/download-build-in-cs.js --username "$E2E_USERNAME" --password "$E2E_PASSWORD" --host "$E2E_HOST" --folder $TRAVIS_BUILD_NUMBER; ./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder content-services --skip-lint --use-dist --timeout 10000
- stage: e2e Test # Test insights - stage: e2e Test # Test insights
env: STAGE=insights env: STAGE=insights
script: node ./scripts/download-build-in-cs.js --username "$E2E_USERNAME" --password "$E2E_PASSWORD" --host "$E2E_HOST" --folder $TRAVIS_BUILD_NUMBER; ./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder insights --skip-lint --use-dist script: node ./scripts/download-build-in-cs.js --username "$E2E_USERNAME" --password "$E2E_PASSWORD" --host "$E2E_HOST" --folder $TRAVIS_BUILD_NUMBER; ./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder insights --skip-lint --use-dist --timeout 10000
- stage: Test Update version 2.0.0 - stage: Test Update version 2.0.0
if: branch = development if: branch = development
env: STAGE=test-BC env: STAGE=test-BC

View File

@@ -494,8 +494,7 @@
}, },
"adf-start-process": { "adf-start-process": {
"name": "My Default Name", "name": "My Default Name",
"processDefinitionName": "My default process def name", "processDefinitionName": "My default process def name"
"defaultProcessSelected": true
}, },
"adf-process-list": { "adf-process-list": {
"presets": { "presets": {

View File

@@ -204,7 +204,6 @@
[appId]="appId" [appId]="appId"
[name]="defaultProcessName" [name]="defaultProcessName"
[processDefinitionName]="defaultProcessDefinitionName" [processDefinitionName]="defaultProcessDefinitionName"
[defaultProcessSelected]="defaultProcessSelected"
(formContentClicked)="onContentClick($event)" (formContentClicked)="onContentClick($event)"
(start)="onStartProcessInstance($event)" (start)="onStartProcessInstance($event)"
(cancel)="onCancelProcessInstance()"> (cancel)="onCancelProcessInstance()">

View File

@@ -134,7 +134,6 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
defaultProcessDefinitionName: string; defaultProcessDefinitionName: string;
defaultProcessName: string; defaultProcessName: string;
defaultProcessSelected: boolean;
activeTab: number = this.tabs.tasks; // tasks|processes|reports activeTab: number = this.tabs.tasks; // tasks|processes|reports
@@ -173,7 +172,6 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
this.defaultProcessName = this.appConfig.get<string>('adf-start-process.name'); this.defaultProcessName = this.appConfig.get<string>('adf-start-process.name');
this.defaultProcessDefinitionName = this.appConfig.get<string>('adf-start-process.processDefinitionName'); this.defaultProcessDefinitionName = this.appConfig.get<string>('adf-start-process.processDefinitionName');
this.defaultProcessSelected = this.appConfig.get<boolean>('adf-start-process.defaultProcessSelected');
// Uncomment this line to replace all 'text' field editors with custom component // Uncomment this line to replace all 'text' field editors with custom component
// formRenderingService.setComponentTypeResolver('text', () => CustomEditorComponent, true); // formRenderingService.setComponentTypeResolver('text', () => CustomEditorComponent, true);

View File

@@ -40,7 +40,6 @@ Starts a process.
| appId | `number` | (optional): Limit the list of processes which can be started to those contained in the specified app | | appId | `number` | (optional): Limit the list of processes which can be started to those contained in the specified app |
| name | `string` | (optional) name to assign to the current process | | name | `string` | (optional) name to assign to the current process |
| processDefinitionName | `string` | (optional) definition name of the process to start | | processDefinitionName | `string` | (optional) definition name of the process to start |
| defaultProcessSelected | `boolean` | (optional) make selected process the default one in process fields, true by default |
| processFilterSelector | `boolean` | (optional) Enables automatic selection of process when typing dowm in process field, true by default | | processFilterSelector | `boolean` | (optional) Enables automatic selection of process when typing dowm in process field, true by default |
| variables | [`ProcessInstanceVariable[]`](../../lib/process-services/process-list/models/process-instance-variable.model.ts) | Variables in input to the process [RestVariable](https://github.com/Alfresco/alfresco-js-api/tree/master/src/alfresco-activiti-rest-api/docs/RestVariable.md) | | variables | [`ProcessInstanceVariable[]`](../../lib/process-services/process-list/models/process-instance-variable.model.ts) | Variables in input to the process [RestVariable](https://github.com/Alfresco/alfresco-js-api/tree/master/src/alfresco-activiti-rest-api/docs/RestVariable.md) |
| values | [`FormValues`](../../lib/core/form/components/widgets/core/form-values.ts) | Parameter to pass form field values in the start form if is associated | | values | [`FormValues`](../../lib/core/form/components/widgets/core/form-values.ts) | Parameter to pass form field values in the start form if is associated |

View File

@@ -71,4 +71,21 @@ export class UploadActions {
return alfrescoJsApi.nodes.deleteNode(folderId, { permanent: true } ); return alfrescoJsApi.nodes.deleteNode(folderId, { permanent: true } );
} }
async uploadFolderFiles(alfrescoJsApi, sourcePath, folder) {
let absolutePath = '../../' + sourcePath;
let files = fs.readdirSync(path.join(__dirname, absolutePath));
let uploadedFiles;
let promises = [];
if (files && files.length > 0) {
for (const fileName of files) {
let pathFile = path.join(sourcePath, fileName);
promises.push(this.uploadFile(alfrescoJsApi, pathFile, fileName, folder));
}
uploadedFiles = await Promise.all(promises);
}
return uploadedFiles;
}
} }

View File

@@ -26,6 +26,7 @@ import AlfrescoApi = require('alfresco-js-api-node');
import FileModel = require('../models/ACS/fileModel'); import FileModel = require('../models/ACS/fileModel');
import { UploadActions } from '../actions/ACS/upload.actions'; import { UploadActions } from '../actions/ACS/upload.actions';
import Util = require('../util/util.js'); import Util = require('../util/util.js');
import { browser } from 'protractor';
describe('Permissions Component', function () { describe('Permissions Component', function () {
@@ -64,6 +65,8 @@ describe('Permissions Component', function () {
groupId = group.entry.id; groupId = group.entry.id;
browser.driver.sleep(15000); // wait search get the groups
done(); done();
}); });

View File

@@ -62,7 +62,7 @@ describe('Search Filters', () => {
loginPage.loginToContentServicesUsingUserModel(acsUser); loginPage.loginToContentServicesUsingUserModel(acsUser);
await browser.driver.sleep(15000); // wait search index previous file/folder uploaded await browser.driver.sleep(30000); // wait search index previous file/folder uploaded
searchDialog.checkSearchIconIsVisible(); searchDialog.checkSearchIconIsVisible();
searchDialog.clickOnSearchIcon(); searchDialog.clickOnSearchIcon();

View File

@@ -127,7 +127,7 @@ describe('Tag component', () => {
tagPage.insertNodeId(pdfFileModel.id); tagPage.insertNodeId(pdfFileModel.id);
tagPage.addTag(tagList[2]); tagPage.addTag(tagList[2]);
browser.driver.sleep(3000); // wait CS return tags browser.driver.sleep(5000); // wait CS return tags
tagPage.checkTagListIsOrderedAscending(); tagPage.checkTagListIsOrderedAscending();
tagPage.checkTagListByNodeIdIsOrderedAscending(); tagPage.checkTagListByNodeIdIsOrderedAscending();

View File

@@ -78,7 +78,7 @@ describe('Upload component - Excluded Files', () => {
dragAndDrop.dropFile(dragAndDropArea, iniExcludedFile.location); dragAndDrop.dropFile(dragAndDropArea, iniExcludedFile.location);
browser.driver.sleep(2000); browser.driver.sleep(5000);
uploadDialog.dialogIsNotDisplayed(); uploadDialog.dialogIsNotDisplayed();

View File

@@ -0,0 +1,363 @@
/*!
* @license
* Copyright 2016 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 TestConfig = require('../test.config');
import LoginPage = require('../pages/adf/loginPage');
import ViewerPage = require('../pages/adf/viewerPage');
import NavigationBarPage = require('../pages/adf/navigationBarPage');
import ContentServicesPage = require('../pages/adf/contentServicesPage');
import resources = require('../util/resources');
import Util = require('../util/util');
import CONSTANTS = require('../util/constants');
import FileModel = require('../models/ACS/fileModel');
import FolderModel = require('../models/ACS/folderModel');
import AcsUserModel = require('../models/ACS/acsUserModel');
import AlfrescoApi = require('alfresco-js-api-node');
import { UploadActions } from '../actions/ACS/upload.actions';
import { browser } from 'protractor';
describe('Viewer', () => {
let viewerPage = new ViewerPage();
let navigationBarPage = new NavigationBarPage();
let loginPage = new LoginPage();
let contentServicesPage = new ContentServicesPage();
let uploadActions = new UploadActions();
let site;
let acsUser = new AcsUserModel();
let pngFileUploaded;
let pngFileInfo = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
});
let archiveFolderInfo = new FolderModel({
'name': resources.Files.ADF_DOCUMENTS.ARCHIVE_FOLDER.folder_name,
'location': resources.Files.ADF_DOCUMENTS.ARCHIVE_FOLDER.folder_location
});
let excelFolderInfo = new FolderModel({
'name': resources.Files.ADF_DOCUMENTS.EXCEL_FOLDER.folder_name,
'location': resources.Files.ADF_DOCUMENTS.EXCEL_FOLDER.folder_location
});
let otherFolderInfo = new FolderModel({
'name': resources.Files.ADF_DOCUMENTS.OTHER_FOLDER.folder_name,
'location': resources.Files.ADF_DOCUMENTS.OTHER_FOLDER.folder_location
});
let pptFolderInfo = new FolderModel({
'name': resources.Files.ADF_DOCUMENTS.PPT_FOLDER.folder_name,
'location': resources.Files.ADF_DOCUMENTS.PPT_FOLDER.folder_location
});
let textFolderInfo = new FolderModel({
'name': resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_name,
'location': resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_location
});
let wordFolderInfo = new FolderModel({
'name': resources.Files.ADF_DOCUMENTS.WORD_FOLDER.folder_name,
'location': resources.Files.ADF_DOCUMENTS.WORD_FOLDER.folder_location
});
let imgFolderInfo = new FolderModel({
'name': resources.Files.ADF_DOCUMENTS.IMG_FOLDER.folder_name,
'location': resources.Files.ADF_DOCUMENTS.IMG_FOLDER.folder_location
});
beforeAll(async (done) => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: TestConfig.adf.url
});
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
site = await this.alfrescoJsApi.core.sitesApi.createSite({
title: Util.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);
pngFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileInfo.location, pngFileInfo.name, site.entry.guid);
done();
});
describe('Archive Folder Uploaded', () => {
let uploadedArchives;
let archiveFolderUploaded;
beforeAll(async (done) => {
archiveFolderUploaded = await uploadActions.uploadFolder(this.alfrescoJsApi, archiveFolderInfo.name, '-my-');
uploadedArchives = await uploadActions.uploadFolderFiles(this.alfrescoJsApi, archiveFolderInfo.location, archiveFolderUploaded.entry.id);
loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
done();
});
afterAll(async (done) => {
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, archiveFolderUploaded.entry.id);
done();
});
it('[C260517] Should be possible to open any Archive file', () => {
uploadedArchives.forEach((currentFile) => {
if (currentFile.entry.name !== '.DS_Store') {
navigationBarPage.openViewer(currentFile.entry.id);
viewerPage.checkZoomInButtonIsDisplayed(15000);
viewerPage.clickCloseButton();
contentServicesPage.checkAcsContainer();
}
});
});
});
describe('Excel Folder Uploaded', () => {
let uploadedExcels;
let excelFolderUploaded;
beforeAll(async (done) => {
excelFolderUploaded = await uploadActions.uploadFolder(this.alfrescoJsApi, excelFolderInfo.name, '-my-');
uploadedExcels = await uploadActions.uploadFolderFiles(this.alfrescoJsApi, excelFolderInfo.location, excelFolderUploaded.entry.id);
loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
done();
});
afterAll(async (done) => {
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, excelFolderUploaded.entry.id);
done();
});
it('[C280008] Should be possible to open any Excel file', () => {
uploadedExcels.forEach((currentFile) => {
if (currentFile.entry.name !== '.DS_Store') {
navigationBarPage.openViewer(currentFile.entry.id);
viewerPage.checkZoomInButtonIsDisplayed(15000);
viewerPage.clickCloseButton();
contentServicesPage.checkAcsContainer();
}
});
});
});
describe('PowerPoint Folder Uploaded', () => {
let uploadedPpts;
let pptFolderUploaded;
beforeAll(async (done) => {
pptFolderUploaded = await uploadActions.uploadFolder(this.alfrescoJsApi, pptFolderInfo.name, '-my-');
uploadedPpts = await uploadActions.uploadFolderFiles(this.alfrescoJsApi, pptFolderInfo.location, pptFolderUploaded.entry.id);
loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
done();
});
afterAll(async (done) => {
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, pptFolderUploaded.entry.id);
done();
});
it('[C280009] Should be possible to open any PowerPoint file', () => {
uploadedPpts.forEach((currentFile) => {
if (currentFile.entry.name !== '.DS_Store') {
navigationBarPage.openViewer(currentFile.entry.id);
viewerPage.checkZoomInButtonIsDisplayed(15000);
viewerPage.clickCloseButton();
contentServicesPage.checkAcsContainer();
}
});
});
});
describe('Text Folder Uploaded', () => {
let uploadedTexts;
let textFolderUploaded;
beforeAll(async (done) => {
textFolderUploaded = await uploadActions.uploadFolder(this.alfrescoJsApi, textFolderInfo.name, '-my-');
uploadedTexts = await uploadActions.uploadFolderFiles(this.alfrescoJsApi, textFolderInfo.location, textFolderUploaded.entry.id);
loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
done();
});
afterAll(async (done) => {
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, textFolderUploaded.entry.id);
done();
});
it('[C280010] Should be possible to open any Text file', () => {
uploadedTexts.forEach((currentFile) => {
if (currentFile.entry.name !== '.DS_Store') {
navigationBarPage.openViewer(currentFile.entry.id);
viewerPage.checkZoomInButtonIsDisplayed(15000);
viewerPage.clickCloseButton();
contentServicesPage.checkAcsContainer();
}
});
});
});
describe('Word Folder Uploaded', () => {
let uploadedWords;
let wordFolderUploaded;
beforeAll(async (done) => {
wordFolderUploaded = await uploadActions.uploadFolder(this.alfrescoJsApi, wordFolderInfo.name, '-my-');
uploadedWords = await uploadActions.uploadFolderFiles(this.alfrescoJsApi, wordFolderInfo.location, wordFolderUploaded.entry.id);
loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
done();
});
afterAll(async (done) => {
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, wordFolderUploaded.entry.id);
done();
});
it('[C280011] Should be possible to open any Word file', () => {
uploadedWords.forEach((currentFile) => {
if (currentFile.entry.name !== '.DS_Store') {
navigationBarPage.openViewer(currentFile.entry.id);
viewerPage.checkZoomInButtonIsDisplayed(15000);
viewerPage.clickCloseButton();
contentServicesPage.checkAcsContainer();
}
});
});
});
describe('Other Folder Uploaded', () => {
let uploadedOthers;
let otherFolderUploaded;
beforeAll(async (done) => {
otherFolderUploaded = await uploadActions.uploadFolder(this.alfrescoJsApi, otherFolderInfo.name, '-my-');
uploadedOthers = await uploadActions.uploadFolderFiles(this.alfrescoJsApi, otherFolderInfo.location, otherFolderUploaded.entry.id);
loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
done();
});
afterAll(async (done) => {
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, otherFolderUploaded.entry.id);
done();
});
it('[C280012] Should be possible to open any other Document supported extension', () => {
uploadedOthers.forEach((currentFile) => {
if (currentFile.entry.name !== '.DS_Store') {
navigationBarPage.openViewer(currentFile.entry.id);
viewerPage.checkZoomInButtonIsDisplayed(15000);
viewerPage.clickCloseButton();
contentServicesPage.checkAcsContainer();
}
});
});
});
describe('Image Folder Uploaded', () => {
let uploadedImages;
let imgFolderUploaded;
beforeAll(async (done) => {
imgFolderUploaded = await uploadActions.uploadFolder(this.alfrescoJsApi, imgFolderInfo.name, '-my-');
uploadedImages = await uploadActions.uploadFolderFiles(this.alfrescoJsApi, imgFolderInfo.location, imgFolderUploaded.entry.id);
loginPage.loginToContentServicesUsingUserModel(acsUser);
contentServicesPage.goToDocumentList();
done();
});
afterAll(async (done) => {
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, imgFolderUploaded.entry.id);
done();
});
it('[C279966] Should be possible to open any Image supported extension', () => {
uploadedImages.forEach((currentFile) => {
if (currentFile.entry.name !== '.DS_Store') {
navigationBarPage.openViewer(currentFile.entry.id);
viewerPage.checkZoomInButtonIsDisplayed(15000);
viewerPage.clickCloseButton();
contentServicesPage.checkAcsContainer();
}
});
});
});
it('[C272813] Should be redirected to site when opening and closing a file in a site', () => {
navigationBarPage.goToSite(site);
viewerPage.checkDatatableHeaderIsDisplayed();
viewerPage.viewFile(pngFileUploaded.entry.name);
viewerPage.checkImgViewerIsDisplayed();
viewerPage.clickCloseButton();
});
});

View File

@@ -136,8 +136,8 @@ describe('Content Services Viewer', () => {
contentServicesPage.checkAcsContainer(); contentServicesPage.checkAcsContainer();
viewerPage.viewFile(pdfFile.name); viewerPage.viewFile(pdfFile.name);
browser.driver.sleep(3000); // wait open file browser.driver.sleep(3000); // wait open file
viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkFileContent('1', pdfFile.firstPageText); viewerPage.checkFileContent('1', pdfFile.firstPageText);
viewerPage.checkCloseButtonIsDisplayed(); viewerPage.checkCloseButtonIsDisplayed();
@@ -153,9 +153,15 @@ describe('Content Services Viewer', () => {
viewerPage.checkZoomInButtonIsDisplayed(); viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkZoomOutButtonIsDisplayed(); viewerPage.checkZoomOutButtonIsDisplayed();
viewerPage.checkScalePageButtonIsDisplayed(); viewerPage.checkScalePageButtonIsDisplayed();
viewerPage.clickCloseButton();
}); });
it('[C260040] Should be able to change pages and zoom when .pdf file is open', () => { it('[C260040] Should be able to change pages and zoom when .pdf file is open', () => {
viewerPage.viewFile(pdfFile.name);
viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkFileContent('1', pdfFile.firstPageText);
viewerPage.clickNextPageButton(); viewerPage.clickNextPageButton();
viewerPage.checkFileContent('2', pdfFile.secondPageText); viewerPage.checkFileContent('2', pdfFile.secondPageText);
viewerPage.checkPageSelectorInputIsDisplayed('2'); viewerPage.checkPageSelectorInputIsDisplayed('2');
@@ -182,6 +188,8 @@ describe('Content Services Viewer', () => {
it('[C260042] Should be able to download, open full-screen and Info container from the Viewer', () => { it('[C260042] Should be able to download, open full-screen and Info container from the Viewer', () => {
viewerPage.viewFile(jpgFile.name); viewerPage.viewFile(jpgFile.name);
viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkImgContainerIsDisplayed(); viewerPage.checkImgContainerIsDisplayed();
viewerPage.checkFullScreenButtonIsDisplayed(); viewerPage.checkFullScreenButtonIsDisplayed();
@@ -197,6 +205,8 @@ describe('Content Services Viewer', () => {
it('[C260052] Should display image, toolbar and pagination when opening a .jpg file', () => { it('[C260052] Should display image, toolbar and pagination when opening a .jpg file', () => {
viewerPage.viewFile(jpgFile.name); viewerPage.viewFile(jpgFile.name);
viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkImgContainerIsDisplayed(); viewerPage.checkImgContainerIsDisplayed();
viewerPage.checkCloseButtonIsDisplayed(); viewerPage.checkCloseButtonIsDisplayed();
@@ -211,9 +221,16 @@ describe('Content Services Viewer', () => {
viewerPage.checkRotateLeftButtonIsDisplayed(); viewerPage.checkRotateLeftButtonIsDisplayed();
viewerPage.checkRotateRightButtonIsDisplayed(); viewerPage.checkRotateRightButtonIsDisplayed();
viewerPage.checkScaleImgButtonIsDisplayed(); viewerPage.checkScaleImgButtonIsDisplayed();
viewerPage.clickCloseButton();
}); });
it('[C260483] Should be able to zoom and rotate image when .jpg file is open', () => { it('[C260483] Should be able to zoom and rotate image when .jpg file is open', () => {
viewerPage.viewFile(jpgFile.name);
viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkPercentageIsDisplayed();
zoom = viewerPage.getZoom(); zoom = viewerPage.getZoom();
viewerPage.clickZoomInButton(); viewerPage.clickZoomInButton();
viewerPage.checkZoomedIn(zoom); viewerPage.checkZoomedIn(zoom);
@@ -234,8 +251,10 @@ describe('Content Services Viewer', () => {
viewerPage.clickCloseButton(); viewerPage.clickCloseButton();
}); });
it('[C279922] Open viewer for a .ppt file', () => { it('[C279922] Should display first page, toolbar and pagination when opening a .ppt file', () => {
viewerPage.viewFile(pptFile.name); viewerPage.viewFile(pptFile.name);
viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkFileContent('1', pptFile.firstPageText); viewerPage.checkFileContent('1', pptFile.firstPageText);
viewerPage.checkCloseButtonIsDisplayed(); viewerPage.checkCloseButtonIsDisplayed();
viewerPage.checkFileThumbnailIsDisplayed(); viewerPage.checkFileThumbnailIsDisplayed();
@@ -248,11 +267,13 @@ describe('Content Services Viewer', () => {
viewerPage.checkZoomInButtonIsDisplayed(); viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkZoomOutButtonIsDisplayed(); viewerPage.checkZoomOutButtonIsDisplayed();
viewerPage.checkScalePageButtonIsDisplayed(); viewerPage.checkScalePageButtonIsDisplayed();
viewerPage.clickCloseButton(); viewerPage.clickCloseButton();
}); });
it('[C260053] Should display first page, toolbar and pagination when opening a .docx file', () => { it('[C260053] Should display first page, toolbar and pagination when opening a .docx file', () => {
viewerPage.viewFile(docxFile.name); viewerPage.viewFile(docxFile.name);
viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkFileContent('1', docxFile.firstPageText); viewerPage.checkFileContent('1', docxFile.firstPageText);
viewerPage.checkCloseButtonIsDisplayed(); viewerPage.checkCloseButtonIsDisplayed();
@@ -266,6 +287,7 @@ describe('Content Services Viewer', () => {
viewerPage.checkZoomInButtonIsDisplayed(); viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkZoomOutButtonIsDisplayed(); viewerPage.checkZoomOutButtonIsDisplayed();
viewerPage.checkScalePageButtonIsDisplayed(); viewerPage.checkScalePageButtonIsDisplayed();
viewerPage.clickCloseButton(); viewerPage.clickCloseButton();
}); });
@@ -306,6 +328,7 @@ describe('Content Services Viewer', () => {
browser.driver.sleep(3000); // wait open file browser.driver.sleep(3000); // wait open file
viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkFileContent('1', pdfFile.firstPageText); viewerPage.checkFileContent('1', pdfFile.firstPageText);
viewerPage.checkThumbnailsBtnIsDisplayed(); viewerPage.checkThumbnailsBtnIsDisplayed();
viewerPage.clickThumbnailsBtn(); viewerPage.clickThumbnailsBtn();
@@ -328,9 +351,15 @@ describe('Content Services Viewer', () => {
viewerPage.clickThumbnailsBtn(); viewerPage.clickThumbnailsBtn();
viewerPage.checkThumbnailsCloseIsDisplayed(); viewerPage.checkThumbnailsCloseIsDisplayed();
viewerPage.clickThumbnailsClose(); viewerPage.clickThumbnailsClose();
viewerPage.clickCloseButton();
}); });
it('[C268105] Should display current thumbnail when getting to the page following the last visible thumbnail', () => { it('[C268105] Should display current thumbnail when getting to the page following the last visible thumbnail', () => {
viewerPage.viewFile(pdfFile.name);
viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkFileContent('1', pdfFile.firstPageText);
viewerPage.checkThumbnailsBtnIsDisplayed(); viewerPage.checkThumbnailsBtnIsDisplayed();
viewerPage.clickThumbnailsBtn(); viewerPage.clickThumbnailsBtn();
viewerPage.clickLastThumbnailDisplayed(); viewerPage.clickLastThumbnailDisplayed();
@@ -350,6 +379,7 @@ describe('Content Services Viewer', () => {
viewerPage.checkThumbnailsBtnIsDisabled(); viewerPage.checkThumbnailsBtnIsDisabled();
viewerPage.checkCloseButtonIsDisplayed();
viewerPage.clickCloseButton(); viewerPage.clickCloseButton();
}); });
@@ -358,6 +388,7 @@ describe('Content Services Viewer', () => {
browser.driver.sleep(3000); // wait open file browser.driver.sleep(3000); // wait open file
viewerPage.checkZoomInButtonIsDisplayed();
viewerPage.checkPasswordDialogIsDisplayed(); viewerPage.checkPasswordDialogIsDisplayed();
viewerPage.checkPasswordSubmitDisabledIsDisplayed(); viewerPage.checkPasswordSubmitDisabledIsDisplayed();
@@ -369,5 +400,7 @@ describe('Content Services Viewer', () => {
viewerPage.enterPassword(protectedFile.password); viewerPage.enterPassword(protectedFile.password);
viewerPage.clickPasswordSubmit(); viewerPage.clickPasswordSubmit();
viewerPage.checkFileContent('1', protectedFile.firstPageText); viewerPage.checkFileContent('1', protectedFile.firstPageText);
viewerPage.clickCloseButton();
}); });
}); });

View File

@@ -0,0 +1,95 @@
/*!
* @license
* Copyright 2016 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 TestConfig = require('../test.config');
import LoginPage = require('../pages/adf/loginPage');
import ViewerPage = require('../pages/adf/viewerPage');
import NavigationBarPage = require('../pages/adf/navigationBarPage');
import resources = require('../util/resources');
import FileModel = require('../models/ACS/fileModel');
import AcsUserModel = require('../models/ACS/acsUserModel');
import AlfrescoApi = require('alfresco-js-api-node');
import { UploadActions } from '../actions/ACS/upload.actions';
import SettingsPage = require('../pages/adf/settingsPage');
describe('Viewer Integration with Router', () => {
let acsUser;
let viewerPage = new ViewerPage();
let loginPage = new LoginPage();
let navigationBarPage = new NavigationBarPage();
let settingsPage = new SettingsPage();
let uploadActions = new UploadActions();
let pngFile = new FileModel({
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
});
beforeAll(async (done) => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: TestConfig.adf.url
});
done();
});
beforeEach(async (done) => {
acsUser = new AcsUserModel();
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
let pngFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, pngFile.location, pngFile.name, '-my-');
Object.assign(pngFile, pngFileUploaded.entry);
loginPage.goToLoginPage();
settingsPage.setProviderEcm();
done();
});
afterEach(() => {
this.alfrescoJsApi.nodes.deleteNode(pngFile.id);
});
it('[C260063] Should be able to open file with URL when user is logged in', () => {
loginPage.login(acsUser.id, acsUser.password);
navigationBarPage.openViewer(pngFile.id);
viewerPage.checkImgViewerIsDisplayed();
});
it('[C260061] Should be able to open file with URL when user is logged out', () => {
navigationBarPage.openViewer(pngFile.id);
loginPage.checkLoginFormIsDisplayed();
loginPage.login(acsUser.id, acsUser.password);
viewerPage.checkImgViewerIsDisplayed();
});
});

View File

@@ -49,6 +49,11 @@ var LoginPage = function () {
var header = element(by.id("adf-header")); var header = element(by.id("adf-header"));
var cardBackground = element(by.css("mat-card[class*='adf-login-card']")); var cardBackground = element(by.css("mat-card[class*='adf-login-card']"));
var adfSettingsPage = new AdfSettingsPage(); var adfSettingsPage = new AdfSettingsPage();
var loginForm = element(by.css("form[id='adf-login-form'"));
this.checkLoginFormIsDisplayed = function () {
Util.waitUntilElementIsVisible(loginForm);
};
/** /**
* Provides the longer wait required * Provides the longer wait required

View File

@@ -160,6 +160,19 @@ var NavigationBarPage = function () {
var logoTooltip = element(by.css('a[title="'+ logoTooltip +'"]')); var logoTooltip = element(by.css('a[title="'+ logoTooltip +'"]'));
Util.waitUntilElementIsVisible(logoTooltip); Util.waitUntilElementIsVisible(logoTooltip);
} }
this.openViewer = function (nodeId) {
browser.get(TestConfig.adf.url + `/files(overlay:files/${nodeId}/view`);
return this;
};
this.goToSite = function (site) {
browser.get(TestConfig.adf.url + `/files/${site.entry.guid}/display/list`);
};
this.checkContentServicesButtonIsDisplayed = function () {
Util.waitUntilElementIsVisible(contentServicesButton);
};
}; };
module.exports = NavigationBarPage; module.exports = NavigationBarPage;

View File

@@ -39,7 +39,7 @@ var FormFields = function () {
}; };
this.getWidget = function (fieldId) { this.getWidget = function (fieldId) {
var widget = element(by.css("form-field div[id='field-" + fieldId + "-container']")); var widget = element(by.css("adf-form-field div[id='field-" + fieldId + "-container']"));
Util.waitUntilElementIsVisible(widget); Util.waitUntilElementIsVisible(widget);
return widget; return widget;
}; };
@@ -119,7 +119,7 @@ var FormFields = function () {
}; };
this.checkWidgetIsReadOnlyMode = function (fieldId) { this.checkWidgetIsReadOnlyMode = function (fieldId) {
var widget = element(by.css("form-field div[id='field-" + fieldId + "-container']")); var widget = element(by.css("adf-form-field div[id='field-" + fieldId + "-container']"));
var widgetReadOnly = widget.element(by.css('div[class*="adf-readonly"]')); var widgetReadOnly = widget.element(by.css('div[class*="adf-readonly"]'));
Util.waitUntilElementIsVisible(widgetReadOnly); Util.waitUntilElementIsVisible(widgetReadOnly);
return widgetReadOnly; return widgetReadOnly;

View File

@@ -26,7 +26,7 @@ var ProcessListPage = function () {
var processListTitle = element(by.css("p[class='adf-empty-content__title']")); var processListTitle = element(by.css("p[class='adf-empty-content__title']"));
var processListSubtitle = element(by.css("p[class='adf-empty-content__subtitle']")); var processListSubtitle = element(by.css("p[class='adf-empty-content__subtitle']"));
var processDetailsMessage = element(by.css("adf-process-instance-details div[class='ng-star-inserted']")); var processDetailsMessage = element(by.css("adf-process-instance-details div[class='ng-star-inserted']"));
var openProcessDropdown = element(by.css('mat-select[aria-label="Select Process"]')); var openProcessDropdown = element(by.id('adf-select-process-dropdown'));
var selectProcessDropdown = element.all(by.css('span[class="mat-option-text"]')); var selectProcessDropdown = element.all(by.css('span[class="mat-option-text"]'));
var startProcessButton = element(by.css('button[data-automation-id="btn-start"]')); var startProcessButton = element(by.css('button[data-automation-id="btn-start"]'));

View File

@@ -16,6 +16,7 @@
*/ */
var Util = require("../../util/util"); var Util = require("../../util/util");
var CardViewPage = require("./cardViewPageComponent");
var ViewerToolbarPage = function () { var ViewerToolbarPage = function () {
@@ -54,11 +55,15 @@ var ViewerToolbarPage = function () {
var leftSideBar = element(by.id("adf-left-sidebar")); var leftSideBar = element(by.id("adf-left-sidebar"));
var unsupportedFileContainer = element(by.cssContainingText(".label", "Document preview could not be loaded")); var unsupportedFileContainer = element(by.cssContainingText(".label", "Document preview could not be loaded"));
var pageCanvas = element.all(by.css("div[class='canvasWrapper']")).first(); var pageCanvas = element.all(by.css("div[class='canvasWrapper']")).first();
var viewer = element(by.css("adf-viewer"));
var pdfViewer = element(by.css("adf-pdf-viewer"));
var imgViewer = element(by.css("adf-img-viewer"));
var activeTab = element(by.css("div[class*='mat-tab-label-active']")); var activeTab = element(by.css("div[class*='mat-tab-label-active']"));
var uploadNewVersionButton = element(by.css("input[data-automation-id='upload-single-file']")); var uploadNewVersionButton = element(by.css("input[data-automation-id='upload-single-file']"));
var rightChevron = element(by.css("div[class*='header-pagination-after']")); var rightChevron = element(by.css("div[class*='header-pagination-after']"));
var toolbarSwitch = element(by.id('adf-switch-toolbar')); var toolbarSwitch = element(by.id('adf-switch-toolbar'));
var toolbar = element(by.id('adf-viewer-toolbar')); var toolbar = element(by.id('adf-viewer-toolbar'));
var datatableHeader = element(by.css("div.adf-datatable-header"))
var goBackSwitch = element(by.id('adf-switch-goback')); var goBackSwitch = element(by.id('adf-switch-goback'));
var openWithSwitch = element(by.id('adf-switch-openwith')); var openWithSwitch = element(by.id('adf-switch-openwith'));
@@ -133,6 +138,30 @@ var ViewerToolbarPage = function () {
passwordInput.sendKeys(password); passwordInput.sendKeys(password);
}; };
this.checkDatatableHeaderIsDisplayed = function () {
Util.waitUntilElementIsVisible(datatableHeader);
}
this.checkPageCanvasIsDisplayed = function () {
Util.waitUntilElementIsVisible(pageCanvas);
};
this.checkToolbarIsDisplayed = function (timeout) {
Util.waitUntilElementIsVisible(toolbar, timeout);
};
this.checkViewerIsNotDisplayed = function () {
Util.waitUntilElementIsNotOnPage(viewer);
};
this.checkPdfViewerIsDisplayed = function () {
Util.waitUntilElementIsOnPage(pdfViewer);
};
this.checkImgViewerIsDisplayed = function () {
Util.waitUntilElementIsOnPage(imgViewer);
};
this.checkPasswordErrorIsDisplayed = function () { this.checkPasswordErrorIsDisplayed = function () {
Util.waitUntilElementIsVisible(passwordError); Util.waitUntilElementIsVisible(passwordError);
}; };
@@ -219,6 +248,10 @@ var ViewerToolbarPage = function () {
Util.waitUntilElementIsVisible(zoomInButton); Util.waitUntilElementIsVisible(zoomInButton);
}; };
this.checkZoomInButtonIsDisplayed = function (timeout) {
Util.waitUntilElementIsVisible(zoomInButton, timeout);
};
this.checkZoomInButtonIsNotDisplayed = function () { this.checkZoomInButtonIsNotDisplayed = function () {
Util.waitUntilElementIsNotVisible(zoomInButton); Util.waitUntilElementIsNotVisible(zoomInButton);
}; };
@@ -349,67 +382,68 @@ var ViewerToolbarPage = function () {
this.clickPasswordSubmit = function () { this.clickPasswordSubmit = function () {
Util.waitUntilElementIsVisible(passwordSubmit); Util.waitUntilElementIsVisible(passwordSubmit);
passwordSubmit.click(); return passwordSubmit.click();
}; };
this.clickSecondThumbnail = function () { this.clickSecondThumbnail = function () {
Util.waitUntilElementIsClickable(secondThumbnail); Util.waitUntilElementIsClickable(secondThumbnail);
secondThumbnail.click(); return secondThumbnail.click();
}; };
this.clickLastThumbnailDisplayed = function () { this.clickLastThumbnailDisplayed = function () {
Util.waitUntilElementIsClickable(lastThumbnailDisplayed); Util.waitUntilElementIsClickable(lastThumbnailDisplayed);
lastThumbnailDisplayed.click(); return lastThumbnailDisplayed.click();
}; };
this.clickThumbnailsClose = function () { this.clickThumbnailsClose = function () {
Util.waitUntilElementIsClickable(thumbnailsClose); Util.waitUntilElementIsClickable(thumbnailsClose);
thumbnailsClose.click(); return thumbnailsClose.click();
}; };
this.clickThumbnailsBtn = function () { this.clickThumbnailsBtn = function () {
Util.waitUntilElementIsVisible(thumbnailsBtn); Util.waitUntilElementIsVisible(thumbnailsBtn);
Util.waitUntilElementIsClickable(thumbnailsBtn); Util.waitUntilElementIsClickable(thumbnailsBtn);
thumbnailsBtn.click(); return thumbnailsBtn.click();
}; };
this.clickScaleImgButton = function () { this.clickScaleImgButton = function () {
Util.waitUntilElementIsClickable(scaleImg); Util.waitUntilElementIsClickable(scaleImg);
scaleImg.click(); return scaleImg.click();
}; };
this.clickScalePdfButton = function () { this.clickScalePdfButton = function () {
Util.waitUntilElementIsClickable(scalePageButton); Util.waitUntilElementIsClickable(scalePageButton);
scalePageButton.click(); return scalePageButton.click();
}; };
this.clickDownloadButton = function () { this.clickDownloadButton = function () {
Util.waitUntilElementIsVisible(downloadButton); Util.waitUntilElementIsVisible(downloadButton);
downloadButton.click(); return downloadButton.click();
}; };
this.clickCloseButton = function () { this.clickCloseButton = function () {
closeButton.click(); Util.waitUntilElementIsVisible(closeButton);
return closeButton.click();
}; };
this.clickPreviousPageButton = function () { this.clickPreviousPageButton = function () {
Util.waitUntilElementIsVisible(previousPageButton); Util.waitUntilElementIsVisible(previousPageButton);
previousPageButton.click(); return previousPageButton.click();
}; };
this.clickNextPageButton = function () { this.clickNextPageButton = function () {
Util.waitUntilElementIsVisible(nextPageButton); Util.waitUntilElementIsVisible(nextPageButton);
nextPageButton.click(); return nextPageButton.click();
}; };
this.clickZoomInButton = function () { this.clickZoomInButton = function () {
Util.waitUntilElementIsVisible(zoomInButton); Util.waitUntilElementIsVisible(zoomInButton);
zoomInButton.click(); return zoomInButton.click();
}; };
this.clickZoomOutButton = function () { this.clickZoomOutButton = function () {
Util.waitUntilElementIsVisible(zoomOutButton); Util.waitUntilElementIsVisible(zoomOutButton);
zoomOutButton.click(); return zoomOutButton.click();
}; };
this.clickScalePageButton = function () { this.clickScalePageButton = function () {
@@ -419,17 +453,17 @@ var ViewerToolbarPage = function () {
this.clickFullScreenButton = function () { this.clickFullScreenButton = function () {
Util.waitUntilElementIsClickable(fullScreenButton); Util.waitUntilElementIsClickable(fullScreenButton);
fullScreenButton.click(); return fullScreenButton.click();
}; };
this.clickRotateLeftButton = function () { this.clickRotateLeftButton = function () {
Util.waitUntilElementIsClickable(rotateLeft); Util.waitUntilElementIsClickable(rotateLeft);
rotateLeft.click(); return rotateLeft.click();
}; };
this.clickRotateRightButton = function () { this.clickRotateRightButton = function () {
Util.waitUntilElementIsClickable(rotateRight); Util.waitUntilElementIsClickable(rotateRight);
rotateRight.click(); return rotateRight.click();
}; };
this.getActiveTab = function () { this.getActiveTab = function () {

View File

@@ -61,7 +61,6 @@ describe('Attach Form Component', () => {
}); });
beforeEach(async(done) => { beforeEach(async(done) => {
let users = new UsersActions(); let users = new UsersActions();
let appsActions = new AppsActions(); let appsActions = new AppsActions();
@@ -85,7 +84,6 @@ describe('Attach Form Component', () => {
}); });
afterEach(async(done) => { afterEach(async(done) => {
await this.alfrescoJsApi.activiti.modelsApi.deleteModel(appId); await this.alfrescoJsApi.activiti.modelsApi.deleteModel(appId);
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
@@ -96,7 +94,6 @@ describe('Attach Form Component', () => {
}); });
it('[C280047] Should be able to view the attach-form component after creating a standalone task', () => { it('[C280047] Should be able to view the attach-form component after creating a standalone task', () => {
processServicesPage.goToProcessServices().goToTaskApp().clickTasksButton(); processServicesPage.goToProcessServices().goToTaskApp().clickTasksButton();
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS); taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
@@ -108,7 +105,6 @@ describe('Attach Form Component', () => {
}); });
it('[C280048] Should be able to view the attach-form component after clicking cancel button', () => { it('[C280048] Should be able to view the attach-form component after clicking cancel button', () => {
processServicesPage.goToProcessServices().goToTaskApp().clickTasksButton(); processServicesPage.goToProcessServices().goToTaskApp().clickTasksButton();
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS); taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
@@ -129,7 +125,6 @@ describe('Attach Form Component', () => {
}); });
it('[C280017] Should be able to attach a form on a standalone task and complete', () => { it('[C280017] Should be able to attach a form on a standalone task and complete', () => {
processServicesPage.goToProcessServices().goToTaskApp().clickTasksButton(); processServicesPage.goToProcessServices().goToTaskApp().clickTasksButton();
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS); taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);

View File

@@ -22,6 +22,7 @@ import ProcessServicesPage = require('../pages/adf/process_services/processServi
import ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage.js'); import ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage.js');
import AppNavigationBarPage = require('../pages/adf/process_services/appNavigationBarPage'); import AppNavigationBarPage = require('../pages/adf/process_services/appNavigationBarPage');
import AppSettingsToggles = require('../pages/adf/process_services/dialog/appSettingsToggles'); import AppSettingsToggles = require('../pages/adf/process_services/dialog/appSettingsToggles');
import FiltersPage = require('../pages/adf/process_services/filtersPage.js');
import TestConfig = require('../test.config'); import TestConfig = require('../test.config');

View File

@@ -63,7 +63,7 @@ describe('Empty Process List Test', () => {
done(); done();
}); });
it('[C260494] Should add process to list when a process is created', () => { fit('[C260494] Should add process to list when a process is created', () => {
loginPage.loginToProcessServicesUsingUserModel(user); loginPage.loginToProcessServicesUsingUserModel(user);
navigationBarPage.clickProcessServicesButton(); navigationBarPage.clickProcessServicesButton();
processServicesPage.checkApsContainer(); processServicesPage.checkApsContainer();
@@ -74,7 +74,7 @@ describe('Empty Process List Test', () => {
processFiltersPage.clickCreateProcessButton(); processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown(); processFiltersPage.clickNewProcessDropdown();
processListPage.openProcessDropdown(); processListPage.openProcessDropdown();
processListPage.selectProcessDropdown(1); processListPage.selectProcessDropdown(0);
processListPage.startProcess(); processListPage.startProcess();
expect(processFiltersPage.numberOfProcessRows()).toEqual(1); expect(processFiltersPage.numberOfProcessRows()).toEqual(1);

View File

@@ -149,66 +149,134 @@ describe('Start Task - Custom App', () => {
}); });
it('[C263947] Start task with no form', () => { it('[C263947] Start task with no form', () => {
processServicesPage.goToProcessServices().goToApp(appModel.name).clickTasksButton(); processServicesPage
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS); .goToProcessServices()
taskPage.createNewTask().addName(tasks[2]).clickStartButton() .goToApp(appModel.name)
.then(() => { .clickTasksButton();
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(tasks[2]);
taskPage.usingFormFields().noFormIsDisplayed(); taskPage
expect(taskPage.usingTaskDetails().getFormName()).toEqual(CONSTANTS.TASKDETAILS.NO_FORM); .usingFiltersPage()
}); .goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
taskPage
.createNewTask()
.addName(tasks[2])
.clickStartButton();
taskPage
.usingTasksListPage()
.checkTaskIsDisplayedInTasksList(tasks[2]);
taskPage
.usingFormFields()
.noFormIsDisplayed();
expect(taskPage.usingTaskDetails().getFormName()).toEqual(CONSTANTS.TASKDETAILS.NO_FORM);
}); });
it('[C263948] Start task buttons', () => { it('[C263948] Start task buttons', () => {
processServicesPage.goToProcessServices().goToApp(appModel.name).clickTasksButton(); processServicesPage.goToProcessServices()
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS); .goToApp(appModel.name)
taskPage.createNewTask().checkStartButtonIsDisabled().addName(tasks[3]) .clickTasksButton();
.checkStartButtonIsEnabled().clickCancelButton()
.then(() => { taskPage
taskPage.usingTasksListPage().checkTaskIsNotDisplayedInTasksList(tasks[3]); .usingFiltersPage()
expect(taskPage.usingFiltersPage().getActiveFilter()).toEqual(CONSTANTS.TASKFILTERS.MY_TASKS); .goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
});
taskPage
.createNewTask()
.checkStartButtonIsDisabled()
.addName(tasks[3])
.checkStartButtonIsEnabled()
.clickCancelButton();
taskPage.usingTasksListPage()
.checkTaskIsNotDisplayedInTasksList(tasks[3]);
expect(taskPage.usingFiltersPage().getActiveFilter()).toEqual(CONSTANTS.TASKFILTERS.MY_TASKS);
}); });
it('[C263949] Refreshing the form', () => { it('[C263949] Refreshing the form', () => {
processServicesPage.goToProcessServices().goToApp(appModel.name).clickTasksButton(); processServicesPage.goToProcessServices().goToApp(appModel.name).clickTasksButton();
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS); taskPage.usingFiltersPage()
.goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
taskPage.createNewTask() taskPage.createNewTask()
.addForm(app.formName).addName(tasks[4]).clickStartButton() .addForm(app.formName)
.then(() => { .addName(tasks[4])
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(tasks[4]); .clickStartButton();
expect(taskPage.usingFormFields().setFieldValue(by.id, formTextField, formFieldValue)
.getFieldValue(formTextField)).toEqual(formFieldValue); taskPage
taskPage.usingFormFields().refreshForm().checkFieldValue(by.id, formTextField, ''); .usingTasksListPage()
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(tasks[4]); .checkTaskIsDisplayedInTasksList(tasks[4]);
taskPage.usingFormFields().setFieldValue(by.id, formTextField, formFieldValue)
.checkFieldValue(by.id, formTextField, formFieldValue); expect(taskPage.usingFormFields()
taskPage.usingFormFields().saveForm().checkFieldValue(by.id, formTextField, formFieldValue); .setFieldValue(by.id, formTextField, formFieldValue)
}); .getFieldValue(formTextField)).toEqual(formFieldValue);
taskPage
.usingFormFields()
.refreshForm()
.checkFieldValue(by.id, formTextField, '');
taskPage
.usingTasksListPage()
.checkTaskIsDisplayedInTasksList(tasks[4]);
taskPage
.usingFormFields()
.setFieldValue(by.id, formTextField, formFieldValue)
.checkFieldValue(by.id, formTextField, formFieldValue);
taskPage
.usingFormFields()
.saveForm()
.checkFieldValue(by.id, formTextField, formFieldValue);
}); });
it('[C263951] Assign User', () => { it('[C263951] Assign User', () => {
processServicesPage.goToProcessServices().goToApp(appModel.name).clickTasksButton(); processServicesPage.goToProcessServices().goToApp(appModel.name).clickTasksButton();
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS); taskPage
taskPage.createNewTask().addName(tasks[5]).addAssignee(assigneeUserModel.firstName).clickStartButton() .usingFiltersPage()
.then(() => { .goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
taskPage.usingTasksListPage().checkTaskListIsLoaded();
taskPage.usingTasksListPage().waitForTableBody(); taskPage
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.INV_TASKS); .createNewTask()
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(tasks[5]).selectTaskFromTasksList(tasks[5]); .addName(tasks[5])
taskPage.checkTaskTitle(tasks[5]); .addAssignee(assigneeUserModel.firstName)
expect(taskPage.usingTaskDetails().getAssignee()).toEqual(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName); .clickStartButton();
});
taskPage
.usingTasksListPage()
.checkTaskListIsLoaded();
taskPage
.usingTasksListPage()
.waitForTableBody();
taskPage
.usingFiltersPage()
.goToFilter(CONSTANTS.TASKFILTERS.INV_TASKS);
taskPage.usingTasksListPage()
.checkTaskIsDisplayedInTasksList(tasks[5])
.selectTaskFromTasksList(tasks[5]);
taskPage.checkTaskTitle(tasks[5]);
expect(taskPage.usingTaskDetails().getAssignee()).toEqual(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
}); });
it('Attach a file', () => { it('Attach a file', () => {
processServicesPage.goToProcessServices().goToApp(appModel.name).clickTasksButton(); processServicesPage.goToProcessServices().goToApp(appModel.name).clickTasksButton();
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS); taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
taskPage.createNewTask().addName(tasks[6]).clickStartButton() taskPage
.then(() => { .createNewTask()
attachmentListPage.clickAttachFileButton(pngFile.location); .addName(tasks[6])
attachmentListPage.checkFileIsAttached(pngFile.name); .clickStartButton();
});
attachmentListPage.clickAttachFileButton(pngFile.location);
attachmentListPage.checkFileIsAttached(pngFile.name);
}); });
it('[C263945] Should Information box be hidden when showHeaderContent property is set on false on custom app', () => { it('[C263945] Should Information box be hidden when showHeaderContent property is set on false on custom app', () => {

View File

@@ -0,0 +1,10 @@
{\rtf1\ansi\ansicpg1252\cocoartf1561\cocoasubrtf600
{\fonttbl\f0\fswiss\fcharset0 ArialMT;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
{\info
{\author Vb1}}\paperw11905\paperh16837\margl1134\margr1134\margb1134\margt1134\vieww10800\viewh8400\viewkind0
\deftab709
\pard\pardeftab709\sb240\sa120\qc\partightenfactor0
\f0\b\fs56 \cf0 RTF test file}

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 754 KiB

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 KiB

View File

@@ -241,6 +241,34 @@ exports.Files = {
INI:{ INI:{
file_location: "/resources/adf/allFileTypes/desktop.ini", file_location: "/resources/adf/allFileTypes/desktop.ini",
file_name: "desktop.ini" file_name: "desktop.ini"
},
ARCHIVE_FOLDER: {
folder_location: "/resources/adf/allFileTypes/documents/archive",
folder_name: "archive"
},
EXCEL_FOLDER: {
folder_location: "/resources/adf/allFileTypes/documents/excel",
folder_name: "excel"
},
OTHER_FOLDER: {
folder_location: "/resources/adf/allFileTypes/documents/other",
folder_name: "other"
},
PPT_FOLDER: {
folder_location: "/resources/adf/allFileTypes/documents/ppt",
folder_name: "ppt"
},
TEXT_FOLDER: {
folder_location: "/resources/adf/allFileTypes/documents/text",
folder_name: "text"
},
WORD_FOLDER: {
folder_location: "/resources/adf/allFileTypes/documents/word",
folder_name: "word"
},
IMG_FOLDER: {
folder_location: "/resources/adf/allFileTypes/images",
folder_name: "images"
} }
}, },

View File

@@ -19,6 +19,7 @@
<ng-template let-entry="$implicit"> <ng-template let-entry="$implicit">
<mat-form-field *ngIf="!entry.row.getValue('isInherited') else show_only_label"> <mat-form-field *ngIf="!entry.row.getValue('isInherited') else show_only_label">
<mat-select id="adf-select-role-permission" <mat-select id="adf-select-role-permission"
[placeholder]="entry.data.getValue(entry.row, entry.col)"
value="{{entry.data.getValue(entry.row, entry.col)}}" value="{{entry.data.getValue(entry.row, entry.col)}}"
(selectionChange)="saveNewRole($event, entry.row.obj)"> (selectionChange)="saveNewRole($event, entry.row.obj)">
<mat-option *ngFor="let role of settableRoles" [value]="role"> <mat-option *ngFor="let role of settableRoles" [value]="role">

View File

@@ -16,8 +16,7 @@
<mat-form-field class="adf-process-input-container"> <mat-form-field class="adf-process-input-container">
<input <input
type="text" type="text"
placeholder="{{'ADF_PROCESS_LIST.START_PROCESS.FORM.TYPE_PLACEHOLDER' | translate}}" placeholder="{{'ADF_PROCESS_LIST.START_PROCESS.FORM.LABEL.TYPE'|translate}}"
aria-label="Number"
matInput matInput
[formControl]="processDefinitionInput" [formControl]="processDefinitionInput"
[matAutocomplete]="auto" [matAutocomplete]="auto"

View File

@@ -51,10 +51,6 @@ export class StartProcessInstanceComponent implements OnChanges, OnInit {
@Input() @Input()
processDefinitionName: string; processDefinitionName: string;
/** (optional) Definition name of the process to start. */
@Input()
defaultProcessSelected: boolean;
/** Variables in input to the process /** Variables in input to the process
* [RestVariable](https://github.com/Alfresco/alfresco-js-api/tree/master/src/alfresco-activiti-rest-api/docs/RestVariable.md). * [RestVariable](https://github.com/Alfresco/alfresco-js-api/tree/master/src/alfresco-activiti-rest-api/docs/RestVariable.md).
*/ */
@@ -166,17 +162,17 @@ export class StartProcessInstanceComponent implements OnChanges, OnInit {
this.processDefinitions = processDefinitionRepresentations; this.processDefinitions = processDefinitionRepresentations;
if (this.hasSingleProcessDefinition()) { if (this.hasSingleProcessDefinition()) {
if (this.processDefinitionName && this.defaultProcessSelected) { this.selectedProcessDef = this.processDefinitions[0];
this.selectedProcessDef = this.getSelectedProcess(this.processDefinitionName); } else {
this.selectedProcessDef = this.processDefinitions.find((currentProcessDefinition) => {
return currentProcessDefinition.name === this.processDefinitionName;
});
}
if (!this.selectedProcessDef.id) { if (this.selectedProcessDef) {
this.selectedProcessDef = this.processDefinitions[0]; if (this.processDefinitionInput) {
} this.processDefinitionInput.setValue(this.selectedProcessDef.name);
} else {
this.selectedProcessDef = this.processDefinitions[0];
} }
this.processDefinitionInput.setValue(this.selectedProcessDef.name);
} }
}, },
() => { () => {