[ACS-5743] Cleanup Content tests (Demo Shell) (#8799)

* remove unused demo shell api

* remove recent files and cleanup unused api

* cleanup upload dialog page

* [ci:force] dummy commit

* [ci:force] cleanup the toolbar and tooltips

* [ci:force] remove dead code

* [ci:force] remove logger and custom action

* [ci:force] remove custom permission e2e test as already tested by unit

* [ci:force] remove "Start process" from the Content demo as not related to document list

* [ci:force] remove useless divs for selection

* [ci:force] dummy change to trigger CI/CD

* Revert "[ci:force] remove useless divs for selection"

This reverts commit fb3ae0b4396f44fc5aa055fcc5edf2df3e870fee.

* [ci:force] remove e2e for artificial scenario

* [ci:force] cleanup unused navigation bar protractor api

* [ci:force] cleanup unused datatable protractor api

* [ci:force] cleanup unused login protractor api

* [ci:force] fix process cloud demo page selector
This commit is contained in:
Denys Vuika 2023-08-01 18:48:19 +01:00 committed by GitHub
parent 3f3e83057d
commit 9497abcb43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 42 additions and 814 deletions

5
.prettierrc Normal file
View File

@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": "none",
"printWidth": 150
}

View File

@ -52,7 +52,6 @@
}, },
"PERSONAL-FILES": "Personal Files", "PERSONAL-FILES": "Personal Files",
"WARN-MULTIPLE-UPLOADS": "Display warning for multiple uploads.", "WARN-MULTIPLE-UPLOADS": "Display warning for multiple uploads.",
"CUSTOM-PERMISSION-MESSAGE": "Enable custom permission message",
"MEDIUM-TIME-FORMAT": "Enable medium time format for document list", "MEDIUM-TIME-FORMAT": "Enable medium time format for document list",
"SEARCH": { "SEARCH": {
"RADIO": { "RADIO": {
@ -160,12 +159,6 @@
"DESCRIPTION_UPLOAD": "Enable upload", "DESCRIPTION_UPLOAD": "Enable upload",
"ENABLE_INFINITE_SCROLL": "Enable Infinite Scrolling", "ENABLE_INFINITE_SCROLL": "Enable Infinite Scrolling",
"MULTISELECT_DESCRIPTION": "Use Cmd (Mac) or Ctrl (Windows) to toggle selection of multiple items", "MULTISELECT_DESCRIPTION": "Use Cmd (Mac) or Ctrl (Windows) to toggle selection of multiple items",
"RECENT": {
"EMPTY_STATE": {
"TITLE": "Recent Files list is empty"
},
"TITLE": "Recent Files"
},
"COLUMNS": { "COLUMNS": {
"DISPLAY_NAME": "Display name", "DISPLAY_NAME": "Display name",
"IS_LOCKED": "Lock", "IS_LOCKED": "Lock",
@ -179,6 +172,8 @@
"DELETED_BY": "Deleted by" "DELETED_BY": "Deleted by"
}, },
"TOOLBAR": { "TOOLBAR": {
"TOGGLE_DISPLAY_MODE": "Toggle display mode",
"TOGGLE_METADATA": "Toggle metadata",
"CARDVIEW": "Card view mode", "CARDVIEW": "Card view mode",
"SHARE_EDIT": "Edit settings", "SHARE_EDIT": "Edit settings",
"NEW_FOLDER": "New folder", "NEW_FOLDER": "New folder",
@ -187,10 +182,6 @@
"DELETE": "Delete", "DELETE": "Delete",
"FAVORITES": "Add to favorites", "FAVORITES": "Add to favorites",
"SHARE": "Share", "SHARE": "Share",
"THEME": "Select a theme",
"SHOW_VERSION": "Show version",
"HIDE_VERSION": "Hide version",
"LISTVIEW": "List view mode",
"CREATE_LIBRARY": "Create Library" "CREATE_LIBRARY": "Create Library"
}, },
"ACTIONS": { "ACTIONS": {
@ -208,8 +199,7 @@
"DOCUMENT": { "DOCUMENT": {
"COPY": "Copy", "COPY": "Copy",
"MOVE": "Move", "MOVE": "Move",
"DELETE": "Delete", "DELETE": "Delete"
"PROCESS_ACTION": "Start Process"
} }
} }
}, },

View File

@ -1,33 +1,4 @@
<div class="app-container"> <div class="app-container">
<mat-accordion *ngIf="showRecentFiles" class="app-container-recent">
<mat-expansion-panel hideToggle="true">
<mat-expansion-panel-header>
<mat-panel-title>
{{ 'DOCUMENT_LIST.RECENT.TITLE' | translate }}
<mat-icon>history</mat-icon>
</mat-panel-title>
</mat-expansion-panel-header>
<adf-document-list
[currentFolderId]="'-recent-'"
locationFormat="/files"
[display]="'gallery'"
[preselectNodes]="selectedNodes"
[showHeader]="noHeaderMode"
[maxItems]="5"
(preview)="showFile($event)"
selectionMode="null">
<adf-custom-empty-content-template>
<div class="app-empty-list__block">
<mat-icon>history</mat-icon>
<p class="app-empty-list__title">{{ 'DOCUMENT_LIST.RECENT.EMPTY_STATE.TITLE' | translate}}</p>
</div>
</adf-custom-empty-content-template>
</adf-document-list>
</mat-expansion-panel>
</mat-accordion>
<div *ngIf="showSitePicker" class="app-site-container-style" id="site-container"> <div *ngIf="showSitePicker" class="app-site-container-style" id="site-container">
<adf-sites-dropdown (change)="onSiteChange($event)" [hideMyFiles]="false" [relations]="'members'"> <adf-sites-dropdown (change)="onSiteChange($event)" [hideMyFiles]="false" [relations]="'members'">
</adf-sites-dropdown> </adf-sites-dropdown>
@ -51,7 +22,7 @@
</button> </button>
<span class="app-error-message--text">{{errorMessage}}</span> <span class="app-error-message--text">{{errorMessage}}</span>
</div> </div>
<adf-toolbar *ngIf="!disableDragArea" [color]="toolbarColor" class="app-files-toolbar"> <adf-toolbar *ngIf="!disableDragArea" class="app-files-toolbar">
<adf-toolbar-title> <adf-toolbar-title>
<adf-breadcrumb <adf-breadcrumb
class="app-files-breadcrumb" class="app-files-breadcrumb"
@ -70,14 +41,9 @@
<button <button
mat-icon-button mat-icon-button
data-automation-id="document-list-grid-view" data-automation-id="document-list-grid-view"
title="{{ 'DOCUMENT_LIST.TOOLBAR.CARDVIEW' | translate }}" title="{{ 'DOCUMENT_LIST.TOOLBAR.TOGGLE_DISPLAY_MODE' | translate }}"
(click)="toggleGalleryView()"> (click)="toggleGalleryView()">
<mat-icon *ngIf="displayMode === 'list'" <mat-icon>list</mat-icon>
matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.CARDVIEW' | translate }}">view_comfy
</mat-icon>
<mat-icon *ngIf="displayMode === 'gallery'"
matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.LISTVIEW' | translate }}">list
</mat-icon>
</button> </button>
<button <button
data-automation-id="create-new-folder" data-automation-id="create-new-folder"
@ -86,13 +52,12 @@
title="{{ 'DOCUMENT_LIST.TOOLBAR.NEW_FOLDER' | translate }}" title="{{ 'DOCUMENT_LIST.TOOLBAR.NEW_FOLDER' | translate }}"
(error)="openSnackMessageError($event)" (error)="openSnackMessageError($event)"
(success)="documentList.reload()" (success)="documentList.reload()"
[adf-create-folder]="currentFolderId" [adf-create-folder]="currentFolderId">
matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.NEW_FOLDER' | translate }}">
<mat-icon>create_new_folder</mat-icon> <mat-icon>create_new_folder</mat-icon>
</button> </button>
<button <button
mat-icon-button mat-icon-button
matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.CREATE_LIBRARY' | translate }}" title="{{ 'DOCUMENT_LIST.TOOLBAR.CREATE_LIBRARY' | translate }}"
data-automation-id="create-new-library" data-automation-id="create-new-library"
(click)="createLibrary()"> (click)="createLibrary()">
<mat-icon>library_add</mat-icon> <mat-icon>library_add</mat-icon>
@ -104,15 +69,13 @@
title="{{ 'DOCUMENT_LIST.TOOLBAR.EDIT_FOLDER' | translate }}" title="{{ 'DOCUMENT_LIST.TOOLBAR.EDIT_FOLDER' | translate }}"
(error)="openSnackMessageError($event)" (error)="openSnackMessageError($event)"
[adf-edit-folder]="documentList.selection[0]?.entry" [adf-edit-folder]="documentList.selection[0]?.entry"
(success)="documentList.reload()" (success)="documentList.reload()">
matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.EDIT_FOLDER' | translate }}">
<mat-icon>create</mat-icon> <mat-icon>create</mat-icon>
</button> </button>
<button mat-icon-button <button mat-icon-button
[disabled]="!hasSelection(documentList.selection)" [disabled]="!hasSelection(documentList.selection)"
title="{{ 'DOCUMENT_LIST.TOOLBAR.DOWNLOAD' | translate }}" title="{{ 'DOCUMENT_LIST.TOOLBAR.DOWNLOAD' | translate }}"
[adfNodeDownload]="documentList.selection" [adfNodeDownload]="documentList.selection">
matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.DOWNLOAD' | translate }}">
<mat-icon>get_app</mat-icon> <mat-icon>get_app</mat-icon>
</button> </button>
<button mat-icon-button <button mat-icon-button
@ -122,8 +85,7 @@
[adf-nodes]="documentList.selection" [adf-nodes]="documentList.selection"
title="{{ 'DOCUMENT_LIST.TOOLBAR.DELETE' | translate }}" title="{{ 'DOCUMENT_LIST.TOOLBAR.DELETE' | translate }}"
(delete)="onDeleteActionSuccess($event)" (delete)="onDeleteActionSuccess($event)"
[adf-delete]="documentList.selection" [adf-delete]="documentList.selection">
matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.DELETE' | translate }}">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
<button <button
@ -132,17 +94,15 @@
[disabled]="!documentList.selection.length" [disabled]="!documentList.selection.length"
#favorite="adfFavorite" #favorite="adfFavorite"
[adf-node-favorite]="documentList.selection" [adf-node-favorite]="documentList.selection"
matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.FAVORITES' | translate }}"> title="{{ 'DOCUMENT_LIST.TOOLBAR.FAVORITES' | translate }}">
<mat-icon> <mat-icon>{{ favorite.hasFavorites() ? 'star' :'star_border' }}</mat-icon>
{{ favorite.hasFavorites() ? 'star' :'star_border' }}
</mat-icon>
</button> </button>
<button mat-icon-button <button mat-icon-button
[disabled]="documentList.selection.length && !shareRef.isFile" [disabled]="documentList.selection.length && !shareRef.isFile"
[baseShareUrl]="baseShareUrl" [baseShareUrl]="baseShareUrl"
#shareRef="adfShare" #shareRef="adfShare"
[adf-share]="documentList.selection[0]" [adf-share]="documentList.selection[0]"
[matTooltip]="(shareRef.isShared [title]="(shareRef.isShared
? 'DOCUMENT_LIST.TOOLBAR.SHARE_EDIT' ? 'DOCUMENT_LIST.TOOLBAR.SHARE_EDIT'
: 'DOCUMENT_LIST.TOOLBAR.SHARE') | translate"> : 'DOCUMENT_LIST.TOOLBAR.SHARE') | translate">
<mat-icon> <mat-icon>
@ -151,25 +111,9 @@
</button> </button>
</div> </div>
<button mat-icon-button [matMenuTriggerFor]="themePicker" <button mat-icon-button (click)="showVersions = !showVersions" class="app-show-versions-button"
matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.THEME' | translate }}"> title="{{ 'DOCUMENT_LIST.TOOLBAR.TOGGLE_METADATA' | translate }}">
<mat-icon>format_color_fill</mat-icon> <mat-icon>{{ showVersions ? 'chevron_right' : 'chevron_left' }}</mat-icon>
</button>
<mat-menu #themePicker="matMenu">
<button mat-menu-item (click)="toolbarColor = null">Default</button>
<button mat-menu-item (click)="toolbarColor = 'primary'">Primary</button>
<button mat-menu-item (click)="toolbarColor = 'accent'">Accent</button>
<button mat-menu-item (click)="toolbarColor = 'warn'">Warn</button>
</mat-menu>
<button mat-icon-button (click)="showVersions = !showVersions" class="app-show-versions-button">
<mat-icon *ngIf="!showVersions" matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.SHOW_VERSION' | translate }}">
chevron_left
</mat-icon>
<mat-icon *ngIf="showVersions" matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.HIDE_VERSION' | translate }}">
chevron_right
</mat-icon>
</button> </button>
<adf-toolbar-divider class="app-toolbar-divider-before-more-menu"></adf-toolbar-divider> <adf-toolbar-divider class="app-toolbar-divider-before-more-menu"></adf-toolbar-divider>
@ -178,8 +122,7 @@
<mat-icon>more_vert</mat-icon> <mat-icon>more_vert</mat-icon>
</button> </button>
<mat-menu #menu="matMenu"> <mat-menu #menu="matMenu">
<button mat-menu-item <button mat-menu-item (click)="toggleGalleryView()">
(click)="toggleGalleryView()">
<mat-icon *ngIf="displayMode === 'list'">view_comfy</mat-icon> <mat-icon *ngIf="displayMode === 'list'">view_comfy</mat-icon>
<mat-icon *ngIf="displayMode === 'gallery'">list</mat-icon> <mat-icon *ngIf="displayMode === 'gallery'">list</mat-icon>
<span>{{ 'DOCUMENT_LIST.TOOLBAR.CARDVIEW' | translate }}</span> <span>{{ 'DOCUMENT_LIST.TOOLBAR.CARDVIEW' | translate }}</span>
@ -243,9 +186,6 @@
(name-click)="documentList.onNodeDblClick($any($event).detail?.node)" (name-click)="documentList.onNodeDblClick($any($event).detail?.node)"
(filterSelection)="onFilterSelected($event)"> (filterSelection)="onFilterSelected($event)">
<adf-custom-no-permission-template *ngIf="enableCustomPermissionMessage">
<h1>You don't have permissions</h1>
</adf-custom-no-permission-template>
<adf-custom-empty-content-template *ngIf="disableDragArea"> <adf-custom-empty-content-template *ngIf="disableDragArea">
<div class="app-empty_template"> <div class="app-empty_template">
<div class="app-no-result-message">{{ 'SEARCH.NO_RESULT' | translate }}</div> <div class="app-no-result-message">{{ 'SEARCH.NO_RESULT' | translate }}</div>
@ -278,15 +218,6 @@
[formatTooltip]="getNodeNameTooltip" [formatTooltip]="getNodeNameTooltip"
class="app-ellipsis-cell adf-expand-cell-5"> class="app-ellipsis-cell adf-expand-cell-5">
</data-column> </data-column>
<!-- Location column demo -->
<!--
<data-column
key="path"
type="location"
format="/files"
title="Location">
</data-column>
-->
<data-column <data-column
key="content.sizeInBytes" key="content.sizeInBytes"
title="{{'DOCUMENT_LIST.COLUMNS.SIZE' | translate}}" title="{{'DOCUMENT_LIST.COLUMNS.SIZE' | translate}}"
@ -304,17 +235,7 @@
</div> </div>
</ng-template> </ng-template>
</data-column> </data-column>
<!-- Notes: has performance overhead due to multiple files/folders causing separate HTTP calls to get tags -->
<!--
<data-column
title="{{'DOCUMENT_LIST.COLUMNS.TAG' | translate}}"
key="id"
class="app-full-width adf-ellipsis-cell">
<ng-template let-entry="$implicit">
<alfresco-tag-node-list [nodeId]="entry.data.getValue(entry.row, entry.col)"></alfresco-tag-node-list>
</ng-template>
</data-column>
-->
<data-column <data-column
class="app-full-width adf-ellipsis-cell adf-desktop-only" class="app-full-width adf-ellipsis-cell adf-desktop-only"
title="{{'DOCUMENT_LIST.COLUMNS.NODE_ID' | translate}}" title="{{'DOCUMENT_LIST.COLUMNS.NODE_ID' | translate}}"
@ -353,26 +274,6 @@
</data-columns> </data-columns>
<content-actions> <content-actions>
<!-- Conditional actions demo -->
<content-action
target="all"
title="Action for 'custom' node"
[disabled]="isCustomActionDisabled"
(execute)="runCustomAction($event)">
</content-action>
<content-action
icon="get_app"
title="Download this file now!"
handler="download"
[visible]="canDownloadNode">
</content-action>
<content-action
icon="get_app"
title="Never see this action again"
handler="download"
[visible]="false">
</content-action>
<!-- common actions -->
<content-action <content-action
icon="get_app" icon="get_app"
title="DOCUMENT_LIST.ACTIONS.DOWNLOAD" title="DOCUMENT_LIST.ACTIONS.DOWNLOAD"
@ -424,13 +325,6 @@
title="DOCUMENT_LIST.ACTIONS.VERSIONS" title="DOCUMENT_LIST.ACTIONS.VERSIONS"
(execute)="onManageVersions($event)"> (execute)="onManageVersions($event)">
</content-action> </content-action>
<content-action
target="document"
*ngIf="authenticationService.isBpmLoggedIn()"
icon="play_arrow"
title="DOCUMENT_LIST.ACTIONS.DOCUMENT.PROCESS_ACTION"
(execute)="startProcessAction($event)">
</content-action>
<content-action <content-action
target="document" target="document"
icon="lock" icon="lock"
@ -504,15 +398,6 @@
</div> </div>
</div> </div>
<div *ngIf="processId">
<adf-start-process
[values]="formValues"
[appId]="processId"
(start)="closeStartProcess()"
(cancel)="closeStartProcess()">
</adf-start-process>
</div>
<div *ngIf="showSettingsPanel" class="app-content-service-settings"> <div *ngIf="showSettingsPanel" class="app-content-service-settings">
<p>Current folder ID: {{ documentList.currentFolderId }}</p> <p>Current folder ID: {{ documentList.currentFolderId }}</p>
@ -546,7 +431,7 @@
</section> </section>
<section> <section>
<mat-slide-toggle id="adf-multiple-upload-switch" [color]="'primary'" (change)="onMultipleFilesUpload()" [(ngModel)]="multipleFileUpload" > <mat-slide-toggle id="adf-multiple-upload-switch" [color]="'primary'" [(ngModel)]="multipleFileUpload" >
{{'DOCUMENT_LIST.MULTIPLE_FILE_UPLOAD' | translate}} {{'DOCUMENT_LIST.MULTIPLE_FILE_UPLOAD' | translate}}
</mat-slide-toggle> </mat-slide-toggle>
</section> </section>
@ -613,12 +498,6 @@
</mat-slide-toggle> </mat-slide-toggle>
</section> </section>
<section>
<mat-slide-toggle color="primary" [(ngModel)]="enableCustomPermissionMessage">
{{'APP.CUSTOM-PERMISSION-MESSAGE' | translate}}
</mat-slide-toggle>
</section>
<section> <section>
<mat-slide-toggle color="primary" [(ngModel)]="enableMediumTimeFormat" id="enableMediumTimeFormat"> <mat-slide-toggle color="primary" [(ngModel)]="enableMediumTimeFormat" id="enableMediumTimeFormat">
{{'APP.MEDIUM-TIME-FORMAT' | translate}} {{'APP.MEDIUM-TIME-FORMAT' | translate}}
@ -639,21 +518,6 @@
</mat-slide-toggle> </mat-slide-toggle>
</section> </section>
<section>
<mat-slide-toggle
color="primary" [(ngModel)]="preselectNodes" id="preselectNodes">
Preselect Nodes
</mat-slide-toggle>
</section>
<form class="example-form">
<mat-form-field *ngIf="preselectNodes" class="adf-preselect-nodes-input">
<input matInput
(input)="setPreselectNodes($any($event).target?.value)"
placeholder="NodeEntry[] => [{ entry: { isFile: true, id: 'node-id' }}, { entry: { isFile: true, id: 'node-id' }} ]">
</mat-form-field>
</form>
<section> <section>
<mat-slide-toggle <mat-slide-toggle
color="primary" [(ngModel)]="enableDownloadPrompt" id="enableDownloadPrompt" (change)="onEnableDownloadPrompt()"> color="primary" [(ngModel)]="enableDownloadPrompt" id="enableDownloadPrompt" (change)="onEnableDownloadPrompt()">

View File

@ -103,22 +103,3 @@
line-height: 1.33; line-height: 1.33;
letter-spacing: -1px; letter-spacing: -1px;
} }
.app-container-recent {
mat-icon {
margin-left: 20px;
}
.app-empty-list__block {
height: 100%;
padding: 0;
margin: 0;
display: flex;
align-items: center;
justify-content: center;
}
}
.adf-preselect-nodes-input {
width: 100%;
}

