mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
[no-issue] fix e2e uploader (#3840)
* fix e2e upload move viewer subbfolder * fix CS services e2e test * add log for error in upload delete * aysnc get node * new tentative * attempt 2 * attempt 3 * new demo shell test travis change for test * excluded file tslint fix * remove desktop only class * renable tests * decrease time notification * add process service multiselect demo test fix e2e * remove log * add custom toolbar example
This commit is contained in:
@@ -102,6 +102,7 @@
|
||||
"DOCUMENT_LIST": {
|
||||
"MULTISELECT_CHECKBOXES": "Multiselect (with checkboxes)",
|
||||
"THUMBNAILS": "Enable Thumbnails",
|
||||
"ALLOW_DROP_FILES": "Enable file drop support for rows",
|
||||
"MULTIPLE_FILE_UPLOAD": "Multiple File Upload",
|
||||
"FOLDER_UPLOAD": "Folder upload",
|
||||
"CUSTOM_FILTER": "Custom extensions filter",
|
||||
@@ -119,6 +120,7 @@
|
||||
"COLUMNS": {
|
||||
"DISPLAY_NAME": "Display name",
|
||||
"IS_LOCKED": "Lock",
|
||||
"NODE_ID": "Node id",
|
||||
"TAG": "Tag",
|
||||
"CREATED_BY": "Created by",
|
||||
"CREATED_ON": "Created on",
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
<app-search-bar fxFlex="0 1 auto"></app-search-bar>
|
||||
|
||||
<div class="adf-header-delimiter"></div>
|
||||
<div class="adf-header-delimiexpandedSidenavter"></div>
|
||||
|
||||
<adf-userinfo
|
||||
class="adf-app-layout-user-profile"
|
||||
|
@@ -90,6 +90,7 @@ export class AppLayoutComponent implements OnInit {
|
||||
this.headerService.redirectUrl.subscribe(redirectUrl => this.redirectUrl = redirectUrl);
|
||||
this.headerService.tooltip.subscribe(tooltip => this.tooltip = tooltip);
|
||||
this.headerService.position.subscribe(position => this.position = position);
|
||||
this.headerService.hideSidenav.subscribe(hideSidenav => this.hideSidenav = hideSidenav);
|
||||
}
|
||||
|
||||
constructor(
|
||||
|
@@ -1,29 +1,41 @@
|
||||
<div>
|
||||
<mat-nav-list class="adf-list-confgurations">
|
||||
<mat-list-item (click)="metadataConfClick()">
|
||||
<a matLine id="adf-metadata-conf">Metadata App config editor</a>
|
||||
<button mat-icon-button>
|
||||
<mat-icon>info</mat-icon>
|
||||
</button>
|
||||
</mat-list-item>
|
||||
|
||||
<h2>Metadata App config editor</h2>
|
||||
<mat-list-item (click)="searchConfClick()">
|
||||
<a matLine id="adf-search-conf" >Search App config editor</a>
|
||||
<button mat-icon-button>
|
||||
<mat-icon>info</mat-icon>
|
||||
</button>
|
||||
</mat-list-item>
|
||||
|
||||
<ngx-monaco-editor id="adf-metadata-editor" class="adf-metadata-editor" [options]="editorOptions" [(ngModel)]="metadataConf" (onInit)="onInitMetadata($event)" ></ngx-monaco-editor>
|
||||
<mat-list-item (click)="fileConfClick()">
|
||||
<a matLine id="adf-file-conf" >Excluded config file</a>
|
||||
<button mat-icon-button>
|
||||
<mat-icon>info</mat-icon>
|
||||
</button>
|
||||
</mat-list-item>
|
||||
</mat-nav-list>
|
||||
|
||||
<button mat-raised-button id="adf-metadata-save" (click)="onSaveMetadata()" color="primary">Save metadata configuration</button>
|
||||
<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>
|
||||
|
||||
<h2>Excluded File config editor</h2>
|
||||
|
||||
<ngx-monaco-editor id="adf-excluded-file" class="adf-excluded-file-editor" [options]="editorOptions" [(ngModel)]="excludedFileConf" (onInit)="onInitExcludedFile($event)" ></ngx-monaco-editor>
|
||||
|
||||
<button mat-raised-button id="adf-excluded-file-save" (click)="onSaveExcludedFile()" color="primary">Save excluded file configuration</button>
|
||||
<button mat-raised-button id="adf-excluded-file-clear" (click)="onClearExcludedFile()" color="primary">Clear excluded file configuration</button>
|
||||
|
||||
<br>
|
||||
<div>
|
||||
<ngx-monaco-editor id="adf-code-configuration-editor"
|
||||
class="adf-file-editor"
|
||||
[options]="editorOptions"
|
||||
[(ngModel)]="code"
|
||||
(onInit)="onInit($event)">
|
||||
</ngx-monaco-editor>
|
||||
<div class="adf-list-confgurations-buttons">
|
||||
<button mat-raised-button id="adf-configuration-save" (click)="onSave()" color="primary">
|
||||
Save
|
||||
</button>
|
||||
<button mat-raised-button id="adf-configuration-clear" (click)="onClear()" color="primary">
|
||||
Clear
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -1,3 +1,16 @@
|
||||
.adf-metadata-editor {
|
||||
height: 300px;
|
||||
.adf-file-editor {
|
||||
height: 500px;
|
||||
width: 65%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.adf-list-confgurations {
|
||||
float: left;
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.adf-list-confgurations-buttons {
|
||||
width: 200px;
|
||||
margin-left: 30%;
|
||||
float: left;
|
||||
}
|
||||
|
@@ -26,8 +26,9 @@ import { AppConfigService, NotificationService } from '@alfresco/adf-core';
|
||||
export class ConfigEditorComponent {
|
||||
|
||||
editor: any;
|
||||
editorSearch: any;
|
||||
editorExcludedFile: any;
|
||||
code: any;
|
||||
field = 'content-metadata';
|
||||
invalidJson = false;
|
||||
|
||||
editorOptions = {
|
||||
theme: 'vs-dark',
|
||||
@@ -37,79 +38,59 @@ export class ConfigEditorComponent {
|
||||
formatOnType: true
|
||||
};
|
||||
|
||||
metadataConf: string;
|
||||
searchConf: string;
|
||||
excludedFileConf: string;
|
||||
|
||||
onInitMetadata(editor) {
|
||||
onInit(editor) {
|
||||
this.editor = editor;
|
||||
setTimeout(() => {
|
||||
this.editor.getAction('editor.action.formatDocument').run();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
onInitSearch(editor) {
|
||||
this.editorSearch = editor;
|
||||
setTimeout(() => {
|
||||
this.editorSearch.getAction('editor.action.formatDocument').run();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
onInitExcludedFile(excludedFile) {
|
||||
this.editorExcludedFile = excludedFile;
|
||||
setTimeout(() => {
|
||||
this.editorExcludedFile.getAction('editor.action.formatDocument').run();
|
||||
}, 1000);
|
||||
this.indentCode();
|
||||
}
|
||||
|
||||
constructor(private appConfig: AppConfigService, private notificationService: NotificationService) {
|
||||
this.metadataConf = JSON.stringify(appConfig.config['content-metadata']);
|
||||
this.searchConf = JSON.stringify(appConfig.config['search']);
|
||||
this.excludedFileConf = JSON.stringify(appConfig.config['files']);
|
||||
this.code = JSON.stringify(appConfig.config['content-metadata']);
|
||||
}
|
||||
|
||||
onSaveMetadata() {
|
||||
onSave() {
|
||||
try {
|
||||
this.appConfig.config['content-metadata'] = JSON.parse(this.editor.getValue());
|
||||
this.appConfig.config[this.field] = JSON.parse(this.editor.getValue());
|
||||
} catch (error) {
|
||||
this.invalidJson = true;
|
||||
this.notificationService.openSnackMessage(
|
||||
'Wrong metadata configuration',
|
||||
'Wrong Code configuration ' + error,
|
||||
4000
|
||||
);
|
||||
} finally {
|
||||
if (!this.invalidJson) {
|
||||
this.notificationService.openSnackMessage(
|
||||
'Saved'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onSaveSearch() {
|
||||
try {
|
||||
this.appConfig.config['search'] = JSON.parse(this.editorSearch.getValue());
|
||||
} catch (error) {
|
||||
this.notificationService.openSnackMessage(
|
||||
'Wrong search configuration',
|
||||
4000
|
||||
);
|
||||
}
|
||||
onClear() {
|
||||
this.code = '';
|
||||
}
|
||||
|
||||
onSaveExcludedFile() {
|
||||
try {
|
||||
this.appConfig.config['files'] = JSON.parse(this.editorExcludedFile.getValue());
|
||||
} catch (error) {
|
||||
this.notificationService.openSnackMessage(
|
||||
'Wrong exclude file configuration',
|
||||
4000
|
||||
);
|
||||
}
|
||||
fileConfClick() {
|
||||
this.code = JSON.stringify(this.appConfig.config['files']);
|
||||
this.field = 'files';
|
||||
this.indentCode();
|
||||
}
|
||||
|
||||
onClearMetadata() {
|
||||
this.metadataConf = '';
|
||||
searchConfClick() {
|
||||
this.code = JSON.stringify(this.appConfig.config['search']);
|
||||
this.field = 'search';
|
||||
this.indentCode();
|
||||
}
|
||||
|
||||
onClearSearch() {
|
||||
this.searchConf = '';
|
||||
metadataConfClick() {
|
||||
this.code = JSON.stringify(this.appConfig.config['content-metadata']);
|
||||
this.field = 'content-metadata';
|
||||
this.indentCode();
|
||||
}
|
||||
|
||||
onClearExcludedFile() {
|
||||
this.searchConf = '';
|
||||
indentCode() {
|
||||
setTimeout(() => {
|
||||
this.editor.getAction('editor.action.formatDocument').run();
|
||||
}, 300);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -70,6 +70,7 @@
|
||||
Custom preset
|
||||
</mat-slide-toggle>
|
||||
</p>
|
||||
|
||||
<p class="toggle">
|
||||
<ng-container *ngIf="isPreset">
|
||||
<mat-form-field floatPlaceholder="float">
|
||||
@@ -227,6 +228,16 @@
|
||||
</mat-slide-toggle>
|
||||
</p>
|
||||
|
||||
<p class="toggle">
|
||||
<mat-slide-toggle
|
||||
id="adf-toggle-custom-toolbar"
|
||||
[color]="'primary'"
|
||||
(change)="toggleToolbar()"
|
||||
[checked]="customToolbar">
|
||||
Custom Toolbar
|
||||
</mat-slide-toggle>
|
||||
</p>
|
||||
|
||||
<p class="toggle">
|
||||
<button mat-raised-button id="adf-switch-showrightsidebar" (click)="toggleShowRightSidebar()" color="primary">
|
||||
Toggle Right Sidebar
|
||||
@@ -244,6 +255,8 @@
|
||||
</adf-info-drawer>
|
||||
</ng-template>
|
||||
|
||||
<ng-template let-node="node" #sidebarTemplate> <adf-info-drawer-layout> <div info-drawer-content> <mat-card> My info </mat-card> </div> </adf-info-drawer-layout> </ng-template>
|
||||
|
||||
<adf-viewer
|
||||
[nodeId]="nodeId"
|
||||
[showSidebar]="showRightSidebar"
|
||||
@@ -259,6 +272,10 @@
|
||||
[sidebarLeftTemplate]="sidebarLeftTemplate"
|
||||
[sidebarTemplate]="sidebarRightTemplate">
|
||||
|
||||
<adf-viewer-toolbar *ngIf="customToolbar">
|
||||
<h1>My custom toolbar</h1>
|
||||
</adf-viewer-toolbar>
|
||||
|
||||
<adf-viewer-toolbar-actions *ngIf="moreActions">
|
||||
<button mat-icon-button id="adf-viewer-time">
|
||||
<mat-icon>alarm</mat-icon>
|
||||
|
@@ -50,6 +50,7 @@ export class FileViewComponent implements OnInit {
|
||||
fileUrlSwitch = false;
|
||||
showLeftSidebar = null;
|
||||
showRightSidebar = false;
|
||||
customToolbar = false;
|
||||
|
||||
constructor(private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
@@ -158,6 +159,10 @@ export class FileViewComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
toggleToolbar() {
|
||||
this.customToolbar = !this.customToolbar;
|
||||
}
|
||||
|
||||
applyCustomPreset() {
|
||||
this.isPreset = false;
|
||||
setTimeout(() => {
|
||||
|
@@ -197,7 +197,7 @@
|
||||
[currentFolderId]="currentFolderId"
|
||||
[contextMenuActions]="true"
|
||||
[contentActions]="true"
|
||||
[allowDropFiles]="true"
|
||||
[allowDropFiles]="allowDropFiles"
|
||||
[selectionMode]="selectionMode"
|
||||
[multiselect]="multiselect"
|
||||
[display]="displayMode"
|
||||
@@ -265,6 +265,11 @@
|
||||
</ng-template>
|
||||
</data-column>
|
||||
-->
|
||||
<data-column
|
||||
class="full-width ellipsis-cell"
|
||||
title="{{'DOCUMENT_LIST.COLUMNS.NODE_ID' | translate}}"
|
||||
key="id">
|
||||
</data-column>
|
||||
<data-column
|
||||
class="desktop-only"
|
||||
title="{{'DOCUMENT_LIST.COLUMNS.IS_LOCKED' | translate}}"
|
||||
@@ -468,43 +473,49 @@
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<mat-slide-toggle [color]="'primary'" [(ngModel)]="multiselect">{{'DOCUMENT_LIST.MULTISELECT_CHECKBOXES' |
|
||||
translate}}
|
||||
<mat-slide-toggle [color]="'primary'" [(ngModel)]="multiselect">
|
||||
{{'DOCUMENT_LIST.MULTISELECT_CHECKBOXES' | translate}}
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<mat-slide-toggle [color]="'primary'" [(ngModel)]="multipleFileUpload">
|
||||
<mat-slide-toggle id="adf-multiple-upload-switch" [color]="'primary'" [(ngModel)]="multipleFileUpload">
|
||||
{{'DOCUMENT_LIST.MULTIPLE_FILE_UPLOAD' | translate}}
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<mat-slide-toggle [color]="'primary'" [(ngModel)]="folderUpload">{{'DOCUMENT_LIST.FOLDER_UPLOAD' |
|
||||
translate}}
|
||||
<mat-slide-toggle id="adf-folder-upload-switch" [color]="'primary'" [(ngModel)]="folderUpload">
|
||||
{{'DOCUMENT_LIST.FOLDER_UPLOAD' | translate}}
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<mat-slide-toggle [color]="'primary'" [(ngModel)]="acceptedFilesTypeShow">{{'DOCUMENT_LIST.CUSTOM_FILTER' |
|
||||
translate}}
|
||||
<mat-slide-toggle id="adf-extension-filter-upload-switch" [color]="'primary'" [(ngModel)]="acceptedFilesTypeShow">
|
||||
{{'DOCUMENT_LIST.CUSTOM_FILTER' | translate}}
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<mat-slide-toggle [color]="'primary'" [(ngModel)]="maxSizeShow">{{'DOCUMENT_LIST.MAX_SIZE' |
|
||||
translate}}
|
||||
<mat-slide-toggle id="adf-max-size-filter-upload-switch" [color]="'primary'" [(ngModel)]="maxSizeShow">
|
||||
{{'DOCUMENT_LIST.MAX_SIZE' | translate}}
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<mat-slide-toggle [color]="'primary'" (click)="toggleThumbnails()" id="enableThumbnails">{{'DOCUMENT_LIST.THUMBNAILS' |
|
||||
translate}}
|
||||
<mat-slide-toggle id="adf-thumbnails-upload-switch" [color]="'primary'" (click)="toggleThumbnails()">
|
||||
{{'DOCUMENT_LIST.THUMBNAILS' | translate}}
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<mat-slide-toggle [color]="'primary'" [(ngModel)]="versioning">
|
||||
<mat-slide-toggle id="adf-document-list-enable-drop-files" [color]="'primary'" (click)="toggleAllowDropFiles()" >
|
||||
{{'DOCUMENT_LIST.ALLOW_DROP_FILES' | translate}}
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<mat-slide-toggle id="adf-version-upload-switch" [color]="'primary'" [(ngModel)]="versioning">
|
||||
{{'DOCUMENT_LIST.ENABLE_VERSIONING' | translate}}
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
@@ -565,7 +576,6 @@
|
||||
#uploadButton
|
||||
tooltip="Custom tooltip"
|
||||
[disabled]="!enableUpload"
|
||||
data-automation-id="multiple-file-upload"
|
||||
[rootFolderId]="documentList.currentFolderId"
|
||||
[multipleFiles]="multipleFileUpload"
|
||||
[uploadFolders]="folderUpload"
|
||||
@@ -583,7 +593,6 @@
|
||||
#uploadButton
|
||||
tooltip="Custom tooltip"
|
||||
[disabled]="!enableUpload"
|
||||
data-automation-id="multiple-file-upload"
|
||||
[rootFolderId]="documentList.currentFolderId"
|
||||
[acceptedFilesType]="acceptedFilesType"
|
||||
[multipleFiles]="multipleFileUpload"
|
||||
|
@@ -164,8 +164,8 @@
|
||||
@media (max-device-width: 1024px) {
|
||||
adf-document-list .adf-data-table {
|
||||
|
||||
.adf-data-table-cell:nth-child(4),
|
||||
.adf-datatable-table-cell-header:nth-child(4) {
|
||||
.adf-data-table-cell:nth-child(5),
|
||||
.adf-datatable-table-cell-header:nth-child(5) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
@@ -59,6 +59,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
fileNodeId: any;
|
||||
showViewer = false;
|
||||
showVersions = false;
|
||||
allowDropFiles = true;
|
||||
displayMode = DisplayMode.List;
|
||||
includeFields = ['isFavorite', 'isLocked', 'aspectNames'];
|
||||
|
||||
@@ -227,6 +228,11 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
this.documentList.reload();
|
||||
}
|
||||
|
||||
toggleAllowDropFiles() {
|
||||
this.allowDropFiles = !this.allowDropFiles;
|
||||
this.documentList.reload();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if (!this.pagination) {
|
||||
this.pagination = <Pagination> {
|
||||
@@ -340,7 +346,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
openSnackMessage(event: any) {
|
||||
this.notificationService.openSnackMessage(
|
||||
event,
|
||||
4000
|
||||
6000
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -53,6 +53,20 @@
|
||||
<mat-radio-button value="end">End</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
<section>
|
||||
<mat-slide-toggle id="adf-hide-sidenav" [color]="'primary'" (click)="changeSidenavVisibility()">
|
||||
Hide Sidebar
|
||||
</mat-slide-toggle>
|
||||
</section>
|
||||
|
||||
<div>
|
||||
<mat-radio-group [(ngModel)]="position" (change)="changePosition()">
|
||||
<mat-radio-button value="start">Start</mat-radio-button>
|
||||
<mat-radio-button value="end">End</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
</div>
|
||||
|
||||
</mat-card>
|
||||
</div>
|
||||
|
@@ -25,6 +25,7 @@ import { HeaderDataService } from './header-data.service';
|
||||
export class HeaderDataComponent {
|
||||
checkbox = true;
|
||||
position = 'start';
|
||||
hideSidenavToggle = false;
|
||||
|
||||
constructor(private headerService: HeaderDataService) {
|
||||
}
|
||||
@@ -65,4 +66,9 @@ export class HeaderDataComponent {
|
||||
changePosition() {
|
||||
this.headerService.changePosition(this.position);
|
||||
}
|
||||
|
||||
changeSidenavVisibility() {
|
||||
this.hideSidenavToggle = !this.hideSidenavToggle;
|
||||
this.headerService.changeSidenavVisibility(this.hideSidenavToggle);
|
||||
}
|
||||
}
|
||||
|
@@ -29,6 +29,7 @@ export class HeaderDataService {
|
||||
@Output() redirectUrl: EventEmitter<string | any[]> = new EventEmitter();
|
||||
@Output() tooltip: EventEmitter<string> = new EventEmitter();
|
||||
@Output() position: EventEmitter<string> = new EventEmitter();
|
||||
@Output() hideSidenav: EventEmitter<string> = new EventEmitter();
|
||||
|
||||
hideMenuButton() {
|
||||
this.show = !this.show;
|
||||
@@ -59,4 +60,8 @@ export class HeaderDataService {
|
||||
changePosition(position) {
|
||||
this.position.emit(position);
|
||||
}
|
||||
|
||||
changeSidenavVisibility(hideSidenav) {
|
||||
this.hideSidenav.emit(hideSidenav);
|
||||
}
|
||||
}
|
||||
|
@@ -48,6 +48,7 @@
|
||||
(success)="onSuccessTaskList($event)"
|
||||
(row-click)="onRowClick($event)"
|
||||
(row-dblclick)="onTaskRowDblClick($event)"
|
||||
[multiselect]="multiSelectTask"
|
||||
#taskList>
|
||||
<!-- Custom column definition demo -->
|
||||
|
||||
@@ -153,6 +154,7 @@
|
||||
[sort]="processFilter?.filter?.sort"
|
||||
(rowClick)="onProcessRowClick($event)"
|
||||
(row-dblclick)="onProcessRowDblClick($event)"
|
||||
[multiselect]="multiSelectProcess"
|
||||
(success)="onSuccessProcessList($event)">
|
||||
<!-- Custom column definition demo -->
|
||||
|
||||
@@ -257,6 +259,12 @@
|
||||
<div>
|
||||
<mat-slide-toggle id="adf-show-header" (change)="toggleHeaderContent()" [checked]="showHeaderContent">{{ 'PS-TAB.TASK-SHOW-HEADER'| translate }}</mat-slide-toggle>
|
||||
</div>
|
||||
<div>
|
||||
<mat-slide-toggle id="adf-process-multiselect" (change)="toggleTasProcesssMultiselect()" [checked]="multiSelectProcess">Multiselect Process List</mat-slide-toggle>
|
||||
</div>
|
||||
<div>
|
||||
<mat-slide-toggle id="adf-task-multiselect" (change)="toggleTaskMultiselect()" [checked]="multiSelectTask">Multiselect Task List</mat-slide-toggle>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</mat-tab>
|
||||
|
@@ -118,6 +118,8 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
|
||||
changePageSize: EventEmitter<Pagination> = new EventEmitter();
|
||||
|
||||
selectFirstReport = false;
|
||||
multiSelectTask = false;
|
||||
multiSelectProcess = false;
|
||||
|
||||
private tabs = { tasks: 0, processes: 1, reports: 2 };
|
||||
|
||||
@@ -505,7 +507,16 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
|
||||
changeTaskFilterIcon() {
|
||||
this.showTaskFilterIcon = !this.showTaskFilterIcon;
|
||||
}
|
||||
|
||||
changeProcessFilterIcon() {
|
||||
this.showProcessFilterIcon = !this.showProcessFilterIcon;
|
||||
}
|
||||
|
||||
toggleTasProcesssMultiselect() {
|
||||
this.multiSelectProcess = !this.multiSelectProcess;
|
||||
}
|
||||
|
||||
toggleTaskMultiselect() {
|
||||
this.multiSelectTask = !this.multiSelectTask;
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import LoginPage = require('../../pages/adf/loginPage');
|
||||
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
|
||||
import ViewerPage = require('../../pages/adf/viewerPage');
|
||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||
import { CommentsPage } from '../../pages/adf/commentsPage';
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
|
@@ -637,7 +637,7 @@ describe('Document List Component', () => {
|
||||
expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED)).toContain('ago');
|
||||
|
||||
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.DISPLAY_NAME)).toBe(docxFile.name);
|
||||
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.SIZE)).toBe(`770.35 KB`);
|
||||
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.SIZE)).toBe(`81.05 KB`);
|
||||
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`);
|
||||
|
||||
expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED)).toContain('ago');
|
||||
|
@@ -20,6 +20,7 @@ import FileModel = require('../models/ACS/fileModel');
|
||||
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
import TagPage = require('../pages/adf/tagPage');
|
||||
import AppNavigationBarPage = require('../pages/adf/process_services/appNavigationBarPage');
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
@@ -34,6 +35,7 @@ describe('Tag component', () => {
|
||||
|
||||
let loginPage = new LoginPage();
|
||||
let tagPage = new TagPage();
|
||||
let appNavigationBarPage = new AppNavigationBarPage();
|
||||
|
||||
let acsUser = new AcsUserModel();
|
||||
let uploadActions = new UploadActions();
|
||||
@@ -48,12 +50,12 @@ describe('Tag component', () => {
|
||||
Util.generateRandomStringToLowerCase()];
|
||||
|
||||
let tags = [
|
||||
{tag: 'test-tag-01'}, {tag: 'test-tag-02'}, {tag: 'test-tag-03'}, {tag: 'test-tag-04'}, {tag: 'test-tag-05'},
|
||||
{tag: 'test-tag-06'}, {tag: 'test-tag-07'}, {tag: 'test-tag-08'}, {tag: 'test-tag-09'}, {tag: 'test-tag-10'},
|
||||
{tag: 'test-tag-11'}, {tag: 'test-tag-12'}, {tag: 'test-tag-13'}, {tag: 'test-tag-14'}, {tag: 'test-tag-15'},
|
||||
{tag: 'test-tag-16'}, {tag: 'test-tag-17'}, {tag: 'test-tag-18'}, {tag: 'test-tag-19'}, {tag: 'test-tag-20'},
|
||||
{tag: 'test-tag-21'}, {tag: 'test-tag-22'}, {tag: 'test-tag-23'}, {tag: 'test-tag-24'}, {tag: 'test-tag-25'},
|
||||
{tag: 'test-tag-26'}, {tag: 'test-tag-27'}, {tag: 'test-tag-28'}, {tag: 'test-tag-29'}, {tag: 'test-tag-30'}];
|
||||
{ tag: 'test-tag-01' }, { tag: 'test-tag-02' }, { tag: 'test-tag-03' }, { tag: 'test-tag-04' }, { tag: 'test-tag-05' },
|
||||
{ tag: 'test-tag-06' }, { tag: 'test-tag-07' }, { tag: 'test-tag-08' }, { tag: 'test-tag-09' }, { tag: 'test-tag-10' },
|
||||
{ tag: 'test-tag-11' }, { tag: 'test-tag-12' }, { tag: 'test-tag-13' }, { tag: 'test-tag-14' }, { tag: 'test-tag-15' },
|
||||
{ tag: 'test-tag-16' }, { tag: 'test-tag-17' }, { tag: 'test-tag-18' }, { tag: 'test-tag-19' }, { tag: 'test-tag-20' },
|
||||
{ tag: 'test-tag-21' }, { tag: 'test-tag-22' }, { tag: 'test-tag-23' }, { tag: 'test-tag-24' }, { tag: 'test-tag-25' },
|
||||
{ tag: 'test-tag-26' }, { tag: 'test-tag-27' }, { tag: 'test-tag-28' }, { tag: 'test-tag-29' }, { tag: 'test-tag-30' }];
|
||||
|
||||
let uppercaseTag = Util.generateRandomStringToUpperCase();
|
||||
let digitsTag = Util.generateRandomStringDigits();
|
||||
@@ -86,7 +88,7 @@ describe('Tag component', () => {
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
tagPage.goToTagPage();
|
||||
appNavigationBarPage.clickTagButton();
|
||||
|
||||
done();
|
||||
});
|
||||
@@ -197,36 +199,19 @@ describe('Tag component', () => {
|
||||
tagPage.checkDeleteTagFromTagListByNodeIdIsNotDisplayed(tagList[3]);
|
||||
});
|
||||
|
||||
it('[C286472] Should be able to click Show more/less button on "List Tags Content Services"', async() => {
|
||||
await browser.refresh();
|
||||
it('[C286472] Should be able to click Show more/less button on "List Tags Content Services"', () => {
|
||||
tagPage.insertNodeId(pdfFileModel.id);
|
||||
|
||||
await tagPage.checkShowMoreButtonIsDisplayed();
|
||||
await tagPage.checkShowLessButtonIsNotDisplayed();
|
||||
tagPage.checkShowMoreButtonIsDisplayed();
|
||||
tagPage.checkShowLessButtonIsNotDisplayed();
|
||||
|
||||
expect(tagPage.checkTagsOnList()).toEqual(10);
|
||||
|
||||
await tagPage.clickShowMoreButton();
|
||||
await tagPage.checkShowMoreButtonIsDisplayed();
|
||||
await tagPage.checkShowLessButtonIsDisplayed();
|
||||
tagPage.clickShowMoreButton();
|
||||
tagPage.checkShowLessButtonIsDisplayed();
|
||||
|
||||
await tagPage.clickShowMoreButtonUntilNotDisplayed();
|
||||
await tagPage.checkShowLessButtonIsDisplayed();
|
||||
await tagPage.checkShowMoreButtonIsNotDisplayed();
|
||||
|
||||
let totalTags = await this.alfrescoJsApi.core.tagsApi.getTags({maxItems: 400});
|
||||
let totalNumberOfTags = totalTags.list.pagination.count;
|
||||
|
||||
expect(tagPage.checkTagsOnList()).toEqual(totalNumberOfTags);
|
||||
|
||||
await tagPage.clickShowLessButton();
|
||||
await tagPage.checkShowMoreButtonIsDisplayed();
|
||||
await tagPage.checkShowLessButtonIsDisplayed();
|
||||
|
||||
expect(tagPage.checkTagsOnList()).toBeLessThan(totalNumberOfTags);
|
||||
|
||||
await tagPage.clickShowLessButtonUntilNotDisplayed();
|
||||
await tagPage.checkShowMoreButtonIsDisplayed();
|
||||
await tagPage.checkShowLessButtonIsNotDisplayed();
|
||||
tagPage.clickShowMoreButtonUntilNotDisplayed();
|
||||
tagPage.checkShowLessButtonIsDisplayed();
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -16,7 +16,8 @@
|
||||
*/
|
||||
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
import TrashcanPage = require('../pages/adf/trashcanPage');
|
||||
import { TrashcanPage } from '../pages/adf/trashcanPage';
|
||||
|
||||
import PaginationPage = require('../pages/adf/paginationPage');
|
||||
import NavigationBarPage = require('../pages/adf/navigationBarPage');
|
||||
|
||||
|
@@ -20,7 +20,8 @@ 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');
|
||||
import UploadToggles = require('../../pages/adf/dialog/uploadToggles');
|
||||
import { UploadToggles } from '../../pages/adf/dialog/uploadToggles';
|
||||
import NavigationBarPage = require('../../pages/adf/navigationBarPage');
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
@@ -31,6 +32,7 @@ import resources = require('../../util/resources');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { DropActions } from '../../actions/drop.actions';
|
||||
import { ConfigEditorPage } from '../../pages/adf/configEditorPage';
|
||||
|
||||
describe('Upload component - Excluded Files', () => {
|
||||
|
||||
@@ -39,6 +41,8 @@ describe('Upload component - Excluded Files', () => {
|
||||
let uploadToggles = new UploadToggles();
|
||||
let loginPage = new LoginPage();
|
||||
let acsUser = new AcsUserModel();
|
||||
let navigationBarPage = new NavigationBarPage();
|
||||
let configEditorPage = new ConfigEditorPage();
|
||||
|
||||
let iniExcludedFile = new FileModel({
|
||||
'name': resources.Files.ADF_DOCUMENTS.INI.file_name,
|
||||
@@ -50,6 +54,16 @@ describe('Upload component - Excluded Files', () => {
|
||||
'location': resources.Files.ADF_DOCUMENTS.FOLDER_EXCLUDED.folder_location
|
||||
});
|
||||
|
||||
let txtFileModel = new FileModel({
|
||||
'name': resources.Files.ADF_DOCUMENTS.TXT_0B.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location
|
||||
});
|
||||
|
||||
let pngFile = new FileModel({
|
||||
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
|
||||
});
|
||||
|
||||
beforeAll(async (done) => {
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'ECM',
|
||||
@@ -72,7 +86,7 @@ describe('Upload component - Excluded Files', () => {
|
||||
it('[C279914] Should not allow upload default excluded files using D&D', () => {
|
||||
contentServicesPage.checkDandDIsDisplayed();
|
||||
|
||||
let dragAndDropArea = element(by.css('adf-upload-drag-area div'));
|
||||
let dragAndDropArea = element.all(by.css('adf-upload-drag-area div')).first();
|
||||
|
||||
let dragAndDrop = new DropActions();
|
||||
|
||||
@@ -98,4 +112,66 @@ describe('Upload component - Excluded Files', () => {
|
||||
|
||||
contentServicesPage.doubleClickRow(folderWithExcludedFile.name).checkContentIsNotDisplayed(iniExcludedFile.name).checkContentIsDisplayed('a_file.txt');
|
||||
});
|
||||
|
||||
it('[C212862] Should not allow upload file excluded in the files extension of app.config.json', () => {
|
||||
navigationBarPage.clickConfigEditorButton();
|
||||
|
||||
browser.refresh();
|
||||
|
||||
configEditorPage.clickFileConfiguration('adf-file-conf');
|
||||
|
||||
configEditorPage.clickClearButton();
|
||||
|
||||
configEditorPage.enterConfiguration('{' +
|
||||
' "excluded": [' +
|
||||
' ".DS_Store",' +
|
||||
' "desktop.ini",' +
|
||||
' "*.txt"' +
|
||||
' ],' +
|
||||
' "match-options": {' +
|
||||
' "nocase": true' +
|
||||
' }' +
|
||||
'}');
|
||||
|
||||
configEditorPage.clickSaveButton();
|
||||
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
contentServicesPage
|
||||
.uploadFile(txtFileModel.location)
|
||||
.checkContentIsNotDisplayed(txtFileModel.name);
|
||||
});
|
||||
|
||||
it('[C274688] Should extension type added as excluded and accepted not be uploaded', () => {
|
||||
navigationBarPage.clickConfigEditorButton();
|
||||
|
||||
browser.refresh();
|
||||
|
||||
configEditorPage.clickFileConfiguration('adf-file-conf');
|
||||
|
||||
configEditorPage.clickClearButton();
|
||||
|
||||
configEditorPage.enterConfiguration('{' +
|
||||
' "excluded": [' +
|
||||
' ".DS_Store",' +
|
||||
' "desktop.ini",' +
|
||||
' "*.png"' +
|
||||
' ],' +
|
||||
' "match-options": {' +
|
||||
' "nocase": true' +
|
||||
' }' +
|
||||
'}');
|
||||
|
||||
configEditorPage.clickSaveButton();
|
||||
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
uploadToggles.enableExtensionFilter();
|
||||
browser.driver.sleep(1000);
|
||||
uploadToggles.addExtension('.png');
|
||||
|
||||
contentServicesPage.uploadFile(pngFile.location);
|
||||
browser.driver.sleep(1000);
|
||||
contentServicesPage.checkContentIsNotDisplayed(pngFile.name);
|
||||
});
|
||||
});
|
||||
|
@@ -15,12 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
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');
|
||||
import UploadToggles = require('../../pages/adf/dialog/uploadToggles');
|
||||
import { UploadToggles } from '../../pages/adf/dialog/uploadToggles';
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
@@ -40,6 +41,7 @@ describe('Upload component', () => {
|
||||
let uploadToggles = new UploadToggles();
|
||||
let loginPage = new LoginPage();
|
||||
let acsUser = new AcsUserModel();
|
||||
let uploadActions = new UploadActions();
|
||||
|
||||
let firstPdfFileModel = new FileModel({
|
||||
'name': resources.Files.ADF_DOCUMENTS.PDF_B.file_name,
|
||||
@@ -53,6 +55,10 @@ describe('Upload component', () => {
|
||||
'name': resources.Files.ADF_DOCUMENTS.PDF.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.PDF.file_location
|
||||
});
|
||||
let pngFileModelTwo = new FileModel({
|
||||
'name': resources.Files.ADF_DOCUMENTS.PNG_B.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.PNG_B.file_location
|
||||
});
|
||||
let pngFileModel = new FileModel({
|
||||
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name,
|
||||
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
|
||||
@@ -83,8 +89,6 @@ describe('Upload component', () => {
|
||||
let filesName = [pdfFileModel.name, docxFileModel.name, pngFileModel.name, firstPdfFileModel.name];
|
||||
|
||||
beforeAll(async (done) => {
|
||||
let uploadActions = new UploadActions();
|
||||
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'ECM',
|
||||
hostEcm: TestConfig.adf.url
|
||||
@@ -107,16 +111,39 @@ describe('Upload component', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
let nodersPromise = await contentServicesPage.getContentList().getAllNodeIdInList();
|
||||
|
||||
nodersPromise.forEach(async (currentNodePormise) => {
|
||||
await currentNodePormise.then(async (currentNode) => {
|
||||
if (currentNode && currentNode !== 'Node id') {
|
||||
await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, currentNode);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C272788] Upload Button is visible on the page', () => {
|
||||
expect(contentServicesPage.getSingleFileButtonTooltip()).toEqual('Custom tooltip');
|
||||
|
||||
contentServicesPage
|
||||
.checkUploadButton()
|
||||
.checkContentIsDisplayed(firstPdfFileModel.name);
|
||||
});
|
||||
|
||||
contentServicesPage
|
||||
.deleteContent(firstPdfFileModel.name)
|
||||
.checkContentIsNotDisplayed(pdfFileModel.name);
|
||||
it('[C260173] Enable folder upload', () => {
|
||||
uploadToggles.enableFolderUpload();
|
||||
contentServicesPage.uploadFolder(folderOne.location);
|
||||
|
||||
contentServicesPage.checkContentIsDisplayed(folderOne.name);
|
||||
expect(contentServicesPage.getFolderButtonTooltip()).toEqual('Custom tooltip');
|
||||
uploadDialog.fileIsUploaded(uploadedFileInFolder.name);
|
||||
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
|
||||
contentServicesPage.doubleClickRow(folderOne.name).checkContentIsDisplayed(uploadedFileInFolder.name);
|
||||
contentServicesPage.goToDocumentList();
|
||||
uploadToggles.disableFolderUpload();
|
||||
});
|
||||
|
||||
it('[C272789] Upload a pdf file', () => {
|
||||
@@ -127,10 +154,6 @@ describe('Upload component', () => {
|
||||
uploadDialog.fileIsUploaded(pdfFileModel.name);
|
||||
|
||||
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
|
||||
|
||||
contentServicesPage
|
||||
.deleteContent(pdfFileModel.name)
|
||||
.checkContentIsNotDisplayed(pdfFileModel.name);
|
||||
});
|
||||
|
||||
it('[C272790] Upload a text file', () => {
|
||||
@@ -140,10 +163,6 @@ describe('Upload component', () => {
|
||||
|
||||
uploadDialog.fileIsUploaded(docxFileModel.name);
|
||||
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
|
||||
|
||||
contentServicesPage
|
||||
.deleteContent(docxFileModel.name)
|
||||
.checkContentIsNotDisplayed(docxFileModel.name);
|
||||
});
|
||||
|
||||
it('[C260141] Upload a png file', () => {
|
||||
@@ -153,10 +172,6 @@ describe('Upload component', () => {
|
||||
|
||||
uploadDialog.fileIsUploaded(pngFileModel.name);
|
||||
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
|
||||
|
||||
contentServicesPage
|
||||
.deleteContent(pngFileModel.name)
|
||||
.checkContentIsNotDisplayed(pngFileModel.name);
|
||||
});
|
||||
|
||||
it('[C260143] Minimize and maximize the upload dialog box', () => {
|
||||
@@ -177,7 +192,6 @@ describe('Upload component', () => {
|
||||
expect(uploadDialog.numberOfCurrentFilesUploaded()).toEqual('1');
|
||||
expect(uploadDialog.numberOfInitialFilesUploaded()).toEqual('1');
|
||||
uploadDialog.checkCloseButtonIsDisplayed().clickOnCloseButton().dialogIsNotDisplayed();
|
||||
contentServicesPage.deleteContent(docxFileModel.name).checkContentIsNotDisplayed(docxFileModel.name);
|
||||
});
|
||||
|
||||
it('[C260168] Cancel the uploaded file through the upload dialog icon', () => {
|
||||
@@ -189,9 +203,9 @@ describe('Upload component', () => {
|
||||
contentServicesPage.checkContentIsNotDisplayed(pdfFileModel.name);
|
||||
});
|
||||
|
||||
it('[C272792] Cancel a big file through the upload dialog icon before the upload to be done', () => {
|
||||
xit('[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)');
|
||||
'document.querySelector("#adf-upload-dialog-cancel").click(); }, 3000)');
|
||||
|
||||
contentServicesPage.uploadFile(largeFile.location);
|
||||
|
||||
@@ -249,7 +263,7 @@ describe('Upload component', () => {
|
||||
uploadToggles.addExtension('.docx');
|
||||
|
||||
let dragAndDrop = new DropActions();
|
||||
let dragAndDropArea = element(by.css('adf-upload-drag-area div'));
|
||||
let dragAndDropArea = element.all(by.css('adf-upload-drag-area div')).first();
|
||||
|
||||
dragAndDrop.dropFile(dragAndDropArea, docxFileModel.location);
|
||||
contentServicesPage.checkContentIsDisplayed(docxFileModel.name);
|
||||
@@ -264,57 +278,64 @@ describe('Upload component', () => {
|
||||
});
|
||||
|
||||
it('[C279920] Upload same file twice', () => {
|
||||
contentServicesPage.uploadFile(pdfFileModel.location).checkContentIsDisplayed(pdfFileModel.name);
|
||||
contentServicesPage
|
||||
.uploadFile(pdfFileModel.location)
|
||||
.checkContentIsDisplayed(pdfFileModel.name);
|
||||
|
||||
pdfFileModel.setVersion('1');
|
||||
contentServicesPage.uploadFile(pdfFileModel.location).checkContentIsDisplayed(pdfFileModel.getVersionName());
|
||||
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
|
||||
contentServicesPage.deleteContent(pdfFileModel.name).checkContentIsNotDisplayed(pdfFileModel.name);
|
||||
contentServicesPage.deleteContent(pdfFileModel.getVersionName()).checkContentIsNotDisplayed(pdfFileModel.getVersionName());
|
||||
|
||||
contentServicesPage
|
||||
.uploadFile(pdfFileModel.location)
|
||||
.checkContentIsDisplayed(pdfFileModel.getVersionName());
|
||||
|
||||
uploadDialog
|
||||
.clickOnCloseButton()
|
||||
.dialogIsNotDisplayed();
|
||||
|
||||
pdfFileModel.setVersion('');
|
||||
});
|
||||
|
||||
it('[C260172] Enable versioning', () => {
|
||||
uploadToggles.enableVersioning();
|
||||
contentServicesPage.uploadFile(pdfFileModel.location).checkContentIsDisplayed(pdfFileModel.name);
|
||||
|
||||
contentServicesPage
|
||||
.uploadFile(pdfFileModel.location)
|
||||
.checkContentIsDisplayed(pdfFileModel.name);
|
||||
|
||||
pdfFileModel.setVersion('1');
|
||||
contentServicesPage.uploadFile(pdfFileModel.location).checkContentIsDisplayed(pdfFileModel.name);
|
||||
uploadDialog.fileIsUploaded(pdfFileModel.name);
|
||||
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
|
||||
contentServicesPage.checkContentIsNotDisplayed(pdfFileModel.getVersionName());
|
||||
contentServicesPage.deleteContent(pdfFileModel.name).checkContentIsNotDisplayed(pdfFileModel.name);
|
||||
|
||||
contentServicesPage
|
||||
.uploadFile(pdfFileModel.location)
|
||||
.checkContentIsDisplayed(pdfFileModel.name);
|
||||
|
||||
uploadDialog
|
||||
.fileIsUploaded(pdfFileModel.name);
|
||||
|
||||
uploadDialog
|
||||
.clickOnCloseButton()
|
||||
.dialogIsNotDisplayed();
|
||||
|
||||
contentServicesPage
|
||||
.checkContentIsNotDisplayed(pdfFileModel.getVersionName());
|
||||
|
||||
pdfFileModel.setVersion('');
|
||||
uploadToggles.disableVersioning();
|
||||
});
|
||||
|
||||
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);
|
||||
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
|
||||
contentServicesPage.doubleClickRow(folderOne.name).checkContentIsDisplayed(uploadedFileInFolder.name);
|
||||
contentServicesPage.goToDocumentList();
|
||||
uploadToggles.disableFolderUpload();
|
||||
});
|
||||
|
||||
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);
|
||||
contentServicesPage.uploadFile(pngFileModelTwo.location).checkContentIsDisplayed(pngFileModelTwo.name);
|
||||
|
||||
uploadDialog.fileIsUploaded(docxFileModel.name);
|
||||
uploadDialog.fileIsUploaded(pngFileModelTwo.name);
|
||||
|
||||
contentServicesPage.uploadFile(pngFileModel.location).checkContentIsDisplayed(pngFileModel.name);
|
||||
|
||||
uploadDialog.fileIsUploaded(pngFileModel.name).fileIsUploaded(docxFileModel.name);
|
||||
uploadDialog.fileIsUploaded(pngFileModel.name).fileIsUploaded(pngFileModelTwo.name);
|
||||
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
|
||||
|
||||
contentServicesPage.uploadFile(pdfFileModel.location).checkContentIsDisplayed(pdfFileModel.name);
|
||||
|
||||
uploadDialog.fileIsUploaded(pdfFileModel.name).fileIsNotDisplayedInDialog(pngFileModel.name).fileIsNotDisplayedInDialog(docxFileModel.name);
|
||||
uploadDialog.fileIsUploaded(pdfFileModel.name).fileIsNotDisplayedInDialog(pngFileModel.name).fileIsNotDisplayedInDialog(pngFileModelTwo.name);
|
||||
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
|
||||
|
||||
contentServicesPage.deleteContents([docxFileModel.name, pngFileModel.name, pdfFileModel.name])
|
||||
.checkContentsAreNotDisplayed([docxFileModel.name, pngFileModel.name, pdfFileModel.name]);
|
||||
});
|
||||
|
||||
it('[C260170] Upload files on the same time', () => {
|
||||
@@ -331,40 +352,39 @@ describe('Upload component', () => {
|
||||
|
||||
uploadDialog.clickOnCloseButton().dialogIsNotDisplayed();
|
||||
|
||||
contentServicesPage.deleteContents(filesName).checkContentsAreNotDisplayed(filesName);
|
||||
|
||||
uploadToggles.disableMultipleFileUpload();
|
||||
});
|
||||
|
||||
xit('[C279919] Enable max size and set it to 400', () => {
|
||||
it('[C260174] Enable max size and set it to 400', () => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
contentServicesPage.checkAcsContainer();
|
||||
uploadToggles.enableMaxSize();
|
||||
uploadToggles.addMaxSize('400');
|
||||
contentServicesPage.uploadFile(fileWithSpecificSize.location).checkContentIsDisplayed(fileWithSpecificSize.name);
|
||||
contentServicesPage.uploadFile(fileWithSpecificSize.location);
|
||||
uploadDialog.fileIsUploaded(fileWithSpecificSize.name).clickOnCloseButton().dialogIsNotDisplayed();
|
||||
contentServicesPage.deleteContent(fileWithSpecificSize.name).checkContentIsNotDisplayed(fileWithSpecificSize.name);
|
||||
uploadToggles.addMaxSize('399');
|
||||
contentServicesPage.uploadFile(fileWithSpecificSize.location).checkContentIsNotDisplayed(fileWithSpecificSize.name);
|
||||
contentServicesPage.uploadFile(fileWithSpecificSize.location);
|
||||
expect(contentServicesPage.getErrorMessage()).toEqual('File ' + fileWithSpecificSize.name + ' is larger than the allowed file size');
|
||||
contentServicesPage.checkContentIsNotDisplayed(fileWithSpecificSize.name);
|
||||
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('[C272796] Enable max size and set it to 0', () => {
|
||||
it('[C272796] Enable max size and set it to 0', () => {
|
||||
contentServicesPage.goToDocumentList();
|
||||
uploadToggles.enableMaxSize();
|
||||
uploadToggles.addMaxSize('0');
|
||||
contentServicesPage.uploadFile(fileWithSpecificSize.location).checkContentIsNotDisplayed(fileWithSpecificSize.name);
|
||||
contentServicesPage.uploadFile(fileWithSpecificSize.location);
|
||||
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();
|
||||
});
|
||||
|
||||
@@ -373,8 +393,9 @@ describe('Upload component', () => {
|
||||
browser.driver.sleep(1000);
|
||||
uploadToggles.addMaxSize('1');
|
||||
uploadToggles.disableMaxSize();
|
||||
contentServicesPage.uploadFile(fileWithSpecificSize.location).checkContentIsDisplayed(fileWithSpecificSize.name);
|
||||
contentServicesPage.uploadFile(fileWithSpecificSize.location);
|
||||
uploadDialog.fileIsUploaded(fileWithSpecificSize.name).clickOnCloseButton().dialogIsNotDisplayed();
|
||||
contentServicesPage.checkContentIsDisplayed(fileWithSpecificSize.name);
|
||||
});
|
||||
|
||||
it('[C91318] Should Enable/Disable upload button when change the disable property', () => {
|
||||
|
@@ -20,7 +20,7 @@ import { element, by } from 'protractor';
|
||||
import LoginPage = require('../../pages/adf/loginPage');
|
||||
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
|
||||
import UploadDialog = require('../../pages/adf/dialog/uploadDialog');
|
||||
import UploadToggles = require('../../pages/adf/dialog/uploadToggles');
|
||||
import { UploadToggles } from '../../pages/adf/dialog/uploadToggles';
|
||||
import NavigationBarPage = require('../../pages/adf/navigationBarPage');
|
||||
import NotificationPage = require('../../pages/adf/notificationPage');
|
||||
|
||||
@@ -99,7 +99,7 @@ describe('Upload - User permission', () => {
|
||||
contentServicesPage.checkDandDIsDisplayed();
|
||||
|
||||
let dragAndDrop = new DropActions();
|
||||
let dragAndDropArea = element(by.css('adf-upload-drag-area div'));
|
||||
let dragAndDropArea = element.all(by.css('adf-upload-drag-area div')).first();
|
||||
|
||||
dragAndDrop.dropFile(dragAndDropArea, emptyFile.location);
|
||||
dragAndDrop.dropFolder(dragAndDropArea, folder.location);
|
||||
@@ -109,6 +109,8 @@ describe('Upload - User permission', () => {
|
||||
|
||||
contentServicesPage.navigateToFolderViaBreadcrumbs('User Homes');
|
||||
|
||||
browser.sleep(5000);
|
||||
|
||||
dragAndDrop.dropFile(dragAndDropArea, emptyFile.location);
|
||||
dragAndDrop.dropFolder(dragAndDropArea, folder.location);
|
||||
|
||||
@@ -122,12 +124,6 @@ describe('Upload - User permission', () => {
|
||||
});
|
||||
|
||||
it('[C279915] Should not be allowed to upload a file in a restricted user folder with limited permissions', () => {
|
||||
navigationBarPage.clickLoginButton();
|
||||
|
||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||
|
||||
contentServicesPage.goToDocumentList();
|
||||
|
||||
contentServicesPage.uploadFile(emptyFile.location).checkContentIsDisplayed(emptyFile.name);
|
||||
|
||||
uploadDialog.fileIsUploaded(emptyFile.name);
|
||||
@@ -136,6 +132,8 @@ describe('Upload - User permission', () => {
|
||||
|
||||
contentServicesPage.navigateToFolderViaBreadcrumbs('User Homes');
|
||||
|
||||
browser.sleep(5000);
|
||||
|
||||
contentServicesPage.uploadFile(emptyFile.location);
|
||||
|
||||
notificationPage.checkNotifyContains('You don\'t have the create permission to upload the content');
|
||||
@@ -154,6 +152,8 @@ describe('Upload - User permission', () => {
|
||||
|
||||
contentServicesPage.navigateToFolderViaBreadcrumbs('User Homes');
|
||||
|
||||
browser.sleep(5000);
|
||||
|
||||
uploadToggles.enableFolderUpload();
|
||||
|
||||
contentServicesPage.uploadFolder(folder.location);
|
||||
@@ -175,7 +175,7 @@ describe('Upload - User permission', () => {
|
||||
|
||||
let dragAndDrop = new DropActions();
|
||||
|
||||
let dragAndDropArea = element(by.css('adf-upload-drag-area div'));
|
||||
let dragAndDropArea = element.all(by.css('adf-upload-drag-area div')).first();
|
||||
|
||||
dragAndDrop.dropFile(dragAndDropArea, emptyFile.location);
|
||||
dragAndDrop.dropFolder(dragAndDropArea, folder.location);
|
||||
|
@@ -15,23 +15,23 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import TestConfig = require('../../test.config');
|
||||
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
import ViewerPage = require('../pages/adf/viewerPage');
|
||||
import NavigationBarPage = require('../pages/adf/navigationBarPage');
|
||||
import ContentServicesPage = require('../pages/adf/contentServicesPage');
|
||||
import LoginPage = require('../../pages/adf/loginPage');
|
||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||
import NavigationBarPage = require('../../pages/adf/navigationBarPage');
|
||||
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
|
||||
|
||||
import resources = require('../util/resources');
|
||||
import Util = require('../util/util');
|
||||
import CONSTANTS = require('../util/constants');
|
||||
import resources = require('../../util/resources');
|
||||
import Util = require('../../util/util');
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
import FileModel = require('../models/ACS/fileModel');
|
||||
import FolderModel = require('../models/ACS/folderModel');
|
||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
import FolderModel = require('../../models/ACS/folderModel');
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../actions/ACS/upload.actions';
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
describe('Viewer', () => {
|
@@ -17,19 +17,19 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import TestConfig = require('../../test.config');
|
||||
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
import ContentServicesPage = require('../pages/adf/contentServicesPage');
|
||||
import ViewerPage = require('../pages/adf/viewerPage');
|
||||
import LoginPage = require('../../pages/adf/loginPage');
|
||||
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
|
||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||
|
||||
import resources = require('../util/resources');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
import FileModel = require('../models/ACS/fileModel');
|
||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../actions/ACS/upload.actions';
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
|
||||
describe('Content Services Viewer', () => {
|
||||
|
@@ -15,20 +15,20 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import TestConfig = require('../../test.config');
|
||||
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
import ViewerPage = require('../pages/adf/viewerPage');
|
||||
import NavigationBarPage = require('../pages/adf/navigationBarPage');
|
||||
import LoginPage = require('../../pages/adf/loginPage');
|
||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||
import NavigationBarPage = require('../../pages/adf/navigationBarPage');
|
||||
|
||||
import resources = require('../util/resources');
|
||||
import resources = require('../../util/resources');
|
||||
|
||||
import FileModel = require('../models/ACS/fileModel');
|
||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
||||
import FileModel = require('../../models/ACS/fileModel');
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UploadActions } from '../actions/ACS/upload.actions';
|
||||
import SettingsPage = require('../pages/adf/settingsPage');
|
||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||
import SettingsPage = require('../../pages/adf/settingsPage');
|
||||
|
||||
describe('Viewer Integration with Router', () => {
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import LoginPage = require('../../pages/adf/loginPage');
|
||||
import ViewerPage = require('../../pages/adf/viewerPage');
|
||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||
import CardViewPage = require('../../pages/adf/metadataViewPage');
|
||||
import NavigationBarPage = require('../../pages/adf/navigationBarPage');
|
||||
import { ConfigEditorPage } from '../../pages/adf/configEditorPage';
|
||||
@@ -73,7 +73,7 @@ describe('Aspect oriented config', () => {
|
||||
|
||||
beforeEach(async(done) => {
|
||||
navigationBarPage.clickConfigEditorButton();
|
||||
configEditorPage.clickClearMetadataButton();
|
||||
configEditorPage.clickClearButton();
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -87,7 +87,7 @@ describe('Aspect oriented config', () => {
|
||||
|
||||
it('[C261117] Should be possible restrict the display properties of one an aspect', () => {
|
||||
|
||||
configEditorPage.enterMetadataConfiguration('{ "presets": {' +
|
||||
configEditorPage.enterConfiguration('{ "presets": {' +
|
||||
' "default": [{' +
|
||||
' "title": "IMAGE",' +
|
||||
' "items": [' +
|
||||
@@ -98,7 +98,7 @@ describe('Aspect oriented config', () => {
|
||||
' }]' +
|
||||
' }');
|
||||
|
||||
configEditorPage.clickSaveMetadataButton();
|
||||
configEditorPage.clickSaveButton();
|
||||
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
|
||||
@@ -121,7 +121,7 @@ describe('Aspect oriented config', () => {
|
||||
|
||||
it('[C260185] Should ignore not existing aspect when present in the configuration', () => {
|
||||
|
||||
configEditorPage.enterMetadataConfiguration(' {' +
|
||||
configEditorPage.enterConfiguration(' {' +
|
||||
' "presets": {' +
|
||||
' "default": {' +
|
||||
' "exif:exif": "*",' +
|
||||
@@ -131,7 +131,7 @@ describe('Aspect oriented config', () => {
|
||||
' }' +
|
||||
' }');
|
||||
|
||||
configEditorPage.clickSaveMetadataButton();
|
||||
configEditorPage.clickSaveButton();
|
||||
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
|
||||
@@ -150,9 +150,9 @@ describe('Aspect oriented config', () => {
|
||||
|
||||
it('[C260183] Should show all the aspect if the content-metadata configuration is NOT provided' , () => {
|
||||
|
||||
configEditorPage.enterMetadataConfiguration('{ }');
|
||||
configEditorPage.enterConfiguration('{ }');
|
||||
|
||||
configEditorPage.clickSaveMetadataButton();
|
||||
configEditorPage.clickSaveButton();
|
||||
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
|
||||
@@ -174,13 +174,13 @@ describe('Aspect oriented config', () => {
|
||||
|
||||
it('[C260182] Should show all the aspects if the default configuration contains the * symbol' , () => {
|
||||
|
||||
configEditorPage.enterMetadataConfiguration('{' +
|
||||
configEditorPage.enterConfiguration('{' +
|
||||
' "presets": {' +
|
||||
' "default": "*"' +
|
||||
' }' +
|
||||
'}');
|
||||
|
||||
configEditorPage.clickSaveMetadataButton();
|
||||
configEditorPage.clickSaveButton();
|
||||
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
|
||||
@@ -203,7 +203,7 @@ describe('Aspect oriented config', () => {
|
||||
|
||||
it('[C268899] Should be possible use a Translation key as Title of a metadata group' , () => {
|
||||
|
||||
configEditorPage.enterMetadataConfiguration('{' +
|
||||
configEditorPage.enterConfiguration('{' +
|
||||
' "presets": {' +
|
||||
' "default": [' +
|
||||
' {' +
|
||||
@@ -231,7 +231,7 @@ describe('Aspect oriented config', () => {
|
||||
' }' +
|
||||
'}');
|
||||
|
||||
configEditorPage.clickSaveMetadataButton();
|
||||
configEditorPage.clickSaveButton();
|
||||
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
|
||||
@@ -253,7 +253,7 @@ describe('Aspect oriented config', () => {
|
||||
|
||||
it('[C279968] Should be possible use a custom preset' , () => {
|
||||
|
||||
configEditorPage.enterMetadataConfiguration('{' +
|
||||
configEditorPage.enterConfiguration('{' +
|
||||
' "presets": {' +
|
||||
' "custom-preset": {' +
|
||||
' "exif:exif": "*",' +
|
||||
@@ -262,7 +262,7 @@ describe('Aspect oriented config', () => {
|
||||
' }' +
|
||||
'}');
|
||||
|
||||
configEditorPage.clickSaveMetadataButton();
|
||||
configEditorPage.clickSaveButton();
|
||||
|
||||
navigationBarPage.clickContentServicesButton();
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import LoginPage = require('../../pages/adf/loginPage');
|
||||
import ViewerPage = require('../../pages/adf/viewerPage');
|
||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||
import CardViewPage = require('../../pages/adf/metadataViewPage');
|
||||
import NavigationBarPage = require('../../pages/adf/navigationBarPage');
|
||||
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import LoginPage = require('../../pages/adf/loginPage');
|
||||
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
|
||||
import ViewerPage = require('../../pages/adf/viewerPage');
|
||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||
import CardViewPage = require('../../pages/adf/metadataViewPage');
|
||||
|
||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
||||
|
@@ -19,7 +19,7 @@ import { browser } from 'protractor';
|
||||
|
||||
import LoginPage = require('../../pages/adf/loginPage');
|
||||
import ContentServicesPage = require('../../pages/adf/contentServicesPage');
|
||||
import ViewerPage = require('../../pages/adf/viewerPage');
|
||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||
import CardViewPage = require('../../pages/adf/metadataViewPage');
|
||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
||||
|
||||
|
@@ -21,7 +21,7 @@ import TestConfig = require('../test.config');
|
||||
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
import ContentServicesPage = require('../pages/adf/contentServicesPage');
|
||||
import ViewerPage = require('../pages/adf/viewerPage');
|
||||
import { ViewerPage } from '../pages/adf/viewerPage';
|
||||
|
||||
import resources = require('../util/resources');
|
||||
|
||||
|
@@ -6,8 +6,6 @@ let proxy = require('http-proxy-middleware');
|
||||
let targetProxy = 'http://' + (PROXY_HOST_ADF || HOST);
|
||||
let fallback = require('connect-history-api-fallback');
|
||||
|
||||
console.log('targetProxy');
|
||||
|
||||
module.exports = {
|
||||
'port': 4200,
|
||||
open: false,
|
||||
|
@@ -18,9 +18,11 @@
|
||||
import { element, by } from 'protractor';
|
||||
|
||||
import Util = require('../../util/util');
|
||||
import { TabsPage } from './material/tabsPage';
|
||||
|
||||
export class CommentsPage {
|
||||
|
||||
tabsPage = new TabsPage();
|
||||
numberOfComments = element(by.id('comment-header'));
|
||||
commentUserIcon = element.all(by.id('comment-user-icon'));
|
||||
commentUserName = element.all(by.id('comment-user'));
|
||||
@@ -28,7 +30,6 @@ export class CommentsPage {
|
||||
commentTime = element.all(by.id('comment-time'));
|
||||
commentInput = element(by.id('comment-input'));
|
||||
addCommentButton = element(by.css("[data-automation-id='comments-input-add']"));
|
||||
commentsTab = element(by.cssContainingText("div[id*='mat-tab-label']", 'Comments'));
|
||||
|
||||
getTotalNumberOfComments() {
|
||||
Util.waitUntilElementIsVisible(this.numberOfComments);
|
||||
@@ -66,9 +67,7 @@ export class CommentsPage {
|
||||
}
|
||||
|
||||
checkCommentsTabIsSelected() {
|
||||
this.commentsTab.getAttribute('aria-selected').then((result) => {
|
||||
expect(result).toBe('true');
|
||||
});
|
||||
this.tabsPage.checkTabIsSelectedByTitle('Comments');
|
||||
}
|
||||
|
||||
checkCommentInputIsDisplayed() {
|
||||
|
@@ -20,27 +20,31 @@ import Util = require('../../util/util');
|
||||
|
||||
export class ConfigEditorPage {
|
||||
|
||||
enterMetadataConfiguration(text) {
|
||||
let textField = element(by.css('#adf-metadata-editor div.overflow-guard > textarea'));
|
||||
browser.driver.sleep(1000);
|
||||
enterConfiguration(text) {
|
||||
let textField = element(by.css('#adf-code-configuration-editor div.overflow-guard > textarea'));
|
||||
Util.waitUntilElementIsVisible(textField);
|
||||
textField.sendKeys('');
|
||||
textField.clear();
|
||||
textField.sendKeys(text);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickSaveMetadataButton() {
|
||||
let saveButton = element(by.xpath('//*[@id="adf-metadata-save"]'));
|
||||
clickSaveButton() {
|
||||
let saveButton = element(by.id('adf-configuration-save'));
|
||||
Util.waitUntilElementIsVisible(saveButton);
|
||||
Util.waitUntilElementIsClickable(saveButton);
|
||||
return saveButton.click();
|
||||
}
|
||||
|
||||
clickClearMetadataButton() {
|
||||
let clearButton = element(by.xpath('//*[@id="adf-metadata-clear"]'));
|
||||
clickClearButton() {
|
||||
let clearButton = element(by.id('adf-configuration-clear'));
|
||||
Util.waitUntilElementIsVisible(clearButton);
|
||||
Util.waitUntilElementIsClickable(clearButton);
|
||||
return clearButton.click();
|
||||
}
|
||||
|
||||
clickFileConfiguration() {
|
||||
let button = element(by.id('adf-file-conf'));
|
||||
Util.waitUntilElementIsVisible(button);
|
||||
Util.waitUntilElementIsClickable(button);
|
||||
return button.click();
|
||||
}
|
||||
}
|
||||
|
@@ -42,7 +42,7 @@ var ContentServicesPage = function () {
|
||||
var contentServicesURL = TestConfig.adf.url + TestConfig.adf.port + "/files";
|
||||
var loadMoreButton = element(by.css("button[data-automation-id='adf-infinite-pagination-button']"));
|
||||
var emptyPagination = element(by.css("adf-pagination[class*='adf-pagination__empty']"));
|
||||
var dragAndDrop = element(by.css("adf-upload-drag-area div"));
|
||||
var dragAndDrop = element.all(by.css("adf-upload-drag-area div")).first();
|
||||
var nameHeader = element(by.css("div[data-automation-id='auto_id_name'] > span"));
|
||||
var sizeHeader = element(by.css("div[data-automation-id='auto_id_content.sizeInBytes'] > span"));
|
||||
var createdByHeader = element(by.css("div[data-automation-id='auto_id_createdByUser.displayName'] > span"));
|
||||
@@ -61,6 +61,10 @@ var ContentServicesPage = function () {
|
||||
var searchInputElement = element(by.css('input[data-automation-id="content-node-selector-search-input"'));
|
||||
var shareNodeButton = element(by.cssContainingText("mat-icon", " share "));
|
||||
|
||||
this.getContentList = function () {
|
||||
return contentList;
|
||||
};
|
||||
|
||||
this.checkRecentFileToBeShowed = function () {
|
||||
Util.waitUntilElementIsVisible(recentFiles);
|
||||
};
|
||||
@@ -87,6 +91,7 @@ var ContentServicesPage = function () {
|
||||
Util.waitUntilElementIsVisible(recentFilesExpanded);
|
||||
};
|
||||
|
||||
|
||||
this.getRecentFileIcon = async function () {
|
||||
await Util.waitUntilElementIsVisible(recentFileIcon);
|
||||
return recentFileIcon.getText();
|
||||
@@ -305,7 +310,6 @@ var ContentServicesPage = function () {
|
||||
var breadcrumb = element(by.css("a[data-automation-id='breadcrumb_" + folder + "']"));
|
||||
Util.waitUntilElementIsVisible(breadcrumb);
|
||||
breadcrumb.click();
|
||||
contentList.tableIsLoaded();
|
||||
return this;
|
||||
};
|
||||
|
||||
@@ -427,7 +431,7 @@ var ContentServicesPage = function () {
|
||||
};
|
||||
|
||||
this.enableThumbnails = function () {
|
||||
var thumbnailSlide = element(by.css('#enableThumbnails'));
|
||||
var thumbnailSlide = element(by.css('#adf-thumbnails-upload-switch'));
|
||||
Util.waitUntilElementIsVisible(thumbnailSlide);
|
||||
thumbnailSlide.click();
|
||||
return this;
|
||||
|
@@ -302,11 +302,26 @@ var ContentList = function () {
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkContentIsNotDisplayed = function (content) {
|
||||
Util.waitUntilElementIsNotVisible(element.all(by.xpath("//div[@id='document-list-container']//div[@filename='" + content + "']")).first());
|
||||
this.checkContentIsNotDisplayed = function (filename) {
|
||||
Util.waitUntilElementIsNotVisible(element.all(by.xpath("//div[@id='document-list-container']//div[@filename='" + filename + "']")).first());
|
||||
return this;
|
||||
};
|
||||
|
||||
this.getNodeIdByFilename = function (filename) {
|
||||
var nodeIdColumn = element.all(by.xpath("//div[@id='document-list-container']//div[@filename='" + filename + "' and @title='Node id']"));
|
||||
var text = nodeIdColumn.getText();
|
||||
return text;
|
||||
};
|
||||
|
||||
this.getAllNodeIdInList = async function (filename) {
|
||||
var nodeIdColumns = await element.all(by.xpath("//div[@id='document-list-container']//div[@title='Node id']"));
|
||||
return await nodeIdColumns.map(async (currentElement) => {
|
||||
return await currentElement.getText().then((nodeText)=>{
|
||||
return nodeText;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
this.checkEmptyFolderMessageIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(emptyFolderMessage);
|
||||
return this;
|
||||
@@ -323,25 +338,25 @@ var ContentList = function () {
|
||||
Util.waitUntilElementIsVisible(row.element(by.css("div[class*='--image'] img[alt*='" + extension + "']")));
|
||||
};
|
||||
|
||||
this.rightClickOnRowNamed = function(rowName) {
|
||||
this.rightClickOnRowNamed = function (rowName) {
|
||||
let row = this.getRowByRowName(rowName);
|
||||
browser.actions().click(row, protractor.Button.RIGHT).perform();
|
||||
Util.waitUntilElementIsVisible(element(by.id('adf-context-menu-content')));
|
||||
}
|
||||
|
||||
this.checkContextActionIsVisible = function(actionName) {
|
||||
this.checkContextActionIsVisible = function (actionName) {
|
||||
let actionButton = element(by.css(`button[data-automation-id="context-${actionName}"`));
|
||||
Util.waitUntilElementIsVisible(actionButton);
|
||||
Util.waitUntilElementIsClickable(actionButton);
|
||||
return actionButton;
|
||||
}
|
||||
|
||||
this.pressContextMenuActionNamed = function(actionName) {
|
||||
this.pressContextMenuActionNamed = function (actionName) {
|
||||
let actionButton = this.checkContextActionIsVisible(actionName);
|
||||
actionButton.click();
|
||||
}
|
||||
|
||||
this.clickRowToSelect = function(rowName) {
|
||||
this.clickRowToSelect = function (rowName) {
|
||||
let row = this.getRowByRowName(rowName);
|
||||
browser.actions().keyDown(protractor.Key.COMMAND).click(row).perform();
|
||||
this.checkRowIsSelected(rowName);
|
||||
|
@@ -1,111 +0,0 @@
|
||||
/*!
|
||||
* @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.
|
||||
*/
|
||||
|
||||
var Util = require('../../../util/util');
|
||||
var ToggleState = require('../core/toggleState');
|
||||
|
||||
var UploadToggles = function () {
|
||||
|
||||
var toggleState = new ToggleState();
|
||||
|
||||
var multipleFileUploadToggle = element(by.cssContainingText("span[class*='toggle-content']", "Multiple File Upload"));
|
||||
var uploadFolderToggle = element(by.cssContainingText("span[class*='toggle-content']", "Folder upload"));
|
||||
var extensionFilterToggle = element(by.cssContainingText("span[class*='toggle-content']", "Custom extensions filter"));
|
||||
var maxSizeToggle = element(by.cssContainingText("span[class*='toggle-content']", "Max size filter"));
|
||||
var versioningToggle = element(by.cssContainingText("span[class*='toggle-content']", "Enable versioning"));
|
||||
var extensionAcceptedField = element(by.css("input[data-automation-id='accepted-files-type']"));
|
||||
var maxSizeField = element(by.css("input[data-automation-id='max-files-size']"));
|
||||
var disableUploadCheckbox = element(by.css("[id='adf-disable-upload']"));
|
||||
var ancestorToggle = by.xpath("ancestor::mat-slide-toggle");
|
||||
|
||||
this.enableMultipleFileUpload = function () {
|
||||
toggleState.enableToggle(multipleFileUploadToggle.element(ancestorToggle));
|
||||
return this;
|
||||
};
|
||||
|
||||
this.disableMultipleFileUpload = function () {
|
||||
toggleState.disableToggle(multipleFileUploadToggle);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.enableFolderUpload = function () {
|
||||
toggleState.enableToggle(uploadFolderToggle.element(ancestorToggle));
|
||||
return this;
|
||||
};
|
||||
|
||||
this.disableFolderUpload = function () {
|
||||
toggleState.disableToggle(uploadFolderToggle);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.enableExtensionFilter = function () {
|
||||
toggleState.enableToggle(extensionFilterToggle.element(ancestorToggle));
|
||||
return this;
|
||||
};
|
||||
|
||||
this.disableExtensionFilter = function () {
|
||||
toggleState.disableToggle(extensionFilterToggle);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.enableMaxSize = function () {
|
||||
toggleState.enableToggle(maxSizeToggle.element(ancestorToggle));
|
||||
return this;
|
||||
};
|
||||
|
||||
this.disableMaxSize = function () {
|
||||
toggleState.disableToggle(maxSizeToggle);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.enableVersioning = function () {
|
||||
toggleState.enableToggle(versioningToggle.element(ancestorToggle));
|
||||
return this;
|
||||
};
|
||||
|
||||
this.disableVersioning = function () {
|
||||
toggleState.disableToggle(versioningToggle);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.clickCheckboxDisableUpload = function () {
|
||||
return disableUploadCheckbox.click();
|
||||
};
|
||||
|
||||
this.addExtension = function (extension) {
|
||||
Util.waitUntilElementIsVisible(extensionAcceptedField);
|
||||
extensionAcceptedField.sendKeys("," + extension);
|
||||
};
|
||||
|
||||
this.addMaxSize = function (size) {
|
||||
this.clearText();
|
||||
maxSizeField.sendKeys(size);
|
||||
};
|
||||
|
||||
this.clearText = function () {
|
||||
Util.waitUntilElementIsVisible(maxSizeField);
|
||||
var deferred = protractor.promise.defer();
|
||||
maxSizeField.clear().then(function (value) {
|
||||
maxSizeField.sendKeys(protractor.Key.ESCAPE);
|
||||
});
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
};
|
||||
module.exports = UploadToggles;
|
||||
|
||||
|
107
e2e/pages/adf/dialog/uploadToggles.ts
Normal file
107
e2e/pages/adf/dialog/uploadToggles.ts
Normal file
@@ -0,0 +1,107 @@
|
||||
/*!
|
||||
* @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 { FormControllersPage } from '../material/formControllersPage';
|
||||
|
||||
import Util = require('../../../util/util');
|
||||
|
||||
export class UploadToggles {
|
||||
|
||||
formControllersPage = new FormControllersPage();
|
||||
multipleFileUploadToggle = element(by.id('adf-multiple-upload-switch'));
|
||||
uploadFolderToggle = element(by.id('adf-folder-upload-switch'));
|
||||
extensionFilterToggle = element(by.id('adf-extension-filter-upload-switch'));
|
||||
maxSizeToggle = element(by.id('adf-max-size-filter-upload-switch'));
|
||||
versioningToggle = element(by.id('adf-version-upload-switch'));
|
||||
extensionAcceptedField = element(by.css('input[data-automation-id="accepted-files-type"]'));
|
||||
maxSizeField = element(by.css('input[data-automation-id="max-files-size"]'));
|
||||
disableUploadCheckbox = element(by.css('[id="adf-disable-upload"]'));
|
||||
|
||||
enableMultipleFileUpload() {
|
||||
this.formControllersPage.enableToggle(this.multipleFileUploadToggle);
|
||||
return this;
|
||||
}
|
||||
|
||||
disableMultipleFileUpload() {
|
||||
this.formControllersPage.disableToggle(this.multipleFileUploadToggle);
|
||||
return this;
|
||||
}
|
||||
|
||||
enableFolderUpload() {
|
||||
this.formControllersPage.enableToggle(this.uploadFolderToggle);
|
||||
return this;
|
||||
}
|
||||
|
||||
disableFolderUpload() {
|
||||
this.formControllersPage.disableToggle(this.uploadFolderToggle);
|
||||
return this;
|
||||
}
|
||||
|
||||
enableExtensionFilter() {
|
||||
this.formControllersPage.enableToggle(this.extensionFilterToggle);
|
||||
return this;
|
||||
}
|
||||
|
||||
disableExtensionFilter() {
|
||||
this.formControllersPage.disableToggle(this.extensionFilterToggle);
|
||||
return this;
|
||||
}
|
||||
|
||||
enableMaxSize() {
|
||||
this.formControllersPage.enableToggle(this.maxSizeToggle);
|
||||
return this;
|
||||
}
|
||||
|
||||
disableMaxSize() {
|
||||
this.formControllersPage.disableToggle(this.maxSizeToggle);
|
||||
return this;
|
||||
}
|
||||
|
||||
enableVersioning() {
|
||||
this.formControllersPage.enableToggle(this.versioningToggle);
|
||||
return this;
|
||||
}
|
||||
|
||||
disableVersioning() {
|
||||
this.formControllersPage.disableToggle(this.versioningToggle);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickCheckboxDisableUpload() {
|
||||
return this.disableUploadCheckbox.click();
|
||||
}
|
||||
|
||||
addExtension(extension) {
|
||||
Util.waitUntilElementIsVisible(this.extensionAcceptedField);
|
||||
this.extensionAcceptedField.sendKeys(',' + extension);
|
||||
}
|
||||
|
||||
addMaxSize(size) {
|
||||
this.clearText();
|
||||
this.maxSizeField.sendKeys(size);
|
||||
}
|
||||
|
||||
clearText() {
|
||||
Util.waitUntilElementIsVisible(this.maxSizeField);
|
||||
let deferred = protractor.promise.defer();
|
||||
this.maxSizeField.clear().then((value) => {
|
||||
this.maxSizeField.sendKeys(protractor.Key.ESCAPE);
|
||||
});
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
}
|
@@ -15,30 +15,25 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var Util = require('../../../util/util');
|
||||
import { element, by } from 'protractor';
|
||||
import Util = require('../../../util/util');
|
||||
|
||||
var ToggleState = function () {
|
||||
|
||||
this.enableToggle = function (toggle) {
|
||||
export class FormControllersPage {
|
||||
enableToggle(toggle) {
|
||||
Util.waitUntilElementIsVisible(toggle);
|
||||
toggle.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') < 0) {
|
||||
toggle.click();
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
this.disableToggle = function (toggle) {
|
||||
disableToggle(toggle) {
|
||||
Util.waitUntilElementIsVisible(toggle);
|
||||
toggle.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') >= 0) {
|
||||
toggle.click();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
};
|
||||
module.exports = ToggleState;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
35
e2e/pages/adf/material/tabsPage.ts
Normal file
35
e2e/pages/adf/material/tabsPage.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
/*!
|
||||
* @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 Util = require('../../../util/util');
|
||||
|
||||
export class TabsPage {
|
||||
|
||||
clickTabByTitle(tabTitle) {
|
||||
let tab = element(by.cssContainingText("div[id*='mat-tab-label']", tabTitle));
|
||||
Util.waitUntilElementIsVisible(tab);
|
||||
tab.click();
|
||||
}
|
||||
|
||||
checkTabIsSelectedByTitle(tabTitle) {
|
||||
let tab = element(by.cssContainingText("div[id*='mat-tab-label']", tabTitle));
|
||||
tab.getAttribute('aria-selected').then((result) => {
|
||||
expect(result).toBe('true');
|
||||
});
|
||||
}
|
||||
}
|
@@ -154,19 +154,6 @@ var MetadataViewPage = function () {
|
||||
return this;
|
||||
};
|
||||
|
||||
this.clickRightChevronToGetToTab = (tabName) => {
|
||||
element.all(by.css('.mat-tab-label'))
|
||||
.map((element) => element.getAttribute('innerText'))
|
||||
.then((texts) => {
|
||||
for (let text of texts) {
|
||||
if (text === tabName) {
|
||||
break;
|
||||
}
|
||||
this.clickRightChevron();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
this.getEditIconTooltip = function () {
|
||||
return editIcon.getAttribute('title');
|
||||
};
|
||||
|
@@ -20,6 +20,7 @@ var Util = require('../../../util/util');
|
||||
var AppNavigationBarPage = function () {
|
||||
|
||||
var tasksButton = element.all(by.cssContainingText("div[class*='mat-tab-label'] .mat-tab-labels div", "Tasks")).first();
|
||||
var tagButton = element.all(by.css("[data-automation-id='Tag']"));
|
||||
var processButton = element.all(by.cssContainingText("div[class*='mat-tab-label'] .mat-tab-labels div", "Process")).first();
|
||||
var reportsButton = element.all(by.cssContainingText("div[class*='mat-tab-label'] .mat-tab-labels div", "Reports")).first();
|
||||
var settingsButton = element.all(by.cssContainingText("div[class*='mat-tab-label'] .mat-tab-labels div", "Settings")).first();
|
||||
@@ -34,6 +35,10 @@ var AppNavigationBarPage = function () {
|
||||
return processButton.click();
|
||||
};
|
||||
|
||||
this.clickTagButton = function () {
|
||||
return tagButton.click();
|
||||
};
|
||||
|
||||
this.clickSettingsButton = function () {
|
||||
return settingsButton.click();
|
||||
};
|
||||
|
@@ -15,43 +15,43 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
var ToggleState = require('../../core/toggleState');
|
||||
import {FormControllersPage} from "../../material/formControllersPage";
|
||||
|
||||
var AppSettingsToggles = function () {
|
||||
|
||||
var toggleState = new ToggleState();
|
||||
var formControllersPage = new FormControllersPage();
|
||||
|
||||
var showDetailsHeaderToggle = element(by.id('adf-show-header'));
|
||||
var showTaskFilterIconsToggle = element(by.id('adf-show-task-filter-icon'));
|
||||
var showProcessFilterIconsToggle = element(by.id('adf-show-process-filter-icon'));
|
||||
|
||||
this.enableShowHeader = function () {
|
||||
toggleState.enableToggle(showDetailsHeaderToggle);
|
||||
formControllersPage.enableToggle(showDetailsHeaderToggle);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.disableShowHeader = function () {
|
||||
toggleState.disableToggle(showDetailsHeaderToggle);
|
||||
formControllersPage.disableToggle(showDetailsHeaderToggle);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.enableTaskFiltersIcon = function () {
|
||||
toggleState.enableToggle(showTaskFilterIconsToggle);
|
||||
formControllersPage.enableToggle(showTaskFilterIconsToggle);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.disableTaskFiltersIcon = function () {
|
||||
toggleState.disableToggle(showTaskFilterIconsToggle);
|
||||
formControllersPage.disableToggle(showTaskFilterIconsToggle);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.enableProcessFiltersIcon = function () {
|
||||
toggleState.enableToggle(showProcessFilterIconsToggle);
|
||||
formControllersPage.enableToggle(showProcessFilterIconsToggle);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.disableProcessFiltersIcon = function () {
|
||||
toggleState.disableToggle(showProcessFilterIconsToggle);
|
||||
formControllersPage.disableToggle(showProcessFilterIconsToggle);
|
||||
return this;
|
||||
};
|
||||
|
||||
|
@@ -36,12 +36,6 @@ var TagPage = function () {
|
||||
var showLessButton = element(by.css('button[data-automation-id="show-fewer-tags"]'));
|
||||
var tagsOnPage = element.all(by.css('div[class*="adf-list-tag"]'));
|
||||
|
||||
this.goToTagPage = function () {
|
||||
browser.driver.get(tagURL);
|
||||
Util.waitUntilElementIsVisible(addTagButton);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.getNodeId = function () {
|
||||
Util.waitUntilElementIsVisible(insertNodeId);
|
||||
return insertNodeId.getAttribute('value');
|
||||
@@ -195,7 +189,7 @@ var TagPage = function () {
|
||||
Util.waitUntilElementIsClickable(showLessButton);
|
||||
return showLessButton.click();
|
||||
};
|
||||
|
||||
|
||||
this.checkTagsOnList = function () {
|
||||
return tagsOnPage.count();
|
||||
};
|
||||
@@ -207,7 +201,7 @@ var TagPage = function () {
|
||||
this.checkShowLessButtonIsNotDisplayed = function () {
|
||||
return Util.waitUntilElementIsNotVisible(showLessButton);
|
||||
};
|
||||
|
||||
|
||||
this.clickShowMoreButtonUntilNotDisplayed = function () {
|
||||
showMoreButton.isDisplayed().then((visible) => {
|
||||
if(visible){
|
||||
|
@@ -1,39 +0,0 @@
|
||||
/*!
|
||||
* @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.
|
||||
*/
|
||||
|
||||
var Util = require('../../util/util');
|
||||
|
||||
var TrashcanPage = function () {
|
||||
|
||||
var rows = by.css("adf-document-list div[class*='adf-datatable-body'] div[class*='adf-datatable-row']");
|
||||
var tableBody = element.all(by.css("adf-document-list div[class='adf-datatable-body']")).first();
|
||||
var pagination = element(by.css("adf-pagination"));
|
||||
|
||||
this.numberOfResultsDisplayed = function () {
|
||||
return element.all(rows).count();
|
||||
};
|
||||
|
||||
this.waitForTableBody = function (){
|
||||
Util.waitUntilElementIsVisible(tableBody);
|
||||
};
|
||||
|
||||
this.waitForPagination = function (){
|
||||
Util.waitUntilElementIsVisible(pagination);
|
||||
};
|
||||
|
||||
};
|
||||
module.exports = TrashcanPage;
|
38
e2e/pages/adf/trashcanPage.ts
Normal file
38
e2e/pages/adf/trashcanPage.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
/*!
|
||||
* @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');
|
||||
|
||||
export class TrashcanPage {
|
||||
|
||||
rows = by.css('adf-document-list div[class*="adf-datatable-body"] div[class*="adf-datatable-row"]');
|
||||
tableBody = element.all(by.css('adf-document-list div[class="adf-datatable-body"]')).first();
|
||||
pagination = element(by.css('adf-pagination'));
|
||||
|
||||
numberOfResultsDisplayed() {
|
||||
return element.all(this.rows).count();
|
||||
}
|
||||
|
||||
waitForTableBody() {
|
||||
Util.waitUntilElementIsVisible(this.tableBody);
|
||||
}
|
||||
|
||||
waitForPagination() {
|
||||
Util.waitUntilElementIsVisible(this.pagination);
|
||||
}
|
||||
|
||||
}
|
@@ -20,16 +20,19 @@ import TestConfig = require('../../test.config');
|
||||
import path = require('path');
|
||||
import remote = require('selenium-webdriver/remote');
|
||||
import { browser, by, element, protractor } from 'protractor';
|
||||
import { FormControllersPage } from './material/formControllersPage';
|
||||
|
||||
export class VersionManagePage {
|
||||
|
||||
showNewVersionButton = element(by.css('#adf-show-version-upload-button'));
|
||||
formControllersPage = new FormControllersPage();
|
||||
|
||||
showNewVersionButton = element(by.id('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'));
|
||||
uploadNewVersionContainer = element(by.id('adf-new-version-uploader-container'));
|
||||
cancelButton = element(by.id('adf-new-version-cancel'));
|
||||
majorRadio = element(by.id('adf-new-version-major'));
|
||||
minorRadio = element(by.id('adf-new-version-minor'));
|
||||
commentText = element(by.id('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'));
|
||||
@@ -54,23 +57,23 @@ export class VersionManagePage {
|
||||
}
|
||||
|
||||
chekFileVersionExist(version) {
|
||||
let fileVersion = element(by.css(`[id="adf-version-list-item-version-${version}"]`));
|
||||
let fileVersion = element(by.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}"]`));
|
||||
let fileVersion = element(by.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}"]`));
|
||||
let fileComment = element(by.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}"]`));
|
||||
let fileDate = element(by.id(`adf-version-list-item-date-${version}`));
|
||||
Util.waitUntilElementIsVisible(fileDate);
|
||||
return fileDate.getText();
|
||||
}
|
||||
@@ -84,13 +87,13 @@ export class VersionManagePage {
|
||||
}
|
||||
|
||||
clickMajorChange() {
|
||||
let radioMajor = element(by.css(`[id="adf-new-version-major"]`));
|
||||
let radioMajor = element(by.id(`adf-new-version-major`));
|
||||
Util.waitUntilElementIsVisible(radioMajor);
|
||||
radioMajor.click();
|
||||
}
|
||||
|
||||
clickMinorChange() {
|
||||
let radioMinor = element(by.css(`[id="adf-new-version-minor"]`));
|
||||
let radioMinor = element(by.id(`adf-new-version-minor`));
|
||||
Util.waitUntilElementIsVisible(radioMinor);
|
||||
radioMinor.click();
|
||||
}
|
||||
@@ -99,48 +102,28 @@ export class VersionManagePage {
|
||||
* disables readOnly
|
||||
*/
|
||||
disableReadOnly() {
|
||||
Util.waitUntilElementIsVisible(this.readOnlySwitch);
|
||||
this.readOnlySwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') >= 0) {
|
||||
this.readOnlySwitch.click();
|
||||
}
|
||||
});
|
||||
this.formControllersPage.disableToggle(this.readOnlySwitch);
|
||||
}
|
||||
|
||||
/**
|
||||
* enables readOnly
|
||||
*/
|
||||
enableReadOnly() {
|
||||
Util.waitUntilElementIsVisible(this.readOnlySwitch);
|
||||
this.readOnlySwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') < 0) {
|
||||
this.readOnlySwitch.click();
|
||||
}
|
||||
});
|
||||
this.formControllersPage.enableToggle(this.readOnlySwitch);
|
||||
}
|
||||
|
||||
/**
|
||||
* disables download
|
||||
*/
|
||||
disableDownload() {
|
||||
Util.waitUntilElementIsVisible(this.downloadSwitch);
|
||||
this.downloadSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') >= 0) {
|
||||
this.downloadSwitch.click();
|
||||
}
|
||||
});
|
||||
this.formControllersPage.disableToggle(this.downloadSwitch);
|
||||
}
|
||||
|
||||
/**
|
||||
* enables download
|
||||
*/
|
||||
enableDownload() {
|
||||
Util.waitUntilElementIsVisible(this.downloadSwitch);
|
||||
this.downloadSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') < 0) {
|
||||
this.downloadSwitch.click();
|
||||
}
|
||||
});
|
||||
this.formControllersPage.enableToggle(this.downloadSwitch);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -148,41 +131,31 @@ export class VersionManagePage {
|
||||
* disables comments
|
||||
*/
|
||||
disableComments() {
|
||||
Util.waitUntilElementIsVisible(this.commentsSwitch);
|
||||
this.commentsSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') >= 0) {
|
||||
this.commentsSwitch.click();
|
||||
}
|
||||
});
|
||||
this.formControllersPage.disableToggle(this.commentsSwitch);
|
||||
}
|
||||
|
||||
/**
|
||||
* enables comments
|
||||
*/
|
||||
enableComments() {
|
||||
Util.waitUntilElementIsVisible(this.commentsSwitch);
|
||||
this.commentsSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') < 0) {
|
||||
this.commentsSwitch.click();
|
||||
}
|
||||
});
|
||||
this.formControllersPage.enableToggle(this.commentsSwitch);
|
||||
}
|
||||
|
||||
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();
|
||||
Util.waitUntilElementIsVisible(element(by.id(`adf-version-list-action-menu-button-${version}`)));
|
||||
element(by.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();
|
||||
Util.waitUntilElementIsVisible(element(by.id(`adf-confirm-accept`)));
|
||||
element(by.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();
|
||||
Util.waitUntilElementIsVisible(element(by.id(`adf-confirm-cancel`)));
|
||||
element(by.id(`adf-confirm-cancel`)).click();
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -196,7 +169,7 @@ export class VersionManagePage {
|
||||
|
||||
downloadFileVersion(version) {
|
||||
this.clickActionButton(version);
|
||||
let downloadButton = element(by.css(`[id="adf-version-list-action-download-${version}"]`));
|
||||
let downloadButton = element(by.id(`adf-version-list-action-download-${version}`));
|
||||
Util.waitUntilElementIsVisible(downloadButton);
|
||||
browser.driver.sleep(500);
|
||||
downloadButton.click();
|
||||
@@ -205,7 +178,7 @@ export class VersionManagePage {
|
||||
|
||||
deleteFileVersion(version) {
|
||||
this.clickActionButton(version);
|
||||
let deleteButton = element(by.css(`[id="adf-version-list-action-delete-${version}"]`));
|
||||
let deleteButton = element(by.id(`adf-version-list-action-delete-${version}`));
|
||||
Util.waitUntilElementIsVisible(deleteButton);
|
||||
browser.driver.sleep(500);
|
||||
deleteButton.click();
|
||||
@@ -214,7 +187,7 @@ export class VersionManagePage {
|
||||
|
||||
restoreFileVersion(version) {
|
||||
this.clickActionButton(version);
|
||||
let restoreButton = element(by.css(`[id="adf-version-list-action-restore-${version}"]`));
|
||||
let restoreButton = element(by.id(`adf-version-list-action-restore-${version}`));
|
||||
Util.waitUntilElementIsVisible(restoreButton);
|
||||
browser.driver.sleep(500);
|
||||
restoreButton.click();
|
||||
@@ -222,9 +195,9 @@ export class VersionManagePage {
|
||||
}
|
||||
|
||||
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}"]`)));
|
||||
Util.waitUntilElementIsVisible(element(by.id(`adf-version-list-action-download-${version}`)));
|
||||
Util.waitUntilElementIsVisible(element(by.id(`adf-version-list-action-delete-${version}`)));
|
||||
Util.waitUntilElementIsVisible(element(by.id(`adf-version-list-action-restore-${version}`)));
|
||||
}
|
||||
|
||||
closeVersionDialog() {
|
||||
|
@@ -1,777 +0,0 @@
|
||||
/*!
|
||||
* @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.
|
||||
*/
|
||||
|
||||
var Util = require("../../util/util");
|
||||
var CardViewPage = require("./cardViewPageComponent");
|
||||
|
||||
var ViewerToolbarPage = function () {
|
||||
|
||||
var closeButton = element(by.css("button[data-automation-id='adf-toolbar-back']"));
|
||||
var fileName = element(by.id("adf-viewer-display-name"));
|
||||
var infoButton = element(by.css("button[data-automation-id='adf-toolbar-sidebar']"));
|
||||
var leftSideBarButton = element(by.css("button[data-automation-id='adf-toolbar-left-sidebar']"));
|
||||
var previousPageButton = element(by.id("viewer-previous-page-button"));
|
||||
var nextPageButton = element(by.id("viewer-next-page-button"));
|
||||
var zoomInButton = element(by.id("viewer-zoom-in-button"));
|
||||
var zoomOutButton = element(by.id("viewer-zoom-out-button"));
|
||||
var scalePageButton = element(by.id("viewer-scale-page-button"));
|
||||
var pdfContainer = element(by.id("viewer-pdf-container"));
|
||||
var fullScreenButton = element(by.css("button[data-automation-id='adf-toolbar-fullscreen']"));
|
||||
var rotateLeft = element(by.css("button[id='viewer-rotate-left-button']"));
|
||||
var rotateRight = element(by.css("button[id='viewer-rotate-right-button']"));
|
||||
var scaleImg = element(by.css("button[id='viewer-reset-button']"));
|
||||
var customBtn = element(by.css("data-automation-id='adf-toolbar-custom-btn'"));
|
||||
var fileThumbnail = element(by.css("img[data-automation-id='adf-file-thumbnail']"));
|
||||
var pageSelectorInput = element(by.css("input[data-automation-id='adf-page-selector']"));
|
||||
var imgContainer = element(by.css("div[data-automation-id='adf-image-container']"));
|
||||
var mediaContainer = element(by.css("adf-media-player[class='adf-media-player ng-star-inserted']"));
|
||||
var allPages = element.all(by.css("div[class='canvasWrapper'] > canvas")).first();
|
||||
var percentage = element(by.css("div[data-automation-id='adf-page-scale'"));
|
||||
var thumbnailsBtn = element(by.css("button[data-automation-id='adf-thumbnails-button']"));
|
||||
var thumbnailsContent = element(by.css("div[data-automation-id='adf-thumbnails-content']"));
|
||||
var thumbnailsClose = element(by.css("button[data-automation-id='adf-thumbnails-close']"));
|
||||
var secondThumbnail = element(by.css("adf-pdf-thumb > img[title='Page 2'"));
|
||||
var lastThumbnailDisplayed = element.all(by.css("adf-pdf-thumb")).last();
|
||||
var passwordDialog = element(by.css("adf-pdf-viewer-password-dialog"));
|
||||
var passwordSubmit = element(by.css("button[data-automation-id='adf-password-dialog-submit']"));
|
||||
var passwordSubmitDisabled = element(by.css("button[data-automation-id='adf-password-dialog-submit'][disabled]"));
|
||||
var passwordInput = element(by.css("input[data-automation-id='adf-password-dialog-input']"));
|
||||
var passwordError = element(by.css("mat-error[data-automation-id='adf-password-dialog-error']"));
|
||||
var infoSideBar = element(by.id("adf-right-sidebar"));
|
||||
var leftSideBar = element(by.id("adf-left-sidebar"));
|
||||
var unsupportedFileContainer = element(by.cssContainingText(".label", "Document preview could not be loaded"));
|
||||
var pageCanvas = element.all(by.css("div[class='canvasWrapper']")).first();
|
||||
var viewer = element(by.css("adf-viewer"));
|
||||
var pdfViewer = element(by.css("adf-pdf-viewer"));
|
||||
var imgViewer = element(by.css("adf-img-viewer"));
|
||||
var activeTab = element(by.css("div[class*='mat-tab-label-active']"));
|
||||
var uploadNewVersionButton = element(by.css("input[data-automation-id='upload-single-file']"));
|
||||
var rightChevron = element(by.css("div[class*='header-pagination-after']"));
|
||||
var toolbarSwitch = element(by.id('adf-switch-toolbar'));
|
||||
var toolbar = element(by.id('adf-viewer-toolbar'));
|
||||
var datatableHeader = element(by.css("div.adf-datatable-header"))
|
||||
var goBackSwitch = element(by.id('adf-switch-goback'));
|
||||
|
||||
var openWithSwitch = element(by.id('adf-switch-openwith'));
|
||||
var openWith = element(by.id('adf-viewer-openwith'));
|
||||
|
||||
var customNameSwitch = element(by.id('adf-switch-custoname'));
|
||||
|
||||
var showRightSidebarSwitch = element(by.id('adf-switch-showrightsidebar'));
|
||||
var showLeftSidebarSwitch = element(by.id('adf-switch-showleftsidebar'));
|
||||
|
||||
var moreActionsSwitch = element(by.id('adf-switch-moreactions'));
|
||||
var moreActions = element(by.id('adf-viewer-moreactions'));
|
||||
|
||||
var downloadSwitch = element(by.id('adf-switch-download'));
|
||||
var downloadButton = element(by.id('adf-viewer-download'));
|
||||
|
||||
var printSwitch = element(by.id('adf-switch-print'));
|
||||
var printButton = element(by.id('adf-viewer-print'));
|
||||
|
||||
var allowSidebarSwitch = element(by.id('adf-switch-allowsidebar'));
|
||||
|
||||
var shareSwitch = element(by.id('adf-switch-share'));
|
||||
var shareButton = element(by.id('adf-viewer-share'));
|
||||
|
||||
var uploadButton = element(by.id('adf-viewer-upload'));
|
||||
var timeButton = element(by.id('adf-viewer-time'));
|
||||
var bugButton = element(by.id('adf-viewer-bug'));
|
||||
|
||||
this.canvasHeight = function () {
|
||||
var deferred = protractor.promise.defer();
|
||||
pageCanvas.getAttribute("style").then(function (value) {
|
||||
var canvasHeight = value.split("height: ")[1].split("px")[0];
|
||||
deferred.fulfill(canvasHeight);
|
||||
});
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
this.canvasWidth = function () {
|
||||
var deferred = protractor.promise.defer();
|
||||
pageCanvas.getAttribute("style").then(function (value) {
|
||||
var canvasWidth = value.split("width: ")[1].split("px")[0];
|
||||
deferred.fulfill(canvasWidth);
|
||||
});
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
this.viewFile = function (fileName) {
|
||||
var fileView = element.all(by.xpath("//div[@id='document-list-container']//div[@filename='" + fileName + "']")).first();
|
||||
Util.waitUntilElementIsVisible(fileView);
|
||||
fileView.click();
|
||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
};
|
||||
|
||||
this.clearPageNumber = function () {
|
||||
Util.waitUntilElementIsVisible(pageSelectorInput);
|
||||
pageSelectorInput.clear();
|
||||
pageSelectorInput.sendKeys(protractor.Key.ENTER);
|
||||
};
|
||||
|
||||
this.getZoom = function () {
|
||||
return percentage.getText();
|
||||
};
|
||||
|
||||
this.exitFullScreen = function () {
|
||||
var jsCode = "document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen();";
|
||||
browser.executeScript(jsCode);
|
||||
};
|
||||
|
||||
this.enterPassword = function (password) {
|
||||
Util.waitUntilElementIsVisible(passwordInput);
|
||||
passwordInput.clear();
|
||||
passwordInput.sendKeys(password);
|
||||
};
|
||||
|
||||
this.checkDatatableHeaderIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(datatableHeader);
|
||||
}
|
||||
|
||||
this.checkPageCanvasIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(pageCanvas);
|
||||
};
|
||||
|
||||
this.checkToolbarIsDisplayed = function (timeout) {
|
||||
Util.waitUntilElementIsVisible(toolbar, timeout);
|
||||
};
|
||||
|
||||
this.checkViewerIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsNotOnPage(viewer);
|
||||
};
|
||||
|
||||
this.checkPdfViewerIsDisplayed = function () {
|
||||
Util.waitUntilElementIsOnPage(pdfViewer);
|
||||
};
|
||||
|
||||
this.checkImgViewerIsDisplayed = function () {
|
||||
Util.waitUntilElementIsOnPage(imgViewer);
|
||||
};
|
||||
|
||||
this.checkPasswordErrorIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(passwordError);
|
||||
};
|
||||
|
||||
this.checkPasswordInputIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(passwordInput);
|
||||
};
|
||||
|
||||
this.checkPasswordSubmitDisabledIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(passwordSubmitDisabled);
|
||||
};
|
||||
|
||||
this.checkPasswordDialogIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(passwordDialog);
|
||||
};
|
||||
|
||||
this.checkAllThumbnailsDisplayed = function (nbPages) {
|
||||
var defaultThumbnailHeight = 143;
|
||||
expect(thumbnailsContent.getAttribute("style")).toEqual("height: " + nbPages * defaultThumbnailHeight + "px; transform: translate(-50%, 0px);");
|
||||
};
|
||||
|
||||
this.checkCurrentThumbnailIsSelected = function () {
|
||||
var selectedThumbnail = element(by.css("adf-pdf-thumb[class='pdf-thumbnails__thumb ng-star-inserted pdf-thumbnails__thumb--selected'] > img"));
|
||||
pageSelectorInput.getAttribute("value").then(function (pageNumber) {
|
||||
expect("Page " + pageNumber).toEqual(selectedThumbnail.getAttribute("title"));
|
||||
});
|
||||
};
|
||||
|
||||
this.checkThumbnailsCloseIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(thumbnailsClose);
|
||||
};
|
||||
|
||||
this.checkThumbnailsBtnIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(thumbnailsBtn);
|
||||
};
|
||||
|
||||
this.checkThumbnailsBtnIsDisabled = function () {
|
||||
Util.waitUntilElementIsVisible(thumbnailsBtn.getAttribute("disabled"));
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkThumbnailsContentIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(thumbnailsContent);
|
||||
};
|
||||
|
||||
this.checkThumbnailsContentIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsNotVisible(thumbnailsContent);
|
||||
};
|
||||
|
||||
this.checkCloseButtonIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(closeButton);
|
||||
};
|
||||
|
||||
this.checkDownloadButtonIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(downloadButton);
|
||||
};
|
||||
|
||||
this.checkInfoButtonIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(infoButton);
|
||||
};
|
||||
|
||||
this.checkInfoButtonIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsNotVisible(infoButton);
|
||||
};
|
||||
|
||||
this.checkFileThumbnailIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(fileThumbnail);
|
||||
};
|
||||
|
||||
this.checkFileNameIsDisplayed = function (file) {
|
||||
Util.waitUntilElementIsVisible(fileName);
|
||||
expect(fileName.getText()).toEqual(file);
|
||||
};
|
||||
|
||||
this.checkPreviousPageButtonIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(previousPageButton);
|
||||
};
|
||||
|
||||
this.checkNextPageButtonIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(nextPageButton);
|
||||
};
|
||||
|
||||
this.checkZoomInButtonIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(zoomInButton);
|
||||
};
|
||||
|
||||
this.checkZoomInButtonIsDisplayed = function (timeout) {
|
||||
Util.waitUntilElementIsVisible(zoomInButton, timeout);
|
||||
};
|
||||
|
||||
this.checkZoomInButtonIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsNotVisible(zoomInButton);
|
||||
};
|
||||
|
||||
this.checkZoomOutButtonIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(zoomOutButton);
|
||||
};
|
||||
|
||||
this.checkScalePageButtonIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(scalePageButton);
|
||||
};
|
||||
|
||||
this.checkPageSelectorInputIsDisplayed = function (number) {
|
||||
Util.waitUntilElementIsVisible(pageSelectorInput);
|
||||
pageSelectorInput.getAttribute("value").then(function (pageNumber) {
|
||||
expect(pageNumber).toEqual(number);
|
||||
});
|
||||
};
|
||||
|
||||
this.checkImgContainerIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(imgContainer);
|
||||
};
|
||||
|
||||
this.checkPdfContainerIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(pdfContainer);
|
||||
};
|
||||
|
||||
this.checkMediaPlayerContainerIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(mediaContainer);
|
||||
};
|
||||
|
||||
this.checkFileContent = function (pageNumber, text) {
|
||||
var pageLoaded = element.all(by.css("div[data-page-number='" + pageNumber + "'][data-loaded='true']")).first();
|
||||
var textLayerLoaded = element.all(by.css("div[data-page-number='" + pageNumber + "'] div[class='textLayer'] > div")).first();
|
||||
var specificText = element.all(by.cssContainingText("div[data-page-number='" + pageNumber + "'] div[class='textLayer'] > div", text)).first();
|
||||
Util.waitUntilElementIsVisible(allPages);
|
||||
Util.waitUntilElementIsVisible(pageLoaded);
|
||||
Util.waitUntilElementIsVisible(textLayerLoaded);
|
||||
Util.waitUntilElementIsVisible(specificText);
|
||||
};
|
||||
|
||||
this.checkFullScreenButtonIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(fullScreenButton);
|
||||
};
|
||||
|
||||
this.checkFullScreenButtonIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsNotVisible(fullScreenButton);
|
||||
};
|
||||
|
||||
this.checkPercentageIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(percentage);
|
||||
};
|
||||
|
||||
this.checkZoomedIn = function (zoom) {
|
||||
expect(percentage.getText()).toBeGreaterThan(zoom);
|
||||
};
|
||||
|
||||
this.checkZoomedOut = function (zoom) {
|
||||
expect(percentage.getText()).toBeLessThan(zoom);
|
||||
};
|
||||
|
||||
this.checkRotateLeftButtonIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(rotateLeft);
|
||||
};
|
||||
|
||||
this.checkRotateRightButtonIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(rotateRight);
|
||||
};
|
||||
|
||||
this.checkScaled = function (zoom) {
|
||||
expect(percentage.getText()).toEqual(zoom);
|
||||
};
|
||||
|
||||
this.checkScaleImgButtonIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(scaleImg);
|
||||
};
|
||||
|
||||
this.checkRotation = function (text) {
|
||||
var rotation = imgContainer.getAttribute("style");
|
||||
expect(rotation).toEqual(text);
|
||||
};
|
||||
|
||||
this.checkCustomBtnDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(customBtn);
|
||||
};
|
||||
|
||||
this.checkUnsupportedFileContainerIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(unsupportedFileContainer);
|
||||
};
|
||||
|
||||
this.checkInfoSideBarIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsNotVisible(infoSideBar);
|
||||
};
|
||||
|
||||
this.checkInfoSideBarIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(infoSideBar);
|
||||
};
|
||||
|
||||
this.checkInfoSideBarIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsNotOnPage(infoSideBar);
|
||||
};
|
||||
|
||||
this.checkLeftSideBarButtonIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsNotOnPage(leftSideBarButton);
|
||||
};
|
||||
|
||||
this.checkLeftSideBarButtonIsDisplayed = function () {
|
||||
Util.waitUntilElementIsOnPage(leftSideBarButton);
|
||||
};
|
||||
|
||||
this.clickInfoButton = function () {
|
||||
Util.waitUntilElementIsVisible(infoButton);
|
||||
return infoButton.click();
|
||||
};
|
||||
|
||||
this.clickLeftSidebarButton = function () {
|
||||
Util.waitUntilElementIsVisible(leftSideBarButton);
|
||||
return leftSideBarButton.click();
|
||||
};
|
||||
|
||||
this.checkLeftSideBarIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(leftSideBar);
|
||||
};
|
||||
|
||||
this.checkLeftSideBarIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsNotOnPage(leftSideBar);
|
||||
};
|
||||
|
||||
this.clickPasswordSubmit = function () {
|
||||
Util.waitUntilElementIsVisible(passwordSubmit);
|
||||
return passwordSubmit.click();
|
||||
};
|
||||
|
||||
this.clickSecondThumbnail = function () {
|
||||
Util.waitUntilElementIsClickable(secondThumbnail);
|
||||
return secondThumbnail.click();
|
||||
};
|
||||
|
||||
this.clickLastThumbnailDisplayed = function () {
|
||||
Util.waitUntilElementIsClickable(lastThumbnailDisplayed);
|
||||
return lastThumbnailDisplayed.click();
|
||||
};
|
||||
|
||||
this.clickThumbnailsClose = function () {
|
||||
Util.waitUntilElementIsClickable(thumbnailsClose);
|
||||
return thumbnailsClose.click();
|
||||
};
|
||||
|
||||
this.clickThumbnailsBtn = function () {
|
||||
Util.waitUntilElementIsVisible(thumbnailsBtn);
|
||||
Util.waitUntilElementIsClickable(thumbnailsBtn);
|
||||
return thumbnailsBtn.click();
|
||||
};
|
||||
|
||||
this.clickScaleImgButton = function () {
|
||||
Util.waitUntilElementIsClickable(scaleImg);
|
||||
return scaleImg.click();
|
||||
};
|
||||
|
||||
this.clickScalePdfButton = function () {
|
||||
Util.waitUntilElementIsClickable(scalePageButton);
|
||||
return scalePageButton.click();
|
||||
};
|
||||
|
||||
this.clickDownloadButton = function () {
|
||||
Util.waitUntilElementIsVisible(downloadButton);
|
||||
return downloadButton.click();
|
||||
};
|
||||
|
||||
this.clickCloseButton = function () {
|
||||
Util.waitUntilElementIsVisible(closeButton);
|
||||
return closeButton.click();
|
||||
};
|
||||
|
||||
this.clickPreviousPageButton = function () {
|
||||
Util.waitUntilElementIsVisible(previousPageButton);
|
||||
return previousPageButton.click();
|
||||
};
|
||||
|
||||
this.clickNextPageButton = function () {
|
||||
Util.waitUntilElementIsVisible(nextPageButton);
|
||||
return nextPageButton.click();
|
||||
};
|
||||
|
||||
this.clickZoomInButton = function () {
|
||||
Util.waitUntilElementIsVisible(zoomInButton);
|
||||
return zoomInButton.click();
|
||||
};
|
||||
|
||||
this.clickZoomOutButton = function () {
|
||||
Util.waitUntilElementIsVisible(zoomOutButton);
|
||||
return zoomOutButton.click();
|
||||
};
|
||||
|
||||
this.clickScalePageButton = function () {
|
||||
Util.waitUntilElementIsVisible(scalePageButton);
|
||||
scalePageButton.click();
|
||||
};
|
||||
|
||||
this.clickFullScreenButton = function () {
|
||||
Util.waitUntilElementIsClickable(fullScreenButton);
|
||||
return fullScreenButton.click();
|
||||
};
|
||||
|
||||
this.clickRotateLeftButton = function () {
|
||||
Util.waitUntilElementIsClickable(rotateLeft);
|
||||
return rotateLeft.click();
|
||||
};
|
||||
|
||||
this.clickRotateRightButton = function () {
|
||||
Util.waitUntilElementIsClickable(rotateRight);
|
||||
return rotateRight.click();
|
||||
};
|
||||
|
||||
this.getActiveTab = function () {
|
||||
Util.waitUntilElementIsVisible(activeTab);
|
||||
return activeTab.getText();
|
||||
};
|
||||
|
||||
this.checkUnsupportedFileContainerIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(unsupportedFileContainer);
|
||||
};
|
||||
|
||||
this.clickRightChevronToGetToTab = (tabName) => {
|
||||
element.all(by.css('.mat-tab-label'))
|
||||
.map((element) => element.getAttribute('innerText'))
|
||||
.then((texts) => {
|
||||
for (let text of texts) {
|
||||
if (text === tabName) {
|
||||
break;
|
||||
}
|
||||
this.clickRightChevron();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
this.clickRightChevron = function () {
|
||||
Util.waitUntilElementIsVisible(rightChevron);
|
||||
rightChevron.click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.clickOnVersionsTab = function () {
|
||||
this.clickRightChevronToGetToTab('Versions');
|
||||
var versionsTab = element(by.cssContainingText("div[id*='mat-tab-label']", "Versions"));
|
||||
Util.waitUntilElementIsVisible(versionsTab);
|
||||
versionsTab.click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkUploadVersionsButtonIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(uploadNewVersionButton);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkVersionIsDisplayed = function (version) {
|
||||
Util.waitUntilElementIsVisible(element(by.cssContainingText("h4[class*='adf-version-list-item-name']", version)));
|
||||
return this;
|
||||
};
|
||||
|
||||
this.clickOnCommentsTab = function () {
|
||||
var commentsTab = element(by.cssContainingText("div[id*='mat-tab-label']", "Comments"));
|
||||
Util.waitUntilElementIsVisible(commentsTab);
|
||||
commentsTab.click();
|
||||
return this;
|
||||
};
|
||||
|
||||
this.disableToolbar = function () {
|
||||
Util.waitUntilElementIsVisible(toolbarSwitch);
|
||||
toolbarSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') >= 0) {
|
||||
toolbarSwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.enableToolbar = function () {
|
||||
Util.waitUntilElementIsVisible(toolbarSwitch);
|
||||
toolbarSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') < 0) {
|
||||
toolbarSwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.checkToolbarIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(toolbar);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkToolbarIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsNotVisible(toolbar);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.disableGoBack = function () {
|
||||
Util.waitUntilElementIsVisible(goBackSwitch);
|
||||
goBackSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') >= 0) {
|
||||
goBackSwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.enableGoBack = function () {
|
||||
Util.waitUntilElementIsVisible(goBackSwitch);
|
||||
goBackSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') < 0) {
|
||||
goBackSwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.checkGoBackIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(closeButton);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkGoBackIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsNotVisible(closeButton);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.disableToolbarOptions = function () {
|
||||
Util.waitUntilElementIsVisible(openWithSwitch);
|
||||
openWithSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') >= 0) {
|
||||
openWithSwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.enableToolbarOptions = function () {
|
||||
Util.waitUntilElementIsVisible(openWithSwitch);
|
||||
openWithSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') < 0) {
|
||||
openWithSwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.checkToolbarOptionsIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(openWith);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkToolbarOptionsIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsNotVisible(openWith);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.disableDownload = function () {
|
||||
Util.waitUntilElementIsVisible(downloadSwitch);
|
||||
downloadSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') >= 0) {
|
||||
downloadSwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.enableDownload = function () {
|
||||
Util.waitUntilElementIsVisible(openWithSwitch);
|
||||
downloadSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') < 0) {
|
||||
downloadSwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.checkDownloadButtonDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(downloadButton);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkDownloadButtonIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsNotVisible(downloadButton);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.disablePrint = function () {
|
||||
Util.waitUntilElementIsVisible(printSwitch);
|
||||
printSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') >= 0) {
|
||||
printSwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.enablePrint = function () {
|
||||
Util.waitUntilElementIsVisible(printSwitch);
|
||||
printSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') < 0) {
|
||||
printSwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.checkPrintButtonIsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(printButton);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkPrintButtonIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsNotVisible(printButton);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.disableShare = function () {
|
||||
Util.waitUntilElementIsVisible(shareSwitch);
|
||||
shareSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') >= 0) {
|
||||
shareSwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.enableShare = function () {
|
||||
Util.waitUntilElementIsVisible(shareSwitch);
|
||||
shareSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') < 0) {
|
||||
shareSwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.disableAllowSidebar = function () {
|
||||
Util.waitUntilElementIsVisible(allowSidebarSwitch);
|
||||
allowSidebarSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') >= 0) {
|
||||
allowSidebarSwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.enableAllowSidebar = function () {
|
||||
Util.waitUntilElementIsVisible(allowSidebarSwitch);
|
||||
allowSidebarSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') < 0) {
|
||||
allowSidebarSwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.checkShareButtonDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(shareButton);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkShareButtonIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsNotVisible(shareButton);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkMoreActionsDisplayed = function () {
|
||||
Util.waitUntilElementIsVisible(bugButton);
|
||||
Util.waitUntilElementIsVisible(timeButton);
|
||||
Util.waitUntilElementIsVisible(uploadButton);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.checkMoreActionsIsNotDisplayed = function () {
|
||||
Util.waitUntilElementIsNotVisible(bugButton);
|
||||
Util.waitUntilElementIsNotVisible(timeButton);
|
||||
Util.waitUntilElementIsNotVisible(uploadButton);
|
||||
return this;
|
||||
};
|
||||
|
||||
this.disableMoreActions = function () {
|
||||
Util.waitUntilElementIsVisible(moreActionsSwitch);
|
||||
moreActionsSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') >= 0) {
|
||||
moreActionsSwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.enableMoreActions = function () {
|
||||
Util.waitUntilElementIsVisible(moreActionsSwitch);
|
||||
moreActionsSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') < 0) {
|
||||
moreActionsSwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.disableCustomName = function () {
|
||||
Util.waitUntilElementIsVisible(customNameSwitch);
|
||||
customNameSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') >= 0) {
|
||||
customNameSwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.enableCustomName = function () {
|
||||
Util.waitUntilElementIsVisible(customNameSwitch);
|
||||
customNameSwitch.getAttribute('class').then((check) => {
|
||||
if (check.indexOf('mat-checked') < 0) {
|
||||
customNameSwitch.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.clickToggleRightSidebar = function () {
|
||||
Util.waitUntilElementIsVisible(showRightSidebarSwitch);
|
||||
showRightSidebarSwitch.click();
|
||||
}
|
||||
|
||||
this.clickToggleLeftSidebar = function () {
|
||||
Util.waitUntilElementIsVisible(showLeftSidebarSwitch);
|
||||
showLeftSidebarSwitch.click();
|
||||
}
|
||||
|
||||
this.enterCustomName = function (text) {
|
||||
const textField = element(by.css('input[data-automation-id="adf-text-custom-name"]'));
|
||||
Util.waitUntilElementIsVisible(textField);
|
||||
textField.sendKeys('');
|
||||
textField.clear().sendKeys(text);
|
||||
return this;
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = ViewerToolbarPage;
|
688
e2e/pages/adf/viewerPage.ts
Normal file
688
e2e/pages/adf/viewerPage.ts
Normal file
@@ -0,0 +1,688 @@
|
||||
/*!
|
||||
* @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 CardViewPage = require('./cardViewPageComponent');
|
||||
|
||||
import { TabsPage } from './material/tabsPage';
|
||||
import { FormControllersPage } from './material/formControllersPage';
|
||||
|
||||
export class ViewerPage {
|
||||
|
||||
tabsPage = new TabsPage();
|
||||
formControllersPage = new FormControllersPage();
|
||||
|
||||
closeButton = element(by.css('button[data-automation-id="adf-toolbar-back"]'));
|
||||
fileName = element(by.id('adf-viewer-display-name'));
|
||||
infoButton = element(by.css('button[data-automation-id="adf-toolbar-sidebar"]'));
|
||||
leftSideBarButton = element(by.css('button[data-automation-id="adf-toolbar-left-sidebar"]'));
|
||||
previousPageButton = element(by.id('viewer-previous-page-button'));
|
||||
nextPageButton = element(by.id('viewer-next-page-button'));
|
||||
zoomInButton = element(by.id('viewer-zoom-in-button'));
|
||||
zoomOutButton = element(by.id('viewer-zoom-out-button'));
|
||||
scalePageButton = element(by.id('viewer-scale-page-button'));
|
||||
pdfContainer = element(by.id('viewer-pdf-container'));
|
||||
fullScreenButton = element(by.css('button[data-automation-id="adf-toolbar-fullscreen"]'));
|
||||
rotateLeft = element(by.css('button[id="viewer-rotate-left-button"]'));
|
||||
rotateRight = element(by.css('button[id="viewer-rotate-right-button"]'));
|
||||
scaleImg = element(by.css('button[id="viewer-reset-button"]'));
|
||||
customBtn = element(by.css('data-automation-id="adf-toolbar-custom-btn"'));
|
||||
fileThumbnail = element(by.css('img[data-automation-id="adf-file-thumbnail"]'));
|
||||
pageSelectorInput = element(by.css('input[data-automation-id="adf-page-selector"]'));
|
||||
imgContainer = element(by.css('div[data-automation-id="adf-image-container"]'));
|
||||
mediaContainer = element(by.css('adf-media-player[class="adf-media-player ng-star-inserted"]'));
|
||||
percentage = element(by.css('div[data-automation-id="adf-page-scale"'));
|
||||
thumbnailsBtn = element(by.css('button[data-automation-id="adf-thumbnails-button"]'));
|
||||
thumbnailsContent = element(by.css('div[data-automation-id="adf-thumbnails-content"]'));
|
||||
thumbnailsClose = element(by.css('button[data-automation-id="adf-thumbnails-close"]'));
|
||||
secondThumbnail = element(by.css('adf-pdf-thumb > img[title="Page 2"'));
|
||||
lastThumbnailDisplayed = element.all(by.css('adf-pdf-thumb')).last();
|
||||
passwordDialog = element(by.css('adf-pdf-viewer-password-dialog'));
|
||||
passwordSubmit = element(by.css('button[data-automation-id="adf-password-dialog-submit"]'));
|
||||
passwordSubmitDisabled = element(by.css('button[data-automation-id="adf-password-dialog-submit"][disabled]'));
|
||||
passwordInput = element(by.css('input[data-automation-id="adf-password-dialog-input"]'));
|
||||
passwordError = element(by.css('mat-error[data-automation-id="adf-password-dialog-error"]'));
|
||||
infoSideBar = element(by.id('adf-right-sidebar'));
|
||||
leftSideBar = element(by.id('adf-left-sidebar'));
|
||||
unsupportedFileContainer = element(by.cssContainingText('.label', 'Document preview could not be loaded'));
|
||||
pageCanvas = element.all(by.css('div[class="canvasWrapper"]')).first();
|
||||
viewer = element(by.css('adf-viewer'));
|
||||
pdfViewer = element(by.css('adf-pdf-viewer'));
|
||||
imgViewer = element(by.css('adf-img-viewer'));
|
||||
activeTab = element(by.css('div[class*="mat-tab-label-active"]'));
|
||||
uploadNewVersionButton = element(by.css('input[data-automation-id="upload-single-file"]'));
|
||||
rightChevron = element(by.css('div[class*="header-pagination-after"]'));
|
||||
toolbarSwitch = element(by.id('adf-switch-toolbar'));
|
||||
toolbar = element(by.id('adf-viewer-toolbar'));
|
||||
datatableHeader = element(by.css('div.adf-datatable-header'));
|
||||
goBackSwitch = element(by.id('adf-switch-goback'));
|
||||
|
||||
openWithSwitch = element(by.id('adf-switch-openwith'));
|
||||
openWith = element(by.id('adf-viewer-openwith'));
|
||||
|
||||
customNameSwitch = element(by.id('adf-switch-custoname'));
|
||||
|
||||
showRightSidebarSwitch = element(by.id('adf-switch-showrightsidebar'));
|
||||
showLeftSidebarSwitch = element(by.id('adf-switch-showleftsidebar'));
|
||||
|
||||
moreActionsSwitch = element(by.id('adf-switch-moreactions'));
|
||||
moreActions = element(by.id('adf-viewer-moreactions'));
|
||||
|
||||
downloadSwitch = element(by.id('adf-switch-download'));
|
||||
downloadButton = element(by.id('adf-viewer-download'));
|
||||
|
||||
printSwitch = element(by.id('adf-switch-print'));
|
||||
printButton = element(by.id('adf-viewer-print'));
|
||||
|
||||
allowSidebarSwitch = element(by.id('adf-switch-allowsidebar'));
|
||||
|
||||
shareSwitch = element(by.id('adf-switch-share'));
|
||||
shareButton = element(by.id('adf-viewer-share'));
|
||||
|
||||
uploadButton = element(by.id('adf-viewer-upload'));
|
||||
timeButton = element(by.id('adf-viewer-time'));
|
||||
bugButton = element(by.id('adf-viewer-bug'));
|
||||
|
||||
canvasHeight() {
|
||||
let deferred = protractor.promise.defer();
|
||||
this.pageCanvas.getAttribute('style').then(function (value) {
|
||||
let canvasHeight = value.split('height: ')[1].split('px')[0];
|
||||
deferred.fulfill(canvasHeight);
|
||||
});
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
canvasWidth() {
|
||||
let deferred = protractor.promise.defer();
|
||||
this.pageCanvas.getAttribute('style').then(function (value) {
|
||||
let canvasWidth = value.split('width: ')[1].split('px')[0];
|
||||
deferred.fulfill(canvasWidth);
|
||||
});
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
viewFile(fileName) {
|
||||
let fileView = element.all(by.xpath('//div[@id="document-list-container"]//div[@filename="' + fileName + '"]')).first();
|
||||
Util.waitUntilElementIsVisible(fileView);
|
||||
fileView.click();
|
||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
}
|
||||
|
||||
clearPageNumber() {
|
||||
Util.waitUntilElementIsVisible(this.pageSelectorInput);
|
||||
this.pageSelectorInput.clear();
|
||||
this.pageSelectorInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
getZoom() {
|
||||
return this.percentage.getText();
|
||||
}
|
||||
|
||||
exitFullScreen() {
|
||||
let jsCode = 'document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen();';
|
||||
browser.executeScript(jsCode);
|
||||
}
|
||||
|
||||
enterPassword(password) {
|
||||
Util.waitUntilElementIsVisible(this.passwordInput);
|
||||
this.passwordInput.clear();
|
||||
this.passwordInput.sendKeys(password);
|
||||
}
|
||||
|
||||
checkDatatableHeaderIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.datatableHeader);
|
||||
}
|
||||
|
||||
checkPageCanvasIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.pageCanvas);
|
||||
}
|
||||
|
||||
checkToolbarIsDisplayed(timeout) {
|
||||
Util.waitUntilElementIsVisible(this.toolbar, timeout);
|
||||
}
|
||||
|
||||
checkViewerIsNotDisplayed() {
|
||||
Util.waitUntilElementIsNotOnPage(this.viewer);
|
||||
}
|
||||
|
||||
checkPdfViewerIsDisplayed() {
|
||||
Util.waitUntilElementIsOnPage(this.pdfViewer);
|
||||
}
|
||||
|
||||
checkImgViewerIsDisplayed() {
|
||||
Util.waitUntilElementIsOnPage(this.imgViewer);
|
||||
}
|
||||
|
||||
checkPasswordErrorIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.passwordError);
|
||||
}
|
||||
|
||||
checkPasswordInputIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.passwordInput);
|
||||
}
|
||||
|
||||
checkPasswordSubmitDisabledIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.passwordSubmitDisabled);
|
||||
}
|
||||
|
||||
checkPasswordDialogIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.passwordDialog);
|
||||
}
|
||||
|
||||
checkAllThumbnailsDisplayed(nbPages) {
|
||||
let defaultThumbnailHeight = 143;
|
||||
expect(this.thumbnailsContent.getAttribute('style')).toEqual('height: ' + nbPages * defaultThumbnailHeight + 'px; transform: translate(-50%, 0px);');
|
||||
}
|
||||
|
||||
checkCurrentThumbnailIsSelected() {
|
||||
let selectedThumbnail = element(by.css('adf-pdf-thumb[class="pdf-thumbnails__thumb ng-star-inserted pdf-thumbnails__thumb--selected"] > img'));
|
||||
this.pageSelectorInput.getAttribute('value').then(function (pageNumber) {
|
||||
expect('Page ' + pageNumber).toEqual(selectedThumbnail.getAttribute('title'));
|
||||
});
|
||||
}
|
||||
|
||||
checkThumbnailsCloseIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.thumbnailsClose);
|
||||
}
|
||||
|
||||
checkThumbnailsBtnIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.thumbnailsBtn);
|
||||
}
|
||||
|
||||
checkThumbnailsBtnIsDisabled() {
|
||||
Util.waitUntilElementIsVisible(this.thumbnailsBtn.getAttribute('disabled'));
|
||||
return this;
|
||||
}
|
||||
|
||||
checkThumbnailsContentIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.thumbnailsContent);
|
||||
}
|
||||
|
||||
checkThumbnailsContentIsNotDisplayed() {
|
||||
Util.waitUntilElementIsNotVisible(this.thumbnailsContent);
|
||||
}
|
||||
|
||||
checkCloseButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.closeButton);
|
||||
}
|
||||
|
||||
checkDownloadButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.downloadButton);
|
||||
}
|
||||
|
||||
checkInfoButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.infoButton);
|
||||
}
|
||||
|
||||
checkInfoButtonIsNotDisplayed() {
|
||||
Util.waitUntilElementIsNotVisible(this.infoButton);
|
||||
}
|
||||
|
||||
checkFileThumbnailIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.fileThumbnail);
|
||||
}
|
||||
|
||||
checkFileNameIsDisplayed(file) {
|
||||
Util.waitUntilElementIsVisible(this.fileName);
|
||||
expect(this.fileName.getText()).toEqual(file);
|
||||
}
|
||||
|
||||
checkPreviousPageButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.previousPageButton);
|
||||
}
|
||||
|
||||
checkNextPageButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.nextPageButton);
|
||||
}
|
||||
|
||||
checkZoomInButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.zoomInButton);
|
||||
}
|
||||
|
||||
checkZoomInButtonIsDisplayed(timeout) {
|
||||
Util.waitUntilElementIsVisible(this.zoomInButton, timeout);
|
||||
}
|
||||
|
||||
checkZoomInButtonIsNotDisplayed() {
|
||||
Util.waitUntilElementIsNotVisible(this.zoomInButton);
|
||||
}
|
||||
|
||||
checkZoomOutButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.zoomOutButton);
|
||||
}
|
||||
|
||||
checkScalePageButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.scalePageButton);
|
||||
}
|
||||
|
||||
checkPageSelectorInputIsDisplayed(checkNumber) {
|
||||
Util.waitUntilElementIsVisible(this.pageSelectorInput);
|
||||
this.pageSelectorInput.getAttribute('value').then(function (pageNumber) {
|
||||
expect(pageNumber).toEqual(checkNumber);
|
||||
});
|
||||
}
|
||||
|
||||
checkImgContainerIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.imgContainer);
|
||||
}
|
||||
|
||||
checkPdfContainerIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.pdfContainer);
|
||||
}
|
||||
|
||||
checkMediaPlayerContainerIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.mediaContainer);
|
||||
}
|
||||
|
||||
checkFileContent(pageNumber, text) {
|
||||
let allPages = element.all(by.css('div[class="canvasWrapper"] > canvas')).first();
|
||||
let pageLoaded = element.all(by.css('div[data-page-number="' + pageNumber + '"][data-loaded="true"]')).first();
|
||||
let textLayerLoaded = element.all(by.css('div[data-page-number="' + pageNumber + '"] div[class="textLayer"] > div')).first();
|
||||
let specificText = element.all(by.cssContainingText('div[data-page-number="' + pageNumber + '"] div[class="textLayer"] > div', text)).first();
|
||||
|
||||
Util.waitUntilElementIsVisible(allPages);
|
||||
Util.waitUntilElementIsVisible(pageLoaded);
|
||||
Util.waitUntilElementIsVisible(textLayerLoaded);
|
||||
Util.waitUntilElementIsVisible(specificText);
|
||||
}
|
||||
|
||||
checkFullScreenButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.fullScreenButton);
|
||||
}
|
||||
|
||||
checkFullScreenButtonIsNotDisplayed() {
|
||||
Util.waitUntilElementIsNotVisible(this.fullScreenButton);
|
||||
}
|
||||
|
||||
checkPercentageIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.percentage);
|
||||
}
|
||||
|
||||
checkZoomedIn(zoom) {
|
||||
expect(this.percentage.getText()).toBeGreaterThan(zoom);
|
||||
}
|
||||
|
||||
checkZoomedOut(zoom) {
|
||||
expect(this.percentage.getText()).toBeLessThan(zoom);
|
||||
}
|
||||
|
||||
checkRotateLeftButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.rotateLeft);
|
||||
}
|
||||
|
||||
checkRotateRightButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.rotateRight);
|
||||
}
|
||||
|
||||
checkScaled(zoom) {
|
||||
expect(this.percentage.getText()).toEqual(zoom);
|
||||
}
|
||||
|
||||
checkScaleImgButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.scaleImg);
|
||||
}
|
||||
|
||||
checkRotation(text) {
|
||||
let rotation = this.imgContainer.getAttribute('style');
|
||||
expect(rotation).toEqual(text);
|
||||
}
|
||||
|
||||
checkCustomBtnDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.customBtn);
|
||||
}
|
||||
|
||||
checkUnsupportedFileContainerIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.unsupportedFileContainer);
|
||||
}
|
||||
|
||||
checkInfoSideBarIsNotDisplayed() {
|
||||
Util.waitUntilElementIsNotVisible(this.infoSideBar);
|
||||
}
|
||||
|
||||
checkInfoSideBarIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.infoSideBar);
|
||||
}
|
||||
|
||||
checkInfoSideBarIsNotDisplayed() {
|
||||
Util.waitUntilElementIsNotOnPage(this.infoSideBar);
|
||||
}
|
||||
|
||||
checkLeftSideBarButtonIsNotDisplayed() {
|
||||
Util.waitUntilElementIsNotOnPage(this.leftSideBarButton);
|
||||
}
|
||||
|
||||
checkLeftSideBarButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsOnPage(this.leftSideBarButton);
|
||||
}
|
||||
|
||||
clickInfoButton() {
|
||||
Util.waitUntilElementIsVisible(this.infoButton);
|
||||
return this.infoButton.click();
|
||||
}
|
||||
|
||||
clickLeftSidebarButton() {
|
||||
Util.waitUntilElementIsVisible(this.leftSideBarButton);
|
||||
return this.leftSideBarButton.click();
|
||||
}
|
||||
|
||||
checkLeftSideBarIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.leftSideBar);
|
||||
}
|
||||
|
||||
checkLeftSideBarIsNotDisplayed() {
|
||||
Util.waitUntilElementIsNotOnPage(this.leftSideBar);
|
||||
}
|
||||
|
||||
clickPasswordSubmit() {
|
||||
Util.waitUntilElementIsVisible(this.passwordSubmit);
|
||||
return this.passwordSubmit.click();
|
||||
}
|
||||
|
||||
clickSecondThumbnail() {
|
||||
Util.waitUntilElementIsClickable(this.secondThumbnail);
|
||||
return this.secondThumbnail.click();
|
||||
}
|
||||
|
||||
clickLastThumbnailDisplayed() {
|
||||
Util.waitUntilElementIsClickable(this.lastThumbnailDisplayed);
|
||||
return this.lastThumbnailDisplayed.click();
|
||||
}
|
||||
|
||||
clickThumbnailsClose() {
|
||||
Util.waitUntilElementIsClickable(this.thumbnailsClose);
|
||||
return this.thumbnailsClose.click();
|
||||
}
|
||||
|
||||
clickThumbnailsBtn() {
|
||||
Util.waitUntilElementIsVisible(this.thumbnailsBtn);
|
||||
Util.waitUntilElementIsClickable(this.thumbnailsBtn);
|
||||
return this.thumbnailsBtn.click();
|
||||
}
|
||||
|
||||
clickScaleImgButton() {
|
||||
Util.waitUntilElementIsClickable(this.scaleImg);
|
||||
return this.scaleImg.click();
|
||||
}
|
||||
|
||||
clickScalePdfButton() {
|
||||
Util.waitUntilElementIsClickable(this.scalePageButton);
|
||||
return this.scalePageButton.click();
|
||||
}
|
||||
|
||||
clickDownloadButton() {
|
||||
Util.waitUntilElementIsVisible(this.downloadButton);
|
||||
return this.downloadButton.click();
|
||||
}
|
||||
|
||||
clickCloseButton() {
|
||||
Util.waitUntilElementIsVisible(this.closeButton);
|
||||
return this.closeButton.click();
|
||||
}
|
||||
|
||||
clickPreviousPageButton() {
|
||||
Util.waitUntilElementIsVisible(this.previousPageButton);
|
||||
return this.previousPageButton.click();
|
||||
}
|
||||
|
||||
clickNextPageButton() {
|
||||
Util.waitUntilElementIsVisible(this.nextPageButton);
|
||||
return this.nextPageButton.click();
|
||||
}
|
||||
|
||||
clickZoomInButton() {
|
||||
Util.waitUntilElementIsVisible(this.zoomInButton);
|
||||
return this.zoomInButton.click();
|
||||
}
|
||||
|
||||
clickZoomOutButton() {
|
||||
Util.waitUntilElementIsVisible(this.zoomOutButton);
|
||||
return this.zoomOutButton.click();
|
||||
}
|
||||
|
||||
clickScalePageButton() {
|
||||
Util.waitUntilElementIsVisible(this.scalePageButton);
|
||||
this.scalePageButton.click();
|
||||
}
|
||||
|
||||
clickFullScreenButton() {
|
||||
Util.waitUntilElementIsClickable(this.fullScreenButton);
|
||||
return this.fullScreenButton.click();
|
||||
}
|
||||
|
||||
clickRotateLeftButton() {
|
||||
Util.waitUntilElementIsClickable(this.rotateLeft);
|
||||
return this.rotateLeft.click();
|
||||
}
|
||||
|
||||
clickRotateRightButton() {
|
||||
Util.waitUntilElementIsClickable(this.rotateRight);
|
||||
return this.rotateRight.click();
|
||||
}
|
||||
|
||||
getActiveTab() {
|
||||
Util.waitUntilElementIsVisible(this.activeTab);
|
||||
return this.activeTab.getText();
|
||||
}
|
||||
|
||||
checkUnsupportedFileContainerIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.unsupportedFileContainer);
|
||||
}
|
||||
|
||||
clickRightChevronToGetToTab = (tabName) => {
|
||||
element.all(by.css('.mat-tab-label'))
|
||||
.map((element) => element.getAttribute('innerText'))
|
||||
.then((texts) => {
|
||||
for (let text of texts) {
|
||||
if (text === tabName) {
|
||||
break;
|
||||
}
|
||||
clickRightChevron();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
clickRightChevron() {
|
||||
Util.waitUntilElementIsVisible(this.rightChevron);
|
||||
this.rightChevron.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnVersionsTab() {
|
||||
clickRightChevronToGetToTab('Versions');
|
||||
tabsPage.clickTabByTitle('Versions');
|
||||
return this;
|
||||
}
|
||||
|
||||
checkUploadVersionsButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.uploadNewVersionButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkVersionIsDisplayed(version) {
|
||||
Util.waitUntilElementIsVisible(element(by.cssContainingText('h4[class*="adf-version-list-item-name"]', version)));
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnCommentsTab() {
|
||||
this.tabsPage.clickTabByTitle('Comments');
|
||||
return this;
|
||||
}
|
||||
|
||||
disableToolbar() {
|
||||
this.formControllersPage.disableToggle(this.toolbarSwitch);
|
||||
}
|
||||
|
||||
enableToolbar() {
|
||||
this.formControllersPage.enableToggle(this.toolbarSwitch);
|
||||
}
|
||||
|
||||
checkToolbarIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.toolbar);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkToolbarIsNotDisplayed() {
|
||||
Util.waitUntilElementIsNotVisible(this.toolbar);
|
||||
return this;
|
||||
}
|
||||
|
||||
disableGoBack() {
|
||||
this.formControllersPage.disableToggle(this.goBackSwitch);
|
||||
}
|
||||
|
||||
enableGoBack() {
|
||||
this.formControllersPage.enableToggle(this.goBackSwitch);
|
||||
}
|
||||
|
||||
checkGoBackIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.closeButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkGoBackIsNotDisplayed() {
|
||||
Util.waitUntilElementIsNotVisible(this.closeButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
disableToolbarOptions() {
|
||||
this.formControllersPage.disableToggle(this.openWithSwitch);
|
||||
}
|
||||
|
||||
enableToolbarOptions() {
|
||||
this.formControllersPage.enableToggle(this.openWithSwitch);
|
||||
}
|
||||
|
||||
checkToolbarOptionsIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.openWith);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkToolbarOptionsIsNotDisplayed() {
|
||||
Util.waitUntilElementIsNotVisible(this.openWith);
|
||||
return this;
|
||||
}
|
||||
|
||||
disableDownload() {
|
||||
this.formControllersPage.disableToggle(this.downloadSwitch);
|
||||
}
|
||||
|
||||
enableDownload() {
|
||||
this.formControllersPage.enableToggle(this.openWithSwitch);
|
||||
}
|
||||
|
||||
checkDownloadButtonDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.downloadButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkDownloadButtonIsNotDisplayed() {
|
||||
Util.waitUntilElementIsNotVisible(this.downloadButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
disablePrint() {
|
||||
this.formControllersPage.disableToggle(this.printSwitch);
|
||||
}
|
||||
|
||||
enablePrint() {
|
||||
this.formControllersPage.enableToggle(this.printSwitch);
|
||||
}
|
||||
|
||||
checkPrintButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.printButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkPrintButtonIsNotDisplayed() {
|
||||
Util.waitUntilElementIsNotVisible(this.printButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
disableShare() {
|
||||
this.formControllersPage.disableToggle(this.shareSwitch);
|
||||
}
|
||||
|
||||
enableShare() {
|
||||
this.formControllersPage.enableToggle(this.shareSwitch);
|
||||
}
|
||||
|
||||
disableAllowSidebar() {
|
||||
this.formControllersPage.disableToggle(this.allowSidebarSwitch);
|
||||
}
|
||||
|
||||
enableAllowSidebar() {
|
||||
this.formControllersPage.enableToggle(this.allowSidebarSwitch);
|
||||
}
|
||||
|
||||
checkShareButtonDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.shareButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkShareButtonIsNotDisplayed() {
|
||||
Util.waitUntilElementIsNotVisible(this.shareButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkMoreActionsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.bugButton);
|
||||
Util.waitUntilElementIsVisible(this.timeButton);
|
||||
Util.waitUntilElementIsVisible(this.uploadButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkMoreActionsIsNotDisplayed() {
|
||||
Util.waitUntilElementIsNotVisible(this.bugButton);
|
||||
Util.waitUntilElementIsNotVisible(this.timeButton);
|
||||
Util.waitUntilElementIsNotVisible(this.uploadButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
disableMoreActions() {
|
||||
this.formControllersPage.disableToggle(this.moreActionsSwitch);
|
||||
}
|
||||
|
||||
enableMoreActions() {
|
||||
this.formControllersPage.enableToggle(this.moreActionsSwitch);
|
||||
}
|
||||
|
||||
disableCustomName() {
|
||||
this.formControllersPage.disableToggle(this.customNameSwitch);
|
||||
}
|
||||
|
||||
enableCustomName() {
|
||||
this.formControllersPage.enableToggle(this.customNameSwitch);
|
||||
}
|
||||
|
||||
clickToggleRightSidebar() {
|
||||
Util.waitUntilElementIsVisible(this.showRightSidebarSwitch);
|
||||
this.showRightSidebarSwitch.click();
|
||||
}
|
||||
|
||||
clickToggleLeftSidebar() {
|
||||
Util.waitUntilElementIsVisible(this.showLeftSidebarSwitch);
|
||||
this.showLeftSidebarSwitch.click();
|
||||
}
|
||||
|
||||
enterCustomName(text) {
|
||||
const textField = element(by.css('input[data-automation-id="adf-text-custom-name"]'));
|
||||
Util.waitUntilElementIsVisible(textField);
|
||||
textField.sendKeys('');
|
||||
textField.clear().sendKeys(text);
|
||||
return this;
|
||||
}
|
||||
}
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import LoginPage = require('../pages/adf/loginPage');
|
||||
import TasksPage = require('../pages/adf/process_services/tasksPage');
|
||||
import ViewerPage = require('../pages/adf/viewerPage');
|
||||
import Widget = require('../pages/adf/process_services/widgets/widget');
|
||||
import ProcessServicesPage = require('../pages/adf/process_services/processServicesPage');
|
||||
|
||||
@@ -28,6 +27,7 @@ import FileModel = require('../models/ACS/fileModel');
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
|
||||
import { ViewerPage } from '../pages/adf/viewerPage';
|
||||
import { AppsActions } from '../actions/APS/apps.actions';
|
||||
import AlfrescoApi = require('alfresco-js-api-node');
|
||||
import { UsersActions } from '../actions/users.actions';
|
||||
|
@@ -63,7 +63,7 @@ describe('Empty Process List Test', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
fit('[C260494] Should add process to list when a process is created', () => {
|
||||
it('[C260494] Should add process to list when a process is created', () => {
|
||||
loginPage.loginToProcessServicesUsingUserModel(user);
|
||||
navigationBarPage.clickProcessServicesButton();
|
||||
processServicesPage.checkApsContainer();
|
||||
|
@@ -20,7 +20,7 @@ import ProcessServicesPage = require('../pages/adf/process_services/processServi
|
||||
import ProcessFiltersPage = require('../pages/adf/process_services/processFiltersPage.js');
|
||||
import ProcessDetailsPage = require('../pages/adf/process_services/processDetailsPage.js');
|
||||
import { AttachmentListPage } from '../pages/adf/process_services/attachmentListPage';
|
||||
import ViewerPage = require('../pages/adf/viewerPage.js');
|
||||
import { ViewerPage } from '../pages/adf/viewerPage';
|
||||
|
||||
import TestConfig = require('../test.config');
|
||||
import resources = require('../util/resources');
|
||||
|
@@ -279,7 +279,7 @@ describe('Start Task - Custom App', () => {
|
||||
attachmentListPage.checkFileIsAttached(pngFile.name);
|
||||
});
|
||||
|
||||
fit('[C263945] Should Information box be hidden when showHeaderContent property is set on false on custom app', () => {
|
||||
it('[C263945] Should Information box be hidden when showHeaderContent property is set on false on custom app', () => {
|
||||
processServicesPage.goToProcessServices().goToApp(appModel.name).clickTasksButton();
|
||||
taskPage.filtersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS);
|
||||
taskPage.createNewTask().addName(showHeaderTask).clickStartButton();
|
||||
|
@@ -21,7 +21,7 @@ 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 ViewerPage = require('../pages/adf/viewerPage.js');
|
||||
import { ViewerPage } from '../pages/adf/viewerPage';
|
||||
|
||||
import CONSTANTS = require('../util/constants');
|
||||
|
||||
|
Binary file not shown.
@@ -52,10 +52,7 @@ export class UploadService {
|
||||
fileUploadDeleted: Subject<FileUploadDeleteEvent> = new Subject<FileUploadDeleteEvent>();
|
||||
fileDeleted: Subject<string> = new Subject<string>();
|
||||
|
||||
constructor(protected apiService: AlfrescoApiService,
|
||||
appConfigService: AppConfigService) {
|
||||
this.excludedFileList = <string[]> appConfigService.get('files.excluded');
|
||||
this.matchingOptions = appConfigService.get('files.match-options');
|
||||
constructor(protected apiService: AlfrescoApiService, private appConfigService: AppConfigService) {
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,8 +86,11 @@ export class UploadService {
|
||||
private filterElement(file: FileModel) {
|
||||
let isAllowed = true;
|
||||
|
||||
this.excludedFileList = <string[]> this.appConfigService.get('files.excluded');
|
||||
if (this.excludedFileList) {
|
||||
|
||||
this.matchingOptions = this.appConfigService.get('files.match-options');
|
||||
|
||||
isAllowed = this.excludedFileList.filter((pattern) => {
|
||||
let minimatch = new Minimatch(pattern, this.matchingOptions);
|
||||
return minimatch.match(file.name);
|
||||
|
43
package-lock.json
generated
43
package-lock.json
generated
@@ -1,37 +1,37 @@
|
||||
{
|
||||
"name": "alfresco-components",
|
||||
"version": "2.5.0",
|
||||
"version": "2.6.0-beta6",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@alfresco/adf-content-services": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-2.5.0.tgz",
|
||||
"integrity": "sha512-c2flI+A99YDP7BZ7lIWMC6JFqsWp5RC81BpZBKXBRw6R8YsJwbBwi9iZu+HZHQe6927THBMxDQX1uXT21ct7FA==",
|
||||
"version": "2.6.0-beta6",
|
||||
"resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-2.6.0-beta6.tgz",
|
||||
"integrity": "sha512-wRTcppfIA0kiE5UrgyjqkHycmO64ocBfQMZl/6is18cw1ln5kc7KkM4mQKt870DCfz56qDfsXb5SfwlOwnvx4A==",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
},
|
||||
"@alfresco/adf-core": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-2.5.0.tgz",
|
||||
"integrity": "sha512-ifjjT1H+dOiiFumDs8tY427HQ87VcL5wErcEkPb+hvW3DSf7czRohFyzRwCADNBEYeY4fqt/bIu35y+K2G738g==",
|
||||
"version": "2.6.0-beta6",
|
||||
"resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-2.6.0-beta6.tgz",
|
||||
"integrity": "sha512-BaCKyFNxrshrBQz9fwltPExOEXcGgtoxL6unwJrkdxWmg4R85q8Y+dkpSKA1TD2X5j+RGn9TLO0GE/HExapafg==",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
},
|
||||
"@alfresco/adf-insights": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@alfresco/adf-insights/-/adf-insights-2.5.0.tgz",
|
||||
"integrity": "sha512-16jqpGN+Jha+8GTe0y+ZN7q10GEwtatqseHS+uz0X/BzTFkGbXTw0s/qB8PiFvVf5US7FkL/U0w/cTaF//Yy4g==",
|
||||
"version": "2.6.0-beta6",
|
||||
"resolved": "https://registry.npmjs.org/@alfresco/adf-insights/-/adf-insights-2.6.0-beta6.tgz",
|
||||
"integrity": "sha512-YbLeNMNl5l2wND4lu/GU7mjVSRJ3wKazNOf5UIHY2CoKDPKi420h6aSDgo8+uP0rLC2JUHCLY7B21Wd3zZNF/w==",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
},
|
||||
"@alfresco/adf-process-services": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@alfresco/adf-process-services/-/adf-process-services-2.5.0.tgz",
|
||||
"integrity": "sha512-79YxXvK4+Uek4S+Gt7XxlfuIYlVdBINToK82/2S8QbJOv8C7vd9KGhb/MbgDcukp7rfdp5zKZfxwwgSrlI2RWg==",
|
||||
"version": "2.6.0-beta6",
|
||||
"resolved": "https://registry.npmjs.org/@alfresco/adf-process-services/-/adf-process-services-2.6.0-beta6.tgz",
|
||||
"integrity": "sha512-lJiNCZAfn+9bDON36ym8DJ8W3yQw1oyWQaETYi8t6wwF/ieA2ZopUZedAacqOAToqIPlXMiKdkDrlQPZzgqAOg==",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
@@ -1188,9 +1188,9 @@
|
||||
}
|
||||
},
|
||||
"alfresco-js-api": {
|
||||
"version": "2.6.0-c87428564306f710159976b0d740a07a94326cf1",
|
||||
"resolved": "https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-c87428564306f710159976b0d740a07a94326cf1.tgz",
|
||||
"integrity": "sha512-OPt75wllx+vjI0RgwbVdvUa4gs+UthJUS4iVaS8PhyXhXNxEHMuv2bKGH48cSolQbNH7kaurxqi80yl8b9kw3A==",
|
||||
"version": "2.6.0-beta6",
|
||||
"resolved": "https://registry.npmjs.org/alfresco-js-api/-/alfresco-js-api-2.6.0-beta6.tgz",
|
||||
"integrity": "sha512-T4S6zWBJtZ/Zb69+30ZrOOOfCgO9Vmd28lo/bqg0sZ84s6ZxATqGaHFktZVxF8kUhg4iQJxzYj3ubmCI9fQjtw==",
|
||||
"requires": {
|
||||
"event-emitter": "0.3.4",
|
||||
"superagent": "3.8.2"
|
||||
@@ -10614,9 +10614,9 @@
|
||||
}
|
||||
},
|
||||
"ngx-monaco-editor": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ngx-monaco-editor/-/ngx-monaco-editor-5.0.0.tgz",
|
||||
"integrity": "sha512-95MARPggYrpwk0Sf6IisaOw82Y/FQ5084kdX6vGzMLmaNnz4Dg2Uo/WoYTnbV+1299VMwdS0RgtQiZPhKlD/kQ=="
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ngx-monaco-editor/-/ngx-monaco-editor-6.0.0.tgz",
|
||||
"integrity": "sha512-sgNZblVUsIYHaWIKUqHopX3+rDL3DsjH9nsQoCuD7aA4p7Oppmd7UXwyT8OYTmimfcoufiA0tiIcH41XCZW58w=="
|
||||
},
|
||||
"nice-try": {
|
||||
"version": "1.0.4",
|
||||
@@ -16200,11 +16200,6 @@
|
||||
"minimalistic-assert": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"web-animations-js": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/web-animations-js/-/web-animations-js-2.3.1.tgz",
|
||||
"integrity": "sha1-Om2bwVGWN3qQ+OKAP6UmIWWwRRA="
|
||||
},
|
||||
"webassemblyjs": {
|
||||
"version": "1.4.3",
|
||||
"resolved": "https://registry.npmjs.org/webassemblyjs/-/webassemblyjs-1.4.3.tgz",
|
||||
|
@@ -90,7 +90,7 @@
|
||||
"moment": "2.22.2",
|
||||
"moment-es6": "^1.0.0",
|
||||
"ng2-charts": "1.6.0",
|
||||
"ngx-monaco-editor": "^5.0.0",
|
||||
"ngx-monaco-editor": "6.0.0",
|
||||
"pdfjs-dist": "^2.0.489",
|
||||
"protractor-retry": "^1.2.0",
|
||||
"raphael": "2.2.7",
|
||||
|
Reference in New Issue
Block a user