mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
[ADF-3384] Create automated tests for Version Component (#3631)
* fix version component restore and delete event * version manager actions * fix test * fix unit test * remove fdescribe * fix tslint * fix screenshot rewrite problem * remove fdescribe * multi instance try * remove fdescribe * try uncomment some test * error page * fix user preferences pagiantion * search page test include * fix type tslint e2e * restore code * default lang momentadapter * fix test * [ADF-3384] removed console log from test * [ADF-3384] adding some fixes for tests and code * [ADF-3384] fixed some test and code
This commit is contained in:
parent
17074478e2
commit
a12662e7e2
@ -20,7 +20,9 @@
|
||||
"ALLOW_DELETE": "Allow delete",
|
||||
"SHOW_COMMENTS": "Show comments on versions",
|
||||
"ALLOW_DOWNLOAD": "Enable version download",
|
||||
"READ_ONLY": "Read-only"
|
||||
"READ_ONLY": "Read-only",
|
||||
"ALLOW_DOWNLOAD": "Allow Download",
|
||||
"COMMENTS": "Show comments"
|
||||
},
|
||||
"PERSONAL-FILES": "Personal Files",
|
||||
"WARN-MULTIPLE-UPLOADS": "Display warning for multiple uploads.",
|
||||
|
@ -72,7 +72,9 @@
|
||||
"options": [
|
||||
{ "key": "name", "label": "Name", "type": "FIELD", "field": "cm:name", "ascending": true },
|
||||
{ "key": "content.sizeInBytes", "label": "Size", "type": "FIELD", "field": "content.size", "ascending": true },
|
||||
{ "key": "description", "label": "Description", "type": "FIELD", "field": "cm:description", "ascending": true }
|
||||
{ "key": "description", "label": "Description", "type": "FIELD", "field": "cm:description", "ascending": true },
|
||||
{ "key": "createdByUser", "label": "Author", "type": "FIELD", "field": "cm:creator", "ascending": true },
|
||||
{ "key": "createdAt", "label": "Created", "type": "FIELD", "field": "cm:created", "ascending": true }
|
||||
],
|
||||
"defaults": [
|
||||
{ "key": "name", "type": "FIELD", "field": "cm:name", "ascending": true }
|
||||
@ -194,7 +196,7 @@
|
||||
]
|
||||
},
|
||||
"pagination": {
|
||||
"size": 25,
|
||||
"size": 20,
|
||||
"supportedPageSizes": [ 5, 10, 15, 20 ]
|
||||
},
|
||||
"files": {
|
||||
|
@ -7,3 +7,14 @@
|
||||
<button mat-raised-button id="adf-metadata-clear" (click)="onClearMetadata()" color="primary">Clear metadata configuration</button>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<h2>Search App config editor</h2>
|
||||
|
||||
<ngx-monaco-editor id="adf-search-editor" class="adf-search-editor" [options]="editorOptions" [(ngModel)]="searchConf" (onInit)="onInitSearch($event)" ></ngx-monaco-editor>
|
||||
|
||||
<button mat-raised-button id="adf-search-save" (click)="onSaveSearch()" color="primary">Save Search configuration</button>
|
||||
<button mat-raised-button id="adf-search-clear" (click)="onClearSearch()" color="primary">Clear Search configuration</button>
|
||||
|
||||
<br>
|
||||
|
@ -26,6 +26,7 @@ import { AppConfigService, NotificationService } from '@alfresco/adf-core';
|
||||
export class ConfigEditorComponent {
|
||||
|
||||
editor: any;
|
||||
editorSearch: any;
|
||||
|
||||
editorOptions = {
|
||||
theme: 'vs-dark',
|
||||
@ -36,6 +37,7 @@ export class ConfigEditorComponent {
|
||||
};
|
||||
|
||||
metadataConf: string;
|
||||
searchConf: string;
|
||||
|
||||
onInitMetadata(editor) {
|
||||
this.editor = editor;
|
||||
@ -44,8 +46,16 @@ export class ConfigEditorComponent {
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
onInitSearch(editor) {
|
||||
this.editorSearch = editor;
|
||||
setTimeout(() => {
|
||||
this.editorSearch.getAction('editor.action.formatDocument').run();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
constructor(private appConfig: AppConfigService, private notificationService: NotificationService) {
|
||||
this.metadataConf = JSON.stringify(appConfig.config['content-metadata']);
|
||||
this.searchConf = JSON.stringify(appConfig.config['search']);
|
||||
}
|
||||
|
||||
onSaveMetadata() {
|
||||
@ -59,7 +69,22 @@ export class ConfigEditorComponent {
|
||||
}
|
||||
}
|
||||
|
||||
onSaveSearch() {
|
||||
try {
|
||||
this.appConfig.config['search'] = JSON.parse(this.editor.getValue());
|
||||
} catch (error) {
|
||||
this.notificationService.openSnackMessage(
|
||||
'Wrong sSearch configuration',
|
||||
4000
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
onClearMetadata() {
|
||||
this.metadataConf = '';
|
||||
}
|
||||
|
||||
onClearSearch() {
|
||||
this.searchConf = '';
|
||||
}
|
||||
}
|
||||
|
@ -380,7 +380,6 @@
|
||||
*ngIf="!infiniteScrolling"
|
||||
class="adf-documentlist-pagination"
|
||||
[target]="documentList"
|
||||
[supportedPageSizes]="supportedPages"
|
||||
(changePageSize)="onChangePageSize($event)"
|
||||
(changePageNumber)="onChangePageNumber($event)"
|
||||
(nextPage)="onNextPage($event)"
|
||||
@ -397,7 +396,7 @@
|
||||
<adf-info-drawer-layout *ngIf="showVersions" class="adf-manage-versions-sidebar" fxFlex="0 0 auto">
|
||||
<div info-drawer-content>
|
||||
|
||||
<adf-info-drawer [title]="'Details'">
|
||||
<adf-info-drawer [title]="'Details'" *ngIf="documentList.selection[0]" >
|
||||
<adf-info-drawer-tab [label]="'Properties'">
|
||||
<adf-content-metadata-card
|
||||
[node]="documentList.selection[0].entry">
|
||||
|
@ -28,7 +28,7 @@ import {
|
||||
AlfrescoApiService, AuthenticationService, AppConfigService, AppConfigValues, ContentService, TranslationService,
|
||||
FileUploadEvent, FolderCreatedEvent, LogService, NotificationService,
|
||||
UploadService, DataColumn, DataRow, UserPreferencesService,
|
||||
PaginationComponent, FormValues, DisplayMode, UserPreferenceValues, InfinitePaginationComponent
|
||||
PaginationComponent, FormValues, DisplayMode, InfinitePaginationComponent
|
||||
} from '@alfresco/adf-core';
|
||||
|
||||
import {
|
||||
@ -177,7 +177,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
|
||||
permissionsStyle: PermissionStyleModel[] = [];
|
||||
infiniteScrolling: boolean;
|
||||
supportedPages: number[];
|
||||
currentSiteid = '';
|
||||
warnOnMultipleUploads = false;
|
||||
thumbnails = false;
|
||||
@ -201,10 +200,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
@Optional() private route: ActivatedRoute,
|
||||
public authenticationService: AuthenticationService,
|
||||
public alfrescoApiService: AlfrescoApiService) {
|
||||
this.preference.select(UserPreferenceValues.SupportedPageSizes)
|
||||
.subscribe((pages) => {
|
||||
this.supportedPages = pages;
|
||||
});
|
||||
|
||||
this.alfrescoApiService.nodeUpdated.subscribe(() => {
|
||||
this.documentList.reload();
|
||||
@ -255,7 +250,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
this.contentService.folderCreated.subscribe(value => this.onFolderCreated(value));
|
||||
this.onCreateFolder = this.contentService.folderCreate.subscribe(value => this.onFolderAction(value));
|
||||
this.onEditFolder = this.contentService.folderEdit.subscribe(value => this.onFolderAction(value));
|
||||
this.supportedPages = this.supportedPages ? this.supportedPages : this.preference.getDefaultPageSizes();
|
||||
|
||||
// this.permissionsStyle.push(new PermissionStyleModel('document-list__create', PermissionsEnum.CREATE));
|
||||
// this.permissionsStyle.push(new PermissionStyleModel('document-list__disable', PermissionsEnum.NOT_CREATE, false, true));
|
||||
|
@ -1,11 +1,23 @@
|
||||
<header mat-dialog-title>{{'VERSION.DIALOG.TITLE' | translate}}</header>
|
||||
|
||||
<section>
|
||||
<mat-slide-toggle color="primary" [(ngModel)]="readOnly">
|
||||
<mat-slide-toggle id="adf-version-manager-switch-readonly" color="primary" [(ngModel)]="readOnly">
|
||||
{{'APP.ADF_VERSION_MANAGER.READ_ONLY' | translate}}
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<mat-slide-toggle id="adf-version-manager-switch-download"color="primary" [(ngModel)]="allowDownload">
|
||||
{{'APP.ADF_VERSION_MANAGER.ALLOW_DOWNLOAD' | translate}}
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<mat-slide-toggle id="adf-version-manager-switch-comments" color="primary" [(ngModel)]="showComments">
|
||||
{{'APP.ADF_VERSION_MANAGER.COMMENTS' | translate}}
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
|
||||
<section mat-dialog-content *ngIf="!readOnly">
|
||||
<adf-version-manager [node]="contentEntry" [allowDownload]="allowDownload" [showComments]="showComments" (uploadError)="uploadError($event)"></adf-version-manager>
|
||||
</section>
|
||||
|
@ -72,6 +72,10 @@ export class NotificationsComponent implements OnInit {
|
||||
}
|
||||
|
||||
setSnackBarConfig(configFormValues: any) {
|
||||
|
||||
if (configFormValues.announcementMessage) {
|
||||
this.snackBarConfig.announcementMessage = configFormValues.announcementMessage;
|
||||
}
|
||||
if (configFormValues.direction) {
|
||||
this.snackBarConfig.direction = configFormValues.direction;
|
||||
|
||||
@ -109,7 +113,6 @@ export class NotificationsComponent implements OnInit {
|
||||
"duration": "${this.snackBarConfig.duration}",
|
||||
"horizontalPosition": "${ this.snackBarConfig.horizontalPosition}",
|
||||
"verticalPosition": "${ this.snackBarConfig.verticalPosition}"}`;
|
||||
|
||||
if (this.message) {
|
||||
if (this.withAction) {
|
||||
this.notificationService
|
||||
|
@ -59,7 +59,6 @@
|
||||
*ngIf="taskList"
|
||||
[target]="taskList"
|
||||
(changePageSize)="onChangePageSize($event)"
|
||||
[supportedPageSizes]="supportedPages"
|
||||
#taskListPagination>
|
||||
</adf-pagination>
|
||||
</div>
|
||||
@ -157,7 +156,6 @@
|
||||
*ngIf="processList"
|
||||
[target]="processList"
|
||||
(changePageSize)="onChangePageSize($event)"
|
||||
[supportedPageSizes]="supportedPages"
|
||||
#processListPagination>
|
||||
</adf-pagination>
|
||||
</div>
|
||||
|
@ -127,8 +127,6 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
|
||||
paginationPageSize = 0;
|
||||
processSchemaColumns: any[] = [];
|
||||
|
||||
supportedPages: number[];
|
||||
|
||||
defaultProcessDefinitionName: string;
|
||||
defaultProcessName: string;
|
||||
|
||||
@ -225,7 +223,6 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
|
||||
this.currentProcessInstanceId = null;
|
||||
});
|
||||
this.layoutType = AppsListComponent.LAYOUT_GRID;
|
||||
this.supportedPages = this.preferenceService.getDefaultPageSizes();
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
|
@ -91,7 +91,6 @@
|
||||
|
||||
</adf-document-list>
|
||||
<adf-pagination [ngClass]="{ 'no-border' : documentList.isEmpty()}"
|
||||
[supportedPageSizes]="supportedPages"
|
||||
[target]="documentList">
|
||||
</adf-pagination>
|
||||
</div>
|
||||
|
@ -37,7 +37,6 @@ export class TrashcanComponent {
|
||||
@ViewChild('documentList')
|
||||
documentList: DocumentListComponent;
|
||||
|
||||
supportedPages = [];
|
||||
currentLocale;
|
||||
|
||||
constructor(
|
||||
@ -45,12 +44,6 @@ export class TrashcanComponent {
|
||||
private router: Router,
|
||||
private notificationService: NotificationService
|
||||
) {
|
||||
this.preference
|
||||
.select(UserPreferenceValues.SupportedPageSizes)
|
||||
.subscribe(pages => {
|
||||
this.supportedPages = pages;
|
||||
});
|
||||
|
||||
this.preference
|
||||
.select(UserPreferenceValues.Locale)
|
||||
.subscribe(locale => {
|
||||
|
@ -26,6 +26,13 @@ Displays the version history of a node in a [Version Manager component](../conte
|
||||
| showActions | `boolean` | true | Toggles showing/hiding of version actions |
|
||||
| showComments | `boolean` | true | Toggles showing/hiding of comments |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| deleted | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>` | Emitted when a version is deleted |
|
||||
| restored | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>` | Emitted when a version is restored |
|
||||
|
||||
## Details
|
||||
|
||||
This component is used by the [Version Manager component](../content-services/version-manager.component.md) to
|
||||
|
@ -36,8 +36,8 @@ Displays the version history of a node with the ability to upload a new version.
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| uploadError | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Object>` | Emitted when an error occurs during upload. |
|
||||
| uploadSuccess | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Object>` | Emitted when a file is uploaded successfully. |
|
||||
| uploadError | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>` | Emitted when an error occurs during upload. |
|
||||
| uploadSuccess | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>` | Emitted when a file is uploaded successfully. |
|
||||
|
||||
## Details
|
||||
|
||||
|
@ -30,6 +30,7 @@ of components organized by ADF libraries.
|
||||
- [Buttons menu component](core/buttons-menu.component.md)
|
||||
- [Empty content component](core/empty-content.component.md)
|
||||
- [Error content component](core/error-content.component.md)
|
||||
- [Header component](core/header.component.md)
|
||||
- [Info drawer tab component](core/info-drawer-tab.component.md)
|
||||
- [Node permission dialog service](content-services/node-permission-dialog.service.md)
|
||||
- [Search check list component](content-services/search-check-list.component.md)
|
||||
@ -129,6 +130,7 @@ of components organized by ADF libraries.
|
||||
- [App config service](core/app-config.service.md)
|
||||
- [Apps list component](process-services/apps-list.component.md)
|
||||
- [Apps process service](core/apps-process.service.md)
|
||||
- [Attach form component](process-services/attach-form.component.md)
|
||||
- [Auth guard bpm service](core/auth-guard-bpm.service.md)
|
||||
- [Auth guard ecm service](core/auth-guard-ecm.service.md)
|
||||
- [Auth guard service](core/auth-guard.service.md)
|
||||
|
28
e2e/actions/ACS/node.actions.ts
Normal file
28
e2e/actions/ACS/node.actions.ts
Normal file
@ -0,0 +1,28 @@
|
||||
/*!
|
||||
* @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.
|
||||
*/
|
||||
|
||||
export class NodeActions {
|
||||
|
||||
lockNode(alfrescoJsApi, nodeId: string, allowOwner?: string) {
|
||||
|
||||
return alfrescoJsApi.nodes.lockNode(nodeId, {
|
||||
'type': allowOwner ? 'ALLOW_OWNER_CHANGES' : 'FULL',
|
||||
'lifetime': 'PERSISTENT'
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @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 path = require('path');
|
||||
import fs = require('fs');
|
||||
import TestConfig = require('../../test.config');
|
||||
|
@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @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 path = require('path');
|
||||
import fs = require('fs');
|
||||
import TestConfig = require('../../test.config');
|
||||
@ -42,7 +59,7 @@ export class AppsActions {
|
||||
return appCreated;
|
||||
}
|
||||
|
||||
async startProcess(alfrescoJsApi, app, processName) {
|
||||
async startProcess(alfrescoJsApi, app, processName?: string) {
|
||||
|
||||
let appDefinitionsList = await alfrescoJsApi.activiti.appsApi.getAppDefinitions();
|
||||
|
||||
@ -52,7 +69,7 @@ export class AppsActions {
|
||||
|
||||
let processDefinitionList = await alfrescoJsApi.activiti.processApi.getProcessDefinitions({ deploymentId: appDefinition.deploymentId });
|
||||
|
||||
let startProcessOptions = { processDefinitionId: processDefinitionList.data[0].id };
|
||||
let startProcessOptions: any = { processDefinitionId: processDefinitionList.data[0].id };
|
||||
|
||||
if (typeof processName !== 'undefined') {
|
||||
startProcessOptions.name = processName;
|
||||
|
@ -1,5 +1,19 @@
|
||||
import TestConfig = require('../../test.config');
|
||||
import AppPublish = require('../../models/APS/AppPublish');
|
||||
/*!
|
||||
* @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.
|
||||
*/
|
||||
|
||||
export class ModelsActions {
|
||||
|
||||
|
@ -1,3 +1,23 @@
|
||||
/*!
|
||||
* @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.
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import fs = require('fs');
|
||||
import path = require('path');
|
||||
import TestConfig = require('../test.config');
|
||||
@ -15,7 +35,7 @@ let JS_BIND_INPUT = function (target) {
|
||||
let data = { files: input.files };
|
||||
|
||||
['dragenter', 'dragover', 'drop'].forEach(function (name) {
|
||||
let mouseEvent = document.createEvent('MouseEvent');
|
||||
let mouseEvent: any = document.createEvent('MouseEvent');
|
||||
mouseEvent.initMouseEvent(name, !0, !0, window, 0, 0, 0, x, y, !1, !1, !1, !1, 0, null);
|
||||
mouseEvent.dataTransfer = data;
|
||||
target.dispatchEvent(mouseEvent);
|
||||
@ -32,7 +52,7 @@ let JS_BIND_INPUT_FOLDER = function (target) {
|
||||
let input = document.createElement('input');
|
||||
input.type = 'file';
|
||||
input.style.display = 'none';
|
||||
input.multiple = 'multiple';
|
||||
input.multiple = true;
|
||||
input.webkitdirectory = true;
|
||||
input.addEventListener('change', function (event) {
|
||||
target.scrollIntoView(true);
|
||||
@ -43,7 +63,7 @@ let JS_BIND_INPUT_FOLDER = function (target) {
|
||||
let data = { files: input.files };
|
||||
|
||||
['dragenter', 'dragover', 'drop'].forEach(function (name) {
|
||||
let mouseEvent = document.createEvent('MouseEvent');
|
||||
let mouseEvent: any = document.createEvent('MouseEvent');
|
||||
mouseEvent.initMouseEvent(name, !0, !0, window, 0, 0, 0, x, y, !1, !1, !1, !1, 0, null);
|
||||
mouseEvent.dataTransfer = data;
|
||||
target.dispatchEvent(mouseEvent);
|
||||
@ -61,9 +81,9 @@ export class DropActions {
|
||||
dropFile(dropArea, filePath) {
|
||||
let absolutePath = path.resolve(path.join(TestConfig.main.rootPath, filePath));
|
||||
|
||||
fs.accessSync(absolutePath, fs.F_OK);
|
||||
fs.accessSync(absolutePath, fs.constants.F_OK);
|
||||
return dropArea.getWebElement().then((element) => {
|
||||
browser.executeScript(JS_BIND_INPUT, element).then((input) => {
|
||||
browser.executeScript(JS_BIND_INPUT, element).then((input: any) => {
|
||||
input.sendKeys(absolutePath);
|
||||
|
||||
});
|
||||
@ -72,10 +92,10 @@ export class DropActions {
|
||||
|
||||
dropFolder(dropArea, folderPath) {
|
||||
let absolutePath = path.resolve(path.join(TestConfig.main.rootPath, folderPath));
|
||||
fs.accessSync(absolutePath, fs.F_OK);
|
||||
fs.accessSync(absolutePath, fs.constants.F_OK);
|
||||
|
||||
return dropArea.getWebElement().then((element) => {
|
||||
browser.executeScript(JS_BIND_INPUT_FOLDER, element).then((input) => {
|
||||
browser.executeScript(JS_BIND_INPUT_FOLDER, element).then((input: any) => {
|
||||
input.sendKeys(absolutePath);
|
||||
|
||||
});
|
||||
|
@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @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 Tenant = require('../models/APS/Tenant');
|
||||
import User = require('../models/APS/User');
|
||||
import TestConfig = require('../test.config');
|
||||
|
@ -25,7 +25,6 @@ import FileModel = require('../../models/ACS/fileModel');
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
import dateFormat = require('dateformat');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
@ -43,7 +42,7 @@ describe('Comment Component', () => {
|
||||
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
|
||||
});
|
||||
|
||||
let uploadActions = new UploadActions();
|
||||
let nodeId, userFullName;
|
||||
|
||||
let comments = {
|
||||
@ -73,8 +72,6 @@ describe('Comment Component', () => {
|
||||
|
||||
beforeEach(async (done) => {
|
||||
|
||||
let uploadActions = new UploadActions();
|
||||
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
|
||||
let pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, '-my-');
|
||||
@ -94,11 +91,7 @@ describe('Comment Component', () => {
|
||||
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
await this.alfrescoJsApi.core.nodesApi.deleteNode(nodeId, {'permanent': true}).then(function() {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, nodeId);
|
||||
|
||||
done();
|
||||
});
|
||||
|
@ -15,6 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
import ContentServicesPage = require('../pages/adf/contentServicesPage');
|
||||
import NavigationBarPage = require('../pages/adf/navigationBarPage');
|
||||
@ -24,7 +26,7 @@ import resources = require('../util/resources');
|
||||
import Util = require('../util/util');
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../actions/ACS/upload.actions';
|
||||
import ErrorPage = require('../pages/adf/documentListErrorPage');
|
||||
import ErrorPage = require('../pages/adf/errorPage');
|
||||
import FileModel = require('../models/ACS/fileModel');
|
||||
import moment from 'moment-es6';
|
||||
import { browser } from '../../node_modules/protractor';
|
||||
@ -95,18 +97,19 @@ describe('Document List Component', () => {
|
||||
expect(errorPage.getErrorDescription()).toBe('You\'re not allowed access to this resource on the server.');
|
||||
});
|
||||
|
||||
xit('[C279924] - Custom error message is displayed', () => {
|
||||
it('[C279924] - Custom error message is displayed', () => {
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.enableCustomPermissionMessage();
|
||||
browser.get(TestConfig.adf.url + '/files/' + privateSite.entry.guid);
|
||||
expect(errorPage.getErrorCode()).toBe('Cris you don\'t have permissions');
|
||||
expect(errorPage.getErrorCode()).toBe('403');
|
||||
});
|
||||
|
||||
it('[C279925] - Message is translated', () => {
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
navBar.openLanguageMenu();
|
||||
navBar.chooseLanguage('Italian');
|
||||
browser.sleep(2000);
|
||||
browser.get(TestConfig.adf.url + '/files/' + privateSite.entry.guid);
|
||||
expect(errorPage.getErrorDescription()).toBe('Accesso alla risorsa sul server non consentito.');
|
||||
});
|
||||
|
@ -55,7 +55,7 @@ describe('Document List - Pagination', function () {
|
||||
|
||||
let acsUser = new AcsUserModel();
|
||||
let newFolderModel = new FolderModel({ 'name': 'newFolder' });
|
||||
let fileNames = [], nrOfFiles = 20, currentPage = 1, secondSetOfFiles, secondSetNumber = 25;
|
||||
let fileNames = [], nrOfFiles = 20, currentPage = 1, secondSetOfFiles, secondSetNumber = 20;
|
||||
let folderTwoModel = new FolderModel({ 'name': 'folderTwo' });
|
||||
let folderThreeModel = new FolderModel({ 'name': 'folderThree' });
|
||||
|
||||
@ -93,7 +93,7 @@ describe('Document List - Pagination', function () {
|
||||
contentServicesPage.navigateToFolder(newFolderModel.name);
|
||||
contentServicesPage.checkAcsContainer();
|
||||
contentServicesPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.default);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfFiles + ' of ' + nrOfFiles);
|
||||
expect(contentServicesPage.numberOfResultsDisplayed()).toBe(nrOfFiles);
|
||||
contentServicesPage.getAllRowsNameColumn().then(function (list) {
|
||||
|
@ -15,6 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
import SearchDialog = require('../pages/adf/dialog/searchDialog');
|
||||
import ContentServicesPage = require('../pages/adf/contentServicesPage');
|
||||
@ -26,7 +28,6 @@ import FileModel = require('../models/ACS/fileModel');
|
||||
import FolderModel = require('../models/ACS/folderModel');
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
import Util = require('../util/util');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
@ -201,6 +202,7 @@ describe('Search component - Search Bar', () => {
|
||||
|
||||
it('[C272802] Existing folder is displayed in search page', () => {
|
||||
searchDialog.clickOnSearchIcon();
|
||||
browser.driver.sleep(1000);
|
||||
searchDialog.enterTextAndPressEnter(firstFolderModel.name);
|
||||
searchResultPage.checkContentIsDisplayed(firstFolderModel.name);
|
||||
});
|
||||
@ -219,6 +221,7 @@ describe('Search component - Search Bar', () => {
|
||||
.clickOnSearchIcon()
|
||||
.enterText(secondFolder.shortName)
|
||||
.pressDownArrowAndEnter();
|
||||
searchDialog.pressDownArrowAndEnter();
|
||||
|
||||
contentServicesPage.checkAcsContainer();
|
||||
expect(contentServicesPage.currentFolderName()).toEqual(secondFolder.name);
|
||||
|
@ -15,6 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
import SearchDialog = require('../pages/adf/dialog/searchDialog');
|
||||
import ContentServicesPage = require('../pages/adf/contentServicesPage');
|
||||
@ -35,9 +37,9 @@ import { UploadActions } from '../actions/ACS/upload.actions';
|
||||
describe('Search component - Search Page', () => {
|
||||
let search = {
|
||||
active: {
|
||||
firstFile: null,
|
||||
secondFile: null,
|
||||
base: Util.generateRandomString(3),
|
||||
firstFile: Util.generateRandomString(),
|
||||
secondFile: Util.generateRandomString(),
|
||||
extension: '.txt'
|
||||
},
|
||||
no_permission: {
|
||||
@ -52,17 +54,22 @@ describe('Search component - Search Page', () => {
|
||||
let searchResultPage = new SearchResultPage();
|
||||
|
||||
let acsUser = new AcsUserModel();
|
||||
let emptyFolderModel = new FolderModel({ 'name': Util.generateRandomString()});
|
||||
let firstFileModel = new FileModel({
|
||||
'name': search.active.firstFile,
|
||||
'location': resources.Files.ADF_DOCUMENTS.TXT.file_location
|
||||
});
|
||||
let emptyFolderModel = new FolderModel({ 'name': Util.generateRandomString() });
|
||||
let firstFileModel;
|
||||
let newFolderModel = new FolderModel({ 'name': 'newFolder' });
|
||||
let fileNames = [], adminFileNames = [], nrOfFiles = 15, adminNrOfFiles = 5;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
fileNames = Util.generateSeqeunceFiles(1, nrOfFiles, search.active.base, search.active.extension);
|
||||
adminFileNames = Util.generateSeqeunceFiles(nrOfFiles + 1, nrOfFiles + adminNrOfFiles, search.active.base, search.active.extension);
|
||||
search.active.firstFile = fileNames[0];
|
||||
search.active.secondFile = fileNames[1];
|
||||
fileNames.splice(0, 1);
|
||||
|
||||
firstFileModel = new FileModel({
|
||||
'name': search.active.firstFile,
|
||||
'location': resources.Files.ADF_DOCUMENTS.TXT.file_location
|
||||
});
|
||||
|
||||
let uploadActions = new UploadActions();
|
||||
|
||||
@ -82,8 +89,7 @@ describe('Search component - Search Page', () => {
|
||||
|
||||
await uploadActions.createEmptyFiles(this.alfrescoJsApi, fileNames, newFolderModelUploaded.entry.id);
|
||||
|
||||
let firstFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, firstFileModel.location, firstFileModel.name, '-my-');
|
||||
Object.assign(firstFileModel, firstFileUploaded.entry);
|
||||
await uploadActions.uploadFile(this.alfrescoJsApi, firstFileModel.location, firstFileModel.name, '-my-');
|
||||
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
@ -197,7 +203,6 @@ describe('Search component - Search Page', () => {
|
||||
.checkSearchIconIsVisible()
|
||||
.clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search.active.base);
|
||||
|
||||
searchResultPage.checkContentIsDisplayed(search.active.secondFile);
|
||||
searchResultPage.sortAndCheckListIsOrderedByName(true).then((result) => {
|
||||
expect(result).toEqual(true);
|
||||
@ -273,8 +278,11 @@ describe('Search component - Search Page', () => {
|
||||
|
||||
it('[C272808] Try to delete a folder without rights from the Search Results Page', () => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
searchDialog.checkSearchBarIsNotVisible().checkSearchIconIsVisible().clickOnSearchIcon()
|
||||
.enterTextAndPressEnter(search.no_permission.noPermFolder);
|
||||
searchDialog.checkSearchBarIsNotVisible();
|
||||
searchDialog.checkSearchIconIsVisible();
|
||||
searchDialog.clickOnSearchIcon();
|
||||
searchDialog.enterTextAndPressEnter(search.no_permission.noPermFolder);
|
||||
|
||||
searchResultPage.checkContentIsDisplayed(search.no_permission.noPermFolder);
|
||||
searchResultPage.deleteContent(search.no_permission.noPermFolder);
|
||||
searchResultPage.checkContentIsDisplayed(search.no_permission.noPermFolder);
|
||||
|
@ -23,7 +23,6 @@ import TagPage = require('../pages/adf/tagPage');
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
import Util = require('../util/util');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../actions/ACS/upload.actions';
|
||||
|
@ -15,6 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, browser } from 'protractor';
|
||||
|
||||
import LoginPage = require('../../pages/adf/loginPage');
|
||||
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
|
||||
import UploadDialog = require('../../pages/adf/dialog/uploadDialog');
|
||||
@ -30,8 +32,6 @@ import resources = require('../../util/resources');
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { DropActions } from '../../actions/drop.actions';
|
||||
|
||||
import path = require('path');
|
||||
|
||||
describe('Upload component - Excluded Files', () => {
|
||||
|
||||
let contentServicesPage = new ContentServicesPage();
|
||||
|
@ -15,6 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, browser } from 'protractor';
|
||||
|
||||
import LoginPage = require('../../pages/adf/loginPage');
|
||||
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
|
||||
import UploadDialog = require('../../pages/adf/dialog/uploadDialog');
|
||||
@ -187,10 +189,11 @@ describe('Upload component', () => {
|
||||
contentServicesPage.checkContentIsNotDisplayed(pdfFileModel.name);
|
||||
});
|
||||
|
||||
xit('[C272792] Cancel a big file through the upload dialog icon before the upload to be done', () => {
|
||||
contentServicesPage.uploadFile(largeFile.location);
|
||||
it('[C272792] Cancel a big file through the upload dialog icon before the upload to be done', () => {
|
||||
browser.executeScript(' setTimeout(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
|
||||
'document.querySelector("#adf-upload-dialog-cancel").click(); }, 5000)');
|
||||
|
||||
uploadDialog.removeFileWhileUploading(largeFile.name).fileIsCancelled(largeFile.name);
|
||||
contentServicesPage.uploadFile(largeFile.location);
|
||||
|
||||
expect(uploadDialog.getTitleText()).toEqual('Upload canceled');
|
||||
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
|
||||
@ -199,7 +202,6 @@ describe('Upload component', () => {
|
||||
|
||||
xit('[C260169] Cancel a big file through the cancel uploads button', () => {
|
||||
contentServicesPage.uploadFile(largeFile.location);
|
||||
uploadDialog.cancelUploads();
|
||||
expect(uploadDialog.getTitleText()).toEqual('Uploading 0 / 1');
|
||||
expect(uploadDialog.getConfirmationDialogTitleText()).toEqual('Cancel Upload');
|
||||
expect(uploadDialog.getConfirmationDialogDescriptionText()).toEqual('Stop uploading and remove files already uploaded.');
|
||||
@ -224,22 +226,27 @@ describe('Upload component', () => {
|
||||
|
||||
it('[C272794] Tooltip of uploading multiple files button', () => {
|
||||
uploadToggles.enableMultipleFileUpload();
|
||||
browser.driver.sleep(1000);
|
||||
expect(contentServicesPage.getMultipleFileButtonTooltip()).toEqual('Custom tooltip');
|
||||
uploadToggles.disableMultipleFileUpload();
|
||||
});
|
||||
|
||||
it('[C260171] Should upload only the extension filter allowed when Enable extension filter is enabled', () => {
|
||||
uploadToggles.enableExtensionFilter().addExtension('.docx');
|
||||
uploadToggles.enableExtensionFilter();
|
||||
browser.driver.sleep(1000);
|
||||
uploadToggles.addExtension('.docx');
|
||||
contentServicesPage.uploadFile(docxFileModel.location).checkContentIsDisplayed(docxFileModel.name);
|
||||
uploadDialog.removeUploadedFile(docxFileModel.name).fileIsCancelled(docxFileModel.name);
|
||||
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
|
||||
contentServicesPage.uploadFile(largeFile.location).checkContentIsNotDisplayed(largeFile.name);
|
||||
contentServicesPage.uploadFile(pngFileModel.location).checkContentIsNotDisplayed(pngFileModel.name);
|
||||
uploadDialog.dialogIsNotDisplayed();
|
||||
uploadToggles.disableExtensionFilter();
|
||||
});
|
||||
|
||||
it('[C274687] Should upload with drag and drop only the extension filter allowed when Enable extension filter is enabled', () => {
|
||||
uploadToggles.enableExtensionFilter().addExtension('.docx');
|
||||
uploadToggles.enableExtensionFilter();
|
||||
browser.driver.sleep(1000);
|
||||
uploadToggles.addExtension('.docx');
|
||||
|
||||
let dragAndDrop = new DropActions();
|
||||
let dragAndDropArea = element(by.css('adf-upload-drag-area div'));
|
||||
@ -250,8 +257,8 @@ describe('Upload component', () => {
|
||||
uploadDialog.removeUploadedFile(docxFileModel.name).fileIsCancelled(docxFileModel.name);
|
||||
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
|
||||
|
||||
dragAndDrop.dropFile(dragAndDropArea, largeFile.location);
|
||||
contentServicesPage.checkContentIsNotDisplayed(largeFile.name);
|
||||
dragAndDrop.dropFile(dragAndDropArea, pngFileModel.location);
|
||||
contentServicesPage.checkContentIsNotDisplayed(pngFileModel.name);
|
||||
uploadDialog.dialogIsNotDisplayed();
|
||||
uploadToggles.disableExtensionFilter();
|
||||
});
|
||||
@ -279,8 +286,9 @@ describe('Upload component', () => {
|
||||
uploadToggles.disableVersioning();
|
||||
});
|
||||
|
||||
xit('[C260173] Enable folder upload', () => {
|
||||
it('[C260173] Enable folder upload', () => {
|
||||
uploadToggles.enableFolderUpload();
|
||||
browser.driver.sleep(1000);
|
||||
contentServicesPage.uploadFolder(folderOne.location).checkContentIsDisplayed(folderOne.name);
|
||||
expect(contentServicesPage.getFolderButtonTooltip()).toEqual('Custom tooltip');
|
||||
uploadDialog.fileIsUploaded(uploadedFileInFolder.name);
|
||||
@ -290,7 +298,7 @@ describe('Upload component', () => {
|
||||
uploadToggles.disableFolderUpload();
|
||||
});
|
||||
|
||||
xit('[C260176] The files uploaded before closing the upload dialog box are not displayed anymore in the upload box', () => {
|
||||
it('[C260176] The files uploaded before closing the upload dialog box are not displayed anymore in the upload box', () => {
|
||||
contentServicesPage.uploadFile(docxFileModel.location).checkContentIsDisplayed(docxFileModel.name);
|
||||
|
||||
uploadDialog.fileIsUploaded(docxFileModel.name);
|
||||
@ -309,7 +317,7 @@ describe('Upload component', () => {
|
||||
.checkContentsAreNotDisplayed([docxFileModel.name, pngFileModel.name, pdfFileModel.name]);
|
||||
});
|
||||
|
||||
xit('[C260170] Upload files on the same time', () => {
|
||||
it('[C260170] Upload files on the same time', () => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.checkAcsContainer();
|
||||
|
||||
@ -331,14 +339,15 @@ describe('Upload component', () => {
|
||||
xit('[C279919] Enable max size and set it to 400', () => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.checkAcsContainer();
|
||||
uploadToggles.enableMaxSize().addMaxSize('400');
|
||||
uploadToggles.enableMaxSize();
|
||||
uploadToggles.addMaxSize('400');
|
||||
contentServicesPage.uploadFile(fileWithSpecificSize.location).checkContentIsDisplayed(fileWithSpecificSize.name);
|
||||
uploadDialog.fileIsUploaded(fileWithSpecificSize.name).clickOnCloseButton().dialogIsNotDisplayed();
|
||||
contentServicesPage.deleteContent(fileWithSpecificSize.name).checkContentIsNotDisplayed(fileWithSpecificSize.name);
|
||||
uploadToggles.addMaxSize('399');
|
||||
contentServicesPage.uploadFile(fileWithSpecificSize.location).checkContentIsNotDisplayed(fileWithSpecificSize.name);
|
||||
uploadDialog.fileIsNotDisplayedInDialog(fileWithSpecificSize.name);
|
||||
expect(contentServicesPage.getErrorMessage()).toEqual('File ' + fileWithSpecificSize.name + ' is larger than the allowed file size');
|
||||
uploadDialog.fileIsNotDisplayedInDialog(fileWithSpecificSize.name);
|
||||
contentServicesPage.uploadFile(emptyFile.location).checkContentIsDisplayed(emptyFile.name);
|
||||
uploadDialog.fileIsUploaded(emptyFile.name).clickOnCloseButton().dialogIsNotDisplayed();
|
||||
contentServicesPage.deleteContent(emptyFile.name).checkContentIsNotDisplayed(emptyFile.name);
|
||||
@ -347,19 +356,22 @@ describe('Upload component', () => {
|
||||
|
||||
xit('[C272796] Enable max size and set it to 0', () => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.checkAcsContainer();
|
||||
uploadToggles.enableMaxSize().addMaxSize('0');
|
||||
uploadToggles.enableMaxSize();
|
||||
uploadToggles.addMaxSize('0');
|
||||
contentServicesPage.uploadFile(fileWithSpecificSize.location).checkContentIsNotDisplayed(fileWithSpecificSize.name);
|
||||
uploadDialog.fileIsNotDisplayedInDialog(fileWithSpecificSize.name);
|
||||
expect(contentServicesPage.getErrorMessage()).toEqual('File ' + fileWithSpecificSize.name + ' is larger than the allowed file size');
|
||||
|
||||
uploadDialog.fileIsNotDisplayedInDialog(fileWithSpecificSize.name);
|
||||
contentServicesPage.uploadFile(emptyFile.location).checkContentIsDisplayed(emptyFile.name);
|
||||
uploadDialog.fileIsUploaded(emptyFile.name).clickOnCloseButton().dialogIsNotDisplayed();
|
||||
contentServicesPage.deleteContent(emptyFile.name).checkContentIsNotDisplayed(emptyFile.name);
|
||||
uploadToggles.disableMaxSize();
|
||||
});
|
||||
|
||||
xit('[C272797] Set max size to 1 and disable it', () => {
|
||||
uploadToggles.enableMaxSize().addMaxSize('1');
|
||||
it('[C272797] Set max size to 1 and disable it', () => {
|
||||
uploadToggles.enableMaxSize();
|
||||
browser.driver.sleep(1000);
|
||||
uploadToggles.addMaxSize('1');
|
||||
uploadToggles.disableMaxSize();
|
||||
contentServicesPage.uploadFile(fileWithSpecificSize.location).checkContentIsDisplayed(fileWithSpecificSize.name);
|
||||
uploadDialog.fileIsUploaded(fileWithSpecificSize.name).clickOnCloseButton().dialogIsNotDisplayed();
|
||||
@ -375,6 +387,7 @@ describe('Upload component', () => {
|
||||
|
||||
it('[C279882] Should be possible Upload a folder in a folder', () => {
|
||||
uploadToggles.enableFolderUpload();
|
||||
browser.driver.sleep(1000);
|
||||
contentServicesPage.uploadFolder(folderOne.location).checkContentIsDisplayed(folderOne.name);
|
||||
uploadDialog.fileIsUploaded(uploadedFileInFolder.name);
|
||||
|
||||
@ -382,6 +395,7 @@ describe('Upload component', () => {
|
||||
contentServicesPage.doubleClickRow(folderOne.name).checkContentIsDisplayed(uploadedFileInFolder.name);
|
||||
|
||||
uploadToggles.enableFolderUpload();
|
||||
browser.driver.sleep(1000);
|
||||
contentServicesPage.uploadFolder(folderTwo.location).checkContentIsDisplayed(folderTwo.name);
|
||||
uploadDialog.fileIsUploaded(uploadedFileInFolderTwo.name);
|
||||
|
||||
|
@ -15,6 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
|
||||
import LoginPage = require('../../pages/adf/loginPage');
|
||||
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
|
||||
import UploadDialog = require('../../pages/adf/dialog/uploadDialog');
|
||||
@ -32,8 +34,6 @@ import resources = require('../../util/resources');
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { DropActions } from '../../actions/drop.actions';
|
||||
|
||||
import path = require('path');
|
||||
|
||||
describe('Upload - User permission', () => {
|
||||
|
||||
let contentServicesPage = new ContentServicesPage();
|
||||
|
148
e2e/content-services/version/version-actions.e2e.ts
Normal file
148
e2e/content-services/version/version-actions.e2e.ts
Normal file
@ -0,0 +1,148 @@
|
||||
/*!
|
||||
* @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 { by, element } from 'protractor';
|
||||
|
||||
import LoginPage = require('../../pages/adf/loginPage');
|
||||
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
|
||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
||||
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import Util = require('../../util/util');
|
||||
import path = require('path');
|
||||
|
||||
describe('Version component', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const contentListPage = new ContentListPage();
|
||||
const versionManagePage = new VersionManagePage();
|
||||
|
||||
let acsUser = new AcsUserModel();
|
||||
|
||||
let txtFileModel = new FileModel({
|
||||
'name': resources.Files.ADF_DOCUMENTS.TXT.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.TXT.file_location
|
||||
});
|
||||
|
||||
let fileModelVersionTwo = new FileModel({
|
||||
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
|
||||
});
|
||||
|
||||
beforeAll(async (done) => {
|
||||
|
||||
let uploadActions = new UploadActions();
|
||||
|
||||
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);
|
||||
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
|
||||
let txtUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, txtFileModel.location, txtFileModel.name, '-my-');
|
||||
|
||||
Object.assign(txtFileModel, txtUploadedFile.entry);
|
||||
|
||||
txtFileModel.update(txtUploadedFile.entry);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
contentServicesPage.navigateToDocumentList();
|
||||
contentListPage.versionManagerContent(txtFileModel.name);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C280003] Should not be possible delete a file version if there is only one version', () => {
|
||||
versionManagePage.clickActionButton('1.0');
|
||||
expect(element(by.css(`[id="adf-version-list-action-delete-1.0"]`)).isEnabled()).toBe(false);
|
||||
versionManagePage.closeActionButton();
|
||||
Util.waitUntilElementIsNotOnPage(element(by.css(`[id="adf-version-list-action-delete-1.0"]`)));
|
||||
});
|
||||
|
||||
it('[C280004] Should not be possible restore the version if there is only one version', () => {
|
||||
versionManagePage.clickActionButton('1.0');
|
||||
expect(element(by.css(`[id="adf-version-list-action-restore-1.0"]`)).isEnabled()).toBe(false);
|
||||
versionManagePage.closeActionButton();
|
||||
Util.waitUntilElementIsNotOnPage(element(by.css(`[id="adf-version-list-action-restore-1.0"]`)));
|
||||
});
|
||||
|
||||
it('[C280005] Should be showed all the default action when you have more then one version', () => {
|
||||
versionManagePage.showNewVersionButton.click();
|
||||
|
||||
versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
|
||||
|
||||
versionManagePage.clickActionButton('1.1').checkActionsArePresent('1.1');
|
||||
|
||||
versionManagePage.closeActionButton();
|
||||
});
|
||||
|
||||
it('[C269081] Should be possible download all the version of a file', () => {
|
||||
versionManagePage.downloadFileVersion('1.0');
|
||||
|
||||
expect(Util.fileExists(path.join(__dirname, 'downloads', txtFileModel.name), 20)).toBe(true);
|
||||
|
||||
versionManagePage.downloadFileVersion('1.1');
|
||||
|
||||
expect(Util.fileExists(path.join(__dirname, 'downloads', fileModelVersionTwo.name), 20)).toBe(true);
|
||||
});
|
||||
|
||||
it('[C272819] Should be possible delete a version when click on delete version action', () => {
|
||||
versionManagePage.deleteFileVersion('1.1');
|
||||
|
||||
versionManagePage.clickAcceptConfirm();
|
||||
|
||||
versionManagePage.chekFileVersionNotExist('1.1');
|
||||
versionManagePage.chekFileVersionExist('1.0');
|
||||
});
|
||||
|
||||
it('[C280006] Should be possible prevent a version to be deleted when click on No on the confirm dialog', () => {
|
||||
versionManagePage.showNewVersionButton.click();
|
||||
|
||||
versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
|
||||
|
||||
versionManagePage.chekFileVersionExist('1.1');
|
||||
|
||||
versionManagePage.deleteFileVersion('1.1');
|
||||
|
||||
versionManagePage.clickCancelConfirm();
|
||||
|
||||
versionManagePage.chekFileVersionExist('1.1');
|
||||
versionManagePage.chekFileVersionExist('1.0');
|
||||
});
|
||||
|
||||
it('[C280007] Should be possible restore an old version of your file', () => {
|
||||
versionManagePage.restoreFileVersion('1.0');
|
||||
|
||||
versionManagePage.chekFileVersionExist('2.0');
|
||||
});
|
||||
|
||||
});
|
383
e2e/content-services/version/version-permissions.e2e.ts
Normal file
383
e2e/content-services/version/version-permissions.e2e.ts
Normal file
@ -0,0 +1,383 @@
|
||||
/*!
|
||||
* @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 { element, by } from 'protractor';
|
||||
|
||||
import LoginPage = require('../../pages/adf/loginPage');
|
||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
||||
import NavigationBarPage = require('../../pages/adf/navigationBarPage');
|
||||
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
|
||||
import UploadDialog = require('../../pages/adf/dialog/uploadDialog');
|
||||
import NotificationPage = require('../../pages/adf/notificationPage');
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import { NodeActions } from '../../actions/ACS/node.actions';
|
||||
|
||||
import Util = require('../../util/util');
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Version component', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const contentListPage = new ContentListPage();
|
||||
const versionManagePage = new VersionManagePage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const uploadDialog = new UploadDialog();
|
||||
const notificationPage = new NotificationPage();
|
||||
let site;
|
||||
|
||||
let acsUser = new AcsUserModel();
|
||||
let consumerUser = new AcsUserModel();
|
||||
let collaboratorUser = new AcsUserModel();
|
||||
let contributorUser = new AcsUserModel();
|
||||
let managerUser = new AcsUserModel();
|
||||
let fileCreatorUser = new AcsUserModel();
|
||||
|
||||
let newVersionFile = new FileModel({
|
||||
'name': resources.Files.ADF_DOCUMENTS.PNG_B.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.PNG_B.file_location
|
||||
});
|
||||
|
||||
let lockFileModel = new FileModel({
|
||||
'name': resources.Files.ADF_DOCUMENTS.PNG_C.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.PNG_C.file_location
|
||||
});
|
||||
|
||||
let differentCreatoFile = new FileModel({
|
||||
'name': resources.Files.ADF_DOCUMENTS.PNG_D.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.PNG_D.file_location
|
||||
});
|
||||
|
||||
beforeAll(async (done) => {
|
||||
|
||||
let uploadActions = new UploadActions();
|
||||
let nodeActions = new NodeActions();
|
||||
|
||||
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);
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(consumerUser);
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(collaboratorUser);
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(contributorUser);
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(managerUser);
|
||||
await this.alfrescoJsApi.core.peopleApi.addPerson(fileCreatorUser);
|
||||
|
||||
site = await this.alfrescoJsApi.core.sitesApi.createSite({
|
||||
title: Util.generateRandomString(),
|
||||
visibility: 'PUBLIC'
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.core.sitesApi.addSiteMember(site.entry.id, {
|
||||
id: consumerUser.id,
|
||||
role: CONSTANTS.CS_USER_ROLES.CONSUMER
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.core.sitesApi.addSiteMember(site.entry.id, {
|
||||
id: collaboratorUser.id,
|
||||
role: CONSTANTS.CS_USER_ROLES.COLLABORATOR
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.core.sitesApi.addSiteMember(site.entry.id, {
|
||||
id: contributorUser.id,
|
||||
role: CONSTANTS.CS_USER_ROLES.CONTRIBUTOR
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.core.sitesApi.addSiteMember(site.entry.id, {
|
||||
id: managerUser.id,
|
||||
role: CONSTANTS.CS_USER_ROLES.MANAGER
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.core.sitesApi.addSiteMember(site.entry.id, {
|
||||
id: fileCreatorUser.id,
|
||||
role: CONSTANTS.CS_USER_ROLES.MANAGER
|
||||
});
|
||||
|
||||
let lockFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, lockFileModel.location, lockFileModel.name, site.entry.guid);
|
||||
Object.assign(lockFileModel, lockFileUploaded.entry);
|
||||
|
||||
nodeActions.lockNode(this.alfrescoJsApi, lockFileModel.id);
|
||||
|
||||
await this.alfrescoJsApi.login(fileCreatorUser.id, fileCreatorUser.password);
|
||||
|
||||
await uploadActions.uploadFile(this.alfrescoJsApi, differentCreatoFile.location, differentCreatoFile.name, site.entry.guid);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
describe('Manager', () => {
|
||||
|
||||
let sameCreatoFile = new FileModel({
|
||||
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
|
||||
});
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let uploadActions = new UploadActions();
|
||||
|
||||
await this.alfrescoJsApi.login(managerUser.id, managerUser.password);
|
||||
|
||||
let sameCreatoFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, sameCreatoFile.location, sameCreatoFile.name, site.entry.guid);
|
||||
Object.assign(sameCreatoFile, sameCreatoFileUploaded.entry);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(managerUser);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(site.entry.guid);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await this.alfrescoJsApi.nodes.deleteNode(sameCreatoFile.id);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C277200] should a user with Manager permission be able to upload a new version for a file with different creator', () => {
|
||||
contentListPage.versionManagerContent(differentCreatoFile.name);
|
||||
|
||||
versionManagePage.showNewVersionButton.click();
|
||||
|
||||
versionManagePage.uploadNewVersionFile(newVersionFile.location);
|
||||
|
||||
versionManagePage.chekFileVersionExist('1.1');
|
||||
expect(versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
|
||||
expect(versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
|
||||
|
||||
versionManagePage.deleteFileVersion('1.1');
|
||||
versionManagePage.clickAcceptConfirm();
|
||||
|
||||
versionManagePage.chekFileVersionNotExist('1.1');
|
||||
|
||||
versionManagePage.closeVersionDialog();
|
||||
|
||||
uploadDialog.clickOnCloseButton();
|
||||
});
|
||||
|
||||
it('[C277204] Should a user with Manager permission not be able to upload a new version for a locked file', () => {
|
||||
contentListPage.versionManagerContent(lockFileModel.name);
|
||||
|
||||
versionManagePage.showNewVersionButton.click();
|
||||
|
||||
versionManagePage.uploadNewVersionFile(newVersionFile.location);
|
||||
|
||||
versionManagePage.chekFileVersionNotExist('1.1');
|
||||
|
||||
versionManagePage.closeVersionDialog();
|
||||
|
||||
uploadDialog.clickOnCloseButton();
|
||||
});
|
||||
|
||||
it('[C277196] Should a user with Manager permission be able to upload a new version for the created file', () => {
|
||||
contentListPage.versionManagerContent(sameCreatoFile.name);
|
||||
|
||||
versionManagePage.showNewVersionButton.click();
|
||||
|
||||
versionManagePage.uploadNewVersionFile(newVersionFile.location);
|
||||
|
||||
versionManagePage.chekFileVersionExist('1.1');
|
||||
expect(versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
|
||||
expect(versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
|
||||
|
||||
versionManagePage.deleteFileVersion('1.1');
|
||||
versionManagePage.clickAcceptConfirm();
|
||||
|
||||
versionManagePage.chekFileVersionNotExist('1.1');
|
||||
|
||||
versionManagePage.closeVersionDialog();
|
||||
|
||||
uploadDialog.clickOnCloseButton();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Consumer', () => {
|
||||
|
||||
beforeAll(async (done) => {
|
||||
loginPage.loginToContentServicesUsingUserModel(consumerUser);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(site.entry.guid);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C277197] Should a user with Consumer permission not be able to upload a new version for a file with different creator', () => {
|
||||
contentListPage.versionManagerContent(differentCreatoFile.name);
|
||||
|
||||
notificationPage.checkNotifyContains(`You don't have access to do this`);
|
||||
});
|
||||
|
||||
it('[C277201] Should a user with Consumer permission not be able to upload a new version for a locked file', () => {
|
||||
contentListPage.versionManagerContent(lockFileModel.name);
|
||||
|
||||
notificationPage.checkNotifyContains(`You don't have access to do this`);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('Contributor', () => {
|
||||
let sameCreatoFile = new FileModel({
|
||||
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
|
||||
});
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let uploadActions = new UploadActions();
|
||||
|
||||
await this.alfrescoJsApi.login(contributorUser.id, contributorUser.password);
|
||||
|
||||
let sameCreatoFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, sameCreatoFile.location, sameCreatoFile.name, site.entry.guid);
|
||||
Object.assign(sameCreatoFile, sameCreatoFileUploaded.entry);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(contributorUser);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(site.entry.guid);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await this.alfrescoJsApi.nodes.deleteNode(sameCreatoFile.id);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C277177] Should a user with Contributor permission be able to upload a new version for the created file', () => {
|
||||
contentListPage.versionManagerContent(sameCreatoFile.name);
|
||||
|
||||
versionManagePage.showNewVersionButton.click();
|
||||
|
||||
versionManagePage.uploadNewVersionFile(newVersionFile.location);
|
||||
|
||||
versionManagePage.chekFileVersionExist('1.1');
|
||||
expect(versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
|
||||
expect(versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
|
||||
|
||||
versionManagePage.deleteFileVersion('1.1');
|
||||
versionManagePage.clickAcceptConfirm();
|
||||
|
||||
versionManagePage.chekFileVersionNotExist('1.1');
|
||||
|
||||
versionManagePage.closeVersionDialog();
|
||||
|
||||
uploadDialog.clickOnCloseButton();
|
||||
});
|
||||
|
||||
it('[C277198] Should a user with Contributor permission not be able to upload a new version for a file with different creator', () => {
|
||||
contentListPage.versionManagerContent(differentCreatoFile.name);
|
||||
|
||||
notificationPage.checkNotifyContains(`You don't have access to do this`);
|
||||
});
|
||||
|
||||
it('[C277202] Should a user with Contributor permission not be able to upload a new version for a locked file', () => {
|
||||
contentListPage.versionManagerContent(lockFileModel.name);
|
||||
|
||||
notificationPage.checkNotifyContains(`You don't have access to do this`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Collaborator', () => {
|
||||
let sameCreatoFile = new FileModel({
|
||||
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
|
||||
});
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let uploadActions = new UploadActions();
|
||||
|
||||
await this.alfrescoJsApi.login(collaboratorUser.id, collaboratorUser.password);
|
||||
|
||||
let sameCreatoFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, sameCreatoFile.location, sameCreatoFile.name, site.entry.guid);
|
||||
Object.assign(sameCreatoFile, sameCreatoFileUploaded.entry);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(collaboratorUser);
|
||||
|
||||
navigationBarPage.openContentServicesFolder(site.entry.guid);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await this.alfrescoJsApi.nodes.deleteNode(sameCreatoFile.id);
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C277195] Should a user with Collaborator permission be able to upload a new version for the created file', () => {
|
||||
contentListPage.versionManagerContent(sameCreatoFile.name);
|
||||
|
||||
versionManagePage.showNewVersionButton.click();
|
||||
|
||||
versionManagePage.uploadNewVersionFile(newVersionFile.location);
|
||||
|
||||
versionManagePage.chekFileVersionExist('1.1');
|
||||
expect(versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
|
||||
expect(versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
|
||||
|
||||
versionManagePage.deleteFileVersion('1.1');
|
||||
versionManagePage.clickAcceptConfirm();
|
||||
|
||||
versionManagePage.chekFileVersionNotExist('1.1');
|
||||
|
||||
versionManagePage.closeVersionDialog();
|
||||
|
||||
uploadDialog.clickOnCloseButton();
|
||||
});
|
||||
|
||||
it('[C277203] Should a user with Collaborator permission not be able to upload a new version for a locked file', () => {
|
||||
contentListPage.versionManagerContent(lockFileModel.name);
|
||||
|
||||
versionManagePage.showNewVersionButton.click();
|
||||
|
||||
versionManagePage.uploadNewVersionFile(newVersionFile.location);
|
||||
|
||||
versionManagePage.chekFileVersionNotExist('1.1');
|
||||
|
||||
versionManagePage.closeVersionDialog();
|
||||
|
||||
uploadDialog.clickOnCloseButton();
|
||||
});
|
||||
|
||||
it('[C277199] should a user with Collaborator permission be able to upload a new version for a file with different creator', () => {
|
||||
contentListPage.versionManagerContent(differentCreatoFile.name);
|
||||
|
||||
versionManagePage.showNewVersionButton.click();
|
||||
|
||||
versionManagePage.uploadNewVersionFile(newVersionFile.location);
|
||||
|
||||
versionManagePage.chekFileVersionExist('1.1');
|
||||
expect(versionManagePage.getFileVersionName('1.1')).toEqual(newVersionFile.name);
|
||||
expect(versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
|
||||
|
||||
versionManagePage.clickActionButton('1.1');
|
||||
|
||||
expect(element(by.css(`[id="adf-version-list-action-delete-1.1"]`)).isEnabled()).toBe(false);
|
||||
|
||||
versionManagePage.closeActionButton();
|
||||
|
||||
versionManagePage.closeVersionDialog();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
139
e2e/content-services/version/version-properties.e2e.ts
Normal file
139
e2e/content-services/version/version-properties.e2e.ts
Normal file
@ -0,0 +1,139 @@
|
||||
/*!
|
||||
* @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 { by, element } from 'protractor';
|
||||
|
||||
import LoginPage = require('../../pages/adf/loginPage');
|
||||
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
|
||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
||||
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import Util = require('../../util/util');
|
||||
|
||||
describe('Version Properties', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const contentListPage = new ContentListPage();
|
||||
const versionManagePage = new VersionManagePage();
|
||||
|
||||
let acsUser = new AcsUserModel();
|
||||
|
||||
let txtFileModel = new FileModel({
|
||||
'name': resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
|
||||
});
|
||||
|
||||
let fileModelVersionTwo = new FileModel({
|
||||
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
|
||||
});
|
||||
|
||||
beforeAll(async (done) => {
|
||||
|
||||
let uploadActions = new UploadActions();
|
||||
|
||||
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);
|
||||
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
|
||||
let txtUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, txtFileModel.location, txtFileModel.name, '-my-');
|
||||
|
||||
Object.assign(txtFileModel, txtUploadedFile.entry);
|
||||
|
||||
txtFileModel.update(txtUploadedFile.entry);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
contentServicesPage.navigateToDocumentList();
|
||||
contentListPage.versionManagerContent(txtFileModel.name);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C272817] Should NOT be present the download action when allowDownload property is false', () => {
|
||||
versionManagePage.disableDownload();
|
||||
|
||||
versionManagePage.clickActionButton('1.0');
|
||||
|
||||
Util.waitUntilElementIsNotVisible(element(by.css(`[id="adf-version-list-action-download-1.0"]`)));
|
||||
|
||||
versionManagePage.closeActionButton();
|
||||
});
|
||||
|
||||
it('[C279992] Should be present the download action when allowDownload property is true', () => {
|
||||
versionManagePage.enableDownload();
|
||||
|
||||
versionManagePage.clickActionButton('1.0');
|
||||
|
||||
Util.waitUntilElementIsVisible(element(by.css(`[id="adf-version-list-action-download-1.0"]`)));
|
||||
|
||||
versionManagePage.closeActionButton();
|
||||
});
|
||||
|
||||
it('[C269085] Should show/hide comments when showComments true/false', () => {
|
||||
versionManagePage.enableComments();
|
||||
|
||||
versionManagePage.showNewVersionButton.click();
|
||||
versionManagePage.enterCommentText('Example comment text');
|
||||
versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
|
||||
|
||||
versionManagePage.chekFileVersionExist('1.1');
|
||||
expect(versionManagePage.getFileVersionComment('1.1')).toEqual('Example comment text');
|
||||
|
||||
versionManagePage.disableComments();
|
||||
|
||||
Util.waitUntilElementIsNotVisible(element(by.css(`[id="adf-version-list-item-comment-1.1"]`)));
|
||||
});
|
||||
|
||||
it('[C277277] Should show/hide actions menu when readOnly is true/false', () => {
|
||||
versionManagePage.disableReadOnly();
|
||||
|
||||
Util.waitUntilElementIsVisible(element(by.css(`[id="adf-version-list-action-menu-button-1.0"]`)));
|
||||
|
||||
versionManagePage.enableReadOnly();
|
||||
|
||||
Util.waitUntilElementIsNotVisible(element(by.css(`[id="adf-version-list-action-menu-button-1.0"]`)));
|
||||
});
|
||||
|
||||
it('[C279994] Should show/hide upload new version button when readOnly is true/false', () => {
|
||||
versionManagePage.disableReadOnly();
|
||||
|
||||
Util.waitUntilElementIsVisible(versionManagePage.showNewVersionButton);
|
||||
|
||||
versionManagePage.enableReadOnly();
|
||||
|
||||
Util.waitUntilElementIsNotVisible(versionManagePage.showNewVersionButton);
|
||||
Util.waitUntilElementIsNotVisible(versionManagePage.uploadNewVersionButton);
|
||||
});
|
||||
|
||||
});
|
@ -15,32 +15,56 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import LoginPage = require('../../pages/adf/loginPage');
|
||||
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
|
||||
import ViewerPage = require('../../pages/adf/viewerPage');
|
||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
||||
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
import dateFormat = require('dateformat');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import Util = require('../../util/util');
|
||||
|
||||
describe('Version component', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let contentServicesPage = new ContentServicesPage();
|
||||
let viewerPage = new ViewerPage();
|
||||
let cardViewPage;
|
||||
let txtUploadedFile;
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const contentListPage = new ContentListPage();
|
||||
const versionManagePage = new VersionManagePage();
|
||||
|
||||
let acsUser = new AcsUserModel();
|
||||
|
||||
let pdfFileModel = new FileModel({
|
||||
'name': resources.Files.ADF_DOCUMENTS.PDF_ALL.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.PDF_ALL.file_location
|
||||
let txtFileModel = new FileModel({
|
||||
'name': resources.Files.ADF_DOCUMENTS.TXT.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.TXT.file_location
|
||||
});
|
||||
|
||||
let fileModelVersionTwo = new FileModel({
|
||||
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
|
||||
});
|
||||
|
||||
let fileModelVersionThree = new FileModel({
|
||||
'name': resources.Files.ADF_DOCUMENTS.PNG_B.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.PNG_B.file_location
|
||||
});
|
||||
|
||||
let fileModelVersionFor = new FileModel({
|
||||
'name': resources.Files.ADF_DOCUMENTS.PNG_C.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.PNG_C.file_location
|
||||
});
|
||||
|
||||
let fileModelVersionFive = new FileModel({
|
||||
'name': resources.Files.ADF_DOCUMENTS.PNG_D.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.PNG_D.file_location
|
||||
});
|
||||
|
||||
beforeAll(async (done) => {
|
||||
@ -58,25 +82,93 @@ describe('Version component', () => {
|
||||
|
||||
await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
|
||||
|
||||
let pdfUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pdfFileModel.location, pdfFileModel.name, '-my-');
|
||||
txtUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, txtFileModel.location, txtFileModel.name, '-my-');
|
||||
Object.assign(txtFileModel, txtUploadedFile.entry);
|
||||
|
||||
Object.assign(pdfFileModel, pdfUploadedFile.entry);
|
||||
|
||||
pdfFileModel.update(pdfUploadedFile.entry);
|
||||
txtFileModel.update(txtUploadedFile.entry);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
contentServicesPage.navigateToDocumentList();
|
||||
contentListPage.versionManagerContent(txtFileModel.name);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C272768] Versions', () => {
|
||||
contentServicesPage.navigateToDocumentList();
|
||||
viewerPage.viewFile(pdfFileModel.name);
|
||||
viewerPage.clickInfoButton();
|
||||
viewerPage.checkInfoSideBarIsDisplayed();
|
||||
viewerPage.clickOnVersionsTab().checkUploadVersionsButtonIsDisplayed();
|
||||
expect(viewerPage.getActiveTab()).toEqual('VERSIONS');
|
||||
viewerPage.checkVersionIsDisplayed(pdfFileModel.name);
|
||||
it('[C272768] Should be visible the first file version when you upload a file', () => {
|
||||
versionManagePage.checkUploadNewVersionsButtonIsDisplayed();
|
||||
|
||||
versionManagePage.chekFileVersionExist('1.0');
|
||||
expect(versionManagePage.getFileVersionName('1.0')).toEqual(txtFileModel.name);
|
||||
expect(versionManagePage.getFileVersionDate('1.0')).not.toBeUndefined();
|
||||
});
|
||||
|
||||
it('[C279995] Should show/hide the new upload file options when click on add New version/canclel button', () => {
|
||||
versionManagePage.showNewVersionButton.click();
|
||||
|
||||
browser.driver.sleep(300);
|
||||
|
||||
Util.waitUntilElementIsVisible(versionManagePage.cancelButton);
|
||||
Util.waitUntilElementIsVisible(versionManagePage.majorRadio);
|
||||
Util.waitUntilElementIsVisible(versionManagePage.minorRadio);
|
||||
Util.waitUntilElementIsVisible(versionManagePage.cancelButton);
|
||||
Util.waitUntilElementIsVisible(versionManagePage.commentText);
|
||||
Util.waitUntilElementIsVisible(versionManagePage.uploadNewVersionButton);
|
||||
|
||||
versionManagePage.cancelButton.click();
|
||||
|
||||
browser.driver.sleep(300);
|
||||
|
||||
Util.waitUntilElementIsNotVisible(versionManagePage.cancelButton);
|
||||
Util.waitUntilElementIsNotVisible(versionManagePage.majorRadio);
|
||||
Util.waitUntilElementIsNotVisible(versionManagePage.minorRadio);
|
||||
Util.waitUntilElementIsNotVisible(versionManagePage.cancelButton);
|
||||
Util.waitUntilElementIsNotVisible(versionManagePage.commentText);
|
||||
Util.waitUntilElementIsNotVisible(versionManagePage.uploadNewVersionButton);
|
||||
|
||||
Util.waitUntilElementIsVisible(versionManagePage.showNewVersionButton);
|
||||
});
|
||||
|
||||
it('[C260244] Should show the version history when select a file with multiple version', () => {
|
||||
versionManagePage.showNewVersionButton.click();
|
||||
versionManagePage.uploadNewVersionFile(fileModelVersionTwo.location);
|
||||
|
||||
versionManagePage.chekFileVersionExist('1.0');
|
||||
expect(versionManagePage.getFileVersionName('1.0')).toEqual(txtFileModel.name);
|
||||
expect(versionManagePage.getFileVersionDate('1.0')).not.toBeUndefined();
|
||||
|
||||
versionManagePage.chekFileVersionExist('1.1');
|
||||
expect(versionManagePage.getFileVersionName('1.1')).toEqual(fileModelVersionTwo.name);
|
||||
expect(versionManagePage.getFileVersionDate('1.1')).not.toBeUndefined();
|
||||
});
|
||||
|
||||
it('[C269084] Should be possible add a comment when add a new version', () => {
|
||||
versionManagePage.showNewVersionButton.click();
|
||||
versionManagePage.enterCommentText('Example comment text');
|
||||
versionManagePage.uploadNewVersionFile(fileModelVersionThree.location);
|
||||
|
||||
versionManagePage.chekFileVersionExist('1.2');
|
||||
expect(versionManagePage.getFileVersionName('1.2')).toEqual(fileModelVersionThree.name);
|
||||
expect(versionManagePage.getFileVersionDate('1.2')).not.toBeUndefined();
|
||||
expect(versionManagePage.getFileVersionComment('1.2')).toEqual('Example comment text');
|
||||
});
|
||||
|
||||
it('[C275719] Should be possible preview the file when you add a new version', () => {
|
||||
versionManagePage.showNewVersionButton.click();
|
||||
versionManagePage.clickMajorChange();
|
||||
|
||||
versionManagePage.uploadNewVersionFile(fileModelVersionFor.location);
|
||||
|
||||
versionManagePage.chekFileVersionExist('2.0');
|
||||
expect(versionManagePage.getFileVersionName('2.0')).toEqual(fileModelVersionFor.name);
|
||||
|
||||
versionManagePage.showNewVersionButton.click();
|
||||
versionManagePage.clickMinorChange();
|
||||
|
||||
versionManagePage.uploadNewVersionFile(fileModelVersionFive.location);
|
||||
|
||||
versionManagePage.chekFileVersionExist('2.1');
|
||||
expect(versionManagePage.getFileVersionName('2.1')).toEqual(fileModelVersionFive.name);
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -44,15 +44,17 @@ describe('Save screenshot at the end', () => {
|
||||
alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
|
||||
let folder = await alfrescoJsApi.nodes.addNode('-my-', {
|
||||
'name': 'contetn-services',
|
||||
'relativePath': 'Buiild-screenshot/Screenshot-e2e-' + buildNumber,
|
||||
'name': 'content-services',
|
||||
'relativePath': 'Build-screenshot/Screenshot-e2e-' + buildNumber,
|
||||
'nodeType': 'cm:folder'
|
||||
}, {}, {});
|
||||
}, {}, {
|
||||
'overwrite': true
|
||||
});
|
||||
|
||||
for (const fileName of files) {
|
||||
|
||||
let pathFile = path.join(__dirname, '../../e2e-output/screenshots', fileName);
|
||||
let file = fs.createReadStream(pathFile);
|
||||
let file: any = fs.createReadStream(pathFile);
|
||||
|
||||
await alfrescoJsApi.upload.uploadFile(
|
||||
file,
|
||||
|
@ -15,11 +15,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import LoginPage = require('../../pages/adf/loginPage');
|
||||
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
|
||||
import ViewerPage = require('../../pages/adf/viewerPage');
|
||||
import CardViewPage = require('../../pages/adf/metadataViewPage');
|
||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
||||
import NavigationBarPage = require('../../pages/adf/navigationBarPage');
|
||||
import { ConfigEditorPage } from '../../pages/adf/configEditorPage';
|
||||
|
||||
@ -28,31 +28,15 @@ import FileModel = require('../../models/ACS/fileModel');
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
import dateFormat = require('dateformat');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
|
||||
describe('Aspect oriented config', () => {
|
||||
|
||||
const METADATA = {
|
||||
DATAFORMAT: 'mmm dd yyyy',
|
||||
TITLE: 'Details',
|
||||
COMMENTS_TAB: 'COMMENTS',
|
||||
PROPERTY_TAB: 'PROPERTIES',
|
||||
DEFAULT_ASPECT: 'Properties',
|
||||
MORE_INFO_BUTTON: 'More information',
|
||||
LESS_INFO_BUTTON: 'Less information',
|
||||
ARROW_DOWN: 'keyboard_arrow_down',
|
||||
ARROW_UP: 'keyboard_arrow_up',
|
||||
EDIT_BUTTON_TOOLTIP: 'Edit'
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const viewerPage = new ViewerPage();
|
||||
const metadataViewPage = new CardViewPage();
|
||||
const contentListPage = new ContentListPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const configEditorPage = new ConfigEditorPage();
|
||||
|
||||
|
@ -15,6 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
|
||||
import LoginPage = require('../../pages/adf/loginPage');
|
||||
import NavigationBarPage = require('../../pages/adf/navigationBarPage');
|
||||
import CardViewPage = require('../../pages/adf/metadataViewPage');
|
||||
@ -279,13 +281,13 @@ describe('CardView Component', () => {
|
||||
describe('Date and DateTime', () => {
|
||||
|
||||
it('[C279961] Should the label be present', () => {
|
||||
let label = element(by.xpath('div[data-automation-id="card-dateitem-label-date"]'));
|
||||
let labelDate = element(by.xpath('div[data-automation-id="card-dateitem-label-date"]'));
|
||||
|
||||
Util.waitUntilElementIsPresent(label);
|
||||
Util.waitUntilElementIsPresent(labelDate);
|
||||
|
||||
let label = element(by.xpath('div[data-automation-id="card-dateitem-label-datetime"]'));
|
||||
let labelDatetime = element(by.xpath('div[data-automation-id="card-dateitem-label-datetime"]'));
|
||||
|
||||
Util.waitUntilElementIsPresent(label);
|
||||
Util.waitUntilElementIsPresent(labelDatetime);
|
||||
});
|
||||
|
||||
it('[C279962] Should be present a default value', () => {
|
||||
|
@ -16,10 +16,8 @@
|
||||
*/
|
||||
|
||||
import LoginPage = require('../../pages/adf/loginPage');
|
||||
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
|
||||
import ViewerPage = require('../../pages/adf/viewerPage');
|
||||
import CardViewPage = require('../../pages/adf/metadataViewPage');
|
||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
||||
import NavigationBarPage = require('../../pages/adf/navigationBarPage');
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
@ -27,14 +25,12 @@ import FileModel = require('../../models/ACS/fileModel');
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
import dateFormat = require('dateformat');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
|
||||
import fs = require('fs');
|
||||
import path = require('path');
|
||||
import Util = require('../../util/util');
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('permissions', () => {
|
||||
|
||||
@ -52,13 +48,10 @@ describe('permissions', () => {
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const contentServicesPage = new ContentServicesPage();
|
||||
const viewerPage = new ViewerPage();
|
||||
const metadataViewPage = new CardViewPage();
|
||||
const contentListPage = new ContentListPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
let acsUser = new AcsUserModel();
|
||||
let consumerUser = new AcsUserModel();
|
||||
let collaboratorUser = new AcsUserModel();
|
||||
let contributorUser = new AcsUserModel();
|
||||
@ -91,17 +84,17 @@ describe('permissions', () => {
|
||||
|
||||
await this.alfrescoJsApi.core.sitesApi.addSiteMember(site.entry.id, {
|
||||
id: consumerUser.id,
|
||||
role: 'SiteConsumer'
|
||||
role: CONSTANTS.CS_USER_ROLES.CONSUMER
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.core.sitesApi.addSiteMember(site.entry.id, {
|
||||
id: collaboratorUser.id,
|
||||
role: 'SiteCollaborator'
|
||||
role: CONSTANTS.CS_USER_ROLES.COLLABORATOR
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.core.sitesApi.addSiteMember(site.entry.id, {
|
||||
id: contributorUser.id,
|
||||
role: 'SiteContributor'
|
||||
role: CONSTANTS.CS_USER_ROLES.CONTRIBUTOR
|
||||
});
|
||||
|
||||
await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, site.entry.guid);
|
@ -25,14 +25,10 @@ import FileModel = require('../../models/ACS/fileModel');
|
||||
|
||||
import TestConfig = require('../../test.config');
|
||||
import resources = require('../../util/resources');
|
||||
import dateFormat = require('dateformat');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
|
||||
import fs = require('fs');
|
||||
import path = require('path');
|
||||
|
||||
describe('CardView Component - properties', () => {
|
||||
|
||||
let METADATA = {
|
||||
|
@ -15,12 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import LoginPage = require('../../pages/adf/loginPage');
|
||||
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
|
||||
import ViewerPage = require('../../pages/adf/viewerPage');
|
||||
import CardViewPage = require('../../pages/adf/metadataViewPage');
|
||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
||||
import NavigationBarPage = require('../../pages/adf/navigationBarPage');
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
@ -52,10 +53,8 @@ describe('Metadata component', () => {
|
||||
const viewerPage = new ViewerPage();
|
||||
const metadataViewPage = new CardViewPage();
|
||||
const contentListPage = new ContentListPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
let acsUser = new AcsUserModel();
|
||||
let consumerUser = new AcsUserModel();
|
||||
|
||||
let folderName = 'Metadata Folder';
|
||||
|
||||
|
54
e2e/core/error_component.e2e.ts
Normal file
54
e2e/core/error_component.e2e.ts
Normal file
@ -0,0 +1,54 @@
|
||||
/*!
|
||||
* @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 LoginPage = require('../pages/adf/loginPage');
|
||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
||||
import TestConfig = require('../test.config');
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import ErrorPage = require('../pages/adf/errorPage');
|
||||
import { browser } from '../../node_modules/protractor';
|
||||
|
||||
describe('Error Component', () => {
|
||||
|
||||
let acsUser = new AcsUserModel();
|
||||
let loginPage = new LoginPage();
|
||||
let errorPage = new ErrorPage();
|
||||
|
||||
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);
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
done();
|
||||
|
||||
});
|
||||
|
||||
it('[C277302] Error message displayed without permissions', () => {
|
||||
browser.get(TestConfig.adf.url + '/error/403');
|
||||
expect(errorPage.getErrorCode()).toBe('403');
|
||||
expect(errorPage.getErrorTitle()).toBe('You don\'t have permission to access this server.');
|
||||
expect(errorPage.getErrorDescription()).toBe('You\'re not allowed access to this resource on the server.');
|
||||
});
|
||||
|
||||
});
|
@ -19,7 +19,6 @@ import NavigationBarPage = require('../pages/adf/navigationBarPage');
|
||||
import { HeaderPage } from '../pages/adf/core/headerPage';
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import Util = require('../util/util.js');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UsersActions } from '../actions/users.actions';
|
||||
@ -54,7 +53,7 @@ describe('Header Component', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async(done) =>{
|
||||
beforeEach(async(done) => {
|
||||
let users = new UsersActions();
|
||||
|
||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
@ -83,8 +82,8 @@ describe('Header Component', () => {
|
||||
it('[C280002] Should be able to view Header component', () => {
|
||||
headerPage.checkShowMenuCheckBoxIsDisplayed();
|
||||
headerPage.checkChooseHeaderColourIsDisplayed();
|
||||
headerPage.checkChangeTitleIsDisplayed(title.default);
|
||||
headerPage.checkChangeUrlPathIsDisplayed(urlPath.default);
|
||||
headerPage.checkChangeTitleIsDisplayed();
|
||||
headerPage.checkChangeUrlPathIsDisplayed();
|
||||
|
||||
});
|
||||
|
||||
|
@ -15,6 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import LoginPage = require('../../pages/adf/loginPage');
|
||||
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
|
||||
import ProcessServicesPage = require('../../pages/adf/process_services/processServicesPage');
|
||||
@ -28,7 +30,6 @@ import AdfSettingsPage = require('../../pages/adf/settingsPage');
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
|
||||
import Util = require('../../util/util');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
|
||||
describe('Login component', () => {
|
||||
|
||||
|
@ -15,6 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import LoginPage = require('../../pages/adf/loginPage');
|
||||
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
|
||||
import ProcessServicesPage = require('../../pages/adf/process_services/processServicesPage');
|
||||
|
@ -17,8 +17,6 @@
|
||||
|
||||
import LoginPage = require('../../pages/adf/loginPage');
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
|
||||
import AdfSettingsPage = require('../../pages/adf/settingsPage');
|
||||
|
||||
describe('Login component - Remember Me', () => {
|
||||
|
@ -77,7 +77,7 @@ describe('Pagination - returns to previous page when current is empty', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
xit('Pagination - returns to previous page when current is empty', () => {
|
||||
it('Pagination - returns to previous page when current is empty', () => {
|
||||
contentServicesPage.navigateToFolder(folderModel.name);
|
||||
contentServicesPage.checkAcsContainer();
|
||||
contentServicesPage.waitForTableBody();
|
||||
|
@ -14,6 +14,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { protractor } from 'protractor';
|
||||
|
||||
import AdfSettingsPage = require('../pages/adf/settingsPage');
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
import UserInfoDialog = require('../pages/adf/dialog/userInfoDialog');
|
||||
|
@ -15,6 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
@ -139,7 +141,7 @@ describe('Content Services Viewer', () => {
|
||||
|
||||
viewerPage.viewFile(pdfFile.name);
|
||||
|
||||
browser.driver.sleep(3000); //wait open file
|
||||
browser.driver.sleep(3000); // wait open file
|
||||
|
||||
viewerPage.checkFileContent('1', pdfFile.firstPageText);
|
||||
viewerPage.checkCloseButtonIsDisplayed();
|
||||
@ -304,7 +306,7 @@ describe('Content Services Viewer', () => {
|
||||
it('[C261123] Should be able to preview all pages and navigate to a page when using thumbnails', () => {
|
||||
viewerPage.viewFile(pdfFile.name);
|
||||
|
||||
browser.driver.sleep(3000); //wait open file
|
||||
browser.driver.sleep(3000); // wait open file
|
||||
|
||||
viewerPage.checkFileContent('1', pdfFile.firstPageText);
|
||||
viewerPage.checkThumbnailsBtnIsDisplayed();
|
||||
@ -355,7 +357,7 @@ describe('Content Services Viewer', () => {
|
||||
it('[C268901] Should need a password when opening a protected file', () => {
|
||||
viewerPage.viewFile(protectedFile.name);
|
||||
|
||||
browser.driver.sleep(3000); //wait open file
|
||||
browser.driver.sleep(3000); // wait open file
|
||||
|
||||
viewerPage.checkPasswordDialogIsDisplayed();
|
||||
viewerPage.checkPasswordSubmitDisabledIsDisplayed();
|
||||
|
@ -45,14 +45,16 @@ describe('Save screenshot at the end', () => {
|
||||
|
||||
let folder = await alfrescoJsApi.nodes.addNode('-my-', {
|
||||
'name': 'core',
|
||||
'relativePath': 'Buiild-screenshot/Screenshot-e2e-' + buildNumber,
|
||||
'relativePath': 'Build-screenshot/Screenshot-e2e-' + buildNumber,
|
||||
'nodeType': 'cm:folder'
|
||||
}, {}, {});
|
||||
}, {}, {
|
||||
'overwrite': true
|
||||
});
|
||||
|
||||
for (const fileName of files) {
|
||||
|
||||
let pathFile = path.join(__dirname, '../../e2e-output/screenshots', fileName);
|
||||
let file = fs.createReadStream(pathFile);
|
||||
let file: any = fs.createReadStream(pathFile);
|
||||
|
||||
await alfrescoJsApi.upload.uploadFile(
|
||||
file,
|
||||
|
@ -45,14 +45,16 @@ describe('Save screenshot at the end', () => {
|
||||
|
||||
let folder = await alfrescoJsApi.nodes.addNode('-my-', {
|
||||
'name': 'insights',
|
||||
'relativePath': 'Buiild-screenshot/Screenshot-e2e-' + buildNumber,
|
||||
'relativePath': 'Build-screenshot/Screenshot-e2e-' + buildNumber,
|
||||
'nodeType': 'cm:folder'
|
||||
}, {}, {});
|
||||
}, {}, {
|
||||
'overwrite': true
|
||||
});
|
||||
|
||||
for (const fileName of files) {
|
||||
|
||||
let pathFile = path.join(__dirname, '../../e2e-output/screenshots', fileName);
|
||||
let file = fs.createReadStream(pathFile);
|
||||
let file: any = fs.createReadStream(pathFile);
|
||||
|
||||
await alfrescoJsApi.upload.uploadFile(
|
||||
file,
|
||||
|
@ -15,8 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
|
||||
import Util = require('../../util/util');
|
||||
import TestConfig = require('../../test.config');
|
||||
|
||||
export class CommentsPage {
|
||||
|
||||
@ -28,7 +29,6 @@ export class CommentsPage {
|
||||
commentInput = element(by.id('comment-input'));
|
||||
addCommentButton = element(by.css("[data-automation-id='comments-input-add']"));
|
||||
|
||||
|
||||
getTotalNumberOfComments() {
|
||||
Util.waitUntilElementIsVisible(this.numberOfComments);
|
||||
return this.numberOfComments.getText();
|
||||
|
@ -15,8 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, browser } from 'protractor';
|
||||
import Util = require('../../util/util');
|
||||
import TestConfig = require('../../test.config');
|
||||
|
||||
export class ConfigEditorPage {
|
||||
|
||||
@ -25,7 +25,8 @@ export class ConfigEditorPage {
|
||||
browser.driver.sleep(1000);
|
||||
Util.waitUntilElementIsVisible(textField);
|
||||
textField.sendKeys('');
|
||||
textField.clear().sendKeys(text);
|
||||
textField.clear();
|
||||
textField.sendKeys(text);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -374,6 +374,7 @@ var ContentServicesPage = function () {
|
||||
for (i = 0; i < content.length; i++) {
|
||||
this.deleteContent(content[i]);
|
||||
this.checkContentIsNotDisplayed(content[i]);
|
||||
browser.driver.sleep(1000);
|
||||
};
|
||||
return this;
|
||||
};
|
||||
@ -382,6 +383,8 @@ var ContentServicesPage = function () {
|
||||
Util.waitUntilElementIsVisible(errorSnackBar);
|
||||
var deferred = protractor.promise.defer();
|
||||
errorSnackBar.getText().then(function (text) {
|
||||
/*tslint:disable-next-line*/
|
||||
console.log(text);
|
||||
deferred.fulfill(text);
|
||||
});
|
||||
return deferred.promise;
|
||||
|
@ -14,8 +14,10 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, protractor } from 'protractor';
|
||||
|
||||
import Util = require('../../../util/util');
|
||||
import TestConfig = require('../../../test.config');
|
||||
|
||||
export class HeaderPage {
|
||||
|
||||
@ -47,7 +49,7 @@ export class HeaderPage {
|
||||
}
|
||||
|
||||
changeHeaderColor(color) {
|
||||
let headerColor = element(by.css('option[value="'+color+'"]'));
|
||||
let headerColor = element(by.css('option[value="' + color + '"]'));
|
||||
return headerColor.click();
|
||||
}
|
||||
|
||||
@ -58,16 +60,20 @@ export class HeaderPage {
|
||||
|
||||
addTitle(title) {
|
||||
Util.waitUntilElementIsVisible(this.titleInput);
|
||||
return this.titleInput.click().sendKeys(title).sendKeys(protractor.Key.ENTER);
|
||||
this.titleInput.click();
|
||||
this.titleInput.sendKeys(title);
|
||||
this.titleInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
checkIconIsDisplayed(url) {
|
||||
let icon = element(by.css('img[src="'+ url +'"]'));
|
||||
let icon = element(by.css('img[src="' + url + '"]'));
|
||||
Util.waitUntilElementIsVisible(icon);
|
||||
}
|
||||
|
||||
addIcon(url) {
|
||||
Util.waitUntilElementIsVisible(this.iconInput);
|
||||
return this.iconInput.click().sendKeys(url).sendKeys(protractor.Key.ENTER);
|
||||
this.iconInput.click();
|
||||
this.iconInput.sendKeys(url);
|
||||
this.iconInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ var Util = require('../../../util/util');
|
||||
var ContentList = function () {
|
||||
var deleteContent = element(by.css("button[data-automation-id*='DELETE']"));
|
||||
var metadataAction = element(by.css("button[data-automation-id*='METADATA']"));
|
||||
var versionManagerAction = element(by.css("button[data-automation-id*='VERSIONS']"));
|
||||
var moveContent = element(by.css("button[data-automation-id*='MOVE']"));
|
||||
var copyContent = element(by.css("button[data-automation-id*='COPY']"));
|
||||
var downloadContent = element(by.css("button[data-automation-id*='DOWNLOAD']"));
|
||||
@ -88,6 +89,12 @@ var ContentList = function () {
|
||||
metadataAction.click();
|
||||
};
|
||||
|
||||
this.versionManagerContent = function (content) {
|
||||
this.clickOnActionMenu(content);
|
||||
this.waitForContentOptions();
|
||||
versionManagerAction.click();
|
||||
};
|
||||
|
||||
this.moveContent = function (content) {
|
||||
this.clickOnActionMenu(content);
|
||||
moveContent.click();
|
||||
|
@ -20,8 +20,8 @@ var Util = require('../../../util/util');
|
||||
|
||||
var UploadDialog = function () {
|
||||
|
||||
var closeButton = element.all((by.css("footer[class*='upload-dialog__actions'] button"))).first();
|
||||
var dialog = element.all(by.css("div[class*='upload-dialog']")).first();
|
||||
var closeButton = element((by.css('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-close"]')));
|
||||
var dialog = element(by.css("div[id='upload-dialog']"));
|
||||
var minimizedDialog = element(by.css("div[class*='upload-dialog--minimized']"));
|
||||
var uploadedStatusIcon = by.css("mat-icon[class*='status--done']");
|
||||
var cancelledStatusIcon = by.css("div[class*='status--cancelled']");
|
||||
@ -36,7 +36,7 @@ var UploadDialog = function () {
|
||||
var canUploadConfirmationDescription = element(by.css("p[class='upload-dialog__confirmation--text']"));
|
||||
var confirmationDialogNoButton = element(by.partialButtonText("No"));
|
||||
var confirmationDialogYesButton = element(by.partialButtonText("Yes"));
|
||||
var cancelUploads = element(by.partialButtonText("Cancel uploads"));
|
||||
var cancelUploads = element((by.css('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-cancel-all"]')));
|
||||
|
||||
this.clickOnCloseButton = function () {
|
||||
this.checkCloseButtonIsDisplayed();
|
||||
|
@ -23,11 +23,17 @@ var ErrorPage = function(){
|
||||
var errorPageCode = element(by.css("adf-error-content .adf-error-content-code"));
|
||||
var errorPageTitle = element(by.css("adf-error-content .adf-error-content-title"));
|
||||
var errorPageDescription = element(by.css("adf-error-content .adf-error-content-description"));
|
||||
var backButton = element(by.id("adf-return-button"));
|
||||
|
||||
this.checkErrorPage = function(){
|
||||
Util.waitUntilElementIsVisible(errorPage);
|
||||
};
|
||||
|
||||
this.clickBackButton = function(){
|
||||
Util.waitUntilElementIsVisible(backButton);
|
||||
backButton.click();
|
||||
};
|
||||
|
||||
this.checkErrorTitle = function(){
|
||||
Util.waitUntilElementIsVisible(errorPageTitle);
|
||||
};
|
||||
@ -45,6 +51,11 @@ var ErrorPage = function(){
|
||||
return errorPageCode.getText();
|
||||
};
|
||||
|
||||
this.getErrorTitle = function() {
|
||||
Util.waitUntilElementIsVisible(errorPageTitle);
|
||||
return errorPageTitle.getText();
|
||||
};
|
||||
|
||||
this.getErrorDescription = function() {
|
||||
Util.waitUntilElementIsVisible(errorPageDescription);
|
||||
return errorPageDescription.getText();
|
@ -15,6 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, protractor, browser } from 'protractor';
|
||||
|
||||
import Util = require('../../../util/util');
|
||||
import TestConfig = require('../../../test.config');
|
||||
import path = require('path');
|
||||
|
@ -76,11 +76,11 @@ var ProcessFiltersPage = function () {
|
||||
};
|
||||
|
||||
this.checkNoContentMessage = function () {
|
||||
Util.waitUntilElementIsVisible(noContentMessage);
|
||||
return Util.waitUntilElementIsVisible(noContentMessage);
|
||||
};
|
||||
|
||||
this.selectFromProcessList = function (title) {
|
||||
var processName = element.all(by.css('div[data-automation-id="text_'+ title +'"]')).first();
|
||||
var processName = element.all(by.css('div[data-automation-id="text_' + title + '"]')).first();
|
||||
Util.waitUntilElementIsVisible(processName);
|
||||
processName.click();
|
||||
};
|
||||
@ -94,7 +94,7 @@ var ProcessFiltersPage = function () {
|
||||
return element.all(rows).count();
|
||||
};
|
||||
|
||||
this.waitForTableBody = function (){
|
||||
this.waitForTableBody = function () {
|
||||
Util.waitUntilElementIsVisible(tableBody);
|
||||
};
|
||||
|
||||
|
@ -125,7 +125,7 @@ var SearchResultsPage = function () {
|
||||
* @param sortOrder: 'true' to sort the list ascendant and 'false' for descendant
|
||||
*/
|
||||
this.sortByAuthor = function (sortOrder) {
|
||||
contentList.sortByAuthor(sortOrder);
|
||||
this.sortBy(sortOrder, "Author");
|
||||
};
|
||||
|
||||
/**
|
||||
@ -134,7 +134,7 @@ var SearchResultsPage = function () {
|
||||
* @param sortOrder: 'true' to sort the list ascendant and 'false' for descendant
|
||||
*/
|
||||
this.sortByCreated = function (sortOrder) {
|
||||
return contentList.sortByCreated(sortOrder);
|
||||
this.sortBy(sortOrder, "Created");
|
||||
};
|
||||
|
||||
/**
|
||||
|
229
e2e/pages/adf/versionManagerPage.ts
Normal file
229
e2e/pages/adf/versionManagerPage.ts
Normal file
@ -0,0 +1,229 @@
|
||||
/*!
|
||||
* @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 Util = require('../../util/util');
|
||||
import TestConfig = require('../../test.config');
|
||||
import path = require('path');
|
||||
import { browser, by, element, protractor } from 'protractor';
|
||||
|
||||
export class VersionManagePage {
|
||||
|
||||
showNewVersionButton = element(by.css('#adf-show-version-upload-button'));
|
||||
uploadNewVersionButton = element(by.css('adf-upload-version-button input[data-automation-id="upload-single-file"]'));
|
||||
uploadNewVersionContainer = element(by.css('#adf-new-version-uploader-container'));
|
||||
cancelButton = element(by.css('#adf-new-version-cancel'));
|
||||
majorRadio = element(by.css('#adf-new-version-major'));
|
||||
minorRadio = element(by.css('#adf-new-version-minor'));
|
||||
commentText = element(by.css('#adf-new-version-text-area'));
|
||||
readOnlySwitch = element(by.id('adf-version-manager-switch-readonly'));
|
||||
downloadSwitch = element(by.id('adf-version-manager-switch-download'));
|
||||
commentsSwitch = element(by.id('adf-version-manager-switch-comments'));
|
||||
|
||||
checkUploadNewVersionsButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.showNewVersionButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
uploadNewVersionFile = function (fileLocation) {
|
||||
Util.waitUntilElementIsVisible(this.uploadNewVersionButton);
|
||||
this.uploadNewVersionButton.sendKeys(path.resolve(path.join(TestConfig.main.rootPath, fileLocation)));
|
||||
Util.waitUntilElementIsVisible(this.showNewVersionButton);
|
||||
return this;
|
||||
};
|
||||
|
||||
getFileVersionName(version) {
|
||||
let fileElement = element(by.css(`[id="adf-version-list-item-name-${version}"]`));
|
||||
Util.waitUntilElementIsVisible(fileElement);
|
||||
return fileElement.getText();
|
||||
}
|
||||
|
||||
chekFileVersionExist(version) {
|
||||
let fileVersion = element(by.css(`[id="adf-version-list-item-version-${version}"]`));
|
||||
return Util.waitUntilElementIsVisible(fileVersion);
|
||||
}
|
||||
|
||||
chekFileVersionNotExist(version) {
|
||||
let fileVersion = element(by.css(`[id="adf-version-list-item-version-${version}"]`));
|
||||
return Util.waitUntilElementIsNotVisible(fileVersion);
|
||||
}
|
||||
|
||||
getFileVersionComment(version) {
|
||||
let fileComment = element(by.css(`[id="adf-version-list-item-comment-${version}"]`));
|
||||
Util.waitUntilElementIsVisible(fileComment);
|
||||
return fileComment.getText();
|
||||
}
|
||||
|
||||
getFileVersionDate(version) {
|
||||
let fileDate = element(by.css(`[id="adf-version-list-item-date-${version}"]`));
|
||||
Util.waitUntilElementIsVisible(fileDate);
|
||||
return fileDate.getText();
|
||||
}
|
||||
|
||||
enterCommentText(text) {
|
||||
Util.waitUntilElementIsVisible(this.commentText);
|
||||
this.commentText.sendKeys('');
|
||||
this.commentText.clear();
|
||||
this.commentText.sendKeys(text);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickMajorChange() {
|
||||
let radioMajor = element(by.css(`[id="adf-new-version-major"]`));
|
||||
Util.waitUntilElementIsVisible(radioMajor);
|
||||
radioMajor.click();
|
||||
}
|
||||
|
||||
clickMinorChange() {
|
||||
let radioMinor = element(by.css(`[id="adf-new-version-minor"]`));
|
||||
Util.waitUntilElementIsVisible(radioMinor);
|
||||
radioMinor.click();
|
||||
}
|
||||
|
||||
/**
|
||||
* disables download
|
||||
*/
|
||||
disableReadOnly() {
|
||||
Util.waitUntilElementIsVisible(this.readOnlySwitch);
|
||||
this.readOnlySwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') >= 0) {
|
||||
this.readOnlySwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* enables download
|
||||
*/
|
||||
enableReadOnly() {
|
||||
Util.waitUntilElementIsVisible(this.readOnlySwitch);
|
||||
this.readOnlySwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') < 0) {
|
||||
this.readOnlySwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* disables download
|
||||
*/
|
||||
disableDownload() {
|
||||
Util.waitUntilElementIsVisible(this.downloadSwitch);
|
||||
this.downloadSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') >= 0) {
|
||||
this.downloadSwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* enables download
|
||||
*/
|
||||
enableDownload() {
|
||||
Util.waitUntilElementIsVisible(this.downloadSwitch);
|
||||
this.downloadSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') < 0) {
|
||||
this.downloadSwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* disables comments
|
||||
*/
|
||||
disableComments() {
|
||||
Util.waitUntilElementIsVisible(this.commentsSwitch);
|
||||
this.commentsSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') >= 0) {
|
||||
this.commentsSwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* enables comments
|
||||
*/
|
||||
enableComments() {
|
||||
Util.waitUntilElementIsVisible(this.commentsSwitch);
|
||||
this.commentsSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') < 0) {
|
||||
this.commentsSwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
clickActionButton(version) {
|
||||
Util.waitUntilElementIsVisible(element(by.css(`[id="adf-version-list-action-menu-button-${version}"]`)));
|
||||
element(by.css(`[id="adf-version-list-action-menu-button-${version}"]`)).click();
|
||||
return this;
|
||||
}
|
||||
|
||||
clickAcceptConfirm() {
|
||||
Util.waitUntilElementIsVisible(element(by.css(`[id="adf-confirm-accept"]`)));
|
||||
element(by.css(`[id="adf-confirm-accept"]`)).click();
|
||||
return this;
|
||||
}
|
||||
|
||||
clickCancelConfirm() {
|
||||
Util.waitUntilElementIsVisible(element(by.css(`[id="adf-confirm-cancel"]`)));
|
||||
element(by.css(`[id="adf-confirm-cancel"]`)).click();
|
||||
return this;
|
||||
}
|
||||
|
||||
closeActionButton() {
|
||||
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
return this;
|
||||
}
|
||||
|
||||
downloadFileVersion(version) {
|
||||
this.clickActionButton(version);
|
||||
let downloadButton = element(by.css(`[id="adf-version-list-action-download-${version}"]`));
|
||||
Util.waitUntilElementIsVisible(downloadButton);
|
||||
browser.driver.sleep(500);
|
||||
downloadButton.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
deleteFileVersion(version) {
|
||||
this.clickActionButton(version);
|
||||
let deleteButton = element(by.css(`[id="adf-version-list-action-delete-${version}"]`));
|
||||
Util.waitUntilElementIsVisible(deleteButton);
|
||||
browser.driver.sleep(500);
|
||||
deleteButton.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
restoreFileVersion(version) {
|
||||
this.clickActionButton(version);
|
||||
let restoreButton = element(by.css(`[id="adf-version-list-action-restore-${version}"]`));
|
||||
Util.waitUntilElementIsVisible(restoreButton);
|
||||
browser.driver.sleep(500);
|
||||
restoreButton.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
checkActionsArePresent(version) {
|
||||
Util.waitUntilElementIsVisible(element(by.css(`[id="adf-version-list-action-download-${version}"]`)));
|
||||
Util.waitUntilElementIsVisible(element(by.css(`[id="adf-version-list-action-delete-${version}"]`)));
|
||||
Util.waitUntilElementIsVisible(element(by.css(`[id="adf-version-list-action-restore-${version}"]`)));
|
||||
}
|
||||
|
||||
closeVersionDialog() {
|
||||
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
Util.waitUntilElementIsNotOnPage(this.uploadNewVersionContainer);
|
||||
}
|
||||
}
|
@ -15,12 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
|
||||
import NavigationBarPage = require('../pages/adf/navigationBarPage');
|
||||
|
||||
import CONSTANTS = require('../util/constants');
|
||||
import Util = require('../util/util');
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
@ -29,7 +29,6 @@ import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UsersActions } from '../actions/users.actions';
|
||||
import { AppsActions } from '../actions/APS/apps.actions';
|
||||
import { ModelsActions } from '../actions/APS/models.actions';
|
||||
import AppPublish = require('../models/APS/AppPublish');
|
||||
|
||||
describe('Modify applications', () => {
|
||||
|
||||
@ -43,7 +42,7 @@ describe('Modify applications', () => {
|
||||
let modelActions = new ModelsActions();
|
||||
let firstApp, appVersionToBeDeleted;
|
||||
|
||||
beforeAll(async(done) => {
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
@ -75,7 +74,7 @@ describe('Modify applications', () => {
|
||||
expect(processServicesPage.getDescription(app.title)).toEqual(app.description);
|
||||
});
|
||||
|
||||
it('[C260213] Should a new version of the app be displayed on dashboard when is replaced by importing another app in APS', async() => {
|
||||
it('[C260213] Should a new version of the app be displayed on dashboard when is replaced by importing another app in APS', async () => {
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
|
||||
processServicesPage.checkApsContainer();
|
||||
@ -97,7 +96,7 @@ describe('Modify applications', () => {
|
||||
expect(processServicesPage.getDescription(app.title)).toEqual(app.description);
|
||||
});
|
||||
|
||||
it('[C260220] Should the app not be displayed on dashboard after it was deleted in APS', async() => {
|
||||
it('[C260220] Should the app not be displayed on dashboard after it was deleted in APS', async () => {
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
|
||||
processServicesPage.checkApsContainer();
|
||||
@ -114,7 +113,7 @@ describe('Modify applications', () => {
|
||||
processServicesPage.checkAppIsNotDisplayed(app.title);
|
||||
});
|
||||
|
||||
it('[C260215] Should the penultimate version of an app be displayed on dashboard when the last version is deleted in APS', async() => {
|
||||
it('[C260215] Should the penultimate version of an app be displayed on dashboard when the last version is deleted in APS', async () => {
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
|
||||
processServicesPage.checkApsContainer();
|
||||
@ -132,7 +131,7 @@ describe('Modify applications', () => {
|
||||
|
||||
expect(processServicesPage.getBackgroundColor(appTobeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.GREY);
|
||||
|
||||
browser.controlFlow().execute(async() => {
|
||||
browser.controlFlow().execute(async () => {
|
||||
await modelActions.deleteVersionModel(this.alfrescoJsApi, appVersionToBeDeleted.id);
|
||||
await modelActions.deleteVersionModel(this.alfrescoJsApi, appVersionToBeDeleted.id);
|
||||
await apps.publishDeployApp(this.alfrescoJsApi, appVersionToBeDeleted.id);
|
||||
|
@ -40,7 +40,7 @@ describe('Checklist component', () => {
|
||||
let taskPage = new TasksPage();
|
||||
|
||||
let tasks = ['no checklist created task', 'checklist number task', 'remove running checklist', 'remove completed checklist', 'hierarchy'];
|
||||
let checklists= ['cancelCheckList', 'dialogChecklist', 'addFirstChecklist', 'addSecondChecklist'];
|
||||
let checklists = ['cancelCheckList', 'dialogChecklist', 'addFirstChecklist', 'addSecondChecklist'];
|
||||
let removeChecklist = ['removeFirstRunningChecklist', 'removeSecondRunningChecklist', 'removeFirstCompletedChecklist', 'removeSecondCompletedChecklist'];
|
||||
let hierarchyChecklist = ['checklistOne', 'checklistTwo', 'checklistOneChild', 'checklistTwoChild'];
|
||||
|
||||
@ -178,7 +178,7 @@ describe('Checklist component', () => {
|
||||
|
||||
taskPage.usingTasksListPage().selectTaskFromTasksList(tasks[4]);
|
||||
taskPage.completeTaskNoForm();
|
||||
|
||||
|
||||
taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.COMPL_TASKS);
|
||||
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(tasks[4]);
|
||||
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(hierarchyChecklist[0]);
|
||||
@ -188,4 +188,3 @@ describe('Checklist component', () => {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
@ -15,15 +15,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
|
||||
import ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage.js');
|
||||
import { CommentsPage } from '../pages/adf/commentsPage';
|
||||
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
import Util = require('../util/util.js');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UsersActions } from '../actions/users.actions';
|
||||
@ -45,10 +44,10 @@ describe('Comment component for Processes', () => {
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
done();
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async(done) =>{
|
||||
beforeEach(async(done) => {
|
||||
let apps = new AppsActions();
|
||||
let users = new UsersActions();
|
||||
|
||||
@ -85,7 +84,7 @@ describe('Comment component for Processes', () => {
|
||||
|
||||
it('[C260464] Should be able to add a comment on APS and check on ADF', () => {
|
||||
browser.controlFlow().execute(async() => {
|
||||
comment = {message: "HELLO"};
|
||||
comment = {message: 'HELLO'};
|
||||
|
||||
await this.alfrescoJsApi.activiti.commentsApi.addProcessInstanceComment(comment, processInstanceId);
|
||||
});
|
||||
@ -100,7 +99,7 @@ describe('Comment component for Processes', () => {
|
||||
|
||||
commentsPage.checkUserIconIsDisplayed(0);
|
||||
|
||||
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments ('+ addedComment.total +')');
|
||||
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + addedComment.total + ')');
|
||||
expect(commentsPage.getMessage(0)).toEqual(addedComment.data[0].message);
|
||||
expect(commentsPage.getUserName(0)).toEqual(addedComment.data[0].createdBy.firstName + ' ' + addedComment.data[0].createdBy.lastName);
|
||||
expect(commentsPage.getTime(0)).toEqual('a few seconds ago');
|
||||
@ -109,7 +108,7 @@ describe('Comment component for Processes', () => {
|
||||
|
||||
it('[C260465] Should not be able to view process comment on included task', () => {
|
||||
browser.controlFlow().execute(async() => {
|
||||
comment = {message: "GOODBYE"};
|
||||
comment = {message: 'GOODBYE'};
|
||||
|
||||
await this.alfrescoJsApi.activiti.commentsApi.addProcessInstanceComment(comment, processInstanceId);
|
||||
});
|
||||
@ -135,7 +134,7 @@ describe('Comment component for Processes', () => {
|
||||
|
||||
let taskId = taskQuery.data[0].id;
|
||||
|
||||
taskComment = {message: "Task Comment"};
|
||||
taskComment = {message: 'Task Comment'};
|
||||
|
||||
await this.alfrescoJsApi.activiti.taskApi.addTaskComment(taskComment, taskId);
|
||||
});
|
||||
@ -150,7 +149,7 @@ describe('Comment component for Processes', () => {
|
||||
|
||||
commentsPage.checkUserIconIsDisplayed(0);
|
||||
|
||||
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments ('+ addedTaskComment.total +')');
|
||||
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + addedTaskComment.total + ')');
|
||||
expect(commentsPage.getMessage(0)).toEqual(addedTaskComment.data[0].message);
|
||||
expect(commentsPage.getUserName(0)).toEqual(addedTaskComment.data[0].createdBy.firstName + ' ' + addedTaskComment.data[0].createdBy.lastName);
|
||||
expect(commentsPage.getTime(0)).toEqual('a few seconds ago');
|
||||
|
@ -15,6 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
|
||||
import TasksPage = require('../pages/adf/process_services/tasksPage');
|
||||
@ -24,7 +26,6 @@ import CONSTANTS = require('../util/constants');
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
import Util = require('../util/util.js');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UsersActions } from '../actions/users.actions';
|
||||
@ -55,7 +56,7 @@ describe('Comment component for Processes', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async(done) =>{
|
||||
beforeEach(async(done) => {
|
||||
let apps = new AppsActions();
|
||||
let users = new UsersActions();
|
||||
|
||||
@ -114,8 +115,8 @@ describe('Comment component for Processes', () => {
|
||||
|
||||
await this.alfrescoJsApi.activiti.taskApi.involveUser(newTaskId, {email: secondUser.email});
|
||||
|
||||
let taskComment = {message: "Task Comment"};
|
||||
let secondTaskComment = {message: "Second Task Comment"};
|
||||
let taskComment = {message: 'Task Comment'};
|
||||
let secondTaskComment = {message: 'Second Task Comment'};
|
||||
|
||||
await this.alfrescoJsApi.activiti.taskApi.addTaskComment(taskComment, newTaskId);
|
||||
await this.alfrescoJsApi.activiti.taskApi.addTaskComment(secondTaskComment, newTaskId);
|
||||
@ -130,12 +131,12 @@ describe('Comment component for Processes', () => {
|
||||
browser.controlFlow().execute(async() => {
|
||||
let totalComments = await this.alfrescoJsApi.activiti.taskApi.getTaskComments(newTaskId, {'latestFirst': true});
|
||||
|
||||
let thirdTaskComment = {message: "Third Task Comment"};
|
||||
let thirdTaskComment = {message: 'Third Task Comment'};
|
||||
|
||||
await commentsPage.checkUserIconIsDisplayed(0);
|
||||
await commentsPage.checkUserIconIsDisplayed(1);
|
||||
|
||||
await expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments ('+ totalComments.total +')');
|
||||
await expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + totalComments.total + ')');
|
||||
|
||||
await expect(commentsPage.getMessage(0)).toEqual(totalComments.data[0].message);
|
||||
await expect(commentsPage.getMessage(1)).toEqual(totalComments.data[1].message);
|
||||
@ -164,7 +165,7 @@ describe('Comment component for Processes', () => {
|
||||
await commentsPage.checkUserIconIsDisplayed(1);
|
||||
await commentsPage.checkUserIconIsDisplayed(2);
|
||||
|
||||
await expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments ('+ totalComments.total +')');
|
||||
await expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + totalComments.total + ')');
|
||||
|
||||
await expect(commentsPage.getMessage(0)).toEqual(totalComments.data[0].message);
|
||||
await expect(commentsPage.getMessage(1)).toEqual(totalComments.data[1].message);
|
||||
|
@ -15,14 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
|
||||
import ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage.js');
|
||||
import FiltersPage = require('../pages/adf/process_services/filtersPage.js')
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
import Util = require('../util/util.js');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UsersActions } from '../actions/users.actions';
|
||||
|
@ -15,14 +15,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
|
||||
import ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage.js');
|
||||
import FiltersPage = require('../pages/adf/process_services/filtersPage.js')
|
||||
import FiltersPage = require('../pages/adf/process_services/filtersPage.js');
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
import Util = require('../util/util.js');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UsersActions } from '../actions/users.actions';
|
||||
@ -96,41 +97,29 @@ describe('Sorting for process filters', () => {
|
||||
it('[C260476] Should be able to create a filter on APS for running processes - Oldest first and check on ADF', () => {
|
||||
browser.controlFlow().execute(async () => {
|
||||
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null,
'name': processFilter.running_old_first,
'icon': 'glyphicon-random',
|
||||
'filter':{'sort': 'created-asc', 'name': '', 'state': 'running'}
|
||||
'appId': null,
'name': processFilter.running_old_first,
'icon': 'glyphicon-random',
|
||||
'filter': {'sort': 'created-asc', 'name': '', 'state': 'running'}
|
||||
});
|
||||
|
||||
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
|
||||
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2');
|
||||
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3');
|
||||
});
|
||||
|
||||
loginPage.loginToProcessServicesUsingUserModel(user);
|
||||
|
||||
processServicesPage
|
||||
});
loginPage.loginToProcessServicesUsingUserModel(user);
processServicesPage
|
||||
.goToProcessServices()
|
||||
.goToTaskApp()
|
||||
.clickProcessButton();
|
||||
|
||||
processFiltersPage.checkFilterIsDisplayed(processFilter.running_old_first);
|
||||
|
||||
filtersPage.goToFilter(processFilter.running_old_first);
|
||||
|
||||
browser.controlFlow().execute(async () => {
|
||||
.clickProcessButton();
processFiltersPage.checkFilterIsDisplayed(processFilter.running_old_first);
filtersPage.goToFilter(processFilter.running_old_first);
browser.controlFlow().execute(async () => {
|
||||
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
|
||||
"processDefinitionId":null,"appDefinitionId":null,"state":"running","sort":"created-asc"
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'running', 'sort': 'created-asc'
|
||||
});
|
||||
expect(processesQuery.data[0].name).toEqual('Process 1');
|
||||
expect(processesQuery.data[1].name).toEqual('Process 2');
|
||||
expect(processesQuery.data[2].name).toEqual('Process 3');
|
||||
});
|
||||
});
|
||||
});
});
|
||||
|
||||
it('[C260477] Should be able to create a filter on APS for completed processes - Oldest first and check on ADF', () => {
|
||||
browser.controlFlow().execute(async () => {
|
||||
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null,
'name': processFilter.completed_old_first,
'icon': 'glyphicon-random',
|
||||
'filter':{'sort': 'created-asc', 'name': '', 'state': 'completed'}
|
||||
'appId': null,
'name': processFilter.completed_old_first,
'icon': 'glyphicon-random',
|
||||
'filter': {'sort': 'created-asc', 'name': '', 'state': 'completed'}
|
||||
});
|
||||
|
||||
let firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
|
||||
@ -155,7 +144,7 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
browser.controlFlow().execute(async () => {
|
||||
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
|
||||
"processDefinitionId":null,"appDefinitionId":null,"state":"completed","sort":"created-asc"
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'created-asc'
|
||||
});
|
||||
expect(processesQuery.data[0].name).toEqual('Process 1');
|
||||
expect(processesQuery.data[1].name).toEqual('Process 2');
|
||||
@ -166,8 +155,8 @@ describe('Sorting for process filters', () => {
|
||||
it('[C260478] Should be able to create a filter on APS for all processes - Oldest first and check on ADF', () => {
|
||||
browser.controlFlow().execute(async () => {
|
||||
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null,
'name': processFilter.all_old_first,
'icon': 'glyphicon-random',
|
||||
'filter':{'sort': 'created-asc', 'name': '', 'state': 'all'}
|
||||
'appId': null,
'name': processFilter.all_old_first,
'icon': 'glyphicon-random',
|
||||
'filter': {'sort': 'created-asc', 'name': '', 'state': 'all'}
|
||||
});
|
||||
|
||||
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
|
||||
@ -196,7 +185,7 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
browser.controlFlow().execute(async () => {
|
||||
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
|
||||
"processDefinitionId":null,"appDefinitionId":null,"state":"all","sort":"created-asc"
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'all', 'sort': 'created-asc'
|
||||
});
|
||||
expect(processesQuery.data[0].name).toEqual('Process 1');
|
||||
expect(processesQuery.data[1].name).toEqual('Process 2');
|
||||
@ -210,8 +199,8 @@ describe('Sorting for process filters', () => {
|
||||
it('[C260479] Should be able to create a filter on APS for running processes - Newest first and check on ADF', () => {
|
||||
browser.controlFlow().execute(async () => {
|
||||
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null,
'name': processFilter.running_new_first,
'icon': 'glyphicon-random',
|
||||
'filter':{'sort': 'created-desc', 'name': '', 'state': 'running'}
|
||||
'appId': null,
'name': processFilter.running_new_first,
'icon': 'glyphicon-random',
|
||||
'filter': {'sort': 'created-desc', 'name': '', 'state': 'running'}
|
||||
});
|
||||
|
||||
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
|
||||
@ -232,7 +221,7 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
browser.controlFlow().execute(async () => {
|
||||
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
|
||||
"processDefinitionId":null,"appDefinitionId":null,"state":"running","sort":"created-desc"
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'running', 'sort': 'created-desc'
|
||||
});
|
||||
expect(processesQuery.data[0].name).toEqual('Process 3');
|
||||
expect(processesQuery.data[1].name).toEqual('Process 2');
|
||||
@ -243,8 +232,8 @@ describe('Sorting for process filters', () => {
|
||||
it('[C260480] Should be able to create a filter on APS for completed processes - Newest first and check on ADF', () => {
|
||||
browser.controlFlow().execute(async () => {
|
||||
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null,
'name': processFilter.completed_new_first,
'icon': 'glyphicon-random',
|
||||
'filter':{'sort': 'created-desc', 'name': '', 'state': 'completed'}
|
||||
'appId': null,
'name': processFilter.completed_new_first,
'icon': 'glyphicon-random',
|
||||
'filter': {'sort': 'created-desc', 'name': '', 'state': 'completed'}
|
||||
});
|
||||
|
||||
let firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
|
||||
@ -269,7 +258,7 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
browser.controlFlow().execute(async () => {
|
||||
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
|
||||
"processDefinitionId":null,"appDefinitionId":null,"state":"completed","sort":"created-desc"
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'created-desc'
|
||||
});
|
||||
expect(processesQuery.data[0].name).toEqual('Process 3');
|
||||
expect(processesQuery.data[1].name).toEqual('Process 2');
|
||||
@ -280,8 +269,8 @@ describe('Sorting for process filters', () => {
|
||||
it('[C260481] Should be able to create a filter on APS for all processes - Newest first and check on ADF', () => {
|
||||
browser.controlFlow().execute(async () => {
|
||||
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null,
'name': processFilter.all_new_first,
'icon': 'glyphicon-random',
|
||||
'filter':{'sort': 'created-desc', 'name': '', 'state': 'all'}
|
||||
'appId': null,
'name': processFilter.all_new_first,
'icon': 'glyphicon-random',
|
||||
'filter': {'sort': 'created-desc', 'name': '', 'state': 'all'}
|
||||
});
|
||||
|
||||
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
|
||||
@ -310,7 +299,7 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
browser.controlFlow().execute(async () => {
|
||||
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
|
||||
"processDefinitionId":null,"appDefinitionId":null,"state":"all","sort":"created-desc"
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'all', 'sort': 'created-desc'
|
||||
});
|
||||
expect(processesQuery.data[0].name).toEqual('Process 6');
|
||||
expect(processesQuery.data[1].name).toEqual('Process 5');
|
||||
@ -321,11 +310,11 @@ describe('Sorting for process filters', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('[C272815] Should be able to create a filter on APS for completed processes - Completed most recently and check on ADF', () =>{
|
||||
it('[C272815] Should be able to create a filter on APS for completed processes - Completed most recently and check on ADF', () => {
|
||||
browser.controlFlow().execute(async () => {
|
||||
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null,
'name': processFilter.completed_most_recently,
'icon': 'glyphicon-random',
|
||||
'filter':{'sort': 'ended-asc', 'name': '', 'state': 'completed'}
|
||||
'appId': null,
'name': processFilter.completed_most_recently,
'icon': 'glyphicon-random',
|
||||
'filter': {'sort': 'ended-asc', 'name': '', 'state': 'completed'}
|
||||
});
|
||||
|
||||
let firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
|
||||
@ -350,7 +339,7 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
browser.controlFlow().execute(async () => {
|
||||
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
|
||||
"processDefinitionId":null,"appDefinitionId":null,"state":"completed","sort":"ended-asc"
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'ended-asc'
|
||||
});
|
||||
expect(processesQuery.data[0].name).toEqual('Process 2');
|
||||
expect(processesQuery.data[1].name).toEqual('Process 1');
|
||||
@ -361,8 +350,8 @@ describe('Sorting for process filters', () => {
|
||||
it('[C272816] Should be able to create a filter on APS for completed processes - Completed least recently and check on ADF', () => {
|
||||
browser.controlFlow().execute(async () => {
|
||||
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null,
'name': processFilter.completed_least_recently,
'icon': 'glyphicon-random',
|
||||
'filter':{'sort': 'ended-desc', 'name': '', 'state': 'completed'}
|
||||
'appId': null,
'name': processFilter.completed_least_recently,
'icon': 'glyphicon-random',
|
||||
'filter': {'sort': 'ended-desc', 'name': '', 'state': 'completed'}
|
||||
});
|
||||
|
||||
let firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
|
||||
@ -387,7 +376,7 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
browser.controlFlow().execute(async () => {
|
||||
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
|
||||
"processDefinitionId":null,"appDefinitionId":null,"state":"completed","sort":"ended-desc"
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'ended-desc'
|
||||
});
|
||||
expect(processesQuery.data[0].name).toEqual('Process 3');
|
||||
expect(processesQuery.data[1].name).toEqual('Process 1');
|
||||
|
@ -38,9 +38,9 @@ describe('People component', () => {
|
||||
let processUserModel, assigneeUserModel, secondAssigneeUserModel;
|
||||
let app = resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
let taskPage = new TasksPage();
|
||||
let peopleTitle = "People this task is shared with ";
|
||||
let peopleTitle = 'People this task is shared with ';
|
||||
|
||||
let tasks = ['no people involved task', 'remove people task', 'can not complete task', 'multiple users', 'completed filter'];
|
||||
let tasks = ['no people involved task', 'remove people task', 'can not complete task', 'multiple users', 'completed filter'];
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
@ -177,8 +177,8 @@ describe('People component', () => {
|
||||
expect(taskPage.usingTaskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
|
||||
.toEqual(assigneeUserModel.email);
|
||||
expect(taskPage.usingTaskDetails().getInvolvedUserEditAction(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
|
||||
.toEqual("can edit");
|
||||
expect(taskPage.usingTaskDetails().getInvolvedPeopleTitle()).toEqual(peopleTitle + "(1)");
|
||||
.toEqual('can edit');
|
||||
expect(taskPage.usingTaskDetails().getInvolvedPeopleTitle()).toEqual(peopleTitle + '(1)');
|
||||
|
||||
taskPage.usingTaskDetails().clickInvolvePeopleButton()
|
||||
.typeUser(secondAssigneeUserModel.firstName + ' ' + secondAssigneeUserModel.lastName)
|
||||
@ -190,8 +190,8 @@ describe('People component', () => {
|
||||
.toEqual(secondAssigneeUserModel.email);
|
||||
|
||||
expect(taskPage.usingTaskDetails().getInvolvedUserEditAction(secondAssigneeUserModel.firstName + ' ' + secondAssigneeUserModel.lastName))
|
||||
.toEqual("can edit");
|
||||
expect(taskPage.usingTaskDetails().getInvolvedPeopleTitle()).toEqual(peopleTitle + "(2)");
|
||||
.toEqual('can edit');
|
||||
expect(taskPage.usingTaskDetails().getInvolvedPeopleTitle()).toEqual(peopleTitle + '(2)');
|
||||
});
|
||||
|
||||
it('[C280014] Should involved user see the task in completed filters when the task is completed', () => {
|
||||
@ -224,4 +224,3 @@ describe('People component', () => {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
@ -22,8 +22,6 @@ import ProcessDetailsPage = require('../pages/adf/process_services/processDetail
|
||||
import { AttachmentListPage } from '../pages/adf/process_services/attachmentListPage';
|
||||
import ViewerPage = require('../pages/adf/viewerPage.js');
|
||||
|
||||
import CONSTANTS = require('../util/constants');
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
import Util = require('../util/util.js');
|
||||
@ -98,7 +96,7 @@ describe('Attachment list action menu for processes', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
xit('[C260228] Option menu functionality - Active Process', () => {
|
||||
it('[C260228] Option menu functionality - Active Process', () => {
|
||||
processServicesPage.goToProcessServices().goToApp(app.title).clickProcessButton();
|
||||
|
||||
processFiltersPage.selectFromProcessList(processName.active);
|
||||
@ -132,7 +130,7 @@ describe('Attachment list action menu for processes', () => {
|
||||
attachmentListPage.checkFileIsRemoved(pngFile.name);
|
||||
});
|
||||
|
||||
xit('[C279886] Option menu functionality - Completed Process', () => {
|
||||
it('[C279886] Option menu functionality - Completed Process', () => {
|
||||
processServicesPage.goToProcessServices().goToApp(app.title).clickProcessButton();
|
||||
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
|
@ -29,7 +29,6 @@ import AlfrescoApi = require('alfresco-js-api-node');
|
||||
|
||||
import { AppsActions } from '../actions/APS/apps.actions';
|
||||
import { UsersActions } from '../actions/users.actions';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
describe('Process Filters Test', () => {
|
||||
|
||||
@ -75,7 +74,7 @@ describe('Process Filters Test', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach( () => {
|
||||
beforeEach(() => {
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
processServicesPage.checkApsContainer();
|
||||
processServicesPage.goToApp(app.title);
|
||||
|
@ -51,7 +51,7 @@ describe('Process List - Pagination', function () {
|
||||
let paginationPage = new PaginationPage();
|
||||
let processFiltersPage = new ProcessFiltersPage();
|
||||
let processDetailsPage = new ProcessDetailsPage();
|
||||
|
||||
let deployedTestApp;
|
||||
let processUserModel;
|
||||
let app = resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
let nrOfProcesses = 20;
|
||||
@ -73,283 +73,322 @@ describe('Process List - Pagination', function () {
|
||||
|
||||
await this.alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
||||
|
||||
let resultApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location);
|
||||
|
||||
for (let i = 0; i < nrOfProcesses; i++) {
|
||||
await apps.startProcess(this.alfrescoJsApi, resultApp);
|
||||
}
|
||||
deployedTestApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location);
|
||||
|
||||
loginPage.loginToProcessServicesUsingUserModel(processUserModel);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
xit('[C261042] Default pagination', function () {
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.checkNoContentMessage();
|
||||
paginationPage.checkPaginationIsNotDisplayed();
|
||||
describe('Empty processes', function () {
|
||||
|
||||
page = 1;
|
||||
totalPages = 1;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfProcesses + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses);
|
||||
paginationPage.checkNextPageButtonIsDisabled();
|
||||
paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
});
|
||||
|
||||
xit('[C261043] Items per page set to 15', function () {
|
||||
page = 1;
|
||||
totalPages = 2;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * page + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fifteenValue);
|
||||
paginationPage.checkNextPageButtonIsEnabled();
|
||||
paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
|
||||
page++;
|
||||
paginationPage.clickOnNextPage();
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfProcesses + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses - itemsPerPage.fifteenValue);
|
||||
paginationPage.checkNextPageButtonIsDisabled();
|
||||
paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
page = 1;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
||||
});
|
||||
|
||||
xit('[C261044] Items per page set to 10', function () {
|
||||
page = 1;
|
||||
totalPages = 2;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.ten);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * page + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
|
||||
paginationPage.checkNextPageButtonIsEnabled();
|
||||
paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
|
||||
page++;
|
||||
paginationPage.clickOnNextPage();
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + nrOfProcesses + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
|
||||
paginationPage.checkNextPageButtonIsDisabled();
|
||||
paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
page = 1;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
});
|
||||
|
||||
it('[C261047] Items per page set to 20', function () {
|
||||
page = 1;
|
||||
totalPages = 1;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfProcesses + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses);
|
||||
paginationPage.checkNextPageButtonIsDisabled();
|
||||
paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
|
||||
});
|
||||
|
||||
it('[C261045] 5 Items per page', function () {
|
||||
page = 1;
|
||||
totalPages = 4;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.five);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.five * page + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
|
||||
paginationPage.checkNextPageButtonIsEnabled();
|
||||
paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
|
||||
page++;
|
||||
paginationPage.clickOnNextPage();
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 6-' + itemsPerPage.five * page + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
|
||||
paginationPage.checkNextPageButtonIsEnabled();
|
||||
paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
page++;
|
||||
paginationPage.clickOnNextPage();
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.five * page + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
|
||||
paginationPage.checkNextPageButtonIsEnabled();
|
||||
paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
page++;
|
||||
paginationPage.clickOnNextPage();
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + itemsPerPage.five * page + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
|
||||
paginationPage.checkNextPageButtonIsDisabled();
|
||||
paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
page = 1;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
});
|
||||
|
||||
it('[C261049] Page number dropdown', function () {
|
||||
page = 1;
|
||||
totalPages = 2;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.ten);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * page + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
|
||||
paginationPage.checkNextPageButtonIsEnabled();
|
||||
paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
|
||||
paginationPage.clickOnPageDropdown();
|
||||
expect(paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
|
||||
page = 2;
|
||||
paginationPage.clickOnPageDropdownOption('2');
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.tenValue * page + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
|
||||
paginationPage.checkNextPageButtonIsDisabled();
|
||||
paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
paginationPage.clickOnPageDropdown();
|
||||
expect(paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
|
||||
page = 1;
|
||||
paginationPage.clickOnPageDropdownOption('1');
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * page + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
|
||||
paginationPage.checkNextPageButtonIsEnabled();
|
||||
paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
});
|
||||
|
||||
xit('[C261048] Sorting by Name', function () {
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
processFiltersPage.sortByName(true);
|
||||
processFiltersPage.waitForTableBody();
|
||||
processFiltersPage.getAllRowsNameColumn().then(function (list) {
|
||||
expect(JSON.stringify(list) === JSON.stringify(processNames)).toEqual(true);
|
||||
it('[C261042] Should show empty content message an no pagination when no process are present', function () {
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.checkNoContentMessage();
|
||||
paginationPage.checkPaginationIsNotDisplayed();
|
||||
});
|
||||
processFiltersPage.sortByName(false);
|
||||
processFiltersPage.getAllRowsNameColumn().then(function (list) {
|
||||
processNames.reverse();
|
||||
expect(JSON.stringify(list) === JSON.stringify(processNames)).toEqual(true);
|
||||
});
|
||||
|
||||
describe('With processes Pagination', function () {
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let apps = new AppsActions();
|
||||
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: TestConfig.adf.url
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.login(processUserModel.email, processUserModel.password);
|
||||
|
||||
for (let i = 0; i < nrOfProcesses; i++) {
|
||||
await apps.startProcess(this.alfrescoJsApi, deployedTestApp);
|
||||
}
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C261042] Default pagination', function () {
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
|
||||
page = 1;
|
||||
totalPages = 1;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfProcesses + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses);
|
||||
paginationPage.checkNextPageButtonIsDisabled();
|
||||
paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
});
|
||||
|
||||
it('[C261043] Items per page set to 15', function () {
|
||||
page = 1;
|
||||
totalPages = 2;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * page + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fifteenValue);
|
||||
paginationPage.checkNextPageButtonIsEnabled();
|
||||
paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
|
||||
page++;
|
||||
paginationPage.clickOnNextPage();
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfProcesses + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses - itemsPerPage.fifteenValue);
|
||||
paginationPage.checkNextPageButtonIsDisabled();
|
||||
paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
page = 1;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
|
||||
});
|
||||
|
||||
it('[C261044] Items per page set to 10', function () {
|
||||
page = 1;
|
||||
totalPages = 2;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.ten);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * page + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
|
||||
paginationPage.checkNextPageButtonIsEnabled();
|
||||
paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
|
||||
page++;
|
||||
paginationPage.clickOnNextPage();
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + nrOfProcesses + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
|
||||
paginationPage.checkNextPageButtonIsDisabled();
|
||||
paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
page = 1;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
});
|
||||
|
||||
it('[C261047] Items per page set to 20', function () {
|
||||
page = 1;
|
||||
totalPages = 1;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfProcesses + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses);
|
||||
paginationPage.checkNextPageButtonIsDisabled();
|
||||
paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
|
||||
});
|
||||
|
||||
it('[C261045] 5 Items per page', function () {
|
||||
let showing;
|
||||
page = 1;
|
||||
totalPages = 4;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.five);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
|
||||
showing = (itemsPerPage.fiveValue * page);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + showing + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
|
||||
paginationPage.checkNextPageButtonIsEnabled();
|
||||
paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
|
||||
page++;
|
||||
paginationPage.clickOnNextPage();
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
|
||||
showing = (itemsPerPage.fiveValue * page);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 6-' + showing + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
|
||||
paginationPage.checkNextPageButtonIsEnabled();
|
||||
paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
page++;
|
||||
paginationPage.clickOnNextPage();
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
|
||||
showing = (itemsPerPage.fiveValue * page);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + showing + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
|
||||
paginationPage.checkNextPageButtonIsEnabled();
|
||||
paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
page++;
|
||||
paginationPage.clickOnNextPage();
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
|
||||
showing = (itemsPerPage.fiveValue * page);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + showing + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
|
||||
paginationPage.checkNextPageButtonIsDisabled();
|
||||
paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
page = 1;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
|
||||
});
|
||||
|
||||
it('[C261049] Page number dropdown', function () {
|
||||
let showing;
|
||||
page = 1;
|
||||
totalPages = 2;
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.ten);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
|
||||
showing = (itemsPerPage.tenValue * page);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + showing + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
|
||||
paginationPage.checkNextPageButtonIsEnabled();
|
||||
paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
|
||||
paginationPage.clickOnPageDropdown();
|
||||
expect(paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
|
||||
page = 2;
|
||||
paginationPage.clickOnPageDropdownOption('2');
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
|
||||
showing = (itemsPerPage.tenValue * page);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + showing + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
|
||||
paginationPage.checkNextPageButtonIsDisabled();
|
||||
paginationPage.checkPreviousPageButtonIsEnabled();
|
||||
|
||||
paginationPage.clickOnPageDropdown();
|
||||
expect(paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
|
||||
page = 1;
|
||||
paginationPage.clickOnPageDropdownOption('1');
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
|
||||
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
|
||||
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
|
||||
|
||||
showing = (itemsPerPage.tenValue * page);
|
||||
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + showing + ' of ' + nrOfProcesses);
|
||||
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
|
||||
paginationPage.checkNextPageButtonIsEnabled();
|
||||
paginationPage.checkPreviousPageButtonIsDisabled();
|
||||
});
|
||||
|
||||
xit('[C261048] Sorting by Name', function () {
|
||||
processServicesPage.goToProcessServices().goToTaskApp().clickProcessButton();
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
|
||||
processDetailsPage.checkProcessTitleIsDisplayed();
|
||||
processFiltersPage.waitForTableBody();
|
||||
processFiltersPage.sortByName(true);
|
||||
processFiltersPage.waitForTableBody();
|
||||
processFiltersPage.getAllRowsNameColumn().then(function (list) {
|
||||
expect(JSON.stringify(list) === JSON.stringify(processNames)).toEqual(true);
|
||||
});
|
||||
processFiltersPage.sortByName(false);
|
||||
processFiltersPage.getAllRowsNameColumn().then(function (list) {
|
||||
processNames.reverse();
|
||||
expect(JSON.stringify(list) === JSON.stringify(processNames)).toEqual(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -15,12 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by } from 'protractor';
|
||||
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
|
||||
import TasksPage = require('../pages/adf/process_services/tasksPage');
|
||||
import { AttachmentListPage } from '../pages/adf/process_services/attachmentListPage';
|
||||
import CONSTANTS = require('../util/constants');
|
||||
import ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage');
|
||||
|
||||
import Task = require('../models/APS/Task');
|
||||
import Tenant = require('../models/APS/Tenant');
|
||||
@ -40,7 +41,6 @@ import { UsersActions } from '../actions/users.actions';
|
||||
|
||||
describe('Start Task - Custom App', () => {
|
||||
|
||||
let processFiltersPage = new ProcessFiltersPage();
|
||||
let TASKDATAFORMAT = 'mmm dd yyyy';
|
||||
let loginPage = new LoginPage();
|
||||
let processServicesPage = new ProcessServicesPage();
|
||||
|
@ -15,6 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by } from 'protractor';
|
||||
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
|
||||
import TasksPage = require('../pages/adf/process_services/tasksPage');
|
||||
|
@ -15,6 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
|
||||
import TasksPage = require('../pages/adf/process_services/tasksPage');
|
||||
@ -177,7 +179,7 @@ describe('Attachment list action menu for tasks', () => {
|
||||
|
||||
it('[C260234] Should be able to attache a file on a task on APS and check on ADF', () => {
|
||||
browser.controlFlow().execute(async() => {
|
||||
let newTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask({name: "SHARE KNOWLEDGE"});
|
||||
let newTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask({name: 'SHARE KNOWLEDGE'});
|
||||
|
||||
let newTaskId = newTask.id;
|
||||
|
||||
|
@ -49,7 +49,7 @@ describe('Task List Pagination', () => {
|
||||
fifteenValue: 15,
|
||||
twenty: '20',
|
||||
twentyValue: 20,
|
||||
default: '25'
|
||||
default: '20'
|
||||
};
|
||||
|
||||
beforeAll(async (done) => {
|
||||
|
@ -45,14 +45,16 @@ describe('Save screenshot at the end', () => {
|
||||
|
||||
let folder = await alfrescoJsApi.nodes.addNode('-my-', {
|
||||
'name': 'process-services',
|
||||
'relativePath': 'Buiild-screenshot/Screenshot-e2e-' + buildNumber,
|
||||
'relativePath': 'Build-screenshot/Screenshot-e2e-' + buildNumber,
|
||||
'nodeType': 'cm:folder'
|
||||
}, {}, {});
|
||||
}, {}, {
|
||||
'overwrite': true
|
||||
});
|
||||
|
||||
for (const fileName of files) {
|
||||
|
||||
let pathFile = path.join(__dirname, '../../e2e-output/screenshots', fileName);
|
||||
let file = fs.createReadStream(pathFile);
|
||||
let file: any = fs.createReadStream(pathFile);
|
||||
|
||||
await alfrescoJsApi.upload.uploadFile(
|
||||
file,
|
||||
|
@ -15,6 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import LoginPage = require('./pages/adf/loginPage');
|
||||
import ProcessServicesPage = require('./pages/adf/process_services/processServicesPage');
|
||||
import TasksPage = require('./pages/adf/process_services/tasksPage');
|
||||
@ -23,15 +25,10 @@ import CONSTANTS = require('./util/constants');
|
||||
|
||||
import Tenant = require('./models/APS/Tenant');
|
||||
import Task = require('./models/APS/Task');
|
||||
import TaskModel = require('./models/APS/TaskModel');
|
||||
import FormModel = require('./models/APS/FormModel');
|
||||
import FileModel = require('./models/ACS/fileModel');
|
||||
|
||||
import TestConfig = require('./test.config');
|
||||
import resources = require('./util/resources');
|
||||
|
||||
import dateFormat = require('dateformat');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UsersActions } from './actions/users.actions';
|
||||
import fs = require('fs');
|
||||
@ -47,7 +44,6 @@ describe('Start Task - Task App', () => {
|
||||
let taskPage = new TasksPage();
|
||||
let tasks = ['Standalone task', 'Completed standalone task', 'Add a form', 'Remove form'];
|
||||
let noFormMessage = 'No forms attached';
|
||||
let taskModel;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let users = new UsersActions();
|
||||
@ -126,7 +122,7 @@ describe('Start Task - Task App', () => {
|
||||
taskPage.usingTasksListPage().checkTaskIsDisplayedInTasksList(tasks[3]);
|
||||
expect(taskPage.usingTaskDetails().getFormName()).toEqual(app.formName);
|
||||
|
||||
browser.controlFlow().execute(async() => {
|
||||
browser.controlFlow().execute(async () => {
|
||||
const listOfTasks = await this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
await this.alfrescoJsApi.activiti.taskApi.removeForm(listOfTasks.data[0].id);
|
||||
});
|
||||
|
@ -22,21 +22,14 @@ import TasksPage = require('./pages/adf/process_services/tasksPage');
|
||||
import CONSTANTS = require('./util/constants');
|
||||
|
||||
import Tenant = require('./models/APS/Tenant');
|
||||
import Task = require('./models/APS/Task');
|
||||
import TaskModel = require('./models/APS/TaskModel');
|
||||
import FormModel = require('./models/APS/FormModel');
|
||||
import FileModel = require('./models/ACS/fileModel');
|
||||
|
||||
import TestConfig = require('./test.config');
|
||||
import resources = require('./util/resources');
|
||||
|
||||
import dateFormat = require('dateformat');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UsersActions } from './actions/users.actions';
|
||||
import { AppsActions } from './actions/APS/apps.actions';
|
||||
|
||||
import fs = require('fs');
|
||||
import path = require('path');
|
||||
import Util = require('./util/util');
|
||||
|
||||
|
@ -20,7 +20,7 @@ var exports = module.exports = {};
|
||||
/**
|
||||
*Rest API Response statusCodes
|
||||
*/
|
||||
exports.HTTP_RESPONSE_STATUS_CODE ={
|
||||
exports.HTTP_RESPONSE_STATUS_CODE = {
|
||||
FORBIDDEN: 403,
|
||||
OK: 200,
|
||||
BAD_REQUEST: 400,
|
||||
@ -32,7 +32,7 @@ exports.HTTP_RESPONSE_STATUS_CODE ={
|
||||
/**
|
||||
*Rest API Response Messages
|
||||
*/
|
||||
exports.HTTP_RESPONSE_STATUS ={
|
||||
exports.HTTP_RESPONSE_STATUS = {
|
||||
OK: {
|
||||
'CODE': 200,
|
||||
'MESSAGE': 'OK'
|
||||
@ -55,8 +55,8 @@ exports.HTTP_RESPONSE_STATUS ={
|
||||
*Rest API HTTP content types
|
||||
*/
|
||||
exports.HTTP_CONTENT_TYPE = {
|
||||
JSON : 'application/json',
|
||||
URLENCODED : 'application/x-www-form-urlencoded',
|
||||
JSON: 'application/json',
|
||||
URLENCODED: 'application/x-www-form-urlencoded',
|
||||
IMAGE_PNG: 'image/png',
|
||||
TEXT: 'text/csv'
|
||||
};
|
||||
@ -120,3 +120,10 @@ exports.PROCESSSTATUS = {
|
||||
RUNNING: 'Running',
|
||||
COMPLETED: 'Completed'
|
||||
};
|
||||
|
||||
exports.CS_USER_ROLES = {
|
||||
CONSUMER: 'SiteConsumer',
|
||||
COLLABORATOR: 'SiteCollaborator',
|
||||
CONTRIBUTOR: 'SiteContributor',
|
||||
MANAGER: 'SiteManager'
|
||||
};
|
||||
|
@ -182,11 +182,27 @@ exports.Files = {
|
||||
file_location: "/resources/adf/allFileTypes/a_png_file.png",
|
||||
file_name: "a_png_file.png"
|
||||
},
|
||||
PNG_B: {
|
||||
file_location: "/resources/adf/allFileTypes/b_png_file.png",
|
||||
file_name: "b_png_file.png"
|
||||
},
|
||||
PNG_C: {
|
||||
file_location: "/resources/adf/allFileTypes/c_png_file.png",
|
||||
file_name: "c_png_file.png"
|
||||
},
|
||||
PNG_D: {
|
||||
file_location: "/resources/adf/allFileTypes/d_png_file.png",
|
||||
file_name: "d_png_file.png"
|
||||
},
|
||||
PPT: {
|
||||
file_location: "/resources/adf/allFileTypes/a_ppt_file.pptx",
|
||||
file_name: "a_ppt_file.pptx",
|
||||
first_page_text: "PPTX test file"
|
||||
},
|
||||
PPT_B: {
|
||||
file_location: "/resources/adf/allFileTypes/b_ppt_file.pptx",
|
||||
file_name: "b_ppt_file.pptx"
|
||||
},
|
||||
TEST: {
|
||||
file_location: "/resources/adf/allFileTypes/testExtension.test",
|
||||
file_name: "testExtension.test"
|
||||
|
@ -27,8 +27,8 @@ import { MAT_DIALOG_DATA } from '@angular/material';
|
||||
</mat-dialog-content>
|
||||
<mat-dialog-actions>
|
||||
<span class="spacer"></span>
|
||||
<button mat-button [mat-dialog-close]="true">{{ yesLabel | translate }}</button>
|
||||
<button mat-button color="primary" [mat-dialog-close]="false" cdkFocusInitial>{{ noLabel | translate }}</button>
|
||||
<button id="adf-confirm-accept" mat-button [mat-dialog-close]="true">{{ yesLabel | translate }}</button>
|
||||
<button id="adf-confirm-cancel" mat-button color="primary" [mat-dialog-close]="false" cdkFocusInitial>{{ noLabel | translate }}</button>
|
||||
</mat-dialog-actions>
|
||||
`,
|
||||
styles: [`
|
||||
|
@ -1,5 +1,6 @@
|
||||
<div *ngIf="isDialogActive"
|
||||
class="upload-dialog"
|
||||
id="upload-dialog"
|
||||
[class.upload-dialog--minimized]="isDialogMinimized"
|
||||
[class.upload-dialog--position-left]="position === 'left'"
|
||||
[class.upload-dialog--position-right]="position === 'right'">
|
||||
@ -45,8 +46,7 @@
|
||||
</span>
|
||||
</header>
|
||||
|
||||
<section
|
||||
class="upload-dialog__info"
|
||||
<section class="upload-dialog__info"
|
||||
*ngIf="totalErrors">
|
||||
{{
|
||||
(totalErrors > 1
|
||||
@ -56,8 +56,7 @@
|
||||
}}
|
||||
</section>
|
||||
|
||||
<section
|
||||
class="upload-dialog__content"
|
||||
<section class="upload-dialog__content"
|
||||
[class.upload-dialog--padding]="isConfirmation">
|
||||
<adf-file-uploading-list
|
||||
(error)="onError($event)"
|
||||
@ -86,10 +85,10 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<footer
|
||||
class="upload-dialog__actions"
|
||||
[class.upload-dialog--hide]="isConfirmation">
|
||||
<footer class="upload-dialog__actions"
|
||||
*ngIf="!isConfirmation">
|
||||
<button
|
||||
id="adf-upload-dialog-cancel-all"
|
||||
color="primary"
|
||||
mat-button
|
||||
*ngIf="!uploadList.isUploadCompleted() && !uploadList.isUploadCancelled()"
|
||||
@ -98,6 +97,7 @@
|
||||
</button>
|
||||
|
||||
<button
|
||||
id="adf-upload-dialog-close"
|
||||
*ngIf="uploadList.isUploadCompleted() || uploadList.isUploadCancelled()"
|
||||
mat-button
|
||||
color="primary"
|
||||
@ -106,10 +106,10 @@
|
||||
</button>
|
||||
</footer>
|
||||
|
||||
<footer
|
||||
class="upload-dialog__actions"
|
||||
[class.upload-dialog--hide]="!isConfirmation">
|
||||
<footer class="upload-dialog__actions"
|
||||
*ngIf="isConfirmation">
|
||||
<button
|
||||
id="adf-upload-dialog-cancel"
|
||||
color="secondary"
|
||||
mat-button
|
||||
(click)="cancelAllUploads()">
|
||||
@ -117,6 +117,7 @@
|
||||
</button>
|
||||
|
||||
<button
|
||||
id="adf-upload-dialog-confirm"
|
||||
mat-button
|
||||
color="primary"
|
||||
(click)="toggleConfirmation()">
|
||||
|
@ -1,39 +1,40 @@
|
||||
<mat-list class="adf-version-list" *ngIf="!isLoading; else loading_template">
|
||||
<mat-list-item *ngFor="let version of versions; let idx = index">
|
||||
<mat-icon mat-list-icon>insert_drive_file</mat-icon>
|
||||
<h4 mat-line class="adf-version-list-item-name">{{version.entry.name}}</h4>
|
||||
<h4 mat-line class="adf-version-list-item-name" [id]="'adf-version-list-item-name-' + version.entry.id" >{{version.entry.name}}</h4>
|
||||
<p mat-line>
|
||||
<span class="adf-version-list-item-version">{{version.entry.id}}</span> -
|
||||
<span class="adf-version-list-item-date">{{version.entry.modifiedAt | date}}</span>
|
||||
<span class="adf-version-list-item-version" [id]="'adf-version-list-item-version-' + version.entry.id" >{{version.entry.id}}</span> -
|
||||
<span class="adf-version-list-item-date" [id]="'adf-version-list-item-date-' + version.entry.id" >{{version.entry.modifiedAt | date}}</span>
|
||||
</p>
|
||||
<p mat-line class="adf-version-list-item-comment" *ngIf="showComments">{{version.entry.versionComment}}</p>
|
||||
<p mat-line [id]="'adf-version-list-item-comment-'+ version.entry.id" class="adf-version-list-item-comment"
|
||||
*ngIf="showComments">{{version.entry.versionComment}}</p>
|
||||
|
||||
<div *ngIf="showActions">
|
||||
<mat-menu [id]="'adf-version-list-action-menu-'+idx"
|
||||
<mat-menu [id]="'adf-version-list-action-menu-'+version.entry.id"
|
||||
#versionMenu="matMenu" yPosition="below" xPosition="before">
|
||||
<button
|
||||
[id]="'adf-version-list-action-restore-'+idx"
|
||||
[id]="'adf-version-list-action-restore-'+version.entry.id"
|
||||
[disabled]="!canUpdate()"
|
||||
mat-menu-item
|
||||
(click)="restore(version.entry.id)">
|
||||
{{ 'ADF_VERSION_LIST.ACTIONS.RESTORE' | translate }}
|
||||
</button>
|
||||
<button *ngIf="allowDownload"
|
||||
[id]="'adf-version-list-action-download-'+idx"
|
||||
[id]="'adf-version-list-action-download-'+version.entry.id"
|
||||
mat-menu-item
|
||||
(click)="downloadVersion(version.entry.id)">
|
||||
{{ 'ADF_VERSION_LIST.ACTIONS.DOWNLOAD' | translate }}
|
||||
</button>
|
||||
<button
|
||||
[disabled]="!canDelete()"
|
||||
[id]="'adf-version-list-action-delete-'+idx"
|
||||
[id]="'adf-version-list-action-delete-'+version.entry.id"
|
||||
(click)="deleteVersion(version.entry.id)"
|
||||
mat-menu-item>
|
||||
{{ 'ADF_VERSION_LIST.ACTIONS.DELETE' | translate }}
|
||||
</button>
|
||||
</mat-menu>
|
||||
|
||||
<button mat-icon-button [matMenuTriggerFor]="versionMenu" [id]="'adf-version-list-action-menu-button-'+idx">
|
||||
<button mat-icon-button [matMenuTriggerFor]="versionMenu" [id]="'adf-version-list-action-menu-button-'+version.entry.id">
|
||||
<mat-icon>more_vert</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
@ -33,6 +33,15 @@ describe('VersionListComponent', () => {
|
||||
const nodeId = 'test-id';
|
||||
const versionId = '1.0';
|
||||
|
||||
const versionTest = [
|
||||
{
|
||||
entry: { name: 'test-file-name', id: '1.0', versionComment: 'test-version-comment' }
|
||||
},
|
||||
{
|
||||
entry: { name: 'test-file-name-two', id: '1.0', versionComment: 'test-version-comment' }
|
||||
}
|
||||
];
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot(),
|
||||
@ -64,6 +73,9 @@ describe('VersionListComponent', () => {
|
||||
});
|
||||
|
||||
it('should raise confirmation dialog on delete', () => {
|
||||
fixture.detectChanges();
|
||||
component.versions = versionTest;
|
||||
|
||||
spyOn(dialog, 'open').and.returnValue({
|
||||
afterClosed() {
|
||||
return Observable.of(false);
|
||||
@ -76,7 +88,8 @@ describe('VersionListComponent', () => {
|
||||
});
|
||||
|
||||
it('should delete the version if user confirms', () => {
|
||||
spyOn(alfrescoApiService.versionsApi, 'listVersionHistory').and.returnValue(Promise.resolve({ list: { entries: [] } }));
|
||||
fixture.detectChanges();
|
||||
component.versions = versionTest;
|
||||
spyOn(dialog, 'open').and.returnValue({
|
||||
afterClosed() {
|
||||
return Observable.of(true);
|
||||
@ -92,6 +105,8 @@ describe('VersionListComponent', () => {
|
||||
});
|
||||
|
||||
it('should not delete version if user rejects', () => {
|
||||
component.versions = versionTest;
|
||||
|
||||
spyOn(dialog, 'open').and.returnValue({
|
||||
afterClosed() {
|
||||
return Observable.of(false);
|
||||
@ -106,21 +121,21 @@ describe('VersionListComponent', () => {
|
||||
expect(alfrescoApiService.versionsApi.deleteVersion).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should reload and raise version-deleted DOM event', (done) => {
|
||||
it('should reload and raise deleted event', (done) => {
|
||||
spyOn(component, 'loadVersionHistory').and.stub();
|
||||
fixture.nativeElement.addEventListener('version-deleted', () => {
|
||||
component.deleted.subscribe(() => {
|
||||
expect(component.loadVersionHistory).toHaveBeenCalled();
|
||||
done();
|
||||
});
|
||||
fixture.detectChanges();
|
||||
component.onVersionDeleted();
|
||||
component.onVersionDeleted({});
|
||||
});
|
||||
|
||||
describe('Version history fetching', () => {
|
||||
|
||||
it('should use loading bar', () => {
|
||||
spyOn(alfrescoApiService.versionsApi, 'listVersionHistory').and
|
||||
.callFake(() => Promise.resolve({ list: { entries: [] } }));
|
||||
.callFake(() => Promise.resolve({ list: { entries: versionTest } }));
|
||||
|
||||
let loadingProgressBar = fixture.debugElement.query(By.css('[data-automation-id="version-history-loading-bar"]'));
|
||||
expect(loadingProgressBar).toBeNull();
|
||||
@ -134,7 +149,7 @@ describe('VersionListComponent', () => {
|
||||
|
||||
it('should load the versions for a given id', () => {
|
||||
spyOn(alfrescoApiService.versionsApi, 'listVersionHistory').and
|
||||
.callFake(() => Promise.resolve({ list: { entries: [] } }));
|
||||
.callFake(() => Promise.resolve({ list: { entries: versionTest } }));
|
||||
|
||||
component.ngOnChanges();
|
||||
fixture.detectChanges();
|
||||
@ -241,12 +256,12 @@ describe('VersionListComponent', () => {
|
||||
|
||||
it('should reload and raise version-restored DOM event', (done) => {
|
||||
spyOn(component, 'loadVersionHistory').and.stub();
|
||||
fixture.nativeElement.addEventListener('version-restored', () => {
|
||||
component.restored.subscribe(() => {
|
||||
expect(component.loadVersionHistory).toHaveBeenCalled();
|
||||
done();
|
||||
});
|
||||
fixture.detectChanges();
|
||||
component.onVersionRestored();
|
||||
component.onVersionRestored({});
|
||||
});
|
||||
|
||||
it('should restore version only when restore allowed', () => {
|
||||
@ -258,8 +273,8 @@ describe('VersionListComponent', () => {
|
||||
|
||||
it('should load the versions for a given id', () => {
|
||||
fixture.detectChanges();
|
||||
spyOn(alfrescoApiService.versionsApi, 'listVersionHistory').and
|
||||
.callFake(() => Promise.resolve({ list: { entries: [] } }));
|
||||
component.versions = versionTest;
|
||||
|
||||
const spyOnRevertVersion = spyOn(alfrescoApiService.versionsApi, 'revertVersion').and
|
||||
.callFake(() => Promise.resolve(
|
||||
{ entry: { name: 'test-file-name', id: '1.0', versionComment: 'test-version-comment' } }));
|
||||
@ -271,8 +286,10 @@ describe('VersionListComponent', () => {
|
||||
|
||||
it('should reload the version list after a version restore', (done) => {
|
||||
fixture.detectChanges();
|
||||
component.versions = versionTest;
|
||||
|
||||
const spyOnListVersionHistory = spyOn(alfrescoApiService.versionsApi, 'listVersionHistory').and
|
||||
.callFake(() => Promise.resolve({ list: { entries: [] } }));
|
||||
.callFake(() => Promise.resolve({ list: { entries: versionTest } }));
|
||||
spyOn(alfrescoApiService.versionsApi, 'revertVersion').and.callFake(() => Promise.resolve());
|
||||
|
||||
component.restore(versionId);
|
||||
@ -307,12 +324,14 @@ describe('VersionListComponent', () => {
|
||||
});
|
||||
|
||||
it('should show Actions if showActions is true', (done) => {
|
||||
component.versions = versionTest;
|
||||
|
||||
component.showActions = true;
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
let menuButton = fixture.debugElement.query(By.css('#adf-version-list-action-menu-button-0'));
|
||||
let menuButton = fixture.nativeElement.querySelector('[id="adf-version-list-action-menu-button-1.0"]');
|
||||
|
||||
expect(menuButton).not.toBeNull();
|
||||
done();
|
||||
@ -325,7 +344,7 @@ describe('VersionListComponent', () => {
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
let menuButton = fixture.debugElement.query(By.css('#adf-version-list-action-menu-button-0'));
|
||||
let menuButton = fixture.nativeElement.querySelector('[id="adf-version-list-action-menu-button-1.0"]');
|
||||
|
||||
expect(menuButton).toBeNull();
|
||||
done();
|
||||
@ -342,6 +361,9 @@ describe('VersionListComponent', () => {
|
||||
return Promise.resolve({
|
||||
list: {
|
||||
entries: [
|
||||
{
|
||||
entry: { name: 'test-file-two', id: '1.1', versionComment: 'test-version-comment' }
|
||||
},
|
||||
{
|
||||
entry: { name: 'test-file-name', id: '1.0', versionComment: 'test-version-comment' }
|
||||
}
|
||||
@ -356,12 +378,12 @@ describe('VersionListComponent', () => {
|
||||
it('should disable delete action if is not allowed', (done) => {
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
let menuButton = fixture.debugElement.query(By.css('#adf-version-list-action-menu-button-0'));
|
||||
menuButton.nativeElement.click();
|
||||
let menuButton = fixture.nativeElement.querySelector('[id="adf-version-list-action-menu-button-1.1"]');
|
||||
menuButton.click();
|
||||
|
||||
let deleteButton = fixture.debugElement.query(By.css('#adf-version-list-action-delete-0'));
|
||||
let deleteButton: any = document.querySelector('[id="adf-version-list-action-delete-1.1"]');
|
||||
|
||||
expect(deleteButton.nativeElement.disabled).toBe(true);
|
||||
expect(deleteButton.disabled).toBe(true);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@ -369,12 +391,12 @@ describe('VersionListComponent', () => {
|
||||
it('should disable restore action if is not allowed', (done) => {
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
let menuButton = fixture.debugElement.query(By.css('#adf-version-list-action-menu-button-0'));
|
||||
menuButton.nativeElement.click();
|
||||
let menuButton = fixture.nativeElement.querySelector('[id="adf-version-list-action-menu-button-1.1"]');
|
||||
menuButton.click();
|
||||
|
||||
let restoreButton = fixture.debugElement.query(By.css('#adf-version-list-action-restore-0'));
|
||||
let restoreButton: any = document.querySelector('[id="adf-version-list-action-restore-1.1"]');
|
||||
|
||||
expect(restoreButton.nativeElement.disabled).toBe(true);
|
||||
expect(restoreButton.disabled).toBe(true);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@ -389,6 +411,9 @@ describe('VersionListComponent', () => {
|
||||
return Promise.resolve({
|
||||
list: {
|
||||
entries: [
|
||||
{
|
||||
entry: { name: 'test-file-name', id: '1.1', versionComment: 'test-version-comment' }
|
||||
},
|
||||
{
|
||||
entry: { name: 'test-file-name', id: '1.0', versionComment: 'test-version-comment' }
|
||||
}
|
||||
@ -403,12 +428,12 @@ describe('VersionListComponent', () => {
|
||||
it('should enable delete action if is allowed', (done) => {
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
let menuButton = fixture.debugElement.query(By.css('#adf-version-list-action-menu-button-0'));
|
||||
menuButton.nativeElement.click();
|
||||
let menuButton = fixture.nativeElement.querySelector('[id="adf-version-list-action-menu-button-1.1"]');
|
||||
menuButton.click();
|
||||
|
||||
let deleteButton = fixture.debugElement.query(By.css('#adf-version-list-action-delete-0'));
|
||||
let deleteButton: any = document.querySelector('[id="adf-version-list-action-delete-1.1"]');
|
||||
|
||||
expect(deleteButton.nativeElement.disabled).toBe(false);
|
||||
expect(deleteButton.disabled).toBe(false);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@ -416,12 +441,12 @@ describe('VersionListComponent', () => {
|
||||
it('should enable restore action if is allowed', (done) => {
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
let menuButton = fixture.debugElement.query(By.css('#adf-version-list-action-menu-button-0'));
|
||||
menuButton.nativeElement.click();
|
||||
let menuButton = fixture.nativeElement.querySelector('[id="adf-version-list-action-menu-button-1.1"]');
|
||||
menuButton.click();
|
||||
|
||||
let restoreButton = fixture.debugElement.query(By.css('#adf-version-list-action-restore-0'));
|
||||
let restoreButton: any = document.querySelector('[id="adf-version-list-action-restore-1.1"]');
|
||||
|
||||
expect(restoreButton.nativeElement.disabled).toBe(false);
|
||||
expect(restoreButton.disabled).toBe(false);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService, ContentService } from '@alfresco/adf-core';
|
||||
import { Component, Input, OnChanges, ViewEncapsulation, ElementRef } from '@angular/core';
|
||||
import { Component, Input, OnChanges, ViewEncapsulation, EventEmitter, Output } from '@angular/core';
|
||||
import { VersionsApi, MinimalNodeEntryEntity, VersionEntry } from 'alfresco-js-api';
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { ConfirmDialogComponent } from '../dialogs/confirm.dialog';
|
||||
@ -56,10 +56,17 @@ export class VersionListComponent implements OnChanges {
|
||||
@Input()
|
||||
showActions = true;
|
||||
|
||||
/** Emitted when a version is restored */
|
||||
@Output()
|
||||
restored: EventEmitter<MinimalNodeEntryEntity> = new EventEmitter<MinimalNodeEntryEntity>();
|
||||
|
||||
/** Emitted when a version is deleted */
|
||||
@Output()
|
||||
deleted: EventEmitter<MinimalNodeEntryEntity> = new EventEmitter<MinimalNodeEntryEntity>();
|
||||
|
||||
constructor(private alfrescoApi: AlfrescoApiService,
|
||||
private contentService: ContentService,
|
||||
private dialog: MatDialog,
|
||||
private el: ElementRef) {
|
||||
private dialog: MatDialog) {
|
||||
this.versionsApi = this.alfrescoApi.versionsApi;
|
||||
}
|
||||
|
||||
@ -68,18 +75,18 @@ export class VersionListComponent implements OnChanges {
|
||||
}
|
||||
|
||||
canUpdate(): boolean {
|
||||
return this.contentService.hasPermission(this.node, 'update');
|
||||
return this.contentService.hasPermission(this.node, 'update') && this.versions.length > 1;
|
||||
}
|
||||
|
||||
canDelete(): boolean {
|
||||
return this.contentService.hasPermission(this.node, 'delete');
|
||||
return this.contentService.hasPermission(this.node, 'delete') && this.versions.length > 1;
|
||||
}
|
||||
|
||||
restore(versionId) {
|
||||
if (this.canUpdate()) {
|
||||
this.versionsApi
|
||||
.revertVersion(this.node.id, versionId, { majorVersion: true, comment: '' })
|
||||
.then(() => this.onVersionRestored());
|
||||
.then(() => this.onVersionRestored(this.node));
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,24 +121,20 @@ export class VersionListComponent implements OnChanges {
|
||||
if (result === true) {
|
||||
this.alfrescoApi.versionsApi
|
||||
.deleteVersion(this.node.id, versionId)
|
||||
.then(() => this.onVersionDeleted());
|
||||
.then(() => this.onVersionDeleted(this.node));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
onVersionDeleted() {
|
||||
onVersionDeleted(node: any) {
|
||||
this.loadVersionHistory();
|
||||
|
||||
const event = new CustomEvent('version-deleted', { bubbles: true });
|
||||
this.el.nativeElement.dispatchEvent(event);
|
||||
this.deleted.emit(node);
|
||||
}
|
||||
|
||||
onVersionRestored() {
|
||||
onVersionRestored(node: any) {
|
||||
this.loadVersionHistory();
|
||||
|
||||
const event = new CustomEvent('version-restored', { bubbles: true });
|
||||
this.el.nativeElement.dispatchEvent(event);
|
||||
this.restored.emit(node);
|
||||
}
|
||||
|
||||
private getVersionContentUrl(nodeId: string, versionId: string, attachment?: boolean) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
<div class="adf-new-version-container">
|
||||
<div class="adf-new-version-uploader-container" fxLayout="row" fxLayoutAlign="end center" [@uploadToggle]="uploadState">
|
||||
<table class="adf-version-upload">
|
||||
<div class="adf-new-version-uploader-container" id="adf-new-version-uploader-container" fxLayout="row" fxLayoutAlign="end center" [@uploadToggle]="uploadState">
|
||||
<table class="adf-version-upload" *ngIf="uploadState !== 'close'">
|
||||
<tr>
|
||||
<td>
|
||||
<adf-version-upload
|
||||
@ -8,7 +8,7 @@
|
||||
[node]="node"
|
||||
(success)="onUploadSuccess($event)"
|
||||
(cancel)="onUploadCancel()"
|
||||
(error)="uploadError.emit($event)">
|
||||
(error)="onUploadError($event)">
|
||||
</adf-version-upload>
|
||||
</td>
|
||||
</tr>
|
||||
@ -27,11 +27,14 @@
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
<adf-version-list
|
||||
#versionList
|
||||
[node]="node"
|
||||
[allowDownload]="allowDownload"
|
||||
[showComments]="showComments">
|
||||
[showComments]="showComments"
|
||||
(deleted)="refresh($event)"
|
||||
(restored)="refresh($event)">
|
||||
</adf-version-list>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
float: left;
|
||||
position: relative;
|
||||
visibility: hidden;
|
||||
display: hidden;
|
||||
}
|
||||
|
||||
.adf-new-version-container {
|
||||
|
@ -102,7 +102,7 @@ describe('VersionManagerComponent', () => {
|
||||
|
||||
const emittedData = { value: { entry: node }};
|
||||
component.uploadSuccess.subscribe(event => {
|
||||
expect(event).toBe(emittedData);
|
||||
expect(event).toBe(node);
|
||||
});
|
||||
component.onUploadSuccess(emittedData);
|
||||
}));
|
||||
|
@ -57,11 +57,11 @@ export class VersionManagerComponent {
|
||||
|
||||
/** Emitted when a file is uploaded successfully. */
|
||||
@Output()
|
||||
uploadSuccess = new EventEmitter();
|
||||
uploadSuccess: EventEmitter<MinimalNodeEntryEntity> = new EventEmitter<MinimalNodeEntryEntity>();
|
||||
|
||||
/** Emitted when an error occurs during upload. */
|
||||
@Output()
|
||||
uploadError = new EventEmitter();
|
||||
uploadError: EventEmitter<MinimalNodeEntryEntity> = new EventEmitter<MinimalNodeEntryEntity>();
|
||||
|
||||
@ViewChild('versionList')
|
||||
versionListComponent: VersionListComponent;
|
||||
@ -73,13 +73,24 @@ export class VersionManagerComponent {
|
||||
private alfrescoApiService: AlfrescoApiService) {
|
||||
}
|
||||
|
||||
onUploadSuccess(event) {
|
||||
refresh(node: MinimalNodeEntryEntity) {
|
||||
this.alfrescoApiService.nodeUpdated.next(node);
|
||||
this.versionListComponent.loadVersionHistory();
|
||||
this.uploadSuccess.emit(node);
|
||||
this.uploadState = 'close';
|
||||
}
|
||||
|
||||
onUploadSuccess(event: any) {
|
||||
this.alfrescoApiService.nodeUpdated.next(event.value.entry);
|
||||
this.versionListComponent.loadVersionHistory();
|
||||
this.uploadSuccess.emit(event);
|
||||
this.uploadSuccess.emit(event.value.entry);
|
||||
this.uploadState = 'close';
|
||||
}
|
||||
|
||||
onUploadError(event: any) {
|
||||
this.uploadError.emit(event);
|
||||
}
|
||||
|
||||
onUploadCancel() {
|
||||
this.uploadState = 'close';
|
||||
}
|
||||
|
@ -1,16 +1,16 @@
|
||||
<div class="adf-new-version-max-width">
|
||||
<mat-radio-group class="adf-new-version-radio-group" [(ngModel)]="semanticVersion">
|
||||
<mat-radio-button class="adf-new-version-radio-button" [value]="'minor'">{{
|
||||
<mat-radio-button class="adf-new-version-radio-button" id="adf-new-version-minor"[value]="'minor'">{{
|
||||
'ADF_VERSION_LIST.ACTIONS.UPLOAD.MINOR' |
|
||||
translate }}
|
||||
</mat-radio-button>
|
||||
<mat-radio-button class="adf-new-version-radio-button" [value]="'major'">{{
|
||||
<mat-radio-button class="adf-new-version-radio-button" id="adf-new-version-major" [value]="'major'">{{
|
||||
'ADF_VERSION_LIST.ACTIONS.UPLOAD.MAJOR' |
|
||||
translate }}
|
||||
</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
<mat-form-field class="adf-new-version-max-width">
|
||||
<textarea matInput [(ngModel)]="comment" class="adf-new-version-text-area"
|
||||
<textarea matInput [(ngModel)]="comment" class="adf-new-version-text-area" id="adf-new-version-text-area"
|
||||
placeholder="{{ 'ADF_VERSION_LIST.ACTIONS.UPLOAD.COMMENT' | translate }}"></textarea>
|
||||
</mat-form-field>
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
(success)="success.emit($event)"
|
||||
(error)="error.emit($event)">
|
||||
</adf-upload-version-button>
|
||||
<button mat-raised-button (click)="cancelUpload()">{{
|
||||
<button mat-raised-button (click)="cancelUpload()" id="adf-new-version-cancel" >{{
|
||||
'ADF_VERSION_LIST.ACTIONS.UPLOAD.CANCEL'| translate }}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -18,7 +18,7 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ObjectUtils } from '../utils/object-utils';
|
||||
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
||||
import { Subject } from 'rxjs/Subject';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
export enum AppConfigValues {
|
||||
@ -49,11 +49,11 @@ export class AppConfigService {
|
||||
alfrescoRepositoryName: 'alfresco-1'
|
||||
};
|
||||
|
||||
private onLoadSubject: BehaviorSubject<any>;
|
||||
private onLoadSubject: Subject<any>;
|
||||
onLoad: Observable<any>;
|
||||
|
||||
constructor(private http: HttpClient) {
|
||||
this.onLoadSubject = new BehaviorSubject(this.config);
|
||||
this.onLoadSubject = new Subject();
|
||||
this.onLoad = this.onLoadSubject.asObservable();
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@ import { Component, HostListener, Input, OnDestroy, OnInit, Renderer2, ViewChild
|
||||
import { MatMenuTrigger } from '@angular/material';
|
||||
import { Subscription } from 'rxjs/Subscription';
|
||||
import { ContextMenuService } from './context-menu.service';
|
||||
|
||||
/**
|
||||
* @deprecated: context-menu-holder is deprecated, use adf-context-menu-holder instead.
|
||||
*/
|
||||
@ -31,9 +32,9 @@ import { ContextMenuService } from './context-menu.service';
|
||||
<mat-menu #contextMenu="matMenu" class="context-menu">
|
||||
<ng-container *ngFor="let link of links">
|
||||
<button *ngIf="link.model?.visible"
|
||||
mat-menu-item
|
||||
[disabled]="link.model?.disabled"
|
||||
(click)="onMenuItemClick($event, link)">
|
||||
mat-menu-item
|
||||
[disabled]="link.model?.disabled"
|
||||
(click)="onMenuItemClick($event, link)">
|
||||
<mat-icon *ngIf="showIcons && link.model?.icon">{{ link.model.icon }}</mat-icon>
|
||||
{{ (link.title || link.model?.title) | translate }}
|
||||
</button>
|
||||
@ -44,7 +45,7 @@ import { ContextMenuService } from './context-menu.service';
|
||||
export class ContextMenuHolderComponent implements OnInit, OnDestroy {
|
||||
links = [];
|
||||
|
||||
private mouseLocation: { left: number, top: number } = {left: 0, top: 0};
|
||||
private mouseLocation: { left: number, top: number } = { left: 0, top: 0 };
|
||||
private menuElement = null;
|
||||
private subscriptions: Subscription[] = [];
|
||||
private contextMenuListenerFn: () => void;
|
||||
@ -70,11 +71,12 @@ export class ContextMenuHolderComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
constructor(
|
||||
private viewport: ViewportRuler,
|
||||
private overlayContainer: OverlayContainer,
|
||||
private contextMenuService: ContextMenuService,
|
||||
private renderer: Renderer2
|
||||
) {}
|
||||
private viewport: ViewportRuler,
|
||||
private overlayContainer: OverlayContainer,
|
||||
private contextMenuService: ContextMenuService,
|
||||
private renderer: Renderer2
|
||||
) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.subscriptions.push(
|
||||
@ -149,20 +151,22 @@ export class ContextMenuHolderComponent implements OnInit, OnDestroy {
|
||||
|
||||
private updatePosition() {
|
||||
setTimeout(() => {
|
||||
if (this.mdMenuElement.clientWidth + this.mouseLocation.left > this.viewport.getViewportRect().width) {
|
||||
this.menuTrigger.menu.xPosition = 'before';
|
||||
this.mdMenuElement.parentElement.style.left = this.mouseLocation.left - this.mdMenuElement.clientWidth + 'px';
|
||||
} else {
|
||||
this.menuTrigger.menu.xPosition = 'after';
|
||||
this.mdMenuElement.parentElement.style.left = this.locationCss().left;
|
||||
}
|
||||
if (this.mdMenuElement.parentElement) {
|
||||
if (this.mdMenuElement.clientWidth + this.mouseLocation.left > this.viewport.getViewportRect().width) {
|
||||
this.menuTrigger.menu.xPosition = 'before';
|
||||
this.mdMenuElement.parentElement.style.left = this.mouseLocation.left - this.mdMenuElement.clientWidth + 'px';
|
||||
} else {
|
||||
this.menuTrigger.menu.xPosition = 'after';
|
||||
this.mdMenuElement.parentElement.style.left = this.locationCss().left;
|
||||
}
|
||||
|
||||
if (this.mdMenuElement.clientHeight + this.mouseLocation.top > this.viewport.getViewportRect().height) {
|
||||
this.menuTrigger.menu.yPosition = 'above';
|
||||
this.mdMenuElement.parentElement.style.top = this.mouseLocation.top - this.mdMenuElement.clientHeight + 'px';
|
||||
} else {
|
||||
this.menuTrigger.menu.yPosition = 'below';
|
||||
this.mdMenuElement.parentElement.style.top = this.locationCss().top;
|
||||
if (this.mdMenuElement.clientHeight + this.mouseLocation.top > this.viewport.getViewportRect().height) {
|
||||
this.menuTrigger.menu.yPosition = 'above';
|
||||
this.mdMenuElement.parentElement.style.top = this.mouseLocation.top - this.mdMenuElement.clientHeight + 'px';
|
||||
} else {
|
||||
this.menuTrigger.menu.yPosition = 'below';
|
||||
this.mdMenuElement.parentElement.style.top = this.locationCss().top;
|
||||
}
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
|
@ -232,6 +232,8 @@ describe('PaginationComponent', () => {
|
||||
|
||||
describe('Without pagination input', () => {
|
||||
it('has defaults', () => {
|
||||
component.ngOnInit();
|
||||
|
||||
const {
|
||||
current, lastPage, isFirstPage, isLastPage,
|
||||
next, previous, range, pages
|
||||
|
@ -15,14 +15,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation,
|
||||
ChangeDetectorRef, OnDestroy, HostBinding } from '@angular/core';
|
||||
import {
|
||||
ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation,
|
||||
ChangeDetectorRef, OnDestroy, HostBinding
|
||||
} from '@angular/core';
|
||||
|
||||
import { Pagination } from 'alfresco-js-api';
|
||||
import { PaginatedComponent } from './paginated-component.interface';
|
||||
import { PaginationComponentInterface } from './pagination-component.interface';
|
||||
import { Subscription } from 'rxjs/Subscription';
|
||||
import { PaginationModel } from '../models/pagination.model';
|
||||
import { UserPreferencesService } from '../services/user-preferences.service';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-pagination',
|
||||
@ -53,11 +56,11 @@ export class PaginationComponent implements OnInit, OnDestroy, PaginationCompone
|
||||
|
||||
/** An array of page sizes. */
|
||||
@Input()
|
||||
supportedPageSizes: number[] = [5, 25, 50, 100];
|
||||
supportedPageSizes: number[];
|
||||
|
||||
/** Pagination object. */
|
||||
@Input()
|
||||
pagination: PaginationModel = PaginationComponent.DEFAULT_PAGINATION;
|
||||
pagination: PaginationModel;
|
||||
|
||||
/** Emitted when pagination changes in any way. */
|
||||
@Output()
|
||||
@ -81,10 +84,20 @@ export class PaginationComponent implements OnInit, OnDestroy, PaginationCompone
|
||||
|
||||
private paginationSubscription: Subscription;
|
||||
|
||||
constructor(private cdr: ChangeDetectorRef) {
|
||||
constructor(private cdr: ChangeDetectorRef, private userPreferencesService: UserPreferencesService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if (!this.pagination) {
|
||||
let defaultPagination = PaginationComponent.DEFAULT_PAGINATION;
|
||||
defaultPagination.maxItems = this.userPreferencesService.paginationSize;
|
||||
this.pagination = defaultPagination;
|
||||
}
|
||||
|
||||
if (!this.supportedPageSizes) {
|
||||
this.supportedPageSizes = this.userPreferencesService.getDefaultPageSizes();
|
||||
}
|
||||
|
||||
if (this.target) {
|
||||
this.paginationSubscription = this.target.pagination.subscribe((pagination: PaginationModel) => {
|
||||
|
||||
|
@ -56,7 +56,7 @@ export class TranslationService {
|
||||
}
|
||||
}
|
||||
|
||||
userPreference.locale$.subscribe( (locale) => {
|
||||
userPreference.locale$.subscribe((locale) => {
|
||||
this.userLang = locale;
|
||||
this.use(this.userLang);
|
||||
});
|
||||
@ -70,22 +70,18 @@ export class TranslationService {
|
||||
addTranslationFolder(name: string = '', path: string = '') {
|
||||
if (!this.customLoader.providerRegistered(name)) {
|
||||
this.customLoader.registerProvider(name, path);
|
||||
if (this.userLang !== this.defaultLang) {
|
||||
this.translate.getTranslation(this.defaultLang).subscribe(() => {
|
||||
this.translate.getTranslation(this.userLang).subscribe(
|
||||
() => {
|
||||
this.translate.use(this.userLang);
|
||||
this.onTranslationChanged(this.userLang);
|
||||
}
|
||||
);
|
||||
});
|
||||
} else {
|
||||
this.translate.getTranslation(this.userLang).subscribe(
|
||||
() => {
|
||||
if (this.userLang) {
|
||||
this.translate.getTranslation(this.userLang).subscribe(() => {
|
||||
this.translate.use(this.userLang);
|
||||
this.onTranslationChanged(this.userLang);
|
||||
}
|
||||
);
|
||||
} else {
|
||||
this.translate.getTranslation(this.defaultLang).subscribe(() => {
|
||||
this.translate.use(this.defaultLang);
|
||||
this.onTranslationChanged(this.defaultLang);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -117,7 +113,7 @@ export class TranslationService {
|
||||
* @param interpolateParams String(s) to be interpolated into the main message
|
||||
* @returns Translated text
|
||||
*/
|
||||
get(key: string|Array<string>, interpolateParams?: Object): Observable<string|any> {
|
||||
get(key: string | Array<string>, interpolateParams?: Object): Observable<string | any> {
|
||||
return this.translate.get(key, interpolateParams);
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ export class UserPreferencesService {
|
||||
private appConfig: AppConfigService,
|
||||
private storage: StorageService) {
|
||||
this.appConfig.onLoad.subscribe(this.initUserPreferenceStatus.bind(this));
|
||||
this.localeSubject = new BehaviorSubject(this.userPreferenceStatus[UserPreferenceValues.Locale]);
|
||||
this.localeSubject = new BehaviorSubject(this.get(UserPreferenceValues.Locale, this.getDefaultLocale()));
|
||||
this.locale$ = this.localeSubject.asObservable();
|
||||
this.onChangeSubject = new BehaviorSubject(this.userPreferenceStatus);
|
||||
this.onChange = this.onChangeSubject.asObservable();
|
||||
@ -61,8 +61,7 @@ export class UserPreferencesService {
|
||||
|
||||
private initUserPreferenceStatus() {
|
||||
this.userPreferenceStatus[UserPreferenceValues.Locale] = this.locale || this.getDefaultLocale();
|
||||
this.userPreferenceStatus[UserPreferenceValues.PaginationSize] = this.paginationSize ?
|
||||
this.paginationSize : this.appConfig.get('pagination.size', this.defaults.paginationSize);
|
||||
this.userPreferenceStatus[UserPreferenceValues.PaginationSize] = this.appConfig.get('pagination.size', this.defaults.paginationSize);
|
||||
this.userPreferenceStatus[UserPreferenceValues.SupportedPageSizes] = this.appConfig.get('pagination.supportedPageSizes', this.defaults.supportedPageSizes);
|
||||
}
|
||||
|
||||
@ -150,27 +149,27 @@ export class UserPreferencesService {
|
||||
* @returns Array of page size values
|
||||
*/
|
||||
getDefaultPageSizes(): number[] {
|
||||
return this.defaults.supportedPageSizes;
|
||||
return this.userPreferenceStatus[UserPreferenceValues.SupportedPageSizes];
|
||||
}
|
||||
|
||||
/** Pagination size. */
|
||||
set paginationSize(value: number) {
|
||||
this.set('PAGINATION_SIZE', value);
|
||||
this.set(UserPreferenceValues.PaginationSize, value);
|
||||
}
|
||||
|
||||
get paginationSize(): number {
|
||||
return Number(this.get('PAGINATION_SIZE')) || this.defaults.paginationSize;
|
||||
return Number(this.get(UserPreferenceValues.PaginationSize, this.userPreferenceStatus[UserPreferenceValues.PaginationSize])) || this.defaults.paginationSize;
|
||||
}
|
||||
|
||||
/** Current locale setting. */
|
||||
get locale(): string {
|
||||
const locale = this.get('LOCALE');
|
||||
const locale = this.get(UserPreferenceValues.Locale, this.userPreferenceStatus[UserPreferenceValues.Locale]);
|
||||
return locale;
|
||||
}
|
||||
|
||||
set locale(value: string) {
|
||||
this.localeSubject.next(value);
|
||||
this.set('LOCALE', value);
|
||||
this.set(UserPreferenceValues.Locale, value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -10,12 +10,12 @@
|
||||
{{ 'ERROR_CONTENT.' + errorCode + '.DESCRIPTION' | translate }}
|
||||
</p>
|
||||
<div class="adf-error-content-buttons">
|
||||
<a mat-raised-button color="primary"
|
||||
<a a id="adf-secondary-button" mat-raised-button color="primary"
|
||||
*ngIf="secondaryButtonText" (click)="onSecondButton()"
|
||||
class="adf-error-content-description-link">
|
||||
class="adf-error-content-description-link">
|
||||
{{ 'ERROR_CONTENT.' + errorCode + '.SECONDARY_BUTTON.TEXT' | translate | uppercase }}
|
||||
</a>
|
||||
<a mat-raised-button color="primary" (click)="onReturnButton()">
|
||||
<a id="adf-return-button" mat-raised-button color="primary" (click)="onReturnButton()">
|
||||
{{ 'ERROR_CONTENT.' + this.errorCode + '.RETURN_BUTTON.TEXT' | translate | uppercase }}
|
||||
</a>
|
||||
</div>
|
||||
|
@ -89,7 +89,8 @@ export class MomentDateAdapter extends DateAdapter<Moment> {
|
||||
}
|
||||
|
||||
clone(date: Moment): Moment {
|
||||
return date.clone().locale(this.locale);
|
||||
let locale = this.locale || 'en';
|
||||
return date.clone().locale(locale);
|
||||
}
|
||||
|
||||
createDate(year: number, month: number, date: number): Moment {
|
||||
@ -97,16 +98,18 @@ export class MomentDateAdapter extends DateAdapter<Moment> {
|
||||
}
|
||||
|
||||
today(): Moment {
|
||||
return moment().locale(this.locale);
|
||||
let locale = this.locale || 'en';
|
||||
return moment().locale(locale);
|
||||
}
|
||||
|
||||
parse(value: any, parseFormat: any): Moment {
|
||||
let locale = this.locale || 'en';
|
||||
|
||||
if (value && typeof value === 'string') {
|
||||
let m = moment(value, parseFormat, this.locale, true);
|
||||
let m = moment(value, parseFormat, locale, true);
|
||||
if (!m.isValid()) {
|
||||
// use strict parsing because Moment's parser is very forgiving, and this can lead to undesired behavior.
|
||||
m = moment(value, this.overrideDisplyaFormat, this.locale, true);
|
||||
m = moment(value, this.overrideDisplyaFormat, locale, true);
|
||||
}
|
||||
if (m.isValid()) {
|
||||
// if user omits year, it defaults to 2001, so check for that issue.
|
||||
@ -123,7 +126,7 @@ export class MomentDateAdapter extends DateAdapter<Moment> {
|
||||
return m;
|
||||
}
|
||||
|
||||
return value ? moment(value).locale(this.locale) : null;
|
||||
return value ? moment(value).locale(locale) : null;
|
||||
}
|
||||
|
||||
format(date: Moment, displayFormat: any): string {
|
||||
@ -204,7 +207,8 @@ export class MomentDateAdapter extends DateAdapter<Moment> {
|
||||
}
|
||||
|
||||
fromIso8601(iso8601String: string): Moment | null {
|
||||
let d = moment(iso8601String, moment.ISO_8601).locale(this.locale);
|
||||
let locale = this.locale || 'en';
|
||||
let d = moment(iso8601String, moment.ISO_8601).locale(locale);
|
||||
return this.isValid(d) ? d : null;
|
||||
}
|
||||
|
||||
|
@ -335,8 +335,4 @@ export class ProcessInstanceListComponent extends DataTableSchema implements On
|
||||
currentPage(skipCount: number, maxItems: number): number {
|
||||
return (skipCount && maxItems) ? Math.floor(skipCount / maxItems) : 0;
|
||||
}
|
||||
|
||||
get supportedPageSizes(): number[] {
|
||||
return this.userPreferences.getDefaultPageSizes();
|
||||
}
|
||||
}
|
||||
|
@ -377,8 +377,4 @@ export class TaskListComponent extends DataTableSchema implements OnChanges, Aft
|
||||
currentPage(skipCount: number, maxItems: number): number {
|
||||
return (skipCount && maxItems) ? Math.floor(skipCount / maxItems) : 0;
|
||||
}
|
||||
|
||||
get supportedPageSizes(): number[] {
|
||||
return this.userPreferences.getDefaultPageSizes();
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user