View File

@ -37,20 +37,15 @@ import {
Pagination, Pagination,
MinimalNodeEntryEntity, MinimalNodeEntryEntity,
SiteEntry, SiteEntry,
SearchEntry, SearchEntry
NodeEntry
} from '@alfresco/js-api'; } from '@alfresco/js-api';
import { import {
AlfrescoApiService,
AuthenticationService,
AppConfigService, AppConfigService,
AppConfigValues, AppConfigValues,
LogService,
NotificationService, NotificationService,
DataRow, DataRow,
UserPreferencesService, UserPreferencesService,
PaginationComponent, PaginationComponent,
FormValues,
DisplayMode, DisplayMode,
ShowHeaderMode, ShowHeaderMode,
InfinitePaginationComponent, InfinitePaginationComponent,
@ -73,15 +68,12 @@ import {
NodesApiService, NodesApiService,
SharedLinksApiService SharedLinksApiService
} from '@alfresco/adf-content-services'; } from '@alfresco/adf-content-services';
import { ProcessFormRenderingService } from '@alfresco/adf-process-services';
import { SelectAppsDialogComponent, ProcessFormRenderingService } from '@alfresco/adf-process-services';
import { VersionManagerDialogAdapterComponent } from './version-manager-dialog-adapter.component'; import { VersionManagerDialogAdapterComponent } from './version-manager-dialog-adapter.component';
import { MetadataDialogAdapterComponent } from './metadata-dialog-adapter.component'; import { MetadataDialogAdapterComponent } from './metadata-dialog-adapter.component';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import { PreviewService } from '../../services/preview.service'; import { PreviewService } from '../../services/preview.service';
import { takeUntil, debounceTime, scan } from 'rxjs/operators'; import { takeUntil, debounceTime, scan } from 'rxjs/operators';
import { ThemePalette } from '@angular/material/core';
const DEFAULT_FOLDER_TO_SHOW = '-my-'; const DEFAULT_FOLDER_TO_SHOW = '-my-';
@ -110,8 +102,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
this.appConfig.get<string>(AppConfigValues.BASESHAREURL) || this.appConfig.get<string>(AppConfigValues.BASESHAREURL) ||
this.appConfig.get<string>(AppConfigValues.ECMHOST)) + '/preview/s/'; this.appConfig.get<string>(AppConfigValues.ECMHOST)) + '/preview/s/';
toolbarColor: ThemePalette;
selectionModes = [ selectionModes = [
{value: 'none', viewValue: 'None'}, {value: 'none', viewValue: 'None'},
{value: 'single', viewValue: 'Single'}, {value: 'single', viewValue: 'Single'},
@ -122,10 +112,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
@Input() @Input()
currentFolderId: string = DEFAULT_FOLDER_TO_SHOW; currentFolderId: string = DEFAULT_FOLDER_TO_SHOW;
formValues: FormValues = {};
processId;
@Input() @Input()
sorting = ['name', 'ASC']; sorting = ['name', 'ASC'];
@ -240,18 +226,13 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
permissionsStyle: PermissionStyleModel[] = []; permissionsStyle: PermissionStyleModel[] = [];
infiniteScrolling: boolean; infiniteScrolling: boolean;
stickyHeader: boolean; stickyHeader: boolean;
preselectNodes: boolean;
warnOnMultipleUploads = false; warnOnMultipleUploads = false;
thumbnails = false; thumbnails = false;
noHeaderMode = ShowHeaderMode.Never;
enableCustomPermissionMessage = false;
enableMediumTimeFormat = false; enableMediumTimeFormat = false;
displayEmptyMetadata = false; displayEmptyMetadata = false;
hyperlinkNavigation = false; hyperlinkNavigation = false;
selectedNodes = []; enableDownloadPrompt = this.appConfig.get<boolean>('viewer.enableDownloadPrompt', false);
enableDownloadPrompt: boolean = this.appConfig.get('viewer.enableDownloadPrompt', false);
enableDownloadPromptReminder: boolean = this.appConfig.get('viewer.enableDownloadPromptReminders', false); enableDownloadPromptReminder: boolean = this.appConfig.get('viewer.enableDownloadPromptReminders', false);
downloadPromptDelay = this.appConfig.get('viewer.downloadPromptDelay', 50); downloadPromptDelay = this.appConfig.get('viewer.downloadPromptDelay', 50);
downloadPromptReminderDelay = this.appConfig.get('viewer.downloadPromptReminderDelay', 30); downloadPromptReminderDelay = this.appConfig.get('viewer.downloadPromptReminderDelay', 30);
@ -264,13 +245,10 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
private dialog: MatDialog, private dialog: MatDialog,
private location: Location, private location: Location,
private router: Router, private router: Router,
private logService: LogService,
private appConfig: AppConfigService, private appConfig: AppConfigService,
private preference: UserPreferencesService, private preference: UserPreferencesService,
private preview: PreviewService, private preview: PreviewService,
@Optional() private route: ActivatedRoute, @Optional() private route: ActivatedRoute,
public authenticationService: AuthenticationService,
public alfrescoApiService: AlfrescoApiService,
private contentMetadataService: ContentMetadataService, private contentMetadataService: ContentMetadataService,
private sharedLinksApiService: SharedLinksApiService, private sharedLinksApiService: SharedLinksApiService,
private dialogAspectListService: DialogAspectListService, private dialogAspectListService: DialogAspectListService,
@ -284,12 +262,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
} }
} }
toggleFolder() {
this.multipleFileUpload = false;
this.folderUpload = !this.folderUpload;
return this.folderUpload;
}
toggleThumbnails() { toggleThumbnails() {
this.thumbnails = !this.thumbnails; this.thumbnails = !this.thumbnails;
this.documentList.reload(); this.documentList.reload();
@ -327,19 +299,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
takeUntil(this.onDestroy$) takeUntil(this.onDestroy$)
) )
.subscribe((value: any[]) => { .subscribe((value: any[]) => {
let selectedNodes: NodeEntry[] = [];
if (this.preselectNodes) {
if (value && value.length > 0) {
if (this.selectionMode === 'single') {
selectedNodes = [...[value[value.length - 1]].map((uploadedFile) => uploadedFile.data)];
} else {
selectedNodes = [...value.map((uploadedFile) => uploadedFile.data)];
}
this.selectedNodes = [...selectedNodes];
}
}
this.onFileUploadEvent(value[0]); this.onFileUploadEvent(value[0]);
}); });
@ -421,15 +380,12 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
} }
onFolderCreated(event: FolderCreatedEvent) { onFolderCreated(event: FolderCreatedEvent) {
this.logService.log('FOLDER CREATED');
this.logService.log(event);
if (event && event.parentId === this.documentList.currentFolderId) { if (event && event.parentId === this.documentList.currentFolderId) {
this.documentList.reload(); this.documentList.reload();
} }
} }
onFolderAction(node) { onFolderAction(node) {
this.logService.log(node);
if (node && node.parentId === this.documentList.currentFolderId) { if (node && node.parentId === this.documentList.currentFolderId) {
this.documentList.reload(); this.documentList.reload();
} }
@ -459,10 +415,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
this.documentListReady.emit(event); this.documentListReady.emit(event);
} }
pageIsEmpty(node: NodePaging) {
return node && node.list && node.list.entries.length === 0;
}
onContentActionError(errors: any) { onContentActionError(errors: any) {
const errorStatusCode = JSON.parse(errors.message).error.statusCode; const errorStatusCode = JSON.parse(errors.message).error.statusCode;
let message: string; let message: string;
@ -582,24 +534,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
return false; return false;
} }
startProcessAction($event: any) {
this.formValues['file'] = $event.value.entry;
const dialogRef = this.dialog.open(SelectAppsDialogComponent, {
width: '630px',
panelClass: 'adf-version-manager-dialog'
});
dialogRef.afterClosed().subscribe((selectedProcess) => {
this.processId = selectedProcess.id;
});
}
closeStartProcess() {
this.processId = null;
}
onChangePageSize(event: Pagination): void { onChangePageSize(event: Pagination): void {
this.preference.paginationSize = event.maxItems; this.preference.paginationSize = event.maxItems;
this.pagination.maxItems = event.maxItems; this.pagination.maxItems = event.maxItems;
@ -619,12 +553,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
this.turnedNextPage.emit(event); this.turnedNextPage.emit(event);
} }
loadNextBatch(event: Pagination): void {
this.pagination.maxItems = event.maxItems;
this.pagination.skipCount = event.skipCount;
this.loadNext.emit(event);
}
onPrevPage(event: Pagination): void { onPrevPage(event: Pagination): void {
this.pagination.maxItems = event.maxItems; this.pagination.maxItems = event.maxItems;
this.pagination.skipCount = event.skipCount; this.pagination.skipCount = event.skipCount;
@ -646,10 +574,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
this.infinitePaginationComponent.reset(); this.infinitePaginationComponent.reset();
} }
canDownloadNode(node: MinimalNodeEntity): boolean {
return node && node.entry && node.entry.name === 'custom';
}
onBeginUpload(event: UploadFilesEvent) { onBeginUpload(event: UploadFilesEvent) {
if (this.warnOnMultipleUploads && event) { if (this.warnOnMultipleUploads && event) {
const files = event.files || []; const files = event.files || [];
@ -673,14 +597,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
} }
} }
isCustomActionDisabled(node: MinimalNodeEntity): boolean {
return !(node && node.entry && node.entry.name === 'custom');
}
runCustomAction(event: any) {
this.logService.log(event);
}
onUploadNewVersion(ev) { onUploadNewVersion(ev) {
const contentEntry = ev.detail.data.node.entry; const contentEntry = ev.detail.data.node.entry;
const showComments = this.showVersionComments; const showComments = this.showVersionComments;
@ -758,32 +674,6 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
this.documentList.reload(); this.documentList.reload();
} }
setPreselectNodes(nodes: string) {
this.selectedNodes = this.getArrayFromString(nodes);
this.documentList.reload();
}
isStringArray(str: string): boolean {
try {
const result = JSON.parse(str);
return Array.isArray(result);
} catch (e) {
return false;
}
}
private getArrayFromString<T = any>(value: string): T[] {
if (this.isStringArray(value)) {
return JSON.parse(value);
} else {
return [];
}
}
onMultipleFilesUpload() {
this.selectedNodes = [];
}
onEnableDownloadPrompt() { onEnableDownloadPrompt() {
const previewConfig = this.appConfig?.config['viewer']; const previewConfig = this.appConfig?.config['viewer'];
previewConfig['enableDownloadPrompt'] = this.enableDownloadPrompt; previewConfig['enableDownloadPrompt'] = this.enableDownloadPrompt;
@ -813,5 +703,4 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
const previewConfig = this.appConfig?.config['viewer']; const previewConfig = this.appConfig?.config['viewer'];
previewConfig['fileAutoDownloadSizeThresholdInMB'] = this.fileAutoDownloadSizeThresholdInMB; previewConfig['fileAutoDownloadSizeThresholdInMB'] = this.fileAutoDownloadSizeThresholdInMB;
} }
} }

View File

@ -16,7 +16,6 @@
*/ */
import { browser } from 'protractor'; import { browser } from 'protractor';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { createApiService, BrowserActions, ErrorPage, LoginPage, StringUtil, UsersActions } from '@alfresco/adf-testing'; import { createApiService, BrowserActions, ErrorPage, LoginPage, StringUtil, UsersActions } from '@alfresco/adf-testing';
import { SitesApi } from '@alfresco/js-api'; import { SitesApi } from '@alfresco/js-api';
@ -24,7 +23,6 @@ import { SitesApi } from '@alfresco/js-api';
describe('Document List Component', () => { describe('Document List Component', () => {
const loginPage = new LoginPage(); const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage();
const errorPage = new ErrorPage(); const errorPage = new ErrorPage();
const navigationBarPage = new NavigationBarPage(); const navigationBarPage = new NavigationBarPage();
const apiService = createApiService(); const apiService = createApiService();
@ -61,12 +59,5 @@ describe('Document List Component', () => {
await expect(await errorPage.getErrorCode()).toBe('403'); await expect(await errorPage.getErrorCode()).toBe('403');
await expect(await errorPage.getErrorDescription()).toBe('You\'re not allowed access to this resource on the server.'); await expect(await errorPage.getErrorDescription()).toBe('You\'re not allowed access to this resource on the server.');
}); });
it('[C279924] Should display custom message when accessing a file without permissions', async () => {
await contentServicesPage.goToDocumentList();
await contentServicesPage.enableCustomPermissionMessage();
await BrowserActions.getUrl(browser.baseUrl + '/files/' + privateSite.entry.guid);
await expect(await errorPage.getErrorCode()).toBe('403');
});
}); });
}); });

View File

@ -25,35 +25,13 @@ describe('Document List Component', () => {
const loginPage = new LoginPage(); const loginPage = new LoginPage();
const contentServicesPage = new ContentServicesPage(); const contentServicesPage = new ContentServicesPage();
let uploadedFolder; let uploadedFolderExtra;
const apiService = createApiService(); const apiService = createApiService();
const uploadActions = new UploadActions(apiService); const uploadActions = new UploadActions(apiService);
let acsUser = null; let acsUser = null;
let testFileNode; let pdfBFileNode;
const navigationBarPage = new NavigationBarPage(); const navigationBarPage = new NavigationBarPage();
const usersActions = new UsersActions(apiService); const usersActions = new UsersActions(apiService);
afterEach(async () => {
await apiService.loginWithProfile('admin');
if (uploadedFolder) {
await uploadActions.deleteFileOrFolder(uploadedFolder.entry.id);
uploadedFolder = null;
}
if (uploadedFolderExtra) {
await uploadActions.deleteFileOrFolder(uploadedFolderExtra.entry.id);
uploadedFolderExtra = null;
}
if (testFileNode) {
await uploadActions.deleteFileOrFolder(testFileNode.entry.id);
testFileNode = null;
}
if (pdfBFileNode) {
await uploadActions.deleteFileOrFolder(pdfBFileNode.entry.id);
pdfBFileNode = null;
}
});
describe('Thumbnails and tooltips', () => { describe('Thumbnails and tooltips', () => {
const pdfFile = new FileModel({ const pdfFile = new FileModel({
name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name, name: browser.params.resources.Files.ADF_DOCUMENTS.PDF.file_name,

View File

@ -49,7 +49,6 @@ export class ContentServicesPage {
multipleFileUploadToggle = $('#adf-document-list-enable-drop-files'); multipleFileUploadToggle = $('#adf-document-list-enable-drop-files');
uploadBorder = $('#document-list-container'); uploadBorder = $('#document-list-container');
contentServices = $('.app-sidenav-link[data-automation-id="Content Services"]');
currentFolder = $('div[class*="adf-breadcrumb-item adf-active"] div'); currentFolder = $('div[class*="adf-breadcrumb-item adf-active"] div');
createFolderButton = $('button[data-automation-id="create-new-folder"]'); createFolderButton = $('button[data-automation-id="create-new-folder"]');
editFolderButton = $('button[data-automation-id="edit-folder"]'); editFolderButton = $('button[data-automation-id="edit-folder"]');
@ -60,20 +59,14 @@ export class ContentServicesPage {
uploadFileButtonInput = $('input[data-automation-id="upload-single-file"]'); uploadFileButtonInput = $('input[data-automation-id="upload-single-file"]');
uploadMultipleFileButton = $('input[data-automation-id="upload-multiple-files"]'); uploadMultipleFileButton = $('input[data-automation-id="upload-multiple-files"]');
uploadFolderButton = $('input[data-automation-id="uploadFolder"]'); uploadFolderButton = $('input[data-automation-id="uploadFolder"]');
errorSnackBar = $('simple-snack-bar[class*="mat-simple-snackbar"]');
emptyPagination = $('adf-pagination[class*="adf-pagination__empty"]'); emptyPagination = $('adf-pagination[class*="adf-pagination__empty"]');
dragAndDrop = $$('adf-upload-drag-area div').first(); dragAndDrop = $$('adf-upload-drag-area div').first();
nameHeader = $$('div[data-automation-id="auto_header_content_id_name"] > span').first(); nameHeader = $$('div[data-automation-id="auto_header_content_id_name"] > span').first();
sizeHeader = $$('div[data-automation-id="auto_header_content_id_content.sizeInBytes"] > span').first(); sizeHeader = $$('div[data-automation-id="auto_header_content_id_content.sizeInBytes"] > span').first();
createdByHeader = $$('div[data-automation-id="auto_header_content_id_createdByUser.displayName"] > span').first(); createdByHeader = $$('div[data-automation-id="auto_header_content_id_createdByUser.displayName"] > span').first();
createdHeader = $$('div[data-automation-id="auto_header_content_id_createdAt"] > span').first(); createdHeader = $$('div[data-automation-id="auto_header_content_id_createdAt"] > span').first();
recentFiles = $('.app-container-recent');
recentFilesExpanded = $('.app-container-recent mat-expansion-panel-header.mat-expanded');
recentFilesClosed = $('.app-container-recent mat-expansion-panel-header');
recentFileIcon = $('.app-container-recent mat-expansion-panel-header mat-icon');
emptyFolder = $('.adf-empty-folder-this-space-is-empty'); emptyFolder = $('.adf-empty-folder-this-space-is-empty');
emptyFolderImage = $('.adf-empty-folder-image'); emptyFolderImage = $('.adf-empty-folder-image');
emptyRecent = $('.app-container-recent .app-empty-list__title');
gridViewButton = $('button[data-automation-id="document-list-grid-view"]'); gridViewButton = $('button[data-automation-id="document-list-grid-view"]');
cardViewContainer = $('div.app-document-list-container div.adf-datatable-card'); cardViewContainer = $('div.app-document-list-container div.adf-datatable-card');
shareNodeButton = element(by.cssContainingText('mat-icon', ' share ')); shareNodeButton = element(by.cssContainingText('mat-icon', ' share '));
@ -234,36 +227,6 @@ export class ContentServicesPage {
return sorted; return sorted;
} }
async checkRecentFileToBeShowed() {
await BrowserVisibility.waitUntilElementIsVisible(this.recentFiles);
}
async expandRecentFiles(): Promise<void> {
await this.checkRecentFileToBeShowed();
await this.checkRecentFileToBeClosed();
await BrowserActions.click(this.recentFilesClosed);
await this.checkRecentFileToBeOpened();
}
async closeRecentFiles(): Promise<void> {
await this.checkRecentFileToBeShowed();
await this.checkRecentFileToBeOpened();
await BrowserActions.click(this.recentFilesExpanded);
await this.checkRecentFileToBeClosed();
}
async checkRecentFileToBeClosed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.recentFilesClosed);
}
async checkRecentFileToBeOpened(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.recentFilesExpanded);
}
async getRecentFileIcon(): Promise<string> {
return BrowserActions.getText(this.recentFileIcon);
}
// @deprecated prefer waitTillContentLoaded // @deprecated prefer waitTillContentLoaded
async checkDocumentListElementsAreDisplayed(): Promise<void> { async checkDocumentListElementsAreDisplayed(): Promise<void> {
await this.checkAcsContainer(); await this.checkAcsContainer();
@ -286,10 +249,6 @@ export class ContentServicesPage {
await this.contentList.dataTablePage().waitTillContentLoaded(); await this.contentList.dataTablePage().waitTillContentLoaded();
} }
async clickOnContentServices(): Promise<void> {
await BrowserActions.click(this.contentServices);
}
async numberOfResultsDisplayed(): Promise<number> { async numberOfResultsDisplayed(): Promise<number> {
return this.contentList.dataTablePage().numberOfRows(); return this.contentList.dataTablePage().numberOfRows();
} }
@ -331,10 +290,6 @@ export class ContentServicesPage {
return this.contentList.dataTablePage().checkListIsSorted(sortOrder, this.columns.createdBy); return this.contentList.dataTablePage().checkListIsSorted(sortOrder, this.columns.createdBy);
} }
async checkListIsSortedBySizeColumn(sortOrder: string): Promise<any> {
return this.contentList.dataTablePage().checkListIsSorted(sortOrder, this.columns.size);
}
async sortAndCheckListIsOrderedByAuthor(sortOrder: string): Promise<any> { async sortAndCheckListIsOrderedByAuthor(sortOrder: string): Promise<any> {
await this.sortByAuthor(sortOrder); await this.sortByAuthor(sortOrder);
return this.checkListIsSortedByAuthorColumn(sortOrder); return this.checkListIsSortedByAuthorColumn(sortOrder);
@ -460,11 +415,6 @@ export class ContentServicesPage {
return BrowserActions.getAttribute(this.uploadMultipleFileButton, 'title'); return BrowserActions.getAttribute(this.uploadMultipleFileButton, 'title');
} }
async getFolderButtonTooltip(): Promise<string> {
await BrowserVisibility.waitUntilElementIsPresent(this.uploadFolderButton);
return BrowserActions.getAttribute(this.uploadFolderButton, 'title');
}
async checkUploadButton(): Promise<void> { async checkUploadButton(): Promise<void> {
await BrowserVisibility.waitUntilElementIsClickable(this.uploadFileButton); await BrowserVisibility.waitUntilElementIsClickable(this.uploadFileButton);
} }
@ -473,20 +423,11 @@ export class ContentServicesPage {
return this.uploadFileButton.isEnabled(); return this.uploadFileButton.isEnabled();
} }
async getErrorMessage(): Promise<string> {
return BrowserActions.getText(this.errorSnackBar);
}
async enableInfiniteScrolling(): Promise<void> { async enableInfiniteScrolling(): Promise<void> {
const infiniteScrollButton = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable Infinite Scrolling')); const infiniteScrollButton = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable Infinite Scrolling'));
await BrowserActions.click(infiniteScrollButton); await BrowserActions.click(infiniteScrollButton);
} }
async enableCustomPermissionMessage(): Promise<void> {
const customPermissionMessage = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable custom permission message'));
await BrowserActions.click(customPermissionMessage);
}
async enableMediumTimeFormat(): Promise<void> { async enableMediumTimeFormat(): Promise<void> {
const mediumTimeFormat = $('#enableMediumTimeFormat'); const mediumTimeFormat = $('#enableMediumTimeFormat');
await BrowserActions.click(mediumTimeFormat); await BrowserActions.click(mediumTimeFormat);
@ -532,11 +473,6 @@ export class ContentServicesPage {
await DropActions.dropFile(this.dragAndDrop, file); await DropActions.dropFile(this.dragAndDrop, file);
} }
async dragAndDropFolder(folderName: string): Promise<void> {
await this.checkDragAndDropDIsDisplayed();
await DropActions.dropFolder(this.dragAndDrop, folderName);
}
async checkLockIsDisplayedForElement(name): Promise<void> { async checkLockIsDisplayedForElement(name): Promise<void> {
const lockButton = $(`div.adf-datatable-cell[data-automation-id="${name}"] button`); const lockButton = $(`div.adf-datatable-cell[data-automation-id="${name}"] button`);
await BrowserVisibility.waitUntilElementIsVisible(lockButton); await BrowserVisibility.waitUntilElementIsVisible(lockButton);
@ -546,12 +482,6 @@ export class ContentServicesPage {
return this.contentList.dataTablePage().getColumnValueForRow(this.columns.name, file, columnName); return this.contentList.dataTablePage().getColumnValueForRow(this.columns.name, file, columnName);
} }
async getStyleValueForRowText(rowName, styleName): Promise<string> {
const row = $(`div.adf-datatable-cell[data-automation-id="${rowName}"] span.adf-datatable-cell-value[title="${rowName}"]`);
await BrowserVisibility.waitUntilElementIsVisible(row);
return row.getCssValue(styleName);
}
async checkEmptyFolderTextToBe(text): Promise<void> { async checkEmptyFolderTextToBe(text): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.emptyFolder); await BrowserVisibility.waitUntilElementIsVisible(this.emptyFolder);
await expect(await this.emptyFolder.getText()).toContain(text); await expect(await this.emptyFolder.getText()).toContain(text);
@ -561,10 +491,6 @@ export class ContentServicesPage {
await expect(await BrowserActions.getAttribute(this.emptyFolderImage, 'src')).toContain(url); await expect(await BrowserActions.getAttribute(this.emptyFolderImage, 'src')).toContain(url);
} }
async checkEmptyRecentFileIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.emptyRecent);
}
async getRowIconImageUrl(fileName): Promise<string> { async getRowIconImageUrl(fileName): Promise<string> {
const iconRow = $(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${fileName}"] img`); const iconRow = $(`.app-document-list-container div.adf-datatable-cell[data-automation-id="${fileName}"] img`);
return BrowserActions.getAttribute(iconRow, 'src'); return BrowserActions.getAttribute(iconRow, 'src');

View File

@ -33,18 +33,10 @@ export class DataTablePage {
}; };
dataTable: DataTableComponentPage; dataTable: DataTableComponentPage;
multiSelect = $(`div[data-automation-id='multiselect'] label > .mat-checkbox-inner-container`);
reset = element(by.xpath(`//span[contains(text(),'Reset to default')]/..`)); reset = element(by.xpath(`//span[contains(text(),'Reset to default')]/..`));
allSelectedRows = $$(`adf-datatable-row[class*='is-selected']`); allSelectedRows = $$(`adf-datatable-row[class*='is-selected']`);
selectedRowNumber = $(`adf-datatable-row[class*='is-selected'] div[data-automation-id*='text_']`); selectedRowNumber = $(`adf-datatable-row[class*='is-selected'] div[data-automation-id*='text_']`);
selectAll = $(`div[class*='header'] label`);
addRowElement = element(by.xpath(`//span[contains(text(),'Add row')]/..`));
replaceRowsElement = element(by.xpath(`//span[contains(text(),'Replace rows')]/..`));
replaceColumnsElement = element(by.xpath(`//span[contains(text(),'Replace columns')]/..`));
createdOnColumn = $(`div[data-automation-id='auto_id_createdOn']`);
idColumnHeader = $(`div[data-automation-id='auto_id_id']`); idColumnHeader = $(`div[data-automation-id='auto_id_id']`);
pasteClipboardInput = $(`input[data-automation-id='paste clipboard input']`);
selectModeDropdown = new DropdownPage($(`mat-select[data-automation-id='datatable-selection-mode']`)); selectModeDropdown = new DropdownPage($(`mat-select[data-automation-id='datatable-selection-mode']`));
constructor(data?) { constructor(data?) {
@ -55,35 +47,6 @@ export class DataTablePage {
} }
} }
async insertFilter(filterText: string): Promise<void> {
const inputFilter = $(`#adf-datatable-filter-input`);
await BrowserActions.clearSendKeys(inputFilter, filterText);
}
async addRow(): Promise<void> {
await BrowserActions.click(this.addRowElement);
}
async replaceRows(id: string): Promise<void> {
const rowID = this.dataTable.getCellElementByValue(this.columns.id, id);
await BrowserVisibility.waitUntilElementIsVisible(rowID);
await BrowserActions.click(this.replaceRowsElement);
await BrowserVisibility.waitUntilElementIsNotVisible(rowID);
}
async replaceColumns(): Promise<void> {
await BrowserActions.click(this.replaceColumnsElement);
await BrowserVisibility.waitUntilElementIsNotVisible(this.createdOnColumn);
}
async clickMultiSelect(): Promise<void> {
await BrowserActions.click(this.multiSelect);
}
async clickReset(): Promise<void> {
await BrowserActions.click(this.reset);
}
async checkRowIsNotSelected(rowNumber: string): Promise<void> { async checkRowIsNotSelected(rowNumber: string): Promise<void> {
const isRowSelected = this.dataTable.getCellElementByValue(this.columns.id, rowNumber) const isRowSelected = this.dataTable.getCellElementByValue(this.columns.id, rowNumber)
.element(by.xpath(`ancestor::adf-datatable-row[contains(@class, 'adf-datatable-row custom-row-style ng-star-inserted is-selected')]`)); .element(by.xpath(`ancestor::adf-datatable-row[contains(@class, 'adf-datatable-row custom-row-style ng-star-inserted is-selected')]`));
@ -94,29 +57,10 @@ export class DataTablePage {
await BrowserVisibility.waitUntilElementIsNotVisible(this.selectedRowNumber); await BrowserVisibility.waitUntilElementIsNotVisible(this.selectedRowNumber);
} }
async checkAllRows(): Promise<void> {
await BrowserActions.click(this.selectAll);
}
async checkRowIsChecked(rowNumber: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.getRowCheckbox(rowNumber));
}
async checkRowIsNotChecked(rowNumber: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.getRowCheckbox(rowNumber));
}
async getNumberOfSelectedRows(): Promise<number> { async getNumberOfSelectedRows(): Promise<number> {
return this.allSelectedRows.count(); return this.allSelectedRows.count();
} }
async clickCheckbox(rowNumber: string): Promise<void> {
await BrowserActions.closeMenuAndDialogs();
const checkbox = this.dataTable.getCellElementByValue(this.columns.id, rowNumber)
.element(by.xpath(`ancestor::adf-datatable-row[contains(@class, 'adf-datatable-row')]//mat-checkbox/label`));
await BrowserActions.click(checkbox);
}
async selectRow(rowNumber: string): Promise<void> { async selectRow(rowNumber: string): Promise<void> {
const row = this.dataTable.getCellElementByValue(this.columns.id, rowNumber); const row = this.dataTable.getCellElementByValue(this.columns.id, rowNumber);
await BrowserActions.click(row); await BrowserActions.click(row);
@ -132,32 +76,6 @@ export class DataTablePage {
await this.selectModeDropdown.selectDropdownOption(selectionMode); await this.selectModeDropdown.selectDropdownOption(selectionMode);
} }
getRowCheckbox(rowNumber: string): ElementFinder {
return this.dataTable.getCellElementByValue(this.columns.id, rowNumber).element(by.xpath(`ancestor::adf-datatable-row/div/mat-checkbox[contains(@class, 'mat-checkbox-checked')]`));
}
async getCopyContentTooltip(): Promise<string> {
return this.dataTable.getCopyContentTooltip();
}
async mouseOverNameColumn(name: string): Promise<void> {
await this.dataTable.mouseOverColumn(this.columns.name, name);
}
async mouseOverCreatedByColumn(name: string): Promise<void> {
await this.dataTable.mouseOverColumn(this.columns.createdBy, name);
}
async mouseOverIdColumn(name: string): Promise<void> {
await this.dataTable.mouseOverColumn(this.columns.id, name);
}
async mouseOverJsonColumn(rowNumber: number): Promise<void> {
const cell = this.dataTable.getCellByRowNumberAndColumnName(rowNumber - 1, this.columns.json);
await BrowserVisibility.waitUntilElementIsVisible(cell);
await browser.actions().mouseMove(cell).perform();
}
getDropTargetIdColumnCell(rowNumber: number): ElementFinder { getDropTargetIdColumnCell(rowNumber: number): ElementFinder {
return this.dataTable.getCellByRowNumberAndColumnName(rowNumber - 1, this.columns.id); return this.dataTable.getCellByRowNumberAndColumnName(rowNumber - 1, this.columns.id);
} }
@ -165,31 +83,4 @@ export class DataTablePage {
getDropTargetIdColumnHeader(): ElementFinder { getDropTargetIdColumnHeader(): ElementFinder {
return this.idColumnHeader; return this.idColumnHeader;
} }
async clickOnIdColumn(name: string): Promise<void> {
await this.dataTable.clickColumn(this.columns.id, name);
}
async clickOnJsonColumn(rowNumber: number): Promise<void> {
await BrowserActions.click(this.dataTable.getCellByRowNumberAndColumnName(rowNumber - 1, this.columns.json));
}
async clickOnNameColumn(name: string): Promise<void> {
await this.dataTable.clickColumn(this.columns.name, name);
}
async clickOnCreatedByColumn(name: string): Promise<void> {
await this.dataTable.clickColumn(this.columns.createdBy, name);
}
async pasteClipboard(): Promise<void> {
await this.pasteClipboardInput.clear();
await BrowserActions.click(this.pasteClipboardInput);
await this.pasteClipboardInput.sendKeys(protractor.Key.chord(protractor.Key.SHIFT, protractor.Key.INSERT));
}
async getClipboardInputText(): Promise<string> {
const inputValue = await BrowserActions.getInputValue(this.pasteClipboardInput);
return inputValue.match(/\d/).toString();
}
} }

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { element, by, browser, ElementFinder, $, $$ } from 'protractor'; import { by, browser, ElementFinder, $, $$ } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing'; import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
export class UploadDialogPage { export class UploadDialogPage {
@ -31,12 +31,6 @@ export class UploadDialogPage {
title = $('span[class*="upload-dialog__title"]'); title = $('span[class*="upload-dialog__title"]');
minimizeButton = $('mat-icon[title="Minimize"]'); minimizeButton = $('mat-icon[title="Minimize"]');
maximizeButton = $('mat-icon[title="Maximize"]'); maximizeButton = $('mat-icon[title="Maximize"]');
canUploadConfirmationTitle = $('.upload-dialog__confirmation--title');
canUploadConfirmationDescription = $('.upload-dialog__confirmation--text');
confirmationDialogNoButton = element(by.partialButtonText('No'));
confirmationDialogYesButton = element(by.partialButtonText('Yes'));
cancelUploadsElement = $('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-cancel-all"]');
cancelUploadInProgressButton = $('div[data-automation-id="cancel-upload-progress"]');
async clickOnCloseButton(): Promise<void> { async clickOnCloseButton(): Promise<void> {
await this.checkCloseButtonIsDisplayed(); await this.checkCloseButtonIsDisplayed();
@ -76,8 +70,8 @@ export class UploadDialogPage {
} }
async filesAreUploaded(content: string[]): Promise<void> { async filesAreUploaded(content: string[]): Promise<void> {
for (let i = 0; i < content.length; i++) { for (const item of content) {
await this.fileIsUploaded(content[i]); await this.fileIsUploaded(item);
} }
} }
@ -85,18 +79,6 @@ export class UploadDialogPage {
await BrowserVisibility.waitUntilElementIsNotVisible($(`div[class*='uploading-row'] span[title="${content}"]`)); await BrowserVisibility.waitUntilElementIsNotVisible($(`div[class*='uploading-row'] span[title="${content}"]`));
} }
async cancelUploads(): Promise<void> {
await BrowserActions.click(this.cancelUploadsElement);
}
async cancelProgress(): Promise<void> {
await BrowserActions.click(this.cancelUploadInProgressButton);
}
async checkCancelProgressIsVisible(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.cancelUploadInProgressButton);
}
async fileIsCancelled(content: string): Promise<void> { async fileIsCancelled(content: string): Promise<void> {
const row: ElementFinder = await this.getRowByRowName(content); const row: ElementFinder = await this.getRowByRowName(content);
await BrowserVisibility.waitUntilElementIsVisible(row); await BrowserVisibility.waitUntilElementIsVisible(row);
@ -115,24 +97,6 @@ export class UploadDialogPage {
return this.title.getText(); return this.title.getText();
} }
async getConfirmationDialogTitleText(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.canUploadConfirmationTitle);
return this.canUploadConfirmationTitle.getText();
}
async getConfirmationDialogDescriptionText(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.canUploadConfirmationDescription);
return this.canUploadConfirmationDescription.getText();
}
async clickOnConfirmationDialogYesButton(): Promise<void> {
await BrowserActions.click(this.confirmationDialogYesButton);
}
async clickOnConfirmationDialogNoButton(): Promise<void> {
await BrowserActions.click(this.confirmationDialogNoButton);
}
async numberOfCurrentFilesUploaded(): Promise<string> { async numberOfCurrentFilesUploaded(): Promise<string> {
const text = await this.getTitleText(); const text = await this.getTitleText();
return text.split('Uploaded ')[1].split(' / ')[0]; return text.split('Uploaded ')[1].split(' / ')[0];

View File

@ -44,16 +44,6 @@ export class UploadTogglesPage {
await this.togglePage.enableToggle(this.uploadFolderToggle); await this.togglePage.enableToggle(this.uploadFolderToggle);
} }
async checkFolderUploadToggleIsEnabled(): Promise<boolean> {
try {
const enabledFolderUpload = $('mat-slide-toggle[id="adf-folder-upload-switch"][class*="mat-checked"]');
await BrowserVisibility.waitUntilElementIsVisible(enabledFolderUpload);
return true;
} catch {
return false;
}
}
async checkMultipleFileUploadToggleIsEnabled(): Promise<void> { async checkMultipleFileUploadToggleIsEnabled(): Promise<void> {
const enabledToggle = $('mat-slide-toggle[id="adf-multiple-upload-switch"][class*="mat-checked"]'); const enabledToggle = $('mat-slide-toggle[id="adf-multiple-upload-switch"][class*="mat-checked"]');
await BrowserVisibility.waitUntilElementIsVisible(enabledToggle); await BrowserVisibility.waitUntilElementIsVisible(enabledToggle);
@ -69,19 +59,6 @@ export class UploadTogglesPage {
await BrowserVisibility.waitUntilElementIsVisible(enabledToggle); await BrowserVisibility.waitUntilElementIsVisible(enabledToggle);
} }
async disableFolderUpload(): Promise<void> {
await this.togglePage.disableToggle(this.uploadFolderToggle);
}
async checkFolderUploadToggleIsNotEnabled(): Promise<boolean> {
try {
const inactiveToggleFolder = $('#adf-folder-upload-switch .mat-slide-toggle-label');
await BrowserVisibility.waitUntilElementIsVisible(inactiveToggleFolder);
return true;
} catch {
return false;
}
}
async enableExtensionFilter(): Promise<void> { async enableExtensionFilter(): Promise<void> {
await browser.executeScript('arguments[0].scrollIntoView()', this.extensionFilterToggle); await browser.executeScript('arguments[0].scrollIntoView()', this.extensionFilterToggle);
await this.togglePage.enableToggle(this.extensionFilterToggle); await this.togglePage.enableToggle(this.extensionFilterToggle);
@ -125,5 +102,4 @@ export class UploadTogglesPage {
async clearText(): Promise<void> { async clearText(): Promise<void> {
await BrowserActions.clearSendKeys(this.maxSizeField, ''); await BrowserActions.clearSendKeys(this.maxSizeField, '');
} }
} }

View File

@ -19,7 +19,6 @@ import { $, browser, by, element } from 'protractor';
import { TogglePage, BrowserActions, BrowserVisibility, LoginPage } from '@alfresco/adf-testing'; import { TogglePage, BrowserActions, BrowserVisibility, LoginPage } from '@alfresco/adf-testing';
export class LoginShellPage { export class LoginShellPage {
loginURL = browser.baseUrl + '/login'; loginURL = browser.baseUrl + '/login';
loginSSOPage = new LoginPage(); loginSSOPage = new LoginPage();
@ -27,17 +26,12 @@ export class LoginShellPage {
txtUsername = $('input[id="username"]'); txtUsername = $('input[id="username"]');
txtPassword = $('input[id="password"]'); txtPassword = $('input[id="password"]');
logoImg = $('img[id="adf-login-img-logo"]'); logoImg = $('img[id="adf-login-img-logo"]');
successRouteTxt = $('input[data-automation-id="adf-success-route"]');
logoTxt = $('input[data-automation-id="adf-url-logo"]'); logoTxt = $('input[data-automation-id="adf-url-logo"]');
usernameError = $('span[data-automation-id="username-error"]'); usernameError = $('span[data-automation-id="username-error"]');
passwordError = $('span[data-automation-id="password-required"]');
loginError = $('.adf-login-error-message');
usernameInactive = $('input[id="username"][class*="ng-invalid"]'); usernameInactive = $('input[id="username"][class*="ng-invalid"]');
passwordInactive = $('input[id="password"][class*="ng-invalid"]');
adfLogo = $('.adf-img-logo'); adfLogo = $('.adf-img-logo');
usernameHighlighted = $('input[id="username"][aria-invalid="true"]'); usernameHighlighted = $('input[id="username"][aria-invalid="true"]');
passwordHighlighted = $('input[id="password"][aria-invalid="true"]');
signInButton = $('#login-button'); signInButton = $('#login-button');
showPasswordElement = $('button[data-automation-id="show_password"]'); showPasswordElement = $('button[data-automation-id="show_password"]');
hidePasswordElement = $('button[data-automation-id="hide_password"]'); hidePasswordElement = $('button[data-automation-id="hide_password"]');
@ -46,7 +40,6 @@ export class LoginShellPage {
register = $('#adf-login-action-right'); register = $('#adf-login-action-right');
footerSwitch = $('#switch4'); footerSwitch = $('#switch4');
rememberMeSwitch = $('#adf-toggle-show-rememberme'); rememberMeSwitch = $('#adf-toggle-show-rememberme');
successRouteSwitch = $('#adf-toggle-show-successRoute');
logoSwitch = $('#adf-toggle-logo'); logoSwitch = $('#adf-toggle-logo');
header = $('#adf-header'); header = $('#adf-header');
settingsIcon = element(by.cssContainingText('a[data-automation-id="settings"] mat-icon', 'settings')); settingsIcon = element(by.cssContainingText('a[data-automation-id="settings"] mat-icon', 'settings'));
@ -84,18 +77,6 @@ export class LoginShellPage {
return BrowserActions.getText(this.usernameError); return BrowserActions.getText(this.usernameError);
} }
async getPasswordTooltip(): Promise<string> {
return BrowserActions.getText(this.passwordError);
}
async getLoginError(): Promise<string> {
return BrowserActions.getText(this.loginError);
}
async checkLoginErrorIsDisplayed(loginError: string): Promise<void> {
await BrowserVisibility.waitUntilElementHasText(this.loginError, loginError);
}
async checkLoginImgURL(): Promise<string> { async checkLoginImgURL(): Promise<string> {
return BrowserActions.getAttribute(this.logoImg, 'src'); return BrowserActions.getAttribute(this.logoImg, 'src');
} }
@ -104,29 +85,15 @@ export class LoginShellPage {
await BrowserVisibility.waitUntilElementIsVisible(this.usernameInactive); await BrowserVisibility.waitUntilElementIsVisible(this.usernameInactive);
} }
async checkPasswordInactive(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.passwordInactive);
}
async checkUsernameHighlighted(): Promise<void> { async checkUsernameHighlighted(): Promise<void> {
await BrowserActions.click(this.adfLogo); await BrowserActions.click(this.adfLogo);
await BrowserVisibility.waitUntilElementIsVisible(this.usernameHighlighted); await BrowserVisibility.waitUntilElementIsVisible(this.usernameHighlighted);
} }
async checkPasswordHighlighted(): Promise<void> {
await BrowserActions.click(this.adfLogo);
await browser.sleep(900000);
await BrowserVisibility.waitUntilElementIsVisible(this.passwordHighlighted);
}
async checkUsernameTooltipIsNotVisible(): Promise<void> { async checkUsernameTooltipIsNotVisible(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.usernameError); await BrowserVisibility.waitUntilElementIsNotVisible(this.usernameError);
} }
async checkPasswordTooltipIsNotVisible(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.passwordError);
}
async getSignInButtonIsEnabled(): Promise<boolean> { async getSignInButtonIsEnabled(): Promise<boolean> {
return this.signInButton.isEnabled(); return this.signInButton.isEnabled();
} }
@ -191,18 +158,10 @@ export class LoginShellPage {
await this.togglePage.disableToggle(this.rememberMeSwitch); await this.togglePage.disableToggle(this.rememberMeSwitch);
} }
async enableSuccessRouteSwitch(): Promise<void> {
await this.togglePage.enableToggle(this.successRouteSwitch);
}
async enableLogoSwitch(): Promise<void> { async enableLogoSwitch(): Promise<void> {
await this.togglePage.enableToggle(this.logoSwitch); await this.togglePage.enableToggle(this.logoSwitch);
} }
async enterSuccessRoute(route: string): Promise<void> {
await BrowserActions.clearSendKeys(this.successRouteTxt, route);
}
async enterLogo(logo: string): Promise<void> { async enterLogo(logo: string): Promise<void> {
await BrowserActions.clearSendKeys(this.logoTxt, logo); await BrowserActions.clearSendKeys(this.logoTxt, logo);
} }

View File

@ -20,21 +20,12 @@ import { $, browser, ElementFinder } from 'protractor';
import { ProcessServicesPage } from '../../process-services/pages/process-services.page'; import { ProcessServicesPage } from '../../process-services/pages/process-services.page';
export class NavigationBarPage { export class NavigationBarPage {
linkListContainer = $('.app-sidenav-linklist');
linkMenuChildrenContainer = $('.nestedMenu'); linkMenuChildrenContainer = $('.nestedMenu');
dataTableNestedButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Datatable"]'); dataTableNestedButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Datatable"]');
dataTableCopyContentButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Copy Content"]');
dataTableDragAndDropButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Drag and Drop"]'); dataTableDragAndDropButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Drag and Drop"]');
processServicesNestedButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="App"]'); processServicesNestedButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="App"]');
processServicesCloudHomeButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Home"]'); processServicesCloudHomeButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Home"]');
themeButton = $('button[data-automation-id="theme menu"]');
themeMenuContent = $('div[class*="mat-menu-panel"]');
appTitle = $('.adf-app-title');
menuButton = $('button[data-automation-id="adf-menu-icon"]');
formButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Form"]'); formButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Form"]');
peopleGroupCloudButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="People/Group Cloud"]');
serviceTaskListButton = this.linkMenuChildrenContainer.$('.app-sidenav-link[data-automation-id="Service Task List"]');
logoutSection = $('div[data-automation-id="adf-logout-section"]'); logoutSection = $('div[data-automation-id="adf-logout-section"]');
personalFiles = $('div [title="Personal Files"]'); personalFiles = $('div [title="Personal Files"]');
@ -61,10 +52,6 @@ export class NavigationBarPage {
await this.clickNavigationBarItem('Content Services', this.personalFiles); await this.clickNavigationBarItem('Content Services', this.personalFiles);
} }
async clickHeaderDataButton(): Promise<void> {
await this.clickNavigationBarItem('Header Data');
}
async clickTaskListButton(): Promise<void> { async clickTaskListButton(): Promise<void> {
await this.clickNavigationBarItem('Task List'); await this.clickNavigationBarItem('Task List');
} }
@ -87,18 +74,6 @@ export class NavigationBarPage {
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer); await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
} }
async navigateToPeopleGroupCloudPage(): Promise<void> {
await this.clickProcessCloudButton();
await BrowserActions.click(this.peopleGroupCloudButton);
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
}
async navigateToServiceTaskListCloudPage(): Promise<void> {
await this.clickProcessCloudButton();
await BrowserActions.click(this.serviceTaskListButton);
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
}
private async clickProcessServicesButton() { private async clickProcessServicesButton() {
await BrowserActions.closeMenuAndDialogs(); await BrowserActions.closeMenuAndDialogs();
await BrowserActions.clickUntilIsNotVisible(this.getMenuItemLocator('Process Services'), this.linkMenuChildrenContainer); await BrowserActions.clickUntilIsNotVisible(this.getMenuItemLocator('Process Services'), this.linkMenuChildrenContainer);
@ -117,10 +92,6 @@ export class NavigationBarPage {
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer); await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
} }
async clickLoginButton(): Promise<void> {
await this.clickNavigationBarItem('Login');
}
async clickTrashcanButton(): Promise<void> { async clickTrashcanButton(): Promise<void> {
await this.clickNavigationBarItem('Trashcan'); await this.clickNavigationBarItem('Trashcan');
} }
@ -146,12 +117,6 @@ export class NavigationBarPage {
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer); await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
} }
async navigateToCopyContentDatatable(): Promise<void> {
await this.clickDataTable();
await BrowserActions.click(this.dataTableCopyContentButton);
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
}
async clickTagButton(): Promise<void> { async clickTagButton(): Promise<void> {
await this.clickNavigationBarItem('Tag'); await this.clickNavigationBarItem('Tag');
} }
@ -160,14 +125,6 @@ export class NavigationBarPage {
await this.clickNavigationBarItem('Social'); await this.clickNavigationBarItem('Social');
} }
async clickSettingsButton(): Promise<void> {
await this.clickNavigationBarItem('Settings');
}
async clickConfigEditorButton(): Promise<void> {
await this.clickNavigationBarItem('Configuration Editor');
}
async clickOverlayViewerButton(): Promise<void> { async clickOverlayViewerButton(): Promise<void> {
await this.clickNavigationBarItem('Overlay Viewer'); await this.clickNavigationBarItem('Overlay Viewer');
} }
@ -176,14 +133,6 @@ export class NavigationBarPage {
await this.clickNavigationBarItem('Tree View'); await this.clickNavigationBarItem('Tree View');
} }
async clickIconsButton(): Promise<void> {
await this.clickNavigationBarItem('Icons');
}
async clickAboutButton(): Promise<void> {
await this.clickNavigationBarItem('About');
}
async clickLogoutButton(): Promise<void> { async clickLogoutButton(): Promise<void> {
Logger.log('Logout'); Logger.log('Logout');
try { try {
@ -196,58 +145,11 @@ export class NavigationBarPage {
} }
} }
async clickThemeButton(): Promise<void> {
await BrowserActions.closeMenuAndDialogs();
await BrowserActions.click(this.themeButton);
await BrowserVisibility.waitUntilElementIsVisible(this.themeMenuContent);
}
async clickOnSpecificThemeButton(themeName): Promise<void> {
const themeElement = $(`button[data-automation-id="${themeName}"]`);
await BrowserActions.click(themeElement);
await BrowserVisibility.waitUntilElementIsNotPresent(this.linkMenuChildrenContainer);
}
async openContentServicesFolder(folderId): Promise<void> { async openContentServicesFolder(folderId): Promise<void> {
await BrowserActions.getUrl(`${browser.baseUrl}/files/${folderId}`); await BrowserActions.getUrl(`${browser.baseUrl}/files/${folderId}`);
} }
async checkMenuButtonIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.menuButton);
}
async checkMenuButtonIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.menuButton);
}
async checkToolbarColor(color: string): Promise<void> {
const toolbarColor = $(`mat-toolbar[class*="mat-${color}"]`);
await BrowserVisibility.waitUntilElementIsVisible(toolbarColor);
}
async clickAppLogo(logoTitle: string): Promise<void> {
const appLogo = $('a[title="' + logoTitle + '"]');
await BrowserActions.click(appLogo);
}
async clickAppLogoText(): Promise<void> {
await BrowserActions.click(this.appTitle);
}
async checkLogoTooltip(logoTooltipTitle: string): Promise<void> {
const logoTooltip = $('a[title="' + logoTooltipTitle + '"]');
await BrowserVisibility.waitUntilElementIsVisible(logoTooltip);
}
async openViewer(nodeId: string): Promise<void> {
await BrowserActions.getUrl(browser.baseUrl + `/files(overlay:files/${nodeId}/view`);
}
async goToSite(site): Promise<void> { async goToSite(site): Promise<void> {
await BrowserActions.getUrl(browser.baseUrl + `/files/${site.entry.guid}/display/list`); await BrowserActions.getUrl(browser.baseUrl + `/files/${site.entry.guid}/display/list`);
} }
async scrollTo(el: ElementFinder): Promise<void> {
await browser.executeScript(`return arguments[0].scrollTop = arguments[1].offsetTop`, this.linkListContainer.getWebElement(), el.getWebElement());
}
} }

View File

@ -16,11 +16,11 @@
*/ */
import { BrowserActions, BrowserVisibility, EditProcessFilterCloudComponentPage, ProcessFiltersCloudComponentPage, ProcessListCloudComponentPage } from '@alfresco/adf-testing'; import { BrowserActions, BrowserVisibility, EditProcessFilterCloudComponentPage, ProcessFiltersCloudComponentPage, ProcessListCloudComponentPage } from '@alfresco/adf-testing';
import { by, element, $ } from 'protractor'; import { $ } from 'protractor';
export class ProcessCloudDemoPage { export class ProcessCloudDemoPage {
createButton = $('button[data-automation-id="create-button"'); createButton = $('button[data-automation-id="create-button"]');
newProcessButton = $('button[data-automation-id="btn-start-process"]'); newProcessButton = $('button[data-automation-id="btn-start-process"]');
processListCloud = new ProcessListCloudComponentPage(); processListCloud = new ProcessListCloudComponentPage();
@ -35,10 +35,6 @@ export class ProcessCloudDemoPage {
return this.processListCloud; return this.processListCloud;
} }
getAllRowsByIdColumn(): Promise<any> {
return this.processListCloud.getAllRowsByColumn('Id');
}
async openNewProcessForm(): Promise<void> { async openNewProcessForm(): Promise<void> {
await this.clickOnCreateButton(); await this.clickOnCreateButton();
await this.newProcessButtonIsDisplayed(); await this.newProcessButtonIsDisplayed();
@ -52,11 +48,4 @@ export class ProcessCloudDemoPage {
async clickOnCreateButton(): Promise<void> { async clickOnCreateButton(): Promise<void> {
await BrowserActions.click(this.createButton); await BrowserActions.click(this.createButton);
} }
async checkActionExecuted(processInstanceId: string, action: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText(`span`, 'Action Menu:')));
await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText(`span`, 'Context Menu:')));
await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText(`span`, 'Process Instance ID: ' + processInstanceId)));
await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText(`span`, 'Action Type: ' + action)));
}
} }

View File

@ -17,12 +17,10 @@
import CONSTANTS = require('../../util/constants'); import CONSTANTS = require('../../util/constants');
import { createApiService, import { createApiService,
ApplicationsUtil, BrowserActions, ApplicationsUtil,
FileBrowserUtil, FileBrowserUtil,
LocalStorageUtil,
LoginPage, ModelsActions, LoginPage, ModelsActions,
ProcessInstanceTasksPage, ProcessInstanceTasksPage,
SelectAppsDialog,
StartProcessPage, StartProcessPage,
StringUtil, StringUtil,
UserModel, UserModel,
@ -37,8 +35,6 @@ import { ProcessDetailsPage } from './../pages/process-details.page';
import { ProcessFiltersPage } from './../pages/process-filters.page'; import { ProcessFiltersPage } from './../pages/process-filters.page';
import { ProcessServicesPage } from './../pages/process-services.page'; import { ProcessServicesPage } from './../pages/process-services.page';
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page'; import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
import { ContentServicesPage } from '../../core/pages/content-services.page';
import { UploadDialogPage } from '../../core/pages/dialog/upload-dialog.page';
import { ProcessInstancesApi } from '@alfresco/js-api'; import { ProcessInstancesApi } from '@alfresco/js-api';
describe('Start Process Component', () => { describe('Start Process Component', () => {
@ -46,7 +42,6 @@ describe('Start Process Component', () => {
const app = browser.params.resources.Files.APP_WITH_PROCESSES; const app = browser.params.resources.Files.APP_WITH_PROCESSES;
const simpleApp = browser.params.resources.Files.WIDGETS_SMOKE_TEST; const simpleApp = browser.params.resources.Files.WIDGETS_SMOKE_TEST;
const dateFormApp = browser.params.resources.Files.APP_WITH_DATE_FIELD_FORM; const dateFormApp = browser.params.resources.Files.APP_WITH_DATE_FIELD_FORM;
const startProcessAttachFileApp = browser.params.resources.Files.START_PROCESS_ATTACH_FILE;
const loginPage = new LoginPage(); const loginPage = new LoginPage();
const navigationBarPage = new NavigationBarPage(); const navigationBarPage = new NavigationBarPage();
@ -57,8 +52,6 @@ describe('Start Process Component', () => {
const processDetailsPage = new ProcessDetailsPage(); const processDetailsPage = new ProcessDetailsPage();
const attachmentListPage = new AttachmentListPage(); const attachmentListPage = new AttachmentListPage();
const processInstanceTasksPage = new ProcessInstanceTasksPage(); const processInstanceTasksPage = new ProcessInstanceTasksPage();
const contentServicesPage = new ContentServicesPage();
const selectAppsDialog = new SelectAppsDialog();
const widget = new Widget(); const widget = new Widget();
const apiService = createApiService(); const apiService = createApiService();
@ -471,70 +464,4 @@ describe('Start Process Component', () => {
}); });
}); });
}); });
describe('Provider: ALL', () => {
const uploadDialog = new UploadDialogPage();
let processUserModel;
const imageUploaded = new FileModel({
name: browser.params.resources.Files.PROFILE_IMAGES.ECM.file_name,
location: browser.params.resources.Files.PROFILE_IMAGES.ECM.file_location
});
beforeAll(async () => {
const apiServiceAll = createApiService({
provider: 'ALL',
hostEcm: browser.params.testConfig.appConfig.ecmHost,
hostBpm: browser.params.testConfig.appConfig.bpmHost
});
const usersActionsAll = new UsersActions(apiServiceAll);
await apiServiceAll.login(browser.params.testConfig.users.admin.username, browser.params.testConfig.users.admin.password);
processUserModel = await usersActionsAll.createUser();
const alfrescoJsBPMAdminUser = createApiService({ hostBpm: browser.params.testConfig.appConfig.bpmHost });
await alfrescoJsBPMAdminUser.login(processUserModel.username, processUserModel.password);
const applicationsService = new ApplicationsUtil(alfrescoJsBPMAdminUser);
await applicationsService.importPublishDeployApp(startProcessAttachFileApp.file_path);
});
it('[C260490] Should be able to start a Process within ACS', async () => {
await BrowserActions.getUrl(`${browser.baseUrl}/settings`);
await LocalStorageUtil.setStorageItem('providers', 'ALL');
await loginPage.login(processUserModel.username, processUserModel.password);
await contentServicesPage.goToDocumentList();
await contentServicesPage.uploadFile(imageUploaded.location);
await contentServicesPage.checkContentIsDisplayed(imageUploaded.name);
await uploadDialog.clickOnCloseButton();
await uploadDialog.dialogIsNotDisplayed();
await contentServicesPage.checkContentIsDisplayed(imageUploaded.name);
await contentServicesPage.getDocumentList().rightClickOnRow(imageUploaded.name);
await contentServicesPage.checkContextActionIsVisible('Start Process');
await contentServicesPage.pressContextMenuActionNamed('Start Process');
await selectAppsDialog.checkSelectAppsDialogIsDisplayed();
await selectAppsDialog.selectApp('start process app');
await selectAppsDialog.clickContinueButton();
await startProcessPage.enterProcessName('Test Process');
await attachmentListPage.checkFileIsAttached(imageUploaded.name);
await startProcessPage.clickFormStartProcessButton();
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await processServicesPage.goToApp(startProcessAttachFileApp.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCompletedFilterButton();
await processFiltersPage.selectFromProcessList('Test Process');
await expect(await processDetailsPage.auditLogEmptyListMessage.getText()).toBe('This list is empty');
});
});
}); });

View File

@ -209,8 +209,8 @@ describe('Search Sorting Picker', () => {
const nodeList = await getNodesDisplayed(numberOfElements, idList); const nodeList = await getNodesDisplayed(numberOfElements, idList);
const modifiedDateList = []; const modifiedDateList = [];
for (let i = 0; i < nodeList.length; i++) { for (const item of nodeList) {
modifiedDateList.push(new Date(nodeList[i].entry.modifiedAt)); modifiedDateList.push(new Date(item.entry.modifiedAt));
} }
await expect(contentServices.checkElementsDateSortedAsc(modifiedDateList)).toBe(true); await expect(contentServices.checkElementsDateSortedAsc(modifiedDateList)).toBe(true);
@ -218,14 +218,12 @@ describe('Search Sorting Picker', () => {
const getNodesDisplayed = async function(numberOfElements: number, idList: string[]) { const getNodesDisplayed = async function(numberOfElements: number, idList: string[]) {
const promises = []; const promises = [];
let nodeList;
for (let i = 0; i < (numberOfElements - 1); i++) { for (let i = 0; i < (numberOfElements - 1); i++) {
if (idList[i] && idList[i].trim() !== '') { if (idList[i] && idList[i].trim() !== '') {
promises.push(nodesApi.getNode(idList[i])); promises.push(nodesApi.getNode(idList[i]));
} }
} }
nodeList = await Promise.all(promises); return Promise.all(promises);
return nodeList;
}; };
}); });

View File

@ -52,20 +52,18 @@ describe('Search component - Search Page', () => {
const acsUser = new UserModel(); const acsUser = new UserModel();
const emptyFolderModel = new FolderModel({ name: 'search' + StringUtil.generateRandomString() }); const emptyFolderModel = new FolderModel({ name: 'search' + StringUtil.generateRandomString() });
let firstFileModel;
const newFolderModel = new FolderModel(); const newFolderModel = new FolderModel();
let fileNames = [];
const nrOfFiles = 15;
const adminNrOfFiles = 5;
beforeAll(async () => { beforeAll(async () => {
fileNames = StringUtil.generateFilesNames(1, nrOfFiles, search.active.base, search.active.extension); const nrOfFiles = 15;
const adminNrOfFiles = 5;
const fileNames = StringUtil.generateFilesNames(1, nrOfFiles, search.active.base, search.active.extension);
const adminFileNames = StringUtil.generateFilesNames(nrOfFiles + 1, nrOfFiles + adminNrOfFiles, search.active.base, search.active.extension); const adminFileNames = StringUtil.generateFilesNames(nrOfFiles + 1, nrOfFiles + adminNrOfFiles, search.active.base, search.active.extension);
search.active.firstFile = fileNames[0]; search.active.firstFile = fileNames[0];
search.active.secondFile = fileNames[1]; search.active.secondFile = fileNames[1];
fileNames.splice(0, 1); fileNames.splice(0, 1);
firstFileModel = new FileModel({ const firstFileModel = new FileModel({
name: search.active.firstFile, name: search.active.firstFile,
location: browser.params.resources.Files.ADF_DOCUMENTS.TXT.file_path location: browser.params.resources.Files.ADF_DOCUMENTS.TXT.file_path
}); });

View File

@ -353,7 +353,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
private layoutPresets = {}; private layoutPresets = {};
private rowMenuCache: { [key: string]: ContentActionModel[] } = {}; private rowMenuCache: { [key: string]: ContentActionModel[] } = {};
private loadingTimeout; private loadingTimeout: any;
private onDestroy$ = new Subject<boolean>(); private onDestroy$ = new Subject<boolean>();
private _nodesApi: NodesApi; private _nodesApi: NodesApi;