mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[ADF-3442] create library dialog (#4018)
* library dialog * integrate with demo shell * update resources * fix license * auto focus for the first input * update e2e tests * try close the dialog between tests * fix afterEach * Revert "try close the dialog between tests" This reverts commit 63464f2b03c226c606d09b18c7d2782e3bb52c0a. * update code due to css lint issues * csslint settings for vs code * missing import lint fix remove not used import convert errorPage js to ts convert tasklistpage js to ts fix redirection creation folder in root fix lint issue fix e2e * e2e fix * fix PS tests * navigation import * fix tests tooltip convert paginapage to ts * fix lint * fix lock files e2e filterspage to ts * fix lint * fix cs cre git dept 3 and not 50 as default in travis * quiet log git download * add some delay and change the delete lock * fix node entry * convert searchDialog to typescript parallel protractor * disable browser execute * restote test * change search tests * move search in a separate e2e folder * experiment fix e2e * change util presence change protractor conf * fix unshare test * improve query viewerPage using css over xpath * waitForAngularEnabled before browser redirect * convert util to ts and more * convert other files to ts * convert to ts other files * trigger build * function fixes use arrow function * process service fixes * lint fix review timeout default * fix failing tests * restore timeout * share dialog fix * remove * use configuration admin * fix APS 2 login sso
This commit is contained in:
committed by
Eugenio Romano
parent
9fd564a78e
commit
058d23d57f
+17
-5
@@ -1,3 +1,6 @@
|
|||||||
|
git:
|
||||||
|
depth: 3
|
||||||
|
quiet: true
|
||||||
language: node_js
|
language: node_js
|
||||||
dist: trusty
|
dist: trusty
|
||||||
sudo: required
|
sudo: required
|
||||||
@@ -128,7 +131,7 @@ jobs:
|
|||||||
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
|
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
|
||||||
if [[ $AFFECTED_LIBS =~ "core$" || $AFFECTED_E2E = "e2e" ]];
|
if [[ $AFFECTED_LIBS =~ "core$" || $AFFECTED_E2E = "e2e" ]];
|
||||||
then
|
then
|
||||||
(./scripts/test-e2e-lib.sh -host localhost:4200 --host_sso "$E2E_HOST_SSO" -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder core --skip-lint --use-dist --timeout 7000 || exit 1;);
|
(./scripts/test-e2e-lib.sh -host localhost:4200 --host_sso "$E2E_HOST_SSO" -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder core --skip-lint --use-dist || exit 1;);
|
||||||
fi
|
fi
|
||||||
- stage: e2e Test # Test process-services
|
- stage: e2e Test # Test process-services
|
||||||
name: process-services
|
name: process-services
|
||||||
@@ -137,7 +140,7 @@ jobs:
|
|||||||
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
|
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
|
||||||
if [[ $AFFECTED_LIBS =~ "process-services$" || $AFFECTED_E2E = "e2e" ]];
|
if [[ $AFFECTED_LIBS =~ "process-services$" || $AFFECTED_E2E = "e2e" ]];
|
||||||
then
|
then
|
||||||
(./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder process-services --skip-lint --use-dist --timeout 7000 || exit 1;);
|
(./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder process-services --skip-lint --use-dist || exit 1;);
|
||||||
fi
|
fi
|
||||||
- stage: e2e Test # Test content-services
|
- stage: e2e Test # Test content-services
|
||||||
name: content-services
|
name: content-services
|
||||||
@@ -146,7 +149,16 @@ jobs:
|
|||||||
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
|
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
|
||||||
if [[ $AFFECTED_LIBS =~ "content-services$" || $AFFECTED_E2E = "e2e" ]];
|
if [[ $AFFECTED_LIBS =~ "content-services$" || $AFFECTED_E2E = "e2e" ]];
|
||||||
then
|
then
|
||||||
(./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder content-services --skip-lint --use-dist --timeout 7000 || exit 1;);
|
(./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder content-services --skip-lint --use-dist || exit 1;);
|
||||||
|
fi
|
||||||
|
- stage: e2e Test # Test search
|
||||||
|
name: search
|
||||||
|
script:
|
||||||
|
AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e")";
|
||||||
|
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
|
||||||
|
if [[ $AFFECTED_LIBS =~ "content-services$" || $AFFECTED_E2E = "e2e" ]];
|
||||||
|
then
|
||||||
|
(./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder search --skip-lint --use-dist || exit 1;);
|
||||||
fi
|
fi
|
||||||
- stage: e2e Test # Test process-services-cloud
|
- stage: e2e Test # Test process-services-cloud
|
||||||
name: process-services-cloud
|
name: process-services-cloud
|
||||||
@@ -155,7 +167,7 @@ jobs:
|
|||||||
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
|
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
|
||||||
if [[ $AFFECTED_LIBS =~ "process-services-cloud$" || $AFFECTED_E2E = "e2e" ]];
|
if [[ $AFFECTED_LIBS =~ "process-services-cloud$" || $AFFECTED_E2E = "e2e" ]];
|
||||||
then
|
then
|
||||||
(./scripts/test-e2e-lib.sh -host localhost:4200 --host_sso "$E2E_HOST_SSO" -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder process-services-cloud --skip-lint --use-dist --timeout 7000 || exit 1;);
|
(./scripts/test-e2e-lib.sh -host localhost:4200 --host_sso "$E2E_HOST_SSO" -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder process-services-cloud --skip-lint --use-dist || exit 1;);
|
||||||
fi
|
fi
|
||||||
- stage: e2e Test # Test insights
|
- stage: e2e Test # Test insights
|
||||||
name: insights
|
name: insights
|
||||||
@@ -164,7 +176,7 @@ jobs:
|
|||||||
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
|
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
|
||||||
if [[ $AFFECTED_LIBS =~ "process-services-cloud$" || $AFFECTED_E2E = "e2e" ]];
|
if [[ $AFFECTED_LIBS =~ "process-services-cloud$" || $AFFECTED_E2E = "e2e" ]];
|
||||||
then
|
then
|
||||||
(./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder insights --skip-lint --use-dist --timeout 7000 || exit 1;);
|
(./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder insights --skip-lint --use-dist || exit 1;);
|
||||||
fi
|
fi
|
||||||
- stage: Create Docker PR
|
- stage: Create Docker PR
|
||||||
script: (./scripts/pr-publish.sh -n $TRAVIS_BUILD_NUMBER -r $REPO_DOCKER -u $USERNAME_DOCKER -p $PASSWORD_DOCKER || exit 1)
|
script: (./scripts/pr-publish.sh -n $TRAVIS_BUILD_NUMBER -r $REPO_DOCKER -u $USERNAME_DOCKER -p $PASSWORD_DOCKER || exit 1)
|
||||||
|
|||||||
Vendored
+6
-1
@@ -19,5 +19,10 @@
|
|||||||
"MD033": false,
|
"MD033": false,
|
||||||
"MD031": false
|
"MD031": false
|
||||||
},
|
},
|
||||||
"cSpell.words": ["mincount", "webscript"]
|
"stylelint.enable": true,
|
||||||
|
"css.validate": false,
|
||||||
|
"scss.validate": false,
|
||||||
|
"stylelint.config": {
|
||||||
|
"extends": "./stylelint-config"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"APP": {
|
"APP": {
|
||||||
|
"CREATE_LIBRARY": "Create Library",
|
||||||
"INFO_DRAWER": {
|
"INFO_DRAWER": {
|
||||||
"TITLE": "Details",
|
"TITLE": "Details",
|
||||||
"COMMENTS": "Comments",
|
"COMMENTS": "Comments",
|
||||||
@@ -146,6 +147,7 @@
|
|||||||
},
|
},
|
||||||
"ACTIONS": {
|
"ACTIONS": {
|
||||||
"VERSIONS": "Manage versions",
|
"VERSIONS": "Manage versions",
|
||||||
|
"LOCK": "Lock",
|
||||||
"METADATA": "Info",
|
"METADATA": "Info",
|
||||||
"DOWNLOAD": "Download",
|
"DOWNLOAD": "Download",
|
||||||
"PERMISSION": "Permission",
|
"PERMISSION": "Permission",
|
||||||
|
|||||||
@@ -54,12 +54,13 @@ export class ConfigEditorComponent {
|
|||||||
this.invalidJson = true;
|
this.invalidJson = true;
|
||||||
this.notificationService.openSnackMessage(
|
this.notificationService.openSnackMessage(
|
||||||
'Wrong Code configuration ' + error,
|
'Wrong Code configuration ' + error,
|
||||||
4000
|
1000
|
||||||
);
|
);
|
||||||
} finally {
|
} finally {
|
||||||
if (!this.invalidJson) {
|
if (!this.invalidJson) {
|
||||||
this.notificationService.openSnackMessage(
|
this.notificationService.openSnackMessage(
|
||||||
'Saved'
|
'Saved',
|
||||||
|
1000
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,6 +75,7 @@
|
|||||||
<mat-icon *ngIf="displayMode === 'gallery'" matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.LISTVIEW' | translate }}">list</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"
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
[disabled]="!canCreateContent(documentList.folderNode)"
|
[disabled]="!canCreateContent(documentList.folderNode)"
|
||||||
title="{{ 'DOCUMENT_LIST.TOOLBAR.NEW_FOLDER' | translate }}"
|
title="{{ 'DOCUMENT_LIST.TOOLBAR.NEW_FOLDER' | translate }}"
|
||||||
@@ -84,6 +85,12 @@
|
|||||||
matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.NEW_FOLDER' | translate }}">
|
matTooltip="{{ 'DOCUMENT_LIST.TOOLBAR.NEW_FOLDER' | translate }}">
|
||||||
<mat-icon>create_new_folder</mat-icon>
|
<mat-icon>create_new_folder</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
mat-icon-button
|
||||||
|
matTooltip="{{ 'APP.CREATE_LIBRARY' | translate }}"
|
||||||
|
(click)="createLibrary()">
|
||||||
|
<mat-icon>library_add</mat-icon>
|
||||||
|
</button>
|
||||||
<button mat-icon-button
|
<button mat-icon-button
|
||||||
[disabled]="!canEditFolder(documentList.selection)"
|
[disabled]="!canEditFolder(documentList.selection)"
|
||||||
title="{{ 'DOCUMENT_LIST.TOOLBAR.EDIT_FOLDER' | translate }}"
|
title="{{ 'DOCUMENT_LIST.TOOLBAR.EDIT_FOLDER' | translate }}"
|
||||||
@@ -372,7 +379,6 @@
|
|||||||
target="document"
|
target="document"
|
||||||
*ngIf="authenticationService.isBpmLoggedIn()"
|
*ngIf="authenticationService.isBpmLoggedIn()"
|
||||||
icon="play_arrow"
|
icon="play_arrow"
|
||||||
target="document"
|
|
||||||
title="DOCUMENT_LIST.ACTIONS.DOCUMENT.PROCESS_ACTION"
|
title="DOCUMENT_LIST.ACTIONS.DOCUMENT.PROCESS_ACTION"
|
||||||
(execute)="startProcessAction($event)">
|
(execute)="startProcessAction($event)">
|
||||||
</content-action>
|
</content-action>
|
||||||
@@ -381,7 +387,7 @@
|
|||||||
icon="lock"
|
icon="lock"
|
||||||
permission="lock"
|
permission="lock"
|
||||||
handler="lock"
|
handler="lock"
|
||||||
title="Lock">
|
title="DOCUMENT_LIST.ACTIONS.LOCK">
|
||||||
</content-action>
|
</content-action>
|
||||||
</content-actions>
|
</content-actions>
|
||||||
</adf-document-list>
|
</adf-document-list>
|
||||||
|
|||||||
@@ -35,7 +35,8 @@ import {
|
|||||||
DocumentListComponent,
|
DocumentListComponent,
|
||||||
PermissionStyleModel,
|
PermissionStyleModel,
|
||||||
UploadFilesEvent,
|
UploadFilesEvent,
|
||||||
ConfirmDialogComponent
|
ConfirmDialogComponent,
|
||||||
|
LibraryDialogComponent
|
||||||
} from '@alfresco/adf-content-services';
|
} from '@alfresco/adf-content-services';
|
||||||
|
|
||||||
import { SelectAppsDialogComponent } from '@alfresco/adf-process-services';
|
import { SelectAppsDialogComponent } from '@alfresco/adf-process-services';
|
||||||
@@ -346,7 +347,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
|||||||
openSnackMessage(event: any) {
|
openSnackMessage(event: any) {
|
||||||
this.notificationService.openSnackMessage(
|
this.notificationService.openSnackMessage(
|
||||||
event,
|
event,
|
||||||
6000
|
4000
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -572,4 +573,17 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
|||||||
getFileFiltering() {
|
getFileFiltering() {
|
||||||
return this.acceptedFilesTypeShow ? this.acceptedFilesType : '*';
|
return this.acceptedFilesTypeShow ? this.acceptedFilesType : '*';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
createLibrary() {
|
||||||
|
const dialogInstance: any = this.dialog.open(LibraryDialogComponent, {
|
||||||
|
width: '400px'
|
||||||
|
});
|
||||||
|
|
||||||
|
dialogInstance.componentInstance.error.subscribe((message) => {
|
||||||
|
this.notificationService.openSnackMessage(
|
||||||
|
message,
|
||||||
|
6000
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ export class FormComponent implements OnInit, OnDestroy {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.notificationService.openSnackMessage(
|
this.notificationService.openSnackMessage(
|
||||||
'Wrong form configuration',
|
'Wrong form configuration',
|
||||||
2000
|
4000
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -270,8 +270,7 @@
|
|||||||
</mat-slide-toggle>
|
</mat-slide-toggle>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<mat-slide-toggle id="adf-show-header" (change)="toggleHeaderContent()"
|
<mat-slide-toggle id="adf-show-header" (change)="toggleHeaderContent()" [checked]="showHeaderContent">{{ 'PS-TAB.TASK-SHOW-HEADER'| translate }}
|
||||||
[checked]="showHeaderContent">{{ 'PS-TAB.TASK-SHOW-HEADER'| translate }}
|
|
||||||
</mat-slide-toggle>
|
</mat-slide-toggle>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<adf-search-control [highlight]="true"
|
<adf-search-control
|
||||||
|
[highlight]="true"
|
||||||
(optionClicked)="onItemClicked($event)"
|
(optionClicked)="onItemClicked($event)"
|
||||||
(submit)="onSearchSubmit($event)">
|
(submit)="onSearchSubmit($event)">
|
||||||
<!-- <adf-empty-search-result>
|
<!-- <adf-empty-search-result>
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
var Util = require('../../util/util');var Util = require('../../util/util');
|
||||||
@@ -15,8 +15,8 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Tenant = require('../models/APS/Tenant');
|
import { Tenant } from '../models/APS/Tenant';
|
||||||
import User = require('../models/APS/User');
|
import { User } from '../models/APS/User';
|
||||||
import TestConfig = require('../test.config');
|
import TestConfig = require('../test.config');
|
||||||
import path = require('path');
|
import path = require('path');
|
||||||
import fs = require('fs');
|
import fs = require('fs');
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
|||||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||||
import { CommentsPage } from '../../pages/adf/commentsPage';
|
import { CommentsPage } from '../../pages/adf/commentsPage';
|
||||||
|
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
import FileModel = require('../../models/ACS/fileModel');
|
import { FileModel } from '../../models/ACS/fileModel';
|
||||||
|
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import resources = require('../../util/resources');
|
import resources = require('../../util/resources');
|
||||||
|
|||||||
@@ -17,18 +17,15 @@
|
|||||||
|
|
||||||
import { LoginPage } from '../../pages/adf/loginPage';
|
import { LoginPage } from '../../pages/adf/loginPage';
|
||||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||||
import CreateFolderDialog = require('../../pages/adf/dialog/createFolderDialog');
|
import { CreateFolderDialog } from '../../pages/adf/dialog/createFolderDialog';
|
||||||
import { NotificationPage } from '../../pages/adf/notificationPage';
|
import { NotificationPage } from '../../pages/adf/notificationPage';
|
||||||
import MetadataViewPage = require('../../pages/adf/metadataViewPage');
|
import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
|
||||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
import { ContentListPage } from '../../pages/adf/dialog/contentListPage';
|
||||||
|
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
|
||||||
|
|
||||||
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
|
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
|
import { browser, Key } from 'protractor';
|
||||||
import { browser, protractor } from 'protractor';
|
|
||||||
|
|
||||||
describe('Create folder directive', function () {
|
describe('Create folder directive', function () {
|
||||||
|
|
||||||
@@ -58,8 +55,14 @@ describe('Create folder directive', function () {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
beforeEach(async (done) => {
|
||||||
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
await browser.actions().sendKeys(Key.ESCAPE).perform();
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(async (done) => {
|
||||||
|
await browser.actions().sendKeys(Key.ESCAPE).perform();
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('[C260154] Should not create the folder if cancel button is clicked', () => {
|
it('[C260154] Should not create the folder if cancel button is clicked', () => {
|
||||||
@@ -125,13 +128,24 @@ describe('Create folder directive', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('[C260159] Should not be possible create a folder with banned character', () => {
|
it('[C260159] Should not be possible create a folder with banned character', () => {
|
||||||
let bannedChar = ['* ', '<', '>', '\\', '/', '?', ':', '|'];
|
browser.refresh();
|
||||||
|
|
||||||
contentServicesPage.clickOnCreateNewFolder();
|
contentServicesPage.clickOnCreateNewFolder();
|
||||||
|
|
||||||
bannedChar.forEach((currentChar) => {
|
createFolderDialog.addFolderName('*');
|
||||||
createFolderDialog.addFolderName(currentChar);
|
createFolderDialog.checkCreateBtnIsDisabled();
|
||||||
createFolderDialog.checkCreateBtnIsDisabled();
|
createFolderDialog.addFolderName('<');
|
||||||
});
|
createFolderDialog.checkCreateBtnIsDisabled();
|
||||||
|
createFolderDialog.addFolderName('>');
|
||||||
|
createFolderDialog.checkCreateBtnIsDisabled();
|
||||||
|
createFolderDialog.addFolderName('\\');
|
||||||
|
createFolderDialog.checkCreateBtnIsDisabled();
|
||||||
|
createFolderDialog.addFolderName('/');
|
||||||
|
createFolderDialog.checkCreateBtnIsDisabled();
|
||||||
|
createFolderDialog.addFolderName('?');
|
||||||
|
createFolderDialog.checkCreateBtnIsDisabled();
|
||||||
|
createFolderDialog.addFolderName(':');
|
||||||
|
createFolderDialog.checkCreateBtnIsDisabled();
|
||||||
|
createFolderDialog.addFolderName('|');
|
||||||
|
createFolderDialog.checkCreateBtnIsDisabled();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -18,14 +18,14 @@
|
|||||||
import { browser } from 'protractor';
|
import { browser } from 'protractor';
|
||||||
import { LoginPage } from '../../pages/adf/loginPage';
|
import { LoginPage } from '../../pages/adf/loginPage';
|
||||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
import { ContentListPage } from '../../pages/adf/dialog/contentListPage';
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import resources = require('../../util/resources');
|
import resources = require('../../util/resources');
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||||
import FileModel = require('../../models/ACS/fileModel');
|
import { FileModel } from '../../models/ACS/fileModel';
|
||||||
import Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
|
|
||||||
describe('Document List Component - Actions', () => {
|
describe('Document List Component - Actions', () => {
|
||||||
|
|
||||||
|
|||||||
@@ -19,14 +19,14 @@ import { browser } from 'protractor';
|
|||||||
import { LoginPage } from '../../pages/adf/loginPage';
|
import { LoginPage } from '../../pages/adf/loginPage';
|
||||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import resources = require('../../util/resources');
|
import resources = require('../../util/resources');
|
||||||
import Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||||
import ErrorPage = require('../../pages/adf/errorPage');
|
import { ErrorPage } from '../../pages/adf/errorPage';
|
||||||
import FileModel = require('../../models/ACS/fileModel');
|
import { FileModel } from '../../models/ACS/fileModel';
|
||||||
import moment from 'moment-es6';
|
import moment from 'moment-es6';
|
||||||
|
|
||||||
describe('Document List Component', () => {
|
describe('Document List Component', () => {
|
||||||
@@ -75,7 +75,7 @@ describe('Document List Component', () => {
|
|||||||
acsUser = new AcsUserModel();
|
acsUser = new AcsUserModel();
|
||||||
let siteName = `PRIVATE_TEST_SITE_${Util.generateRandomString(5)}`;
|
let siteName = `PRIVATE_TEST_SITE_${Util.generateRandomString(5)}`;
|
||||||
let folderName = `MEESEEKS_${Util.generateRandomString(5)}`;
|
let folderName = `MEESEEKS_${Util.generateRandomString(5)}`;
|
||||||
let privateSiteBody = { visibility: 'PRIVATE' , title: siteName};
|
let privateSiteBody = { visibility: 'PRIVATE', title: siteName };
|
||||||
|
|
||||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ describe('Document List Component', () => {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async(done) => {
|
afterAll(async (done) => {
|
||||||
await this.alfrescoJsApi.core.sitesApi.deleteSite(privateSite.entry.id);
|
await this.alfrescoJsApi.core.sitesApi.deleteSite(privateSite.entry.id);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
@@ -303,7 +303,7 @@ describe('Document List Component', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('[C260121] Should show the spinner on content loading', async (done) => {
|
xit('[C260121] Should show the spinner on content loading', async (done) => {
|
||||||
acsUser = new AcsUserModel();
|
acsUser = new AcsUserModel();
|
||||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||||
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser);
|
||||||
@@ -511,17 +511,17 @@ describe('Document List Component', () => {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach( () => {
|
beforeEach(() => {
|
||||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||||
contentServicesPage.goToDocumentList();
|
contentServicesPage.goToDocumentList();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('[C260108] Should display tooltip for file\'s name', () => {
|
it('[C260108] Should display tooltip for file\'s name', () => {
|
||||||
expect(contentServicesPage.getTooltip(pdfFile.name)).toEqual(pdfFile.name);
|
expect(contentServicesPage.getContentList().getTooltip(pdfFile.name)).toEqual(pdfFile.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('[C260109] Should display tooltip for folder\'s name', () => {
|
it('[C260109] Should display tooltip for folder\'s name', () => {
|
||||||
expect(contentServicesPage.getTooltip(folderName)).toEqual(folderName);
|
expect(contentServicesPage.getContentList().getTooltip(folderName)).toEqual(folderName);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('[C260119] Should have a specific thumbnail for folders', async (done) => {
|
it('[C260119] Should have a specific thumbnail for folders', async (done) => {
|
||||||
@@ -560,7 +560,7 @@ describe('Document List Component', () => {
|
|||||||
describe('Gallery View', () => {
|
describe('Gallery View', () => {
|
||||||
|
|
||||||
let cardProperties = {
|
let cardProperties = {
|
||||||
DISPLAY_NAME : 'Display name',
|
DISPLAY_NAME: 'Display name',
|
||||||
SIZE: 'Size',
|
SIZE: 'Size',
|
||||||
LOCK: 'Lock',
|
LOCK: 'Lock',
|
||||||
CREATED_BY: 'Created by',
|
CREATED_BY: 'Created by',
|
||||||
@@ -600,7 +600,7 @@ describe('Document List Component', () => {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach( () => {
|
beforeEach(() => {
|
||||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||||
contentServicesPage.goToDocumentList();
|
contentServicesPage.goToDocumentList();
|
||||||
contentServicesPage.clickGridViewButton();
|
contentServicesPage.clickGridViewButton();
|
||||||
|
|||||||
@@ -17,14 +17,14 @@
|
|||||||
|
|
||||||
import { LoginPage } from '../../pages/adf/loginPage';
|
import { LoginPage } from '../../pages/adf/loginPage';
|
||||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||||
import PaginationPage = require('../../pages/adf/paginationPage');
|
import { PaginationPage } from '../../pages/adf/paginationPage';
|
||||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||||
|
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
import FolderModel = require('../../models/ACS/folderModel');
|
import { FolderModel } from '../../models/ACS/folderModel';
|
||||||
|
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
|
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||||
|
|||||||
@@ -16,28 +16,29 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { LoginPage } from '../pages/adf/loginPage';
|
import { LoginPage } from '../pages/adf/loginPage';
|
||||||
import { NavigationBarPage } from '../pages/adf/NavigationBarPage';
|
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
||||||
import ContentList = require('../pages/adf/dialog/contentList');
|
import { ContentListPage } from '../pages/adf/dialog/contentListPage';
|
||||||
|
|
||||||
import { LockFilePage } from '../pages/adf/lockFilePage';
|
import { LockFilePage } from '../pages/adf/lockFilePage';
|
||||||
|
|
||||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||||
import FileModel = require('../models/ACS/fileModel');
|
import { FileModel } from '../models/ACS/fileModel';
|
||||||
|
|
||||||
import CONSTANTS = require('../util/constants');
|
import CONSTANTS = require('../util/constants');
|
||||||
import Util = require('../util/util');
|
import { Util } from '../util/util';
|
||||||
|
|
||||||
import TestConfig = require('../test.config');
|
import TestConfig = require('../test.config');
|
||||||
import resources = require('../util/resources');
|
import resources = require('../util/resources');
|
||||||
|
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
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('Lock File', () => {
|
describe('Lock File', () => {
|
||||||
|
|
||||||
const loginPage = new LoginPage();
|
const loginPage = new LoginPage();
|
||||||
const navigationBarPage = new NavigationBarPage();
|
const navigationBarPage = new NavigationBarPage();
|
||||||
const contentList = new ContentList();
|
const contentList = new ContentListPage();
|
||||||
const lockFilePage = new LockFilePage();
|
const lockFilePage = new LockFilePage();
|
||||||
|
|
||||||
let adminUser = new AcsUserModel();
|
let adminUser = new AcsUserModel();
|
||||||
@@ -128,7 +129,7 @@ describe('Lock File', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('[C286604] Should be able to open Lock file option by clicking the lock image', () => {
|
it('[C286604] Should be able to open Lock file option by clicking the lock image', () => {
|
||||||
contentList.clickContentLockIcon(pngFileModel.name);
|
contentList.lockContent(pngFileModel.name);
|
||||||
|
|
||||||
lockFilePage.checkLockFileCheckboxIsDisplayed();
|
lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||||
lockFilePage.checkCancelButtonIsDisplayed();
|
lockFilePage.checkCancelButtonIsDisplayed();
|
||||||
@@ -136,7 +137,7 @@ describe('Lock File', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('[C286625] Should be able to click Cancel to cancel lock file operation', () => {
|
it('[C286625] Should be able to click Cancel to cancel lock file operation', () => {
|
||||||
contentList.clickContentLockIcon(pngFileModel.name);
|
contentList.lockContent(pngFileModel.name);
|
||||||
|
|
||||||
lockFilePage.checkLockFileCheckboxIsDisplayed();
|
lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||||
lockFilePage.clickCancelButton();
|
lockFilePage.clickCancelButton();
|
||||||
@@ -145,7 +146,7 @@ describe('Lock File', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('[C286603] Should be able to click on Lock file checkbox and lock a file', () => {
|
it('[C286603] Should be able to click on Lock file checkbox and lock a file', () => {
|
||||||
contentList.clickContentLockIcon(pngFileToLock.name);
|
contentList.lockContent(pngFileToLock.name);
|
||||||
|
|
||||||
lockFilePage.checkLockFileCheckboxIsDisplayed();
|
lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||||
lockFilePage.clickLockFileCheckbox();
|
lockFilePage.clickLockFileCheckbox();
|
||||||
@@ -155,14 +156,14 @@ describe('Lock File', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('[C286618] Should be able to uncheck Lock file checkbox and unlock a file', () => {
|
it('[C286618] Should be able to uncheck Lock file checkbox and unlock a file', () => {
|
||||||
contentList.clickContentLockIcon(pngFileModel.name);
|
contentList.lockContent(pngFileModel.name);
|
||||||
|
|
||||||
lockFilePage.checkLockFileCheckboxIsDisplayed();
|
lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||||
lockFilePage.clickLockFileCheckbox();
|
lockFilePage.clickLockFileCheckbox();
|
||||||
lockFilePage.clickSaveButton();
|
lockFilePage.clickSaveButton();
|
||||||
|
|
||||||
contentList.checkLockedIcon(pngFileModel.name);
|
contentList.checkLockedIcon(pngFileModel.name);
|
||||||
contentList.clickContentLockIcon(pngFileModel.name);
|
contentList.lockContent(pngFileModel.name);
|
||||||
|
|
||||||
lockFilePage.clickLockFileCheckbox();
|
lockFilePage.clickLockFileCheckbox();
|
||||||
lockFilePage.clickSaveButton();
|
lockFilePage.clickSaveButton();
|
||||||
@@ -197,7 +198,7 @@ describe('Lock File', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('[C286610] Should not be able to delete a locked file', async () => {
|
it('[C286610] Should not be able to delete a locked file', async () => {
|
||||||
await contentList.clickContentLockIcon(pngFileModel.name);
|
await contentList.lockContent(pngFileModel.name);
|
||||||
|
|
||||||
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||||
await lockFilePage.clickLockFileCheckbox();
|
await lockFilePage.clickLockFileCheckbox();
|
||||||
@@ -213,7 +214,7 @@ describe('Lock File', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('[C286611] Should not be able to rename a locked file', async () => {
|
it('[C286611] Should not be able to rename a locked file', async () => {
|
||||||
await contentList.clickContentLockIcon(pngFileModel.name);
|
await contentList.lockContent(pngFileModel.name);
|
||||||
|
|
||||||
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||||
await lockFilePage.clickLockFileCheckbox();
|
await lockFilePage.clickLockFileCheckbox();
|
||||||
@@ -229,7 +230,7 @@ describe('Lock File', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('[C286612] Should not be able to move a locked file', async () => {
|
it('[C286612] Should not be able to move a locked file', async () => {
|
||||||
await contentList.clickContentLockIcon(pngFileModel.name);
|
await contentList.lockContent(pngFileModel.name);
|
||||||
|
|
||||||
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||||
await lockFilePage.clickLockFileCheckbox();
|
await lockFilePage.clickLockFileCheckbox();
|
||||||
@@ -244,7 +245,7 @@ describe('Lock File', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('[C286613] Should not be able to update a new version on a locked file', async () => {
|
it('[C286613] Should not be able to update a new version on a locked file', async () => {
|
||||||
await contentList.clickContentLockIcon(pngFileModel.name);
|
await contentList.lockContent(pngFileModel.name);
|
||||||
|
|
||||||
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||||
await lockFilePage.clickLockFileCheckbox();
|
await lockFilePage.clickLockFileCheckbox();
|
||||||
@@ -262,8 +263,10 @@ describe('Lock File', () => {
|
|||||||
|
|
||||||
describe('Locked file with owner permissions', () => {
|
describe('Locked file with owner permissions', () => {
|
||||||
|
|
||||||
|
let pngFileToBeLocked;
|
||||||
|
|
||||||
beforeAll(async (done) => {
|
beforeAll(async (done) => {
|
||||||
let pngFileToBeLocked = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileToLock.location, pngFileToLock.name, documentLibrary);
|
pngFileToBeLocked = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileToLock.location, pngFileToLock.name, documentLibrary);
|
||||||
|
|
||||||
lockedFileNodeId = pngFileToBeLocked.entry.id;
|
lockedFileNodeId = pngFileToBeLocked.entry.id;
|
||||||
|
|
||||||
@@ -291,8 +294,8 @@ describe('Lock File', () => {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('[C286614] Owner of the locked file should be able to rename if "Allow owner to modify" is checked', async () => {
|
it('[C286614] Owner of the locked file should be able to rename if Allow owner to modify is checked', async () => {
|
||||||
await contentList.clickContentLockIcon(pngFileModel.name);
|
await contentList.lockContent(pngFileModel.name);
|
||||||
|
|
||||||
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||||
await lockFilePage.clickLockFileCheckbox();
|
await lockFilePage.clickLockFileCheckbox();
|
||||||
@@ -304,8 +307,8 @@ describe('Lock File', () => {
|
|||||||
expect(response.entry.name).toEqual('My new name');
|
expect(response.entry.name).toEqual('My new name');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('[C286615] Owner of the locked file should be able to update a new version if "Allow owner to modify" is checked', async () => {
|
it('[C286615] Owner of the locked file should be able to update a new version if Allow owner to modify is checked', async () => {
|
||||||
await contentList.clickContentLockIcon(pngFileModel.name);
|
await contentList.lockContent(pngFileModel.name);
|
||||||
|
|
||||||
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||||
await lockFilePage.clickLockFileCheckbox();
|
await lockFilePage.clickLockFileCheckbox();
|
||||||
@@ -317,8 +320,8 @@ describe('Lock File', () => {
|
|||||||
expect(response.entry.modifiedAt).toBeGreaterThan(response.entry.createdAt);
|
expect(response.entry.modifiedAt).toBeGreaterThan(response.entry.createdAt);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('[C286616] Owner of the locked file should be able to move if "Allow owner to modify" is checked', async () => {
|
it('[C286616] Owner of the locked file should be able to move if Allow owner to modify is checked', async () => {
|
||||||
await contentList.clickContentLockIcon(pngFileModel.name);
|
await contentList.lockContent(pngFileModel.name);
|
||||||
|
|
||||||
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||||
await lockFilePage.clickLockFileCheckbox();
|
await lockFilePage.clickLockFileCheckbox();
|
||||||
@@ -333,29 +336,21 @@ describe('Lock File', () => {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('[C286617] Owner of the locked file should be able to delete if "Allow owner to modify" is checked', async () => {
|
it('[C286617] Owner of the locked file should be able to delete if Allow owner to modify is checked', () => {
|
||||||
|
|
||||||
loginPage.loginToContentServicesUsingUserModel(adminUser);
|
loginPage.loginToContentServicesUsingUserModel(adminUser);
|
||||||
|
|
||||||
navigationBarPage.openContentServicesFolder(documentLibrary);
|
navigationBarPage.openContentServicesFolder(documentLibrary);
|
||||||
|
|
||||||
await contentList.clickContentLockIcon(pngFileToLock.name);
|
contentList.lockContent(pngFileToLock.name);
|
||||||
|
|
||||||
await lockFilePage.checkLockFileCheckboxIsDisplayed();
|
lockFilePage.checkLockFileCheckboxIsDisplayed();
|
||||||
await lockFilePage.clickLockFileCheckbox();
|
lockFilePage.clickLockFileCheckbox();
|
||||||
await lockFilePage.clickAllowOwnerCheckbox();
|
lockFilePage.clickAllowOwnerCheckbox();
|
||||||
await lockFilePage.clickSaveButton();
|
lockFilePage.clickSaveButton();
|
||||||
|
|
||||||
await this.alfrescoJsApi.core.nodesApi.deleteNode(lockedFileNodeId);
|
contentList.deleteContent(pngFileToBeLocked.entry.name);
|
||||||
|
contentList.checkContentIsNotDisplayed(pngFileToBeLocked.entry.name);
|
||||||
try {
|
|
||||||
await this.alfrescoJsApi.core.nodesApi.getNode(lockedFileNodeId);
|
|
||||||
|
|
||||||
} catch (error) {
|
|
||||||
expect(error.status).toEqual(404);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { LoginPage } from '../pages/adf/loginPage';
|
import { LoginPage } from '../pages/adf/loginPage';
|
||||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||||
import TestConfig = require('../test.config');
|
import TestConfig = require('../test.config');
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
import { NotificationPage } from '../pages/adf/notificationPage';
|
import { NotificationPage } from '../pages/adf/notificationPage';
|
||||||
|
|||||||
@@ -18,14 +18,14 @@
|
|||||||
import { PermissionsPage } from '../pages/adf/permissionsPage';
|
import { PermissionsPage } from '../pages/adf/permissionsPage';
|
||||||
import { LoginPage } from '../pages/adf/loginPage';
|
import { LoginPage } from '../pages/adf/loginPage';
|
||||||
import { ContentServicesPage } from '../pages/adf/contentServicesPage';
|
import { ContentServicesPage } from '../pages/adf/contentServicesPage';
|
||||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||||
import TestConfig = require('../test.config');
|
import TestConfig = require('../test.config');
|
||||||
import resources = require('../util/resources');
|
import resources = require('../util/resources');
|
||||||
import ContentListPage = require('../pages/adf/dialog/contentList');
|
import { ContentListPage } from '../pages/adf/dialog/contentListPage';
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
import FileModel = require('../models/ACS/fileModel');
|
import { FileModel } from '../models/ACS/fileModel';
|
||||||
import { UploadActions } from '../actions/ACS/upload.actions';
|
import { UploadActions } from '../actions/ACS/upload.actions';
|
||||||
import Util = require('../util/util');
|
import { Util } from '../util/util';
|
||||||
import { browser } from 'protractor';
|
import { browser } from 'protractor';
|
||||||
|
|
||||||
describe('Permissions Component', function () {
|
describe('Permissions Component', function () {
|
||||||
|
|||||||
@@ -17,13 +17,13 @@
|
|||||||
|
|
||||||
import { LoginPage } from '../../pages/adf/loginPage';
|
import { LoginPage } from '../../pages/adf/loginPage';
|
||||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
import { ContentListPage } from '../../pages/adf/dialog/contentListPage';
|
||||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||||
import { ShareDialog } from '../../pages/adf/dialog/shareDialog';
|
import { ShareDialog } from '../../pages/adf/dialog/shareDialog';
|
||||||
|
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
import FileModel = require('../../models/ACS/fileModel');
|
import { FileModel } from '../../models/ACS/fileModel';
|
||||||
|
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import resources = require('../../util/resources');
|
import resources = require('../../util/resources');
|
||||||
@@ -81,8 +81,8 @@ describe('Share file', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('Shared link dialog', () => {
|
describe('Shared link dialog', () => {
|
||||||
afterEach(async (done) => {
|
afterEach( (done) => {
|
||||||
await browser.refresh();
|
browser.refresh();
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -141,9 +141,9 @@ describe('Share file', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('Shared link preview', () => {
|
describe('Shared link preview', () => {
|
||||||
afterEach(async (done) => {
|
afterEach( (done) => {
|
||||||
await loginPage.loginToContentServicesUsingUserModel(acsUser);
|
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||||
await contentServicesPage.navigateToDocumentList();
|
contentServicesPage.navigateToDocumentList();
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -16,15 +16,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import CONSTANTS = require('../../util/constants');
|
import CONSTANTS = require('../../util/constants');
|
||||||
import Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||||
import { LoginPage } from '../../pages/adf/loginPage';
|
import { LoginPage } from '../../pages/adf/loginPage';
|
||||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
import { ContentListPage } from '../../pages/adf/dialog/contentListPage';
|
||||||
import ErrorPage = require('../../pages/adf/errorPage');
|
import { ErrorPage } from '../../pages/adf/errorPage';
|
||||||
import { ShareDialog } from '../../pages/adf/dialog/shareDialog';
|
import { ShareDialog } from '../../pages/adf/dialog/shareDialog';
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
import FileModel = require('../../models/ACS/fileModel');
|
import { FileModel } from '../../models/ACS/fileModel';
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import resources = require('../../util/resources');
|
import resources = require('../../util/resources');
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
@@ -51,7 +51,7 @@ describe('Unshare file', () => {
|
|||||||
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
|
'location': resources.Files.ADF_DOCUMENTS.PNG.file_location
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeAll(async(done) => {
|
beforeAll(async (done) => {
|
||||||
const site = {
|
const site = {
|
||||||
title: siteName,
|
title: siteName,
|
||||||
visibility: 'PRIVATE',
|
visibility: 'PRIVATE',
|
||||||
@@ -142,10 +142,10 @@ describe('Unshare file', () => {
|
|||||||
shareDialog.clickUnShareFile();
|
shareDialog.clickUnShareFile();
|
||||||
shareDialog.confirmationDialogIsDisplayed();
|
shareDialog.confirmationDialogIsDisplayed();
|
||||||
shareDialog.clickConfirmationDialogRemoveButton();
|
shareDialog.clickConfirmationDialogRemoveButton();
|
||||||
shareDialog.shareToggleButtonIsChecked();
|
shareDialog.dialogIsClosed();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('[C280556] Should redirect to 404 when trying to access an unshared file', async() => {
|
it('[C280556] Should redirect to 404 when trying to access an unshared file', async () => {
|
||||||
contentListPage.clickRowToSelect(pngFileModel.name);
|
contentListPage.clickRowToSelect(pngFileModel.name);
|
||||||
contentServicesPage.clickShareButton();
|
contentServicesPage.clickShareButton();
|
||||||
shareDialog.checkDialogIsDisplayed();
|
shareDialog.checkDialogIsDisplayed();
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||||
import FileModel = require('../models/ACS/fileModel');
|
import { FileModel } from '../models/ACS/fileModel';
|
||||||
|
|
||||||
import { LoginPage } from '../pages/adf/loginPage';
|
import { LoginPage } from '../pages/adf/loginPage';
|
||||||
import { TagPage } from '../pages/adf/tagPage';
|
import { TagPage } from '../pages/adf/tagPage';
|
||||||
@@ -28,7 +28,7 @@ import resources = require('../util/resources');
|
|||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
import { UploadActions } from '../actions/ACS/upload.actions';
|
import { UploadActions } from '../actions/ACS/upload.actions';
|
||||||
|
|
||||||
import Util = require('../util/util');
|
import { Util } from '../util/util';
|
||||||
import { browser } from 'protractor';
|
import { browser } from 'protractor';
|
||||||
|
|
||||||
describe('Tag component', () => {
|
describe('Tag component', () => {
|
||||||
|
|||||||
@@ -18,14 +18,14 @@
|
|||||||
import { LoginPage } from '../pages/adf/loginPage';
|
import { LoginPage } from '../pages/adf/loginPage';
|
||||||
import { TrashcanPage } from '../pages/adf/trashcanPage';
|
import { TrashcanPage } from '../pages/adf/trashcanPage';
|
||||||
|
|
||||||
import PaginationPage = require('../pages/adf/paginationPage');
|
import { PaginationPage } from '../pages/adf/paginationPage';
|
||||||
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
||||||
|
|
||||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||||
import FolderModel = require('../models/ACS/folderModel');
|
import { FolderModel } from '../models/ACS/folderModel';
|
||||||
|
|
||||||
import TestConfig = require('../test.config');
|
import TestConfig = require('../test.config');
|
||||||
import Util = require('../util/util');
|
import { Util } from '../util/util';
|
||||||
|
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
import { UploadActions } from '../actions/ACS/upload.actions';
|
import { UploadActions } from '../actions/ACS/upload.actions';
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import { LoginPage } from '../pages/adf/loginPage';
|
|||||||
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
||||||
import { TreeViewPage } from '../pages/adf/content_services/treeViewPage';
|
import { TreeViewPage } from '../pages/adf/content_services/treeViewPage';
|
||||||
|
|
||||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||||
|
|
||||||
import TestConfig = require('../test.config');
|
import TestConfig = require('../test.config');
|
||||||
|
|
||||||
|
|||||||
@@ -19,13 +19,13 @@ import { element, by, browser } from 'protractor';
|
|||||||
|
|
||||||
import { LoginPage } from '../../pages/adf/loginPage';
|
import { LoginPage } from '../../pages/adf/loginPage';
|
||||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||||
import UploadDialog = require('../../pages/adf/dialog/uploadDialog');
|
import { UploadDialog } from '../../pages/adf/dialog/uploadDialog';
|
||||||
import { UploadToggles } from '../../pages/adf/dialog/uploadToggles';
|
import { UploadToggles } from '../../pages/adf/dialog/uploadToggles';
|
||||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||||
|
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
import FileModel = require('../../models/ACS/fileModel');
|
import { FileModel } from '../../models/ACS/fileModel';
|
||||||
import FolderModel = require('../../models/ACS/folderModel');
|
import { FolderModel } from '../../models/ACS/folderModel';
|
||||||
|
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import resources = require('../../util/resources');
|
import resources = require('../../util/resources');
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ import { element, by, browser } from 'protractor';
|
|||||||
|
|
||||||
import { LoginPage } from '../../pages/adf/loginPage';
|
import { LoginPage } from '../../pages/adf/loginPage';
|
||||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||||
import UploadDialog = require('../../pages/adf/dialog/uploadDialog');
|
import { UploadDialog } from '../../pages/adf/dialog/uploadDialog';
|
||||||
import { UploadToggles } from '../../pages/adf/dialog/uploadToggles';
|
import { UploadToggles } from '../../pages/adf/dialog/uploadToggles';
|
||||||
|
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
import FileModel = require('../../models/ACS/fileModel');
|
import { FileModel } from '../../models/ACS/fileModel';
|
||||||
import FolderModel = require('../../models/ACS/folderModel');
|
import { FolderModel } from '../../models/ACS/folderModel';
|
||||||
|
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import resources = require('../../util/resources');
|
import resources = require('../../util/resources');
|
||||||
|
|||||||
@@ -17,18 +17,18 @@
|
|||||||
|
|
||||||
import { element, by, browser } from 'protractor';
|
import { element, by, browser } from 'protractor';
|
||||||
|
|
||||||
import Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
|
|
||||||
import { LoginPage } from '../../pages/adf/loginPage';
|
import { LoginPage } from '../../pages/adf/loginPage';
|
||||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||||
import UploadDialog = require('../../pages/adf/dialog/uploadDialog');
|
import { UploadDialog } from '../../pages/adf/dialog/uploadDialog';
|
||||||
import { UploadToggles } from '../../pages/adf/dialog/uploadToggles';
|
import { UploadToggles } from '../../pages/adf/dialog/uploadToggles';
|
||||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||||
import { NotificationPage } from '../../pages/adf/notificationPage';
|
import { NotificationPage } from '../../pages/adf/notificationPage';
|
||||||
|
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
import FileModel = require('../../models/ACS/fileModel');
|
import { FileModel } from '../../models/ACS/fileModel';
|
||||||
import FolderModel = require('../../models/ACS/folderModel');
|
import { FolderModel } from '../../models/ACS/folderModel';
|
||||||
|
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import resources = require('../../util/resources');
|
import resources = require('../../util/resources');
|
||||||
|
|||||||
@@ -19,18 +19,18 @@ import { by, element } from 'protractor';
|
|||||||
|
|
||||||
import { LoginPage } from '../../pages/adf/loginPage';
|
import { LoginPage } from '../../pages/adf/loginPage';
|
||||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
import { ContentListPage } from '../../pages/adf/dialog/contentListPage';
|
||||||
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
|
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
|
||||||
|
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
import FileModel = require('../../models/ACS/fileModel');
|
import { FileModel } from '../../models/ACS/fileModel';
|
||||||
|
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import resources = require('../../util/resources');
|
import resources = require('../../util/resources');
|
||||||
|
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||||
import Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
import path = require('path');
|
import path = require('path');
|
||||||
|
|
||||||
describe('Version component actions', () => {
|
describe('Version component actions', () => {
|
||||||
|
|||||||
@@ -18,14 +18,14 @@
|
|||||||
import { element, by } from 'protractor';
|
import { element, by } from 'protractor';
|
||||||
|
|
||||||
import { LoginPage } from '../../pages/adf/loginPage';
|
import { LoginPage } from '../../pages/adf/loginPage';
|
||||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
import { ContentListPage } from '../../pages/adf/dialog/contentListPage';
|
||||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||||
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
|
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
|
||||||
import UploadDialog = require('../../pages/adf/dialog/uploadDialog');
|
import { UploadDialog } from '../../pages/adf/dialog/uploadDialog';
|
||||||
import { NotificationPage } from '../../pages/adf/notificationPage';
|
import { NotificationPage } from '../../pages/adf/notificationPage';
|
||||||
|
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
import FileModel = require('../../models/ACS/fileModel');
|
import { FileModel } from '../../models/ACS/fileModel';
|
||||||
|
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import resources = require('../../util/resources');
|
import resources = require('../../util/resources');
|
||||||
@@ -34,7 +34,7 @@ import AlfrescoApi = require('alfresco-js-api-node');
|
|||||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||||
import { NodeActions } from '../../actions/ACS/node.actions';
|
import { NodeActions } from '../../actions/ACS/node.actions';
|
||||||
|
|
||||||
import Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
import CONSTANTS = require('../../util/constants');
|
import CONSTANTS = require('../../util/constants');
|
||||||
|
|
||||||
describe('Version component permissions', () => {
|
describe('Version component permissions', () => {
|
||||||
|
|||||||
@@ -19,18 +19,18 @@ import { by, element } from 'protractor';
|
|||||||
|
|
||||||
import { LoginPage } from '../../pages/adf/loginPage';
|
import { LoginPage } from '../../pages/adf/loginPage';
|
||||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
import { ContentListPage } from '../../pages/adf/dialog/contentListPage';
|
||||||
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
|
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
|
||||||
|
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
import FileModel = require('../../models/ACS/fileModel');
|
import { FileModel } from '../../models/ACS/fileModel';
|
||||||
|
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import resources = require('../../util/resources');
|
import resources = require('../../util/resources');
|
||||||
|
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||||
import Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
|
|
||||||
describe('Version Properties', () => {
|
describe('Version Properties', () => {
|
||||||
|
|
||||||
|
|||||||
@@ -19,18 +19,18 @@ import { browser } from 'protractor';
|
|||||||
|
|
||||||
import { LoginPage } from '../../pages/adf/loginPage';
|
import { LoginPage } from '../../pages/adf/loginPage';
|
||||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
import { ContentListPage } from '../../pages/adf/dialog/contentListPage';
|
||||||
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
|
import { VersionManagePage } from '../../pages/adf/versionManagerPage';
|
||||||
|
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
import FileModel = require('../../models/ACS/fileModel');
|
import { FileModel } from '../../models/ACS/fileModel';
|
||||||
|
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import resources = require('../../util/resources');
|
import resources = require('../../util/resources');
|
||||||
|
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||||
import Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
|
|
||||||
describe('Version component', () => {
|
describe('Version component', () => {
|
||||||
|
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ import { browser } from 'protractor';
|
|||||||
|
|
||||||
import { LoginPage } from '../../pages/adf/loginPage';
|
import { LoginPage } from '../../pages/adf/loginPage';
|
||||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||||
import CardViewPage = require('../../pages/adf/metadataViewPage');
|
import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
|
||||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||||
import { ConfigEditorPage } from '../../pages/adf/configEditorPage';
|
import { ConfigEditorPage } from '../../pages/adf/configEditorPage';
|
||||||
|
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
import FileModel = require('../../models/ACS/fileModel');
|
import { FileModel } from '../../models/ACS/fileModel';
|
||||||
|
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import resources = require('../../util/resources');
|
import resources = require('../../util/resources');
|
||||||
@@ -37,7 +37,7 @@ describe('Aspect oriented config', () => {
|
|||||||
|
|
||||||
const loginPage = new LoginPage();
|
const loginPage = new LoginPage();
|
||||||
const viewerPage = new ViewerPage();
|
const viewerPage = new ViewerPage();
|
||||||
const metadataViewPage = new CardViewPage();
|
const metadataViewPage = new MetadataViewPage();
|
||||||
const navigationBarPage = new NavigationBarPage();
|
const navigationBarPage = new NavigationBarPage();
|
||||||
const configEditorPage = new ConfigEditorPage();
|
const configEditorPage = new ConfigEditorPage();
|
||||||
let contentServicesPage = new ContentServicesPage();
|
let contentServicesPage = new ContentServicesPage();
|
||||||
@@ -71,13 +71,13 @@ describe('Aspect oriented config', () => {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(async(done) => {
|
beforeEach(async (done) => {
|
||||||
navigationBarPage.clickConfigEditorButton();
|
navigationBarPage.clickConfigEditorButton();
|
||||||
configEditorPage.clickClearButton();
|
configEditorPage.clickClearButton();
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(async(done) => {
|
afterEach(async (done) => {
|
||||||
viewerPage.clickCloseButton();
|
viewerPage.clickCloseButton();
|
||||||
contentServicesPage.checkAcsContainer();
|
contentServicesPage.checkAcsContainer();
|
||||||
browser.refresh();
|
browser.refresh();
|
||||||
@@ -96,7 +96,8 @@ describe('Aspect oriented config', () => {
|
|||||||
' }' +
|
' }' +
|
||||||
' ]' +
|
' ]' +
|
||||||
' }]' +
|
' }]' +
|
||||||
' }');
|
' }' +
|
||||||
|
' }');
|
||||||
|
|
||||||
configEditorPage.clickSaveButton();
|
configEditorPage.clickSaveButton();
|
||||||
|
|
||||||
@@ -148,7 +149,7 @@ describe('Aspect oriented config', () => {
|
|||||||
metadataViewPage.checkMetadataGroupIsNotPresent('exists');
|
metadataViewPage.checkMetadataGroupIsNotPresent('exists');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('[C260183] Should show all the aspect if the content-metadata configuration is NOT provided' , () => {
|
it('[C260183] Should show all the aspect if the content-metadata configuration is NOT provided', () => {
|
||||||
|
|
||||||
configEditorPage.enterConfiguration('{ }');
|
configEditorPage.enterConfiguration('{ }');
|
||||||
|
|
||||||
@@ -172,7 +173,7 @@ describe('Aspect oriented config', () => {
|
|||||||
metadataViewPage.checkMetadataGroupIsPresent('Content');
|
metadataViewPage.checkMetadataGroupIsPresent('Content');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('[C260182] Should show all the aspects if the default configuration contains the star symbol' , () => {
|
it('[C260182] Should show all the aspects if the default configuration contains the star symbol', () => {
|
||||||
|
|
||||||
configEditorPage.enterConfiguration('{' +
|
configEditorPage.enterConfiguration('{' +
|
||||||
' "presets": {' +
|
' "presets": {' +
|
||||||
@@ -201,7 +202,7 @@ describe('Aspect oriented config', () => {
|
|||||||
metadataViewPage.checkMetadataGroupIsPresent('Content');
|
metadataViewPage.checkMetadataGroupIsPresent('Content');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('[C268899] Should be possible use a Translation key as Title of a metadata group' , () => {
|
it('[C268899] Should be possible use a Translation key as Title of a metadata group', () => {
|
||||||
|
|
||||||
configEditorPage.enterConfiguration('{' +
|
configEditorPage.enterConfiguration('{' +
|
||||||
' "presets": {' +
|
' "presets": {' +
|
||||||
@@ -251,7 +252,7 @@ describe('Aspect oriented config', () => {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('[C279968] Should be possible use a custom preset' , () => {
|
it('[C279968] Should be possible use a custom preset', () => {
|
||||||
|
|
||||||
configEditorPage.enterConfiguration('{' +
|
configEditorPage.enterConfiguration('{' +
|
||||||
' "presets": {' +
|
' "presets": {' +
|
||||||
|
|||||||
@@ -19,22 +19,21 @@ import { element, by } from 'protractor';
|
|||||||
|
|
||||||
import { LoginPage } from '../../pages/adf/loginPage';
|
import { LoginPage } from '../../pages/adf/loginPage';
|
||||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||||
|
import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
|
||||||
import CardViewPage = require('../../pages/adf/metadataViewPage');
|
|
||||||
|
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import resources = require('../../util/resources');
|
import resources = require('../../util/resources');
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
import { UsersActions } from '../../actions/users.actions';
|
import { UsersActions } from '../../actions/users.actions';
|
||||||
import { AppsActions } from '../../actions/APS/apps.actions';
|
import { AppsActions } from '../../actions/APS/apps.actions';
|
||||||
import CardViewPageComponent = require('../../pages/adf/cardViewPageComponent');
|
import { CardViewComponentPage } from '../../pages/adf/cardViewComponentPage';
|
||||||
import Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
|
|
||||||
describe('CardView Component', () => {
|
describe('CardView Component', () => {
|
||||||
const loginPage = new LoginPage();
|
const loginPage = new LoginPage();
|
||||||
const navigationBarPage = new NavigationBarPage();
|
const navigationBarPage = new NavigationBarPage();
|
||||||
const cardViewPageComponent = new CardViewPageComponent();
|
const cardViewPageComponent = new CardViewComponentPage();
|
||||||
const metadataViewPage = new CardViewPage();
|
const metadataViewPage = new MetadataViewPage();
|
||||||
|
|
||||||
const app = resources.Files.APP_WITH_PROCESSES;
|
const app = resources.Files.APP_WITH_PROCESSES;
|
||||||
|
|
||||||
@@ -69,7 +68,7 @@ describe('CardView Component', () => {
|
|||||||
describe('key-value pair ', () => {
|
describe('key-value pair ', () => {
|
||||||
|
|
||||||
it('[C279938] Should the label be present', () => {
|
it('[C279938] Should the label be present', () => {
|
||||||
let label = element(by.xpath('div[data-automation-id="card-key-value-pairs-label-key-value-pairs"]'));
|
let label = element(by.css('div[data-automation-id="card-key-value-pairs-label-key-value-pairs"]'));
|
||||||
|
|
||||||
Util.waitUntilElementIsPresent(label);
|
Util.waitUntilElementIsPresent(label);
|
||||||
});
|
});
|
||||||
@@ -91,7 +90,7 @@ describe('CardView Component', () => {
|
|||||||
describe('SelectBox', () => {
|
describe('SelectBox', () => {
|
||||||
|
|
||||||
it('[C279939] Should the label be present', () => {
|
it('[C279939] Should the label be present', () => {
|
||||||
let label = element(by.xpath('div[data-automation-id="card-select-label-select"]'));
|
let label = element(by.css('div[data-automation-id="card-select-label-select"]'));
|
||||||
|
|
||||||
Util.waitUntilElementIsPresent(label);
|
Util.waitUntilElementIsPresent(label);
|
||||||
});
|
});
|
||||||
@@ -108,7 +107,7 @@ describe('CardView Component', () => {
|
|||||||
describe('Text', () => {
|
describe('Text', () => {
|
||||||
|
|
||||||
it('[C279937] Should the label be present', () => {
|
it('[C279937] Should the label be present', () => {
|
||||||
let label = element(by.xpath('div[data-automation-id="card-textitem-label-name"]'));
|
let label = element(by.css('div[data-automation-id="card-textitem-label-name"]'));
|
||||||
|
|
||||||
Util.waitUntilElementIsPresent(label);
|
Util.waitUntilElementIsPresent(label);
|
||||||
});
|
});
|
||||||
@@ -139,7 +138,7 @@ describe('CardView Component', () => {
|
|||||||
describe('Int', () => {
|
describe('Int', () => {
|
||||||
|
|
||||||
it('[C279940] Should the label be present', () => {
|
it('[C279940] Should the label be present', () => {
|
||||||
let label = element(by.xpath('div[data-automation-id="card-textitem-label-int"]'));
|
let label = element(by.css('div[data-automation-id="card-textitem-label-int"]'));
|
||||||
|
|
||||||
Util.waitUntilElementIsPresent(label);
|
Util.waitUntilElementIsPresent(label);
|
||||||
});
|
});
|
||||||
@@ -213,7 +212,7 @@ describe('CardView Component', () => {
|
|||||||
describe('Float', () => {
|
describe('Float', () => {
|
||||||
|
|
||||||
it('[C279941] Should the label be present', () => {
|
it('[C279941] Should the label be present', () => {
|
||||||
let label = element(by.xpath('div[data-automation-id="card-textitem-label-float"]'));
|
let label = element(by.css('div[data-automation-id="card-textitem-label-float"]'));
|
||||||
|
|
||||||
Util.waitUntilElementIsPresent(label);
|
Util.waitUntilElementIsPresent(label);
|
||||||
});
|
});
|
||||||
@@ -263,7 +262,7 @@ describe('CardView Component', () => {
|
|||||||
describe('Boolean', () => {
|
describe('Boolean', () => {
|
||||||
|
|
||||||
it('[C279942] Should the label be present', () => {
|
it('[C279942] Should the label be present', () => {
|
||||||
let label = element(by.xpath('div[data-automation-id="card-boolean-label-boolean"]'));
|
let label = element(by.css('div[data-automation-id="card-boolean-label-boolean"]'));
|
||||||
|
|
||||||
Util.waitUntilElementIsPresent(label);
|
Util.waitUntilElementIsPresent(label);
|
||||||
});
|
});
|
||||||
@@ -282,11 +281,11 @@ describe('CardView Component', () => {
|
|||||||
describe('Date and DateTime', () => {
|
describe('Date and DateTime', () => {
|
||||||
|
|
||||||
it('[C279961] Should the label be present', () => {
|
it('[C279961] Should the label be present', () => {
|
||||||
let labelDate = element(by.xpath('div[data-automation-id="card-dateitem-label-date"]'));
|
let labelDate = element(by.css('div[data-automation-id="card-dateitem-label-date"]'));
|
||||||
|
|
||||||
Util.waitUntilElementIsPresent(labelDate);
|
Util.waitUntilElementIsPresent(labelDate);
|
||||||
|
|
||||||
let labelDatetime = element(by.xpath('div[data-automation-id="card-dateitem-label-datetime"]'));
|
let labelDatetime = element(by.css('div[data-automation-id="card-dateitem-label-datetime"]'));
|
||||||
|
|
||||||
Util.waitUntilElementIsPresent(labelDatetime);
|
Util.waitUntilElementIsPresent(labelDatetime);
|
||||||
});
|
});
|
||||||
@@ -301,11 +300,11 @@ describe('CardView Component', () => {
|
|||||||
it('[C279936] Should not be possible edit any parameter when editable property is false', () => {
|
it('[C279936] Should not be possible edit any parameter when editable property is false', () => {
|
||||||
cardViewPageComponent.disableEdit();
|
cardViewPageComponent.disableEdit();
|
||||||
|
|
||||||
let editIconText = element(by.xpath('mat-icon[data-automation-id="card-textitem-edit-icon-name"]'));
|
let editIconText = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-name"]'));
|
||||||
let editIconInt = element(by.xpath('mat-icon[data-automation-id="card-textitem-edit-icon-int"]'));
|
let editIconInt = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-int"]'));
|
||||||
let editIconFloat = element(by.xpath('mat-icon[data-automation-id="card-textitem-edit-icon-float"]'));
|
let editIconFloat = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-float"]'));
|
||||||
let editIconKey = element(by.xpath('mat-icon[data-automation-id="card-key-value-pairs-button-key-value-pairs"]'));
|
let editIconKey = element(by.css('mat-icon[data-automation-id="card-key-value-pairs-button-key-value-pairs"]'));
|
||||||
let editIconData = element(by.xpath('mat-datetimepicker-toggle'));
|
let editIconData = element(by.css('mat-datetimepicker-toggle'));
|
||||||
|
|
||||||
Util.waitUntilElementIsNotVisible(editIconText);
|
Util.waitUntilElementIsNotVisible(editIconText);
|
||||||
Util.waitUntilElementIsNotVisible(editIconInt);
|
Util.waitUntilElementIsNotVisible(editIconInt);
|
||||||
|
|||||||
@@ -17,11 +17,11 @@
|
|||||||
|
|
||||||
import { LoginPage } from '../../pages/adf/loginPage';
|
import { LoginPage } from '../../pages/adf/loginPage';
|
||||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||||
import CardViewPage = require('../../pages/adf/metadataViewPage');
|
import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
|
||||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||||
|
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
import FileModel = require('../../models/ACS/fileModel');
|
import { FileModel } from '../../models/ACS/fileModel';
|
||||||
|
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import resources = require('../../util/resources');
|
import resources = require('../../util/resources');
|
||||||
@@ -29,7 +29,7 @@ import resources = require('../../util/resources');
|
|||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||||
|
|
||||||
import Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
import CONSTANTS = require('../../util/constants');
|
import CONSTANTS = require('../../util/constants');
|
||||||
|
|
||||||
describe('permissions', () => {
|
describe('permissions', () => {
|
||||||
@@ -49,7 +49,7 @@ describe('permissions', () => {
|
|||||||
|
|
||||||
const loginPage = new LoginPage();
|
const loginPage = new LoginPage();
|
||||||
const viewerPage = new ViewerPage();
|
const viewerPage = new ViewerPage();
|
||||||
const metadataViewPage = new CardViewPage();
|
const metadataViewPage = new MetadataViewPage();
|
||||||
const navigationBarPage = new NavigationBarPage();
|
const navigationBarPage = new NavigationBarPage();
|
||||||
|
|
||||||
let consumerUser = new AcsUserModel();
|
let consumerUser = new AcsUserModel();
|
||||||
|
|||||||
@@ -18,10 +18,10 @@
|
|||||||
import { LoginPage } from '../../pages/adf/loginPage';
|
import { LoginPage } from '../../pages/adf/loginPage';
|
||||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||||
import CardViewPage = require('../../pages/adf/metadataViewPage');
|
import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
|
||||||
|
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
import FileModel = require('../../models/ACS/fileModel');
|
import { FileModel } from '../../models/ACS/fileModel';
|
||||||
|
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import resources = require('../../util/resources');
|
import resources = require('../../util/resources');
|
||||||
@@ -47,7 +47,7 @@ describe('CardView Component - properties', () => {
|
|||||||
let loginPage = new LoginPage();
|
let loginPage = new LoginPage();
|
||||||
let contentServicesPage = new ContentServicesPage();
|
let contentServicesPage = new ContentServicesPage();
|
||||||
let viewerPage = new ViewerPage();
|
let viewerPage = new ViewerPage();
|
||||||
let metadataViewPage = new CardViewPage();
|
let metadataViewPage = new MetadataViewPage();
|
||||||
|
|
||||||
let acsUser = new AcsUserModel();
|
let acsUser = new AcsUserModel();
|
||||||
|
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ import { browser } from 'protractor';
|
|||||||
import { LoginPage } from '../../pages/adf/loginPage';
|
import { LoginPage } from '../../pages/adf/loginPage';
|
||||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||||
import CardViewPage = require('../../pages/adf/metadataViewPage');
|
import { MetadataViewPage } from '../../pages/adf/metadataViewPage';
|
||||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
import { ContentListPage } from '../../pages/adf/dialog/contentListPage';
|
||||||
|
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
import FileModel = require('../../models/ACS/fileModel');
|
import { FileModel } from '../../models/ACS/fileModel';
|
||||||
|
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import resources = require('../../util/resources');
|
import resources = require('../../util/resources');
|
||||||
@@ -51,7 +51,7 @@ describe('Metadata component', () => {
|
|||||||
const loginPage = new LoginPage();
|
const loginPage = new LoginPage();
|
||||||
const contentServicesPage = new ContentServicesPage();
|
const contentServicesPage = new ContentServicesPage();
|
||||||
const viewerPage = new ViewerPage();
|
const viewerPage = new ViewerPage();
|
||||||
const metadataViewPage = new CardViewPage();
|
const metadataViewPage = new MetadataViewPage();
|
||||||
const contentListPage = new ContentListPage();
|
const contentListPage = new ContentListPage();
|
||||||
|
|
||||||
let acsUser = new AcsUserModel();
|
let acsUser = new AcsUserModel();
|
||||||
|
|||||||
@@ -16,17 +16,19 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { LoginPage } from '../../pages/adf/loginPage';
|
import { LoginPage } from '../../pages/adf/loginPage';
|
||||||
import DataTablePage = require('../../pages/adf/dataTablePage');
|
import { DataTablePage } from '../../pages/adf/dataTablePage';
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
|
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
|
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||||
|
|
||||||
describe('Datatable component - selection', () => {
|
describe('Datatable component - selection', () => {
|
||||||
|
|
||||||
let dataTablePage = new DataTablePage();
|
let dataTablePage = new DataTablePage();
|
||||||
let loginPage = new LoginPage();
|
let loginPage = new LoginPage();
|
||||||
let acsUser = new AcsUserModel();
|
let acsUser = new AcsUserModel();
|
||||||
|
let navigationBarPage = new NavigationBarPage();
|
||||||
|
|
||||||
beforeAll(async (done) => {
|
beforeAll(async (done) => {
|
||||||
this.alfrescoJsApi = new AlfrescoApi({
|
this.alfrescoJsApi = new AlfrescoApi({
|
||||||
@@ -40,7 +42,7 @@ describe('Datatable component - selection', () => {
|
|||||||
|
|
||||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||||
|
|
||||||
dataTablePage.goToDatatable();
|
navigationBarPage.navigateToDatatable();
|
||||||
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -16,17 +16,19 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { LoginPage } from '../../pages/adf/loginPage';
|
import { LoginPage } from '../../pages/adf/loginPage';
|
||||||
import DataTablePage = require('../../pages/adf/dataTablePage');
|
import { DataTablePage } from '../../pages/adf/dataTablePage';
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
|
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
|
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||||
|
|
||||||
describe('Datatable component', () => {
|
describe('Datatable component', () => {
|
||||||
|
|
||||||
let dataTablePage = new DataTablePage();
|
let dataTablePage = new DataTablePage();
|
||||||
let loginPage = new LoginPage();
|
let loginPage = new LoginPage();
|
||||||
let acsUser = new AcsUserModel();
|
let acsUser = new AcsUserModel();
|
||||||
|
let navigationBarPage = new NavigationBarPage();
|
||||||
|
|
||||||
beforeAll(async (done) => {
|
beforeAll(async (done) => {
|
||||||
this.alfrescoJsApi = new AlfrescoApi({
|
this.alfrescoJsApi = new AlfrescoApi({
|
||||||
@@ -40,7 +42,7 @@ describe('Datatable component', () => {
|
|||||||
|
|
||||||
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
loginPage.loginToContentServicesUsingUserModel(acsUser);
|
||||||
|
|
||||||
dataTablePage.goToDatatable();
|
navigationBarPage.navigateToDatatable();
|
||||||
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -16,10 +16,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { LoginPage } from '../pages/adf/loginPage';
|
import { LoginPage } from '../pages/adf/loginPage';
|
||||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||||
import TestConfig = require('../test.config');
|
import TestConfig = require('../test.config');
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
import ErrorPage = require('../pages/adf/errorPage');
|
import { ErrorPage } from '../pages/adf/errorPage';
|
||||||
import { browser } from '../../node_modules/protractor';
|
import { browser } from '../../node_modules/protractor';
|
||||||
|
|
||||||
describe('Error Component', () => {
|
describe('Error Component', () => {
|
||||||
|
|||||||
@@ -18,11 +18,11 @@
|
|||||||
import { LoginPage } from '../pages/adf/loginPage';
|
import { LoginPage } from '../pages/adf/loginPage';
|
||||||
import { ContentServicesPage } from '../pages/adf/contentServicesPage';
|
import { ContentServicesPage } from '../pages/adf/contentServicesPage';
|
||||||
|
|
||||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||||
import FolderModel = require('../models/ACS/folderModel');
|
import { FolderModel } from '../models/ACS/folderModel';
|
||||||
|
|
||||||
import TestConfig = require('../test.config');
|
import TestConfig = require('../test.config');
|
||||||
import Util = require('../util/util');
|
import { Util } from '../util/util';
|
||||||
|
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
import { UploadActions } from '../actions/ACS/upload.actions';
|
import { UploadActions } from '../actions/ACS/upload.actions';
|
||||||
|
|||||||
@@ -15,16 +15,16 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { LoginAPSPage } from '../../../pages/adf/loginApsPage';
|
import { LoginSSOPage } from '../../../pages/adf/loginSSOPage';
|
||||||
import { SettingsPage } from '../../../pages/adf/settingsPage';
|
import { SettingsPage } from '../../../pages/adf/settingsPage';
|
||||||
import TestConfig = require('../../../test.config');
|
import TestConfig = require('../../../test.config');
|
||||||
import { browser } from 'protractor';
|
import { browser } from 'protractor';
|
||||||
import { NavigationBarPage } from '../../../pages/adf/NavigationBarPage';
|
import { NavigationBarPage } from '../../../pages/adf/navigationBarPage';
|
||||||
|
|
||||||
describe('Login component - SSO', () => {
|
describe('Login component - SSO', () => {
|
||||||
|
|
||||||
const settingsPage = new SettingsPage();
|
const settingsPage = new SettingsPage();
|
||||||
const loginApsPage = new LoginAPSPage();
|
const loginApsPage = new LoginSSOPage();
|
||||||
const navigationBarPage = new NavigationBarPage();
|
const navigationBarPage = new NavigationBarPage();
|
||||||
const path = '/auth/realms/springboot';
|
const path = '/auth/realms/springboot';
|
||||||
let silentLogin;
|
let silentLogin;
|
||||||
@@ -33,19 +33,17 @@ describe('Login component - SSO', () => {
|
|||||||
navigationBarPage.clickLogoutButton();
|
navigationBarPage.clickLogoutButton();
|
||||||
browser.executeScript('window.sessionStorage.clear();');
|
browser.executeScript('window.sessionStorage.clear();');
|
||||||
browser.executeScript('window.localStorage.clear();');
|
browser.executeScript('window.localStorage.clear();');
|
||||||
});
|
|
||||||
|
|
||||||
it('[C261050] Should be possible login in the PS with SSO', async () => {
|
|
||||||
silentLogin = false;
|
|
||||||
await settingsPage.setProviderBpmSso(TestConfig.adf.hostSso, TestConfig.adf.hostSso + path, silentLogin);
|
|
||||||
await loginApsPage.clickOnSSOButton();
|
|
||||||
browser.ignoreSynchronization = true;
|
|
||||||
await loginApsPage.loginAPS(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it ('[C280667] Should be redirect directly to keycloak without show the login page with silent login', async () => {
|
it('[C261050] Should be possible login in the PS with SSO', () => {
|
||||||
await settingsPage.setProviderBpmSso(TestConfig.adf.hostSso, TestConfig.adf.hostSso + path);
|
silentLogin = false;
|
||||||
browser.ignoreSynchronization = true;
|
settingsPage.setProviderBpmSso(TestConfig.adf.hostSso, TestConfig.adf.hostSso + path, silentLogin);
|
||||||
await loginApsPage.loginAPS(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
loginApsPage.clickOnSSOButton();
|
||||||
|
loginApsPage.loginAPS(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('[C280667] Should be redirect directly to keycloak without show the login page with silent login', () => {
|
||||||
|
settingsPage.setProviderBpmSso(TestConfig.adf.hostSso, TestConfig.adf.hostSso + path);
|
||||||
|
loginApsPage.loginAPS(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -25,12 +25,12 @@ import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
|||||||
import { UserInfoDialog } from '../../pages/adf/dialog/userInfoDialog';
|
import { UserInfoDialog } from '../../pages/adf/dialog/userInfoDialog';
|
||||||
|
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
|
|
||||||
import { SettingsPage } from '../../pages/adf/settingsPage';
|
import { SettingsPage } from '../../pages/adf/settingsPage';
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
|
|
||||||
import Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
|
|
||||||
describe('Login component', () => {
|
describe('Login component', () => {
|
||||||
|
|
||||||
@@ -234,7 +234,6 @@ describe('Login component', () => {
|
|||||||
|
|
||||||
browser.getAllWindowHandles().then((handles) => {
|
browser.getAllWindowHandles().then((handles) => {
|
||||||
|
|
||||||
browser.ignoreSynchronization = true;
|
|
||||||
browser.switchTo().window(handles[1]).then(() => {
|
browser.switchTo().window(handles[1]).then(() => {
|
||||||
browser.get(TestConfig.adf.url + '/activiti');
|
browser.get(TestConfig.adf.url + '/activiti');
|
||||||
processServicesPage.checkApsContainer();
|
processServicesPage.checkApsContainer();
|
||||||
|
|||||||
@@ -23,13 +23,13 @@ import { ProcessServicesPage } from '../../pages/adf/process_services/processSer
|
|||||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||||
|
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
|
|
||||||
import { SettingsPage } from '../../pages/adf/settingsPage';
|
import { SettingsPage } from '../../pages/adf/settingsPage';
|
||||||
|
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
|
|
||||||
import Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||||
|
|
||||||
describe('Login component - Redirect', () => {
|
describe('Login component - Redirect', () => {
|
||||||
@@ -40,14 +40,17 @@ describe('Login component - Redirect', () => {
|
|||||||
let contentServicesPage = new ContentServicesPage();
|
let contentServicesPage = new ContentServicesPage();
|
||||||
let loginPage = new LoginPage();
|
let loginPage = new LoginPage();
|
||||||
let user = new AcsUserModel();
|
let user = new AcsUserModel();
|
||||||
|
let userFolderOwner = new AcsUserModel();
|
||||||
let adminUserModel = new AcsUserModel({
|
let adminUserModel = new AcsUserModel({
|
||||||
'id': TestConfig.adf.adminUser,
|
'id': TestConfig.adf.adminUser,
|
||||||
'password': TestConfig.adf.adminPassword
|
'password': TestConfig.adf.adminPassword
|
||||||
});
|
});
|
||||||
|
let uploadedFolder;
|
||||||
|
let uploadActions = new UploadActions();
|
||||||
|
|
||||||
beforeAll(async (done) => {
|
beforeAll(async (done) => {
|
||||||
this.alfrescoJsApi = new AlfrescoApi({
|
this.alfrescoJsApi = new AlfrescoApi({
|
||||||
provider: 'ALL',
|
provider: 'ECM',
|
||||||
hostEcm: TestConfig.adf.url,
|
hostEcm: TestConfig.adf.url,
|
||||||
hostBpm: TestConfig.adf.url
|
hostBpm: TestConfig.adf.url
|
||||||
});
|
});
|
||||||
@@ -55,6 +58,11 @@ describe('Login component - Redirect', () => {
|
|||||||
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||||
|
|
||||||
await this.alfrescoJsApi.core.peopleApi.addPerson(user);
|
await this.alfrescoJsApi.core.peopleApi.addPerson(user);
|
||||||
|
await this.alfrescoJsApi.core.peopleApi.addPerson(userFolderOwner);
|
||||||
|
|
||||||
|
await this.alfrescoJsApi.login(user.id, user.password);
|
||||||
|
|
||||||
|
uploadedFolder = await uploadActions.uploadFolder(this.alfrescoJsApi, 'protecteFolder' + Util.generateRandomString(), '-my-');
|
||||||
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
@@ -100,16 +108,10 @@ describe('Login component - Redirect', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('[C260088] Should be re-redirect to the request URL after login when try to access to a protect URL ', () => {
|
it('[C260088] Should be re-redirect to the request URL after login when try to access to a protect URL ', () => {
|
||||||
let uploadActions = new UploadActions();
|
|
||||||
|
|
||||||
let uploadedFolder;
|
|
||||||
let folderName = Util.generateRandomString();
|
|
||||||
|
|
||||||
settingsPage.setProviderEcm();
|
settingsPage.setProviderEcm();
|
||||||
loginPage.login(user.id, user.password);
|
loginPage.login(user.id, user.password);
|
||||||
|
|
||||||
browser.controlFlow().execute(async () => {
|
browser.controlFlow().execute(async () => {
|
||||||
uploadedFolder = await uploadActions.uploadFolder(this.alfrescoJsApi, folderName, '-my-');
|
|
||||||
|
|
||||||
navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
|
navigationBarPage.openContentServicesFolder(uploadedFolder.entry.id);
|
||||||
|
|
||||||
|
|||||||
@@ -17,13 +17,13 @@
|
|||||||
|
|
||||||
import { LoginPage } from '../pages/adf/loginPage';
|
import { LoginPage } from '../pages/adf/loginPage';
|
||||||
import { ContentServicesPage } from '../pages/adf/contentServicesPage';
|
import { ContentServicesPage } from '../pages/adf/contentServicesPage';
|
||||||
import PaginationPage = require('../pages/adf/paginationPage');
|
import { PaginationPage } from '../pages/adf/paginationPage';
|
||||||
|
import { Util } from '../util/util';
|
||||||
|
|
||||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||||
import FolderModel = require('../models/ACS/folderModel');
|
import { FolderModel } from '../models/ACS/folderModel';
|
||||||
|
|
||||||
import TestConfig = require('../test.config');
|
import TestConfig = require('../test.config');
|
||||||
import Util = require('../util/util');
|
|
||||||
|
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
import { UploadActions } from '../actions/ACS/upload.actions';
|
import { UploadActions } from '../actions/ACS/upload.actions';
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ import { LoginPage } from '../pages/adf/loginPage';
|
|||||||
import { UserInfoDialog } from '../pages/adf/dialog/userInfoDialog';
|
import { UserInfoDialog } from '../pages/adf/dialog/userInfoDialog';
|
||||||
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
||||||
|
|
||||||
import AcsUserModel = require('../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../models/ACS/acsUserModel';
|
||||||
import FileModel = require('../models/ACS/fileModel');
|
import { FileModel } from '../models/ACS/fileModel';
|
||||||
|
|
||||||
import PeopleAPI = require('../restAPI/ACS/PeopleAPI');
|
import PeopleAPI = require('../restAPI/ACS/PeopleAPI');
|
||||||
|
|
||||||
|
|||||||
@@ -21,16 +21,16 @@ import { LoginPage } from '../../pages/adf/loginPage';
|
|||||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||||
import ContentListPage = require('../../pages/adf/dialog/contentList');
|
import { ContentListPage } from '../../pages/adf/dialog/contentListPage';
|
||||||
import { ShareDialog } from '../../pages/adf/dialog/shareDialog';
|
import { ShareDialog } from '../../pages/adf/dialog/shareDialog';
|
||||||
|
|
||||||
import resources = require('../../util/resources');
|
import resources = require('../../util/resources');
|
||||||
import Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
import CONSTANTS = require('../../util/constants');
|
import CONSTANTS = require('../../util/constants');
|
||||||
|
|
||||||
import FileModel = require('../../models/ACS/fileModel');
|
import { FileModel } from '../../models/ACS/fileModel';
|
||||||
import FolderModel = require('../../models/ACS/folderModel');
|
import { FolderModel } from '../../models/ACS/folderModel';
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
|
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ import { ViewerPage } from '../../pages/adf/viewerPage';
|
|||||||
|
|
||||||
import resources = require('../../util/resources');
|
import resources = require('../../util/resources');
|
||||||
|
|
||||||
import FileModel = require('../../models/ACS/fileModel');
|
import { FileModel } from '../../models/ACS/fileModel';
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
|
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
|||||||
|
|
||||||
import resources = require('../../util/resources');
|
import resources = require('../../util/resources');
|
||||||
|
|
||||||
import FileModel = require('../../models/ACS/fileModel');
|
import { FileModel } from '../../models/ACS/fileModel';
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
|
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||||
|
|||||||
@@ -21,12 +21,12 @@ import { LoginPage } from '../../pages/adf/loginPage';
|
|||||||
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
import { ContentServicesPage } from '../../pages/adf/contentServicesPage';
|
||||||
import { ViewerPage } from '../../pages/adf/viewerPage';
|
import { ViewerPage } from '../../pages/adf/viewerPage';
|
||||||
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
import { NavigationBarPage } from '../../pages/adf/navigationBarPage';
|
||||||
import DataTablePage = require('../../pages/adf/dataTablePage');
|
import { DataTablePage } from '../../pages/adf/dataTablePage';
|
||||||
|
|
||||||
import resources = require('../../util/resources');
|
import resources = require('../../util/resources');
|
||||||
|
|
||||||
import FileModel = require('../../models/ACS/fileModel');
|
import { FileModel } from '../../models/ACS/fileModel';
|
||||||
import AcsUserModel = require('../../models/ACS/acsUserModel');
|
import { AcsUserModel } from '../../models/ACS/acsUserModel';
|
||||||
|
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
import { UploadActions } from '../../actions/ACS/upload.actions';
|
import { UploadActions } from '../../actions/ACS/upload.actions';
|
||||||
|
|||||||
@@ -17,12 +17,12 @@
|
|||||||
|
|
||||||
import { LoginPage } from '../pages/adf/loginPage';
|
import { LoginPage } from '../pages/adf/loginPage';
|
||||||
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
||||||
import AnalyticsPage = require('../pages/adf/process_services/analyticsPage');
|
import { AnalyticsPage } from '../pages/adf/process_services/analyticsPage';
|
||||||
import { ProcessServicesPage } from '../pages/adf/process_services/processServicesPage';
|
import { ProcessServicesPage } from '../pages/adf/process_services/processServicesPage';
|
||||||
import { AppNavigationBarPage } from '../pages/adf/process_services/appNavigationBarPage';
|
import { AppNavigationBarPage } from '../pages/adf/process_services/appNavigationBarPage';
|
||||||
import TestConfig = require('../test.config');
|
import TestConfig = require('../test.config');
|
||||||
import Tenant = require('../models/APS/Tenant');
|
import { Tenant } from '../models/APS/Tenant';
|
||||||
import User = require('../models/APS/User');
|
import { User } from '../models/APS/User';
|
||||||
|
|
||||||
import AlfrescoApi = require('alfresco-js-api-node');
|
import AlfrescoApi = require('alfresco-js-api-node');
|
||||||
|
|
||||||
|
|||||||
@@ -15,42 +15,43 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
|
|
||||||
var AcsUserModel = function (details) {
|
export class AcsUserModel {
|
||||||
|
|
||||||
this.firstName = Util.generateRandomString();
|
firstName = Util.generateRandomString();
|
||||||
this.lastName = Util.generateRandomString();
|
lastName = Util.generateRandomString();
|
||||||
this.password = Util.generateRandomString();
|
password = Util.generateRandomString();
|
||||||
this.email = Util.generateRandomString();
|
email = Util.generateRandomString();
|
||||||
this.id = Util.generateRandomString();
|
id = Util.generateRandomString();
|
||||||
this.jobTitle = "N/A";
|
jobTitle = 'N/A';
|
||||||
|
|
||||||
this.getFirstName = function () {
|
constructor(details?: any) {
|
||||||
|
Object.assign(this, details);
|
||||||
|
}
|
||||||
|
|
||||||
|
getFirstName = function () {
|
||||||
return this.firstName;
|
return this.firstName;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getLastName = function () {
|
getLastName = function () {
|
||||||
return this.lastName;
|
return this.lastName;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getPassword = function () {
|
getPassword = function () {
|
||||||
return this.password;
|
return this.password;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getEmail = function () {
|
getEmail = function () {
|
||||||
return this.email;
|
return this.email;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getId = function () {
|
getId = function () {
|
||||||
return this.id;
|
return this.id;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getJobTitle = function () {
|
getJobTitle = function () {
|
||||||
return this.jobTitle;
|
return this.jobTitle;
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.assign(this, details);
|
}
|
||||||
|
|
||||||
};
|
|
||||||
module.exports = AcsUserModel;
|
|
||||||
@@ -15,22 +15,22 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
|
|
||||||
var AcsUserModel = function (details) {
|
export class CreatedByModel {
|
||||||
|
displayName = Util.generateRandomString();
|
||||||
|
id = Util.generateRandomString();
|
||||||
|
|
||||||
this.displayName = Util.generateRandomString();
|
constructor(details?: any) {
|
||||||
this.id = Util.generateRandomString();
|
Object.assign(this, details);
|
||||||
|
}
|
||||||
|
|
||||||
this.getId = function () {
|
getId() {
|
||||||
return this.id;
|
return this.id;
|
||||||
};
|
}
|
||||||
|
|
||||||
this.getDisplayName = function () {
|
getDisplayName() {
|
||||||
return this.displayName;
|
return this.displayName;
|
||||||
};
|
}
|
||||||
|
|
||||||
Object.assign(this, details);
|
}
|
||||||
|
|
||||||
};
|
|
||||||
module.exports = AcsUserModel;
|
|
||||||
@@ -1,116 +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 resources = require('../../util/resources');
|
|
||||||
var CreatedByModel = require('./createdByModel');
|
|
||||||
var ContentModel = require('./contentModel');
|
|
||||||
var ContentPropertiesModel = require('./contentProperties');
|
|
||||||
|
|
||||||
var FileModel = function (details) {
|
|
||||||
|
|
||||||
this.id = Util.generateRandomString();
|
|
||||||
this.name = Util.generateRandomString();
|
|
||||||
this.shortName = this.name;
|
|
||||||
this.location = resources.Files.ADF_DOCUMENTS.PDF.file_location;
|
|
||||||
this.tooltip = this.name;
|
|
||||||
this.version = "";
|
|
||||||
this.firstPageText = resources.Files.ADF_DOCUMENTS.PDF.first_page_text;
|
|
||||||
this.lastPageText = resources.Files.ADF_DOCUMENTS.PDF.last_page_text;
|
|
||||||
this.secondPageText = resources.Files.ADF_DOCUMENTS.PDF.second_page_text;
|
|
||||||
this.lastPageNumber = resources.Files.ADF_DOCUMENTS.PDF.last_page_number;
|
|
||||||
this.createdAt = "";
|
|
||||||
this.createdByUser = {};
|
|
||||||
this.modifiedByUser = {};
|
|
||||||
this.content = {};
|
|
||||||
this.properties = {};
|
|
||||||
|
|
||||||
this.getName = function () {
|
|
||||||
return this.name;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.setVersion = function (ver) {
|
|
||||||
this.version = "-" + ver;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getVersionName = function () {
|
|
||||||
var extension = this.name.split(".")[1];
|
|
||||||
var name = this.name.split(".")[0];
|
|
||||||
return name + this.version + "." + extension;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getShortName = function () {
|
|
||||||
return this.shortName;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getLocation = function () {
|
|
||||||
return this.location;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getTooltip = function () {
|
|
||||||
return this.tooltip;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getId = function () {
|
|
||||||
return this.id;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getFirstPageText = function () {
|
|
||||||
return this.firstPageText;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getLastPageText = function () {
|
|
||||||
return this.lastPageText;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getSecondPageText = function () {
|
|
||||||
return this.secondPageText;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getLastPageNumber = function () {
|
|
||||||
return this.lastPageNumber;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getCreatedByUser = function () {
|
|
||||||
return this.createdByUser;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getModifiedByUser = function () {
|
|
||||||
return this.modifiedByUser;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getContent = function () {
|
|
||||||
return this.content;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getProperties = function () {
|
|
||||||
return this.properties;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.update = function(details) {
|
|
||||||
Object.assign(this, {
|
|
||||||
createdByUser: new CreatedByModel(details.createdByUser),
|
|
||||||
modifiedByUser: new CreatedByModel(details.modifiedByUser),
|
|
||||||
content: new ContentModel(details.content),
|
|
||||||
properties: new ContentPropertiesModel(details.properties)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
Object.assign(this, details);
|
|
||||||
|
|
||||||
};
|
|
||||||
module.exports = FileModel;
|
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
/*!
|
||||||
|
* @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 resources = require('../../util/resources');
|
||||||
|
import ContentModel = require('./contentModel');
|
||||||
|
import ContentPropertiesModel = require('./contentProperties');
|
||||||
|
import { CreatedByModel } from './createdByModel';
|
||||||
|
import { Util } from '../../util/util';
|
||||||
|
|
||||||
|
export class FileModel {
|
||||||
|
|
||||||
|
id = Util.generateRandomString();
|
||||||
|
name = Util.generateRandomString();
|
||||||
|
shortName = this.name;
|
||||||
|
location = resources.Files.ADF_DOCUMENTS.PDF.file_location;
|
||||||
|
tooltip = this.name;
|
||||||
|
version = '';
|
||||||
|
firstPageText = resources.Files.ADF_DOCUMENTS.PDF.first_page_text;
|
||||||
|
lastPageText = resources.Files.ADF_DOCUMENTS.PDF.last_page_text;
|
||||||
|
secondPageText = resources.Files.ADF_DOCUMENTS.PDF.second_page_text;
|
||||||
|
lastPageNumber = resources.Files.ADF_DOCUMENTS.PDF.last_page_number;
|
||||||
|
createdAt = '';
|
||||||
|
createdByUser = {};
|
||||||
|
modifiedByUser = {};
|
||||||
|
content = {};
|
||||||
|
properties = {};
|
||||||
|
|
||||||
|
constructor(details?: any) {
|
||||||
|
Object.assign(this, details);
|
||||||
|
}
|
||||||
|
|
||||||
|
getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
setVersion(ver) {
|
||||||
|
this.version = '-' + ver;
|
||||||
|
}
|
||||||
|
|
||||||
|
getVersionName() {
|
||||||
|
let extension = this.name.split('.')[1];
|
||||||
|
let name = this.name.split('.')[0];
|
||||||
|
return name + this.version + '.' + extension;
|
||||||
|
}
|
||||||
|
|
||||||
|
getShortName() {
|
||||||
|
return this.shortName;
|
||||||
|
}
|
||||||
|
|
||||||
|
getLocation() {
|
||||||
|
return this.location;
|
||||||
|
}
|
||||||
|
|
||||||
|
getTooltip() {
|
||||||
|
return this.tooltip;
|
||||||
|
}
|
||||||
|
|
||||||
|
getId() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
getFirstPageText() {
|
||||||
|
return this.firstPageText;
|
||||||
|
}
|
||||||
|
|
||||||
|
getLastPageText() {
|
||||||
|
return this.lastPageText;
|
||||||
|
}
|
||||||
|
|
||||||
|
getSecondPageText() {
|
||||||
|
return this.secondPageText;
|
||||||
|
}
|
||||||
|
|
||||||
|
getLastPageNumber() {
|
||||||
|
return this.lastPageNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
getCreatedByUser() {
|
||||||
|
return this.createdByUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
getModifiedByUser() {
|
||||||
|
return this.modifiedByUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
getContent() {
|
||||||
|
return this.content;
|
||||||
|
}
|
||||||
|
|
||||||
|
getProperties() {
|
||||||
|
return this.properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
update(details) {
|
||||||
|
Object.assign(this, {
|
||||||
|
createdByUser: new CreatedByModel(details.createdByUser),
|
||||||
|
modifiedByUser: new CreatedByModel(details.modifiedByUser),
|
||||||
|
content: new ContentModel(details.content),
|
||||||
|
properties: new ContentPropertiesModel(details.properties)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,34 +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 FileModel = require('./fileModel');
|
|
||||||
|
|
||||||
var FilesModel = function () {
|
|
||||||
|
|
||||||
var files = null;
|
|
||||||
|
|
||||||
this.setFiles = function (arr) {
|
|
||||||
files = arr.map(function(item) {
|
|
||||||
return new FileModel(item.entry);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getFiles = function () {
|
|
||||||
return files;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
module.exports = FilesModel;
|
|
||||||
@@ -15,39 +15,39 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
|
|
||||||
var FolderModel = function (details) {
|
export class FolderModel {
|
||||||
|
|
||||||
this.id = Util.generateRandomString();
|
id = Util.generateRandomString();
|
||||||
this.name = Util.generateRandomString();
|
name = Util.generateRandomString();
|
||||||
this.shortName = this.name;
|
shortName = this.name;
|
||||||
this.tooltip = this.name;
|
tooltip = this.name;
|
||||||
this.location = "";
|
location = '';
|
||||||
this.description= "";
|
description = '';
|
||||||
|
|
||||||
this.getName = function () {
|
constructor(details?: any) {
|
||||||
|
Object.assign(this, details);
|
||||||
|
}
|
||||||
|
|
||||||
|
getName() {
|
||||||
return this.name;
|
return this.name;
|
||||||
};
|
}
|
||||||
|
|
||||||
this.getShortName = function () {
|
getShortName() {
|
||||||
return this.shortName;
|
return this.shortName;
|
||||||
};
|
}
|
||||||
|
|
||||||
this.getTooltip = function () {
|
getTooltip() {
|
||||||
return this.tooltip;
|
return this.tooltip;
|
||||||
};
|
}
|
||||||
|
|
||||||
this.getId = function () {
|
getId() {
|
||||||
return this.id;
|
return this.id;
|
||||||
};
|
}
|
||||||
|
|
||||||
this.getLocation = function () {
|
getLocation() {
|
||||||
return this.location;
|
return this.location;
|
||||||
};
|
}
|
||||||
|
|
||||||
Object.assign(this, details);
|
|
||||||
|
|
||||||
};
|
|
||||||
module.exports = FolderModel;
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,37 +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');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create Group Object
|
|
||||||
*
|
|
||||||
* @param details - Group object used to overwrite the default values
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
|
|
||||||
var Group = function (details) {
|
|
||||||
|
|
||||||
this.name = Util.generateRandomString();
|
|
||||||
this.type = "1";
|
|
||||||
this.parentGroupId = null;
|
|
||||||
this.tenantId = "1";
|
|
||||||
|
|
||||||
Object.assign(this, details);
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = Group;
|
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create Json Object for standalone task
|
* Create Json Object for standalone task
|
||||||
@@ -23,11 +23,12 @@ var Util = require('../../util/util');
|
|||||||
* @param details - JSON object used to overwrite the default values
|
* @param details - JSON object used to overwrite the default values
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
|
export class StandaloneTask {
|
||||||
|
|
||||||
var StandaloneTask = function (details) {
|
name = Util.generateRandomString();
|
||||||
|
|
||||||
this.name = Util.generateRandomString();
|
constructor(details?: any) {
|
||||||
|
Object.assign(this, details);
|
||||||
|
}
|
||||||
|
|
||||||
Object.assign(this, details);
|
}
|
||||||
};
|
|
||||||
module.exports = StandaloneTask;
|
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create tenant JSON Object
|
* Create tenant JSON Object
|
||||||
@@ -23,14 +23,16 @@ var Util = require('../../util/util');
|
|||||||
* @param details - JSON object used to overwrite the default values
|
* @param details - JSON object used to overwrite the default values
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
var Tenant = function (details) {
|
export class Tenant {
|
||||||
this.active = true;
|
|
||||||
this.configuration = "DefaultConfig";
|
|
||||||
this.domain = "DefaultDomain";
|
|
||||||
this.maxUsers = 10;
|
|
||||||
this.name = Util.generateRandomString();
|
|
||||||
|
|
||||||
Object.assign(this, details);
|
active = true;
|
||||||
};
|
configuration = 'DefaultConfig';
|
||||||
|
domain = 'DefaultDomain';
|
||||||
|
maxUsers = 10;
|
||||||
|
name = Util.generateRandomString();
|
||||||
|
|
||||||
module.exports = Tenant;
|
constructor(details?: any) {
|
||||||
|
Object.assign(this, details);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -15,25 +15,25 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create User JSON Object
|
* Create tenant JSON Object
|
||||||
*
|
*
|
||||||
* @param details - JSON object used to overwrite the default values
|
* @param details - JSON object used to overwrite the default values
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
|
export class User {
|
||||||
|
|
||||||
var User = function (details) {
|
email = Util.generateRandomEmail();
|
||||||
|
firstName = Util.generateRandomString();
|
||||||
|
lastName = Util.generateRandomString();
|
||||||
|
password = Util.generatePasswordString();
|
||||||
|
type = 'enterprise';
|
||||||
|
tenantId = '1';
|
||||||
|
company = null;
|
||||||
|
|
||||||
this.email = Util.generateRandomEmail();
|
constructor(details?: any) {
|
||||||
this.firstName = Util.generateRandomString();
|
Object.assign(this, details);
|
||||||
this.lastName = Util.generateRandomString();
|
}
|
||||||
this.password = Util.generatePasswordString();
|
}
|
||||||
this.type = 'enterprise';
|
|
||||||
this.tenantId = "1";
|
|
||||||
this.company = null;
|
|
||||||
|
|
||||||
Object.assign(this, details);
|
|
||||||
};
|
|
||||||
module.exports = User;
|
|
||||||
@@ -0,0 +1,236 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright 2016 Alfresco Software, Ltd.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { by, element } from 'protractor';
|
||||||
|
import { Util } from '../../util/util';
|
||||||
|
|
||||||
|
export class CardViewComponentPage {
|
||||||
|
|
||||||
|
addButton = element(by.className('adf-card-view__key-value-pairs__add-btn'));
|
||||||
|
keyValueRow = 'card-view__key-value-pairs__row';
|
||||||
|
selectValue = 'mat-option';
|
||||||
|
textField = element(by.css(`input[data-automation-id='card-textitem-editinput-name']`));
|
||||||
|
intField = element(by.css(`input[data-automation-id='card-textitem-editinput-int']`));
|
||||||
|
floatField = element(by.css(`input[data-automation-id='card-textitem-editinput-float']`));
|
||||||
|
valueInputField = element(by.xpath(`//*[contains(@id,'input') and @placeholder='Value']`));
|
||||||
|
nameInputField = element(by.xpath(`//*[contains(@id,'input') and @placeholder='Name']`));
|
||||||
|
consoleLog = element(by.className('adf-console'));
|
||||||
|
deleteButton = element.all(by.className('adf-card-view__key-value-pairs__remove-btn')).first();
|
||||||
|
select = element(by.css('mat-select[data-automation-class="select-box"]'));
|
||||||
|
checkbox = element(by.css(`mat-checkbox[data-automation-id='card-boolean-boolean']`));
|
||||||
|
resetButton = element(by.css(`#adf-reset-card-log`));
|
||||||
|
selectedValue = element(by.css('.mat-select-value-text span'));
|
||||||
|
listContent = element(by.className('mat-select-content'));
|
||||||
|
editableSwitch = element(by.id('adf-toggle-editable'));
|
||||||
|
|
||||||
|
clickOnAddButton() {
|
||||||
|
Util.waitUntilElementIsVisible(this.addButton);
|
||||||
|
this.addButton.click();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
clickOnResetButton() {
|
||||||
|
Util.waitUntilElementIsVisible(this.resetButton);
|
||||||
|
this.resetButton.click();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
clickOnTextField() {
|
||||||
|
let toggleText = element(by.css(`div[data-automation-id='card-textitem-edit-toggle-name']`));
|
||||||
|
Util.waitUntilElementIsVisible(toggleText);
|
||||||
|
toggleText.click();
|
||||||
|
Util.waitUntilElementIsVisible(this.textField);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
clickOnTextClearIcon() {
|
||||||
|
let clearIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-reset-name"]`));
|
||||||
|
Util.waitUntilElementIsVisible(clearIcon);
|
||||||
|
return clearIcon.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
clickOnTextSaveIcon() {
|
||||||
|
let saveIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-update-name"]`));
|
||||||
|
Util.waitUntilElementIsVisible(saveIcon);
|
||||||
|
return saveIcon.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
getTextFieldText() {
|
||||||
|
let textField = element(by.css(`span[data-automation-id="card-textitem-value-name"]`));
|
||||||
|
Util.waitUntilElementIsVisible(textField);
|
||||||
|
return textField.getText();
|
||||||
|
}
|
||||||
|
|
||||||
|
enterTextField(text) {
|
||||||
|
Util.waitUntilElementIsVisible(this.textField);
|
||||||
|
this.textField.sendKeys('');
|
||||||
|
this.textField.clear();
|
||||||
|
this.textField.sendKeys(text);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
clickOnIntField() {
|
||||||
|
let toggleText = element(by.css('div[data-automation-id="card-textitem-edit-toggle-int"]'));
|
||||||
|
Util.waitUntilElementIsVisible(toggleText);
|
||||||
|
toggleText.click();
|
||||||
|
Util.waitUntilElementIsVisible(this.intField);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
clickOnIntClearIcon() {
|
||||||
|
let clearIcon = element(by.css('mat-icon[data-automation-id="card-textitem-reset-int"]'));
|
||||||
|
Util.waitUntilElementIsVisible(clearIcon);
|
||||||
|
return clearIcon.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
clickOnIntSaveIcon() {
|
||||||
|
let saveIcon = element(by.css('mat-icon[data-automation-id="card-textitem-update-int"]'));
|
||||||
|
Util.waitUntilElementIsVisible(saveIcon);
|
||||||
|
return saveIcon.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
enterIntField(text) {
|
||||||
|
Util.waitUntilElementIsVisible(this.intField);
|
||||||
|
this.intField.sendKeys('');
|
||||||
|
this.intField.clear();
|
||||||
|
this.intField.sendKeys(text);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
getIntFieldText() {
|
||||||
|
let textField = element(by.css('span[data-automation-id="card-textitem-value-int"]'));
|
||||||
|
Util.waitUntilElementIsVisible(textField);
|
||||||
|
return textField.getText();
|
||||||
|
}
|
||||||
|
|
||||||
|
getErrorInt() {
|
||||||
|
let errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-int"]'));
|
||||||
|
Util.waitUntilElementIsVisible(errorElement);
|
||||||
|
return errorElement.getText();
|
||||||
|
}
|
||||||
|
|
||||||
|
clickOnFloatField() {
|
||||||
|
let toggleText = element(by.css('div[data-automation-id="card-textitem-edit-toggle-float"]'));
|
||||||
|
Util.waitUntilElementIsVisible(toggleText);
|
||||||
|
toggleText.click();
|
||||||
|
Util.waitUntilElementIsVisible(this.floatField);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
clickOnFloatClearIcon() {
|
||||||
|
let clearIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-reset-float"]`));
|
||||||
|
Util.waitUntilElementIsVisible(clearIcon);
|
||||||
|
return clearIcon.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
clickOnFloatSaveIcon() {
|
||||||
|
let saveIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-update-float"]`));
|
||||||
|
Util.waitUntilElementIsVisible(saveIcon);
|
||||||
|
return saveIcon.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
enterFloatField(text) {
|
||||||
|
Util.waitUntilElementIsVisible(this.floatField);
|
||||||
|
this.floatField.sendKeys('');
|
||||||
|
this.floatField.clear();
|
||||||
|
this.floatField.sendKeys(text);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
getFloatFieldText() {
|
||||||
|
let textField = element(by.css('span[data-automation-id="card-textitem-value-float"]'));
|
||||||
|
Util.waitUntilElementIsVisible(textField);
|
||||||
|
return textField.getText();
|
||||||
|
}
|
||||||
|
|
||||||
|
getErrorFloat() {
|
||||||
|
let errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-float"]'));
|
||||||
|
Util.waitUntilElementIsVisible(errorElement);
|
||||||
|
return errorElement.getText();
|
||||||
|
}
|
||||||
|
|
||||||
|
setName(name) {
|
||||||
|
Util.waitUntilElementIsVisible(this.nameInputField);
|
||||||
|
this.nameInputField.sendKeys(name);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
setValue(value) {
|
||||||
|
Util.waitUntilElementIsVisible(this.valueInputField);
|
||||||
|
this.valueInputField.sendKeys(value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
waitForOutput() {
|
||||||
|
Util.waitUntilElementIsVisible(this.consoleLog);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
getOutputText(index) {
|
||||||
|
return this.consoleLog.all(by.css('p')).get(index).getText();
|
||||||
|
}
|
||||||
|
|
||||||
|
deletePairsValues() {
|
||||||
|
Util.waitUntilElementIsVisible(this.deleteButton);
|
||||||
|
this.deleteButton.click();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkNameAndValueVisibility(index) {
|
||||||
|
Util.waitUntilElementIsNotOnPage(this.getKeyValueRow(index));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
getKeyValueRow(index) {
|
||||||
|
return element.all(by.css(this.keyValueRow)).get(index);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
getMatSelectValue(index) {
|
||||||
|
return element.all(by.className(this.selectValue)).get(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
clickSelectBox() {
|
||||||
|
this.select.click();
|
||||||
|
Util.waitUntilElementIsVisible(this.listContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
checkboxClick() {
|
||||||
|
this.checkbox.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
selectValueFromComboBox(index) {
|
||||||
|
this.getMatSelectValue(index).click();
|
||||||
|
Util.waitUntilElementIsVisible(this.consoleLog);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
getSelectionValue() {
|
||||||
|
return this.selectedValue.getText();
|
||||||
|
}
|
||||||
|
|
||||||
|
disableEdit() {
|
||||||
|
Util.waitUntilElementIsVisible(this.editableSwitch);
|
||||||
|
this.editableSwitch.getAttribute('class').then((check) => {
|
||||||
|
if (check === 'mat-slide-toggle mat-primary mat-checked') {
|
||||||
|
this.editableSwitch.click();
|
||||||
|
expect(this.editableSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,234 +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 CardViewComponentPage = function () {
|
|
||||||
|
|
||||||
const addButton = element(by.className('adf-card-view__key-value-pairs__add-btn'));
|
|
||||||
const keyValueRow = 'card-view__key-value-pairs__row';
|
|
||||||
const selectValue = 'mat-option';
|
|
||||||
const textField = element(by.css("input[data-automation-id='card-textitem-editinput-name']"));
|
|
||||||
const intField = element(by.css("input[data-automation-id='card-textitem-editinput-int']"));
|
|
||||||
const floatField = element(by.css("input[data-automation-id='card-textitem-editinput-float']"));
|
|
||||||
const valueInputField = element(by.xpath("//*[contains(@id,'input') and @placeholder='Value']"));
|
|
||||||
const nameInputField = element(by.xpath("//*[contains(@id,'input') and @placeholder='Name']"));
|
|
||||||
const consoleLog = element(by.className('adf-console'));
|
|
||||||
const deleteButton = element.all(by.className('adf-card-view__key-value-pairs__remove-btn')).first();
|
|
||||||
const select = element(by.css('mat-select[data-automation-class="select-box"]'));
|
|
||||||
const checkbox = element(by.css("mat-checkbox[data-automation-id='card-boolean-boolean']"));
|
|
||||||
const resetButton = element(by.css("#adf-reset-card-log"));
|
|
||||||
const selectedValue = element(by.css('.mat-select-value-text span'));
|
|
||||||
const listContent = element(by.className('mat-select-content'));
|
|
||||||
const editableSwitch = element(by.id('adf-toggle-editable'));
|
|
||||||
|
|
||||||
this.clickOnAddButton = function () {
|
|
||||||
Util.waitUntilElementIsVisible(addButton);
|
|
||||||
addButton.click();
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.clickOnResetButton= function () {
|
|
||||||
Util.waitUntilElementIsVisible(resetButton);
|
|
||||||
resetButton.click();
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.clickOnTextField = function () {
|
|
||||||
let toggleText = element(by.css("div[data-automation-id='card-textitem-edit-toggle-name']"));
|
|
||||||
Util.waitUntilElementIsVisible(toggleText);
|
|
||||||
toggleText.click();
|
|
||||||
Util.waitUntilElementIsVisible(textField);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.clickOnTextClearIcon = function () {
|
|
||||||
let clearIcon = element(by.css("mat-icon[data-automation-id=\"card-textitem-reset-name\"]"));
|
|
||||||
Util.waitUntilElementIsVisible(clearIcon);
|
|
||||||
return clearIcon.click();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.clickOnTextSaveIcon = function () {
|
|
||||||
let saveIcon = element(by.css("mat-icon[data-automation-id=\"card-textitem-update-name\"]"));
|
|
||||||
Util.waitUntilElementIsVisible(saveIcon);
|
|
||||||
return saveIcon.click();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getTextFieldText = function () {
|
|
||||||
var textField = element(by.css("span[data-automation-id='card-textitem-value-name']"));
|
|
||||||
Util.waitUntilElementIsVisible(textField);
|
|
||||||
return textField.getText();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.enterTextField = function (text) {
|
|
||||||
Util.waitUntilElementIsVisible(textField);
|
|
||||||
textField.sendKeys('');
|
|
||||||
textField.clear().sendKeys(text);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.clickOnIntField = function () {
|
|
||||||
let toggleText = element(by.css('div[data-automation-id="card-textitem-edit-toggle-int"]'));
|
|
||||||
Util.waitUntilElementIsVisible(toggleText);
|
|
||||||
toggleText.click();
|
|
||||||
Util.waitUntilElementIsVisible(intField);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.clickOnIntClearIcon = function () {
|
|
||||||
let clearIcon = element(by.css('mat-icon[data-automation-id="card-textitem-reset-int"]'));
|
|
||||||
Util.waitUntilElementIsVisible(clearIcon);
|
|
||||||
return clearIcon.click();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.clickOnIntSaveIcon = function () {
|
|
||||||
let saveIcon = element(by.css('mat-icon[data-automation-id="card-textitem-update-int"]'));
|
|
||||||
Util.waitUntilElementIsVisible(saveIcon);
|
|
||||||
return saveIcon.click();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.enterIntField = function (text) {
|
|
||||||
Util.waitUntilElementIsVisible(intField);
|
|
||||||
intField.sendKeys('');
|
|
||||||
intField.clear().sendKeys(text);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getIntFieldText = function () {
|
|
||||||
var textField = element(by.css('span[data-automation-id="card-textitem-value-int"]'));
|
|
||||||
Util.waitUntilElementIsVisible(textField);
|
|
||||||
return textField.getText();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getErrorInt = function () {
|
|
||||||
let errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-int"]'));
|
|
||||||
Util.waitUntilElementIsVisible(errorElement);
|
|
||||||
return errorElement.getText();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.clickOnFloatField = function () {
|
|
||||||
let toggleText = element(by.css('div[data-automation-id="card-textitem-edit-toggle-float"]'));
|
|
||||||
Util.waitUntilElementIsVisible(toggleText);
|
|
||||||
toggleText.click();
|
|
||||||
Util.waitUntilElementIsVisible(floatField);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.clickOnFloatClearIcon = function () {
|
|
||||||
let clearIcon = element(by.css("mat-icon[data-automation-id='card-textitem-reset-float']"));
|
|
||||||
Util.waitUntilElementIsVisible(clearIcon);
|
|
||||||
return clearIcon.click();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.clickOnFloatSaveIcon = function () {
|
|
||||||
let saveIcon = element(by.css("mat-icon[data-automation-id='card-textitem-update-float']"));
|
|
||||||
Util.waitUntilElementIsVisible(saveIcon);
|
|
||||||
return saveIcon.click();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.enterFloatField = function (text) {
|
|
||||||
Util.waitUntilElementIsVisible(floatField);
|
|
||||||
floatField.sendKeys('');
|
|
||||||
floatField.clear().sendKeys(text);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getFloatFieldText = function () {
|
|
||||||
var textField = element(by.css('span[data-automation-id="card-textitem-value-float"]'));
|
|
||||||
Util.waitUntilElementIsVisible(textField);
|
|
||||||
return textField.getText();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getErrorFloat = function () {
|
|
||||||
let errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-float"]'));
|
|
||||||
Util.waitUntilElementIsVisible(errorElement);
|
|
||||||
return errorElement.getText();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.setName = function (name) {
|
|
||||||
Util.waitUntilElementIsVisible(nameInputField);
|
|
||||||
nameInputField.sendKeys(name);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.setValue = function (value) {
|
|
||||||
Util.waitUntilElementIsVisible(valueInputField);
|
|
||||||
valueInputField.sendKeys(value);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
this.waitForOutput = function () {
|
|
||||||
Util.waitUntilElementIsVisible(consoleLog);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getOutputText = function (index) {
|
|
||||||
return consoleLog.all(by.css('p')).get(index).getText();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.deletePairsValues = function () {
|
|
||||||
Util.waitUntilElementIsVisible(deleteButton);
|
|
||||||
deleteButton.click();
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkNameAndValueVisibility = (index) => {
|
|
||||||
Util.waitUntilElementIsNotOnPage(this.getKeyValueRow(index));
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getKeyValueRow = (index) => {
|
|
||||||
return element.all(by.css(keyValueRow)).get(index);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getMatSelectValue = (index) => {
|
|
||||||
return element.all(by.className(selectValue)).get(index);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.clickSelectBox = () => {
|
|
||||||
select.click();
|
|
||||||
Util.waitUntilElementIsVisible(listContent);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkboxClick = () => {
|
|
||||||
checkbox.click();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.selectValueFromComboBox = (index) => {
|
|
||||||
this.getMatSelectValue(index).click();
|
|
||||||
Util.waitUntilElementIsVisible(consoleLog);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getSelectionValue = () => {
|
|
||||||
return selectedValue.getText();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.disableEdit = function () {
|
|
||||||
Util.waitUntilElementIsVisible(editableSwitch);
|
|
||||||
editableSwitch.getAttribute('class').then(function (check) {
|
|
||||||
if (check === 'mat-slide-toggle mat-primary mat-checked') {
|
|
||||||
editableSwitch.click();
|
|
||||||
expect(editableSwitch.getAttribute('class')).toEqual('mat-slide-toggle mat-primary');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
module.exports = CardViewComponentPage;
|
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { element, by } from 'protractor';
|
import { element, by } from 'protractor';
|
||||||
|
|
||||||
import Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
import { TabsPage } from './material/tabsPage';
|
import { TabsPage } from './material/tabsPage';
|
||||||
|
|
||||||
export class CommentsPage {
|
export class CommentsPage {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { element, by, browser } from 'protractor';
|
import { element, by, browser } from 'protractor';
|
||||||
import Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
|
|
||||||
export class ConfigEditorPage {
|
export class ConfigEditorPage {
|
||||||
|
|
||||||
@@ -30,6 +30,7 @@ export class ConfigEditorPage {
|
|||||||
enterBigConfigurationText(text) {
|
enterBigConfigurationText(text) {
|
||||||
let textField = element(by.css('#adf-code-configuration-editor div.overflow-guard > textarea'));
|
let textField = element(by.css('#adf-code-configuration-editor div.overflow-guard > textarea'));
|
||||||
Util.waitUntilElementIsVisible(textField);
|
Util.waitUntilElementIsVisible(textField);
|
||||||
|
|
||||||
browser.executeScript('this.monaco.editor.getModels()[0].setValue(`' + text + '`)');
|
browser.executeScript('this.monaco.editor.getModels()[0].setValue(`' + text + '`)');
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,10 +15,10 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Util = require('../../util/util');
|
|
||||||
import ContentList = require('./dialog/contentList');
|
|
||||||
import CreateFolderDialog = require('./dialog/createFolderDialog');
|
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
|
import { Util } from '../../util/util';
|
||||||
|
import { ContentListPage } from './dialog/contentListPage';
|
||||||
|
import { CreateFolderDialog } from './dialog/createFolderDialog';
|
||||||
import { NavigationBarPage } from './navigationBarPage';
|
import { NavigationBarPage } from './navigationBarPage';
|
||||||
import { by, element, protractor, $$, browser } from 'protractor';
|
import { by, element, protractor, $$, browser } from 'protractor';
|
||||||
|
|
||||||
@@ -26,15 +26,14 @@ import path = require('path');
|
|||||||
|
|
||||||
export class ContentServicesPage {
|
export class ContentServicesPage {
|
||||||
|
|
||||||
contentList = new ContentList();
|
contentList = new ContentListPage();
|
||||||
createFolderDialog = new CreateFolderDialog();
|
createFolderDialog = new CreateFolderDialog();
|
||||||
uploadBorder = element(by.id('document-list-container'));
|
uploadBorder = element(by.id('document-list-container'));
|
||||||
tableBody = element.all(by.css('adf-document-list div[class="adf-datatable-body"]')).first();
|
tableBody = element.all(by.css('adf-document-list div[class="adf-datatable-body"]')).first();
|
||||||
contentServices = element(by.css('a[data-automation-id="Content Services"]'));
|
contentServices = element(by.css('a[data-automation-id="Content Services"]'));
|
||||||
currentFolder = element(by.css('div[class*="adf-breadcrumb-item adf-active"] div'));
|
currentFolder = element(by.css('div[class*="adf-breadcrumb-item adf-active"] div'));
|
||||||
createFolderButton = element(by.cssContainingText('mat-icon', 'create_new_folder'));
|
createFolderButton = element(by.css('button[data-automation-id="create-new-folder"]'));
|
||||||
activeBreadcrumb = element(by.css('div[class*="adf-active"]'));
|
activeBreadcrumb = element(by.css('div[class*="active"]'));
|
||||||
tooltip = by.css('div[class*="--text adf-full-width"] span');
|
|
||||||
uploadFileButton = element(by.css('input[data-automation-id="upload-single-file"]'));
|
uploadFileButton = element(by.css('input[data-automation-id="upload-single-file"]'));
|
||||||
uploadMultipleFileButton = element(by.css('input[data-automation-id="upload-multiple-files"]'));
|
uploadMultipleFileButton = element(by.css('input[data-automation-id="upload-multiple-files"]'));
|
||||||
uploadFolderButton = element(by.css('input[data-automation-id="uploadFolder"]'));
|
uploadFolderButton = element(by.css('input[data-automation-id="uploadFolder"]'));
|
||||||
@@ -57,7 +56,7 @@ export class ContentServicesPage {
|
|||||||
gridViewButton = element(by.css('button[data-automation-id="document-list-grid-view"]'));
|
gridViewButton = element(by.css('button[data-automation-id="document-list-grid-view"]'));
|
||||||
cardViewContainer = element(by.css('div.adf-document-list-container div.adf-data-table-card'));
|
cardViewContainer = element(by.css('div.adf-document-list-container div.adf-data-table-card'));
|
||||||
copyButton = element(by.css('button[data-automation-id="content-node-selector-actions-choose"]'));
|
copyButton = element(by.css('button[data-automation-id="content-node-selector-actions-choose"]'));
|
||||||
searchInputElement = element(by.css('input[data-automation-id="content-node-selector-search-input"'));
|
searchInputElement = element(by.css('input[data-automation-id="content-node-selector-search-input"]'));
|
||||||
shareNodeButton = element(by.cssContainingText('mat-icon', ' share '));
|
shareNodeButton = element(by.cssContainingText('mat-icon', ' share '));
|
||||||
|
|
||||||
getElementsDisplayed() {
|
getElementsDisplayed() {
|
||||||
@@ -82,7 +81,7 @@ export class ContentServicesPage {
|
|||||||
checkElementsSortedByNameAsc(elements) {
|
checkElementsSortedByNameAsc(elements) {
|
||||||
browser.controlFlow().execute(async () => {
|
browser.controlFlow().execute(async () => {
|
||||||
let numberOfElements = await this.numberOfResultsDisplayed();
|
let numberOfElements = await this.numberOfResultsDisplayed();
|
||||||
for (let i = 0; i < (numberOfElements - 1) ; i++ ) {
|
for (let i = 0; i < (numberOfElements - 1); i++) {
|
||||||
expect(JSON.stringify(elements[i]) <= JSON.stringify(elements[i + 1])).toEqual(true);
|
expect(JSON.stringify(elements[i]) <= JSON.stringify(elements[i + 1])).toEqual(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -92,7 +91,7 @@ export class ContentServicesPage {
|
|||||||
checkElementsSortedByNameDesc(elements) {
|
checkElementsSortedByNameDesc(elements) {
|
||||||
browser.controlFlow().execute(async () => {
|
browser.controlFlow().execute(async () => {
|
||||||
let numberOfElements = await this.numberOfResultsDisplayed();
|
let numberOfElements = await this.numberOfResultsDisplayed();
|
||||||
for (let i = 0; i < (numberOfElements - 1) ; i++ ) {
|
for (let i = 0; i < (numberOfElements - 1); i++) {
|
||||||
expect(JSON.stringify(elements[i]) >= JSON.stringify(elements[i + 1])).toEqual(true);
|
expect(JSON.stringify(elements[i]) >= JSON.stringify(elements[i + 1])).toEqual(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -173,12 +172,8 @@ export class ContentServicesPage {
|
|||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
getTooltip(content) {
|
getBreadcrumbTooltip(nodeName: string) {
|
||||||
return this.contentList.getRowByRowName(content).element(this.tooltip).getAttribute('title');
|
return element(by.css(`nav[data-automation-id="breadcrumb"] div[title="${nodeName}"]`)).getAttribute('title');
|
||||||
}
|
|
||||||
|
|
||||||
getBreadcrumbTooltip(content) {
|
|
||||||
return element(by.css('nav[data-automation-id="breadcrumb"] div[title="' + content + '"]')).getAttribute('title');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getAllRowsNameColumn() {
|
getAllRowsNameColumn() {
|
||||||
@@ -259,6 +254,7 @@ export class ContentServicesPage {
|
|||||||
createNewFolder(folder) {
|
createNewFolder(folder) {
|
||||||
this.clickOnCreateNewFolder();
|
this.clickOnCreateNewFolder();
|
||||||
this.createFolderDialog.addFolderName(folder);
|
this.createFolderDialog.addFolderName(folder);
|
||||||
|
browser.sleep(200);
|
||||||
this.createFolderDialog.clickOnCreateButton();
|
this.createFolderDialog.clickOnCreateButton();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -351,7 +347,7 @@ export class ContentServicesPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
checkItemInDocList(fileName) {
|
checkItemInDocList(fileName) {
|
||||||
Util.waitUntilElementIsVisible(element(by.css('div[data-automation-id="text_' + fileName + '"]')));
|
Util.waitUntilElementIsVisible(element(by.css(`div[data-automation-id="text_${fileName}"]`)));
|
||||||
}
|
}
|
||||||
|
|
||||||
enableInfiniteScrolling() {
|
enableInfiniteScrolling() {
|
||||||
@@ -376,7 +372,7 @@ export class ContentServicesPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enableThumbnails() {
|
enableThumbnails() {
|
||||||
let thumbnailSlide = element(by.css('#adf-thumbnails-upload-switch'));
|
let thumbnailSlide = element(by.id('adf-thumbnails-upload-switch'));
|
||||||
Util.waitUntilElementIsVisible(thumbnailSlide);
|
Util.waitUntilElementIsVisible(thumbnailSlide);
|
||||||
thumbnailSlide.click();
|
thumbnailSlide.click();
|
||||||
return this;
|
return this;
|
||||||
@@ -427,7 +423,7 @@ export class ContentServicesPage {
|
|||||||
getColumnValueForRow(file, columnName) {
|
getColumnValueForRow(file, columnName) {
|
||||||
let row = this.contentList.getRowByRowName(file);
|
let row = this.contentList.getRowByRowName(file);
|
||||||
Util.waitUntilElementIsVisible(row);
|
Util.waitUntilElementIsVisible(row);
|
||||||
let rowColumn = row.element(by.css('div[title="' + columnName + '"] span'));
|
let rowColumn = row.element(by.css(`div[title="${columnName}"] span`));
|
||||||
Util.waitUntilElementIsVisible(rowColumn);
|
Util.waitUntilElementIsVisible(rowColumn);
|
||||||
return rowColumn.getText();
|
return rowColumn.getText();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Util = require('../../../../../util/util');
|
import { Util } from '../../../../../util/util';
|
||||||
import { by, browser, protractor } from 'protractor';
|
import { by, browser, protractor } from 'protractor';
|
||||||
import { DatePickerPage } from '../../../material/datePickerPage';
|
import { DatePickerPage } from '../../../material/datePickerPage';
|
||||||
|
|
||||||
|
|||||||
@@ -14,8 +14,8 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
import Util = require('../../../../../util/util');
|
import { Util } from '../../../../../util/util';
|
||||||
import { by, protractor, browser } from 'protractor';
|
import { by, protractor } from 'protractor';
|
||||||
|
|
||||||
export class NumberRangeFilterPage {
|
export class NumberRangeFilterPage {
|
||||||
|
|
||||||
|
|||||||
@@ -15,24 +15,24 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Util = require('../../../../../util/util');
|
import { Util } from '../../../../../util/util';
|
||||||
import { element, by } from 'protractor';
|
import { element, by, ElementFinder } from 'protractor';
|
||||||
|
|
||||||
export class SearchCheckListPage {
|
export class SearchCheckListPage {
|
||||||
|
|
||||||
filter;
|
filter: ElementFinder;
|
||||||
inputBy = by.css('div[class*="mat-expansion-panel-content"] input');
|
inputBy = by.css('div[class*="mat-expansion-panel-content"] input');
|
||||||
showMoreBy = by.css('button[title="Show more"]');
|
showMoreBy = by.css('button[title="Show more"]');
|
||||||
showLessBy = by.css('button[title="Show less"]');
|
showLessBy = by.css('button[title="Show less"]');
|
||||||
clearAllButton = by.css('button');
|
clearAllButton = by.css('button');
|
||||||
|
|
||||||
constructor(filter) {
|
constructor(filter: ElementFinder) {
|
||||||
this.filter = filter;
|
this.filter = filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
clickCheckListOption(option) {
|
clickCheckListOption(option) {
|
||||||
Util.waitUntilElementIsVisible(this.filter);
|
Util.waitUntilElementIsVisible(this.filter);
|
||||||
let result = this.filter.element(by.css(`mat-checkbox[data-automation-id*='-${option}'] .mat-checkbox-inner-container`));
|
let result = this.filter.all(by.css(`mat-checkbox[data-automation-id*='-${option}'] .mat-checkbox-inner-container`)).first();
|
||||||
Util.waitUntilElementIsVisible(result);
|
Util.waitUntilElementIsVisible(result);
|
||||||
Util.waitUntilElementIsClickable(result);
|
Util.waitUntilElementIsClickable(result);
|
||||||
result.click();
|
result.click();
|
||||||
@@ -63,16 +63,16 @@ export class SearchCheckListPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
checkSearchFilterInputIsDisplayed() {
|
checkSearchFilterInputIsDisplayed() {
|
||||||
Util.waitUntilElementIsVisible(this.filter.element(this.inputBy));
|
Util.waitUntilElementIsVisible(this.filter.all(this.inputBy).first());
|
||||||
}
|
}
|
||||||
|
|
||||||
searchInFilter(option) {
|
searchInFilter(option) {
|
||||||
let inputElement = this.filter.element(this.inputBy);
|
let inputElement = this.filter.all(this.inputBy).first();
|
||||||
Util.waitUntilElementIsClickable(this.filter);
|
Util.waitUntilElementIsClickable(this.filter);
|
||||||
Util.waitUntilElementIsClickable(inputElement);
|
Util.waitUntilElementIsClickable(inputElement);
|
||||||
|
|
||||||
inputElement.clear();
|
inputElement.clear();
|
||||||
this.filter.element(this.inputBy).sendKeys(option);
|
this.filter.all(this.inputBy).first().sendKeys(option);
|
||||||
}
|
}
|
||||||
|
|
||||||
checkShowLessButtonIsNotDisplayed() {
|
checkShowLessButtonIsNotDisplayed() {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Util = require('../../../../../util/util');
|
import { Util } from '../../../../../util/util';
|
||||||
import { element, by, browser } from 'protractor';
|
import { element, by, browser } from 'protractor';
|
||||||
|
|
||||||
export class SearchRadioPage {
|
export class SearchRadioPage {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { browser, by, protractor } from 'protractor';
|
import { browser, by, protractor } from 'protractor';
|
||||||
import Util = require('../../../../../util/util');
|
import { Util } from '../../../../../util/util';
|
||||||
|
|
||||||
export class SearchSliderPage {
|
export class SearchSliderPage {
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Util = require('../../../../../util/util');
|
import { Util } from '../../../../../util/util';
|
||||||
import { protractor, by } from 'protractor';
|
import { protractor, by } from 'protractor';
|
||||||
|
|
||||||
export class SearchTextPage {
|
export class SearchTextPage {
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Util = require('../../../../util/util');
|
import { Util } from '../../../../util/util';
|
||||||
import { by } from 'protractor';
|
import { by, ElementFinder } from 'protractor';
|
||||||
import { SearchTextPage } from './components/search-text';
|
import { SearchTextPage } from './components/search-text';
|
||||||
import { SearchCheckListPage } from './components/search-checkList';
|
import { SearchCheckListPage } from './components/search-checkList';
|
||||||
import { SearchRadioPage } from './components/search-radio';
|
import { SearchRadioPage } from './components/search-radio';
|
||||||
@@ -26,56 +26,56 @@ import { SearchSliderPage } from './components/search-slider.page';
|
|||||||
|
|
||||||
export class SearchCategoriesPage {
|
export class SearchCategoriesPage {
|
||||||
|
|
||||||
checkListFiltersPage(filter) {
|
checkListFiltersPage(filter: ElementFinder) {
|
||||||
return new SearchCheckListPage(filter);
|
return new SearchCheckListPage(filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
textFiltersPage(filter) {
|
textFiltersPage(filter: ElementFinder) {
|
||||||
return new SearchTextPage(filter);
|
return new SearchTextPage(filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
radioFiltersPage(filter) {
|
radioFiltersPage(filter: ElementFinder) {
|
||||||
return new SearchRadioPage(filter);
|
return new SearchRadioPage(filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
dateRangeFilter(filter) {
|
dateRangeFilter(filter: ElementFinder) {
|
||||||
return new DateRangeFilterPage(filter);
|
return new DateRangeFilterPage(filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
numberRangeFilter(filter) {
|
numberRangeFilter(filter: ElementFinder) {
|
||||||
return new NumberRangeFilterPage(filter);
|
return new NumberRangeFilterPage(filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
sliderFilter(filter) {
|
sliderFilter(filter: ElementFinder) {
|
||||||
return new SearchSliderPage(filter);
|
return new SearchSliderPage(filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
checkFilterIsDisplayed(filter) {
|
checkFilterIsDisplayed(filter: ElementFinder) {
|
||||||
Util.waitUntilElementIsVisible(filter);
|
Util.waitUntilElementIsVisible(filter);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
clickFilter(filter) {
|
clickFilter(filter: ElementFinder) {
|
||||||
Util.waitUntilElementIsVisible(filter);
|
Util.waitUntilElementIsVisible(filter);
|
||||||
filter.element(by.css('mat-expansion-panel-header')).click();
|
filter.element(by.css('mat-expansion-panel-header')).click();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
clickFilterHeader(filter) {
|
clickFilterHeader(filter: ElementFinder) {
|
||||||
let fileSizeFilterHeader = filter.element(by.css('mat-expansion-panel-header'));
|
let fileSizeFilterHeader = filter.element(by.css('mat-expansion-panel-header'));
|
||||||
Util.waitUntilElementIsClickable(fileSizeFilterHeader);
|
Util.waitUntilElementIsClickable(fileSizeFilterHeader);
|
||||||
fileSizeFilterHeader.click();
|
fileSizeFilterHeader.click();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
checkFilterIsCollapsed(filter) {
|
checkFilterIsCollapsed(filter: ElementFinder) {
|
||||||
filter.getAttribute('class').then((elementClass) => {
|
filter.getAttribute('class').then((elementClass) => {
|
||||||
expect(elementClass).not.toContain('mat-expanded');
|
expect(elementClass).not.toContain('mat-expanded');
|
||||||
});
|
});
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
checkFilterIsExpanded(filter) {
|
checkFilterIsExpanded(filter: ElementFinder) {
|
||||||
filter.getAttribute('class').then((elementClass) => {
|
filter.getAttribute('class').then((elementClass) => {
|
||||||
expect(elementClass).toContain('mat-expanded');
|
expect(elementClass).toContain('mat-expanded');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Util = require('../../../util/util');
|
import { Util } from '../../../util/util';
|
||||||
import { element, by, protractor } from 'protractor';
|
import { element, by, protractor } from 'protractor';
|
||||||
|
|
||||||
export class TreeViewPage {
|
export class TreeViewPage {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { element, by, protractor } from 'protractor';
|
import { element, by, protractor } from 'protractor';
|
||||||
|
|
||||||
import Util = require('../../../util/util');
|
import { Util } from '../../../util/util';
|
||||||
|
|
||||||
export class HeaderPage {
|
export class HeaderPage {
|
||||||
|
|
||||||
|
|||||||
@@ -1,354 +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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { element, by, browser } from 'protractor';
|
|
||||||
|
|
||||||
var TestConfig = require('../../test.config');
|
|
||||||
var Util = require('../../util/util');
|
|
||||||
|
|
||||||
var DataTablePage = function (rootElement = element(by.css("adf-datatable"))) {
|
|
||||||
|
|
||||||
var dataTableURL = TestConfig.adf.url + TestConfig.adf.port + "/datatable";
|
|
||||||
|
|
||||||
var contents = element.all(by.css('div[class="adf-datatable-body"] span'));
|
|
||||||
var multiSelect = element(by.css("div[data-automation-id='multiselect'] label > div[class='mat-checkbox-inner-container']"));
|
|
||||||
var selectionButton = element(by.css("div[class='mat-select-arrow']"));
|
|
||||||
var selectionDropDown = element(by.css("div[class*='ng-trigger-transformPanel']"));
|
|
||||||
var allSelectedRows = element.all(by.css("div[class*='is-selected']"));
|
|
||||||
var selectedRowNumber = element(by.css("div[class*='is-selected'] div[data-automation-id*='text_']"));
|
|
||||||
var selectAll = element(by.css("div[class*='header'] label"));
|
|
||||||
var list = rootElement.all(by.css("div[class*=adf-datatable-body] div[class*=adf-datatable-row]"));
|
|
||||||
var addRow = element(by.xpath("//span[contains(text(),'Add row')]/.."));
|
|
||||||
var replaceRows = element(by.xpath("//span[contains(text(),'Replace rows')]/.."));
|
|
||||||
var reset = element(by.xpath("//span[contains(text(),'Reset to default')]/.."));
|
|
||||||
var replaceColumns = element(by.xpath("//span[contains(text(),'Replace columns')]/.."));
|
|
||||||
var createdOnColumn = element(by.css("div[data-automation-id='auto_id_createdOn']"));
|
|
||||||
var pageLoaded = element(by.css("div[data-automation-id='auto_id_id']"));
|
|
||||||
var tableBody = element.all(by.css("div[class='adf-datatable-body']")).first();
|
|
||||||
var spinner = element(by.css('mat-progress-spinner'));
|
|
||||||
var rows = by.css("adf-datatable div[class*='adf-datatable-body'] div[class*='adf-datatable-row']");
|
|
||||||
var nameColumn = by.css("adf-datatable div[class*='adf-datatable-body'] div[class*='adf-datatable-row'] div[title='Name'] span");
|
|
||||||
|
|
||||||
this.goToDatatable = function () {
|
|
||||||
browser.driver.get(dataTableURL);
|
|
||||||
Util.waitUntilElementIsVisible(pageLoaded);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getAllDisplayedRows = function () {
|
|
||||||
return element.all(rows).count();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getAllRowsNameColumn = function () {
|
|
||||||
return this.getAllRowsColumnValues(nameColumn);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getAllRowsColumnValues = function (locator) {
|
|
||||||
var deferred = protractor.promise.defer();
|
|
||||||
Util.waitUntilElementIsVisible(element.all(locator).first());
|
|
||||||
var initialList = [];
|
|
||||||
|
|
||||||
element.all(locator).each(function (element) {
|
|
||||||
element.getText().then(function (text) {
|
|
||||||
if (text !== '') {
|
|
||||||
initialList.push(text);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}).then(function () {
|
|
||||||
deferred.fulfill(initialList);
|
|
||||||
});
|
|
||||||
|
|
||||||
return deferred.promise;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve row by row number
|
|
||||||
*
|
|
||||||
* @param rowNumber
|
|
||||||
*/
|
|
||||||
this.getRowByRowNumber = function (rowNumber) {
|
|
||||||
Util.waitUntilElementIsVisible(element(by.css("div[data-automation-id='text_" + rowNumber + "']")));
|
|
||||||
return element(by.css("div[data-automation-id='text_" + rowNumber + "']"));
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve the checkbox of the row
|
|
||||||
*
|
|
||||||
* @param rowNumber
|
|
||||||
*/
|
|
||||||
this.getRowCheckbox = function (rowNumber) {
|
|
||||||
return this.getRowByRowNumber(rowNumber).element(by.xpath("ancestor::div/div/mat-checkbox[contains(@class, 'mat-checkbox-checked')]"));
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Click multiselect option
|
|
||||||
* */
|
|
||||||
this.clickMultiSelect = function () {
|
|
||||||
Util.waitUntilElementIsVisible(multiSelect);
|
|
||||||
multiSelect.click();
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Click reset option
|
|
||||||
* */
|
|
||||||
this.clickReset = function () {
|
|
||||||
Util.waitUntilElementIsVisible(reset);
|
|
||||||
reset.click();
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Click specific checkbox in row
|
|
||||||
* @method clickCheckbox
|
|
||||||
* @param {String} row number
|
|
||||||
*/
|
|
||||||
this.clickCheckbox = function (rowNumber) {
|
|
||||||
var checkbox = this.getRowByRowNumber(rowNumber).element(by.xpath("ancestor::div[contains(@class, 'adf-datatable-row')]//mat-checkbox/label"));
|
|
||||||
Util.waitUntilElementIsVisible(checkbox);
|
|
||||||
checkbox.click();
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Select a specific row
|
|
||||||
* @method selectRow
|
|
||||||
* @param {String} row number
|
|
||||||
*/
|
|
||||||
this.selectRow = function (rowNumber) {
|
|
||||||
return this.getRowByRowNumber(rowNumber).click();
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Select a specific row using command key
|
|
||||||
* @method selectRow
|
|
||||||
* @param {String} row number
|
|
||||||
*/
|
|
||||||
this.selectRowWithKeyboard = function (rowNumber) {
|
|
||||||
let row = this.getRowByRowNumber(rowNumber);
|
|
||||||
browser.actions().sendKeys(protractor.Key.COMMAND).click(row).perform();
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Select a specific selection mode
|
|
||||||
* @method selectSelectionMode
|
|
||||||
* @param {String} selection mode
|
|
||||||
*/
|
|
||||||
this.selectSelectionMode = function (selectionMode) {
|
|
||||||
let selectMode = element(by.cssContainingText("span[class='mat-option-text']", selectionMode));
|
|
||||||
selectionButton.click();
|
|
||||||
Util.waitUntilElementIsVisible(selectionDropDown);
|
|
||||||
selectMode.click();
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if a specific row is selected
|
|
||||||
* @method checkRowIsSelected
|
|
||||||
* @param {String} row number
|
|
||||||
*/
|
|
||||||
this.checkRowIsSelected = function (rowNumber) {
|
|
||||||
let isRowSelected = this.getRowByRowNumber(rowNumber).element(by.xpath("ancestor::div[contains(@class, 'is-selected')]"));
|
|
||||||
Util.waitUntilElementIsVisible(isRowSelected);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if a specific row is not selected
|
|
||||||
* @method checkRowIsNotSelected
|
|
||||||
* @param {String} row number
|
|
||||||
*/
|
|
||||||
this.checkRowIsNotSelected = function (rowNumber) {
|
|
||||||
let isRowSelected = this.getRowByRowNumber(rowNumber).element(by.xpath("ancestor::div[contains(@class, 'adf-datatable-row custom-row-style ng-star-inserted is-selected')]"));
|
|
||||||
Util.waitUntilElementIsNotOnPage(isRowSelected);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check no row is selected
|
|
||||||
* @method checkNoRowIsSelected
|
|
||||||
*/
|
|
||||||
this.checkNoRowIsSelected = function () {
|
|
||||||
Util.waitUntilElementIsNotOnPage(selectedRowNumber);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkAllRows = function () {
|
|
||||||
Util.waitUntilElementIsVisible(selectAll);
|
|
||||||
selectAll.click();
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check specfic row is checked
|
|
||||||
* @method checkRowIsChecked
|
|
||||||
* @param {String} row number
|
|
||||||
*/
|
|
||||||
this.checkRowIsChecked = function (rowNumber) {
|
|
||||||
Util.waitUntilElementIsVisible(this.getRowCheckbox(rowNumber));
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check specfic row is not checked
|
|
||||||
* @method checkRowIsNotChecked
|
|
||||||
* @param {String} row number
|
|
||||||
*/
|
|
||||||
this.checkRowIsNotChecked = function (rowNumber) {
|
|
||||||
Util.waitUntilElementIsNotOnPage(this.getRowCheckbox(rowNumber));
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add a row to the table
|
|
||||||
* @method addRow
|
|
||||||
*/
|
|
||||||
this.addRow = function () {
|
|
||||||
Util.waitUntilElementIsVisible(addRow);
|
|
||||||
addRow.click();
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the number of rows of the table
|
|
||||||
* @method getNumberOfRows
|
|
||||||
*/
|
|
||||||
this.getNumberOfRows = function () {
|
|
||||||
return list.count();
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the number of selected rows of the table
|
|
||||||
* @method getNumberOfSelectedRows
|
|
||||||
*/
|
|
||||||
this.getNumberOfSelectedRows = function () {
|
|
||||||
return allSelectedRows.count();
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* replace rows
|
|
||||||
* @method replaceRows
|
|
||||||
* @param {String} id
|
|
||||||
*/
|
|
||||||
this.replaceRows = function (id) {
|
|
||||||
let rowID = this.getRowByRowNumber(id);
|
|
||||||
Util.waitUntilElementIsVisible(rowID);
|
|
||||||
replaceRows.click();
|
|
||||||
Util.waitUntilElementIsNotOnPage(rowID);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* replace columns
|
|
||||||
* @method replaceColumns
|
|
||||||
*/
|
|
||||||
this.replaceColumns = function () {
|
|
||||||
Util.waitUntilElementIsVisible(replaceColumns);
|
|
||||||
replaceColumns.click();
|
|
||||||
Util.waitUntilElementIsNotOnPage(createdOnColumn);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getRowsName = function (content) {
|
|
||||||
let row = element(by.css("div[data-automation-id*='" + content + "']"));
|
|
||||||
Util.waitUntilElementIsPresent(row);
|
|
||||||
return row;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.doubleClickRow = function (rowName) {
|
|
||||||
let row = this.getRowByRowName(rowName);
|
|
||||||
Util.waitUntilElementIsVisible(row);
|
|
||||||
Util.waitUntilElementIsClickable(row);
|
|
||||||
row.click();
|
|
||||||
Util.waitUntilElementIsVisible(row.all(by.css("div[class*='--image'] mat-icon[svgicon*='selected']")).first());
|
|
||||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getRowByRowName = function (content) {
|
|
||||||
let rowByRowName = by.xpath("ancestor::div[contains(@class, 'adf-datatable-row')]");
|
|
||||||
Util.waitUntilElementIsPresent(this.getRowsName(content).element(rowByRowName));
|
|
||||||
return this.getRowsName(content).element(rowByRowName);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.waitForTableBody = function () {
|
|
||||||
Util.waitUntilElementIsVisible(tableBody);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.insertFilter = function (filterText) {
|
|
||||||
let inputFilter = element(by.xpath("//*[@id=\"adf-datatable-filter-input\"]"));
|
|
||||||
inputFilter.clear();
|
|
||||||
return inputFilter.sendKeys(filterText);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getNodeIdFirstElement = function () {
|
|
||||||
let firstNode = element.all(by.css('adf-datatable div[title="Node id"] span')).first();
|
|
||||||
return firstNode.getText();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.sortByColumn = function (sortOrder, locator) {
|
|
||||||
Util.waitUntilElementIsVisible(element(locator));
|
|
||||||
return element(locator).getAttribute('class').then(function (result) {
|
|
||||||
if (sortOrder === true) {
|
|
||||||
if (!result.includes('sorted-asc')) {
|
|
||||||
if (result.includes('sorted-desc') || result.includes('sortable')) {
|
|
||||||
element(locator).click();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (result.includes('sorted-asc')) {
|
|
||||||
element(locator).click();
|
|
||||||
} else if (result.includes('sortable')) {
|
|
||||||
element(locator).click();
|
|
||||||
element(locator).click();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return Promise.resolve();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkContentIsDisplayed = function(content) {
|
|
||||||
var row = by.cssContainingText("span", content);
|
|
||||||
Util.waitUntilElementIsVisible(tableBody.all(row).first());
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkContentIsNotDisplayed = function(content) {
|
|
||||||
var row = by.cssContainingText("span", content);
|
|
||||||
Util.waitUntilElementIsNotOnPage(tableBody.all(row).first());
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.selectRowByContentName = function(content) {
|
|
||||||
var row = by.cssContainingText("span", content);
|
|
||||||
Util.waitUntilElementIsVisible(tableBody.element(row));
|
|
||||||
tableBody.element(row).click();
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.contentInPosition = function (position){
|
|
||||||
Util.waitUntilElementIsVisible(contents);
|
|
||||||
return contents.get(position -1).getText();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkSpinnerIsDisplayed = function () {
|
|
||||||
Util.waitUntilElementIsPresent(spinner);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkRowIsDisplayedByName = function (name) {
|
|
||||||
Util.waitUntilElementIsVisible(element(by.css("div[filename='"+name+"']")));
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkRowIsNotDisplayedByName = function (taskName) {
|
|
||||||
Util.waitUntilElementIsNotOnPage(element(by.css("div[filename='"+taskName+"']")));
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getNumberOfRowsDisplayedWithSameName = function (taskName) {
|
|
||||||
Util.waitUntilElementIsVisible(element(by.css("div[filename='"+taskName+"']")));
|
|
||||||
return element.all(by.css("div[title='Name'][filename='"+taskName+"']")).count();
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
module.exports = DataTablePage;
|
|
||||||
@@ -0,0 +1,271 @@
|
|||||||
|
/*!
|
||||||
|
* @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 { browser, by, element, protractor } from 'protractor';
|
||||||
|
import { Util } from '../../util/util';
|
||||||
|
import { ElementFinder } from 'protractor/built/element';
|
||||||
|
|
||||||
|
export class DataTablePage {
|
||||||
|
|
||||||
|
rootElement: ElementFinder;
|
||||||
|
list: ElementFinder;
|
||||||
|
contents = element.all(by.css('div[class="adf-datatable-body"] span'));
|
||||||
|
multiSelect = element(by.css(`div[data-automation-id='multiselect'] label > div[class='mat-checkbox-inner-container']`));
|
||||||
|
selectionButton = element(by.css(`div[class='mat-select-arrow']`));
|
||||||
|
selectionDropDown = element(by.css(`div[class*='ng-trigger-transformPanel']`));
|
||||||
|
allSelectedRows = element.all(by.css(`div[class*='is-selected']`));
|
||||||
|
selectedRowNumber = element(by.css(`div[class*='is-selected'] div[data-automation-id*='text_']`));
|
||||||
|
selectAll = element(by.css(`div[class*='header'] label`));
|
||||||
|
addRowElement = element(by.xpath(`//span[contains(text(),'Add row')]/..`));
|
||||||
|
replaceRowsElement = element(by.xpath(`//span[contains(text(),'Replace rows')]/..`));
|
||||||
|
reset = element(by.xpath(`//span[contains(text(),'Reset to default')]/..`));
|
||||||
|
replaceColumnsElement = element(by.xpath(`//span[contains(text(),'Replace columns')]/..`));
|
||||||
|
createdOnColumn = element(by.css(`div[data-automation-id='auto_id_createdOn']`));
|
||||||
|
pageLoaded = element(by.css(`div[data-automation-id='auto_id_id']`));
|
||||||
|
tableBody = element.all(by.css(`div[class='adf-datatable-body']`)).first();
|
||||||
|
spinner = element(by.css('mat-progress-spinner'));
|
||||||
|
rows = by.css(`adf-datatable div[class*='adf-datatable-body'] div[class*='adf-datatable-row']`);
|
||||||
|
nameColumn = by.css(`adf-datatable div[class*='adf-datatable-body'] div[class*='adf-datatable-row'] div[title='Name'] span`);
|
||||||
|
|
||||||
|
constructor(rootElement: ElementFinder = element(by.css('adf-datatable'))) {
|
||||||
|
this.rootElement = rootElement;
|
||||||
|
this.list = this.rootElement.all(by.css(`div[class*=adf-datatable-body] div[class*=adf-datatable-row]`));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
getAllDisplayedRows() {
|
||||||
|
return element.all(this.rows).count();
|
||||||
|
}
|
||||||
|
|
||||||
|
getAllRowsNameColumn() {
|
||||||
|
return this.getAllRowsColumnValues(this.nameColumn);
|
||||||
|
}
|
||||||
|
|
||||||
|
getAllRowsColumnValues(locator) {
|
||||||
|
let deferred = protractor.promise.defer();
|
||||||
|
Util.waitUntilElementIsVisible(element.all(locator).first());
|
||||||
|
let initialList = [];
|
||||||
|
|
||||||
|
element.all(locator).each(function (currentElement) {
|
||||||
|
currentElement.getText().then(function (text) {
|
||||||
|
if (text !== '') {
|
||||||
|
initialList.push(text);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}).then(function () {
|
||||||
|
deferred.fulfill(initialList);
|
||||||
|
});
|
||||||
|
|
||||||
|
return deferred.promise;
|
||||||
|
}
|
||||||
|
|
||||||
|
getRowByRowNumber(rowNumber) {
|
||||||
|
Util.waitUntilElementIsVisible(element(by.css(`div[data-automation-id='text_` + rowNumber + `']`)));
|
||||||
|
return element(by.css(`div[data-automation-id='text_` + rowNumber + `']`));
|
||||||
|
}
|
||||||
|
|
||||||
|
getRowCheckbox(rowNumber) {
|
||||||
|
return this.getRowByRowNumber(rowNumber).element(by.xpath(`ancestor::div/div/mat-checkbox[contains(@class, 'mat-checkbox-checked')]`));
|
||||||
|
}
|
||||||
|
|
||||||
|
clickMultiSelect() {
|
||||||
|
Util.waitUntilElementIsVisible(this.multiSelect);
|
||||||
|
this.multiSelect.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
clickReset() {
|
||||||
|
Util.waitUntilElementIsVisible(this.reset);
|
||||||
|
this.reset.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
clickCheckbox(rowNumber) {
|
||||||
|
let checkbox = this.getRowByRowNumber(rowNumber).element(by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row')]//mat-checkbox/label`));
|
||||||
|
Util.waitUntilElementIsVisible(checkbox);
|
||||||
|
checkbox.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
selectRow(rowNumber) {
|
||||||
|
return this.getRowByRowNumber(rowNumber).click();
|
||||||
|
}
|
||||||
|
|
||||||
|
selectRowWithKeyboard(rowNumber) {
|
||||||
|
let row = this.getRowByRowNumber(rowNumber);
|
||||||
|
browser.actions().sendKeys(protractor.Key.COMMAND).click(row).perform();
|
||||||
|
}
|
||||||
|
|
||||||
|
selectSelectionMode(selectionMode) {
|
||||||
|
let selectMode = element(by.cssContainingText(`span[class='mat-option-text']`, selectionMode));
|
||||||
|
this.selectionButton.click();
|
||||||
|
Util.waitUntilElementIsVisible(this.selectionDropDown);
|
||||||
|
selectMode.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
checkRowIsSelected(rowNumber) {
|
||||||
|
let isRowSelected = this.getRowByRowNumber(rowNumber).element(by.xpath(`ancestor::div[contains(@class, 'is-selected')]`));
|
||||||
|
Util.waitUntilElementIsVisible(isRowSelected);
|
||||||
|
}
|
||||||
|
|
||||||
|
checkRowIsNotSelected(rowNumber) {
|
||||||
|
let isRowSelected = this.getRowByRowNumber(rowNumber)
|
||||||
|
.element(by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row custom-row-style ng-star-inserted is-selected')]`));
|
||||||
|
Util.waitUntilElementIsNotOnPage(isRowSelected);
|
||||||
|
}
|
||||||
|
|
||||||
|
checkNoRowIsSelected() {
|
||||||
|
Util.waitUntilElementIsNotOnPage(this.selectedRowNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
checkAllRows() {
|
||||||
|
Util.waitUntilElementIsVisible(this.selectAll);
|
||||||
|
this.selectAll.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
checkRowIsChecked(rowNumber) {
|
||||||
|
Util.waitUntilElementIsVisible(this.getRowCheckbox(rowNumber));
|
||||||
|
}
|
||||||
|
|
||||||
|
checkRowIsNotChecked(rowNumber) {
|
||||||
|
Util.waitUntilElementIsNotOnPage(this.getRowCheckbox(rowNumber));
|
||||||
|
}
|
||||||
|
|
||||||
|
addRow() {
|
||||||
|
Util.waitUntilElementIsVisible(this.addRowElement);
|
||||||
|
this.addRowElement.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
getNumberOfRows() {
|
||||||
|
return this.list.count();
|
||||||
|
}
|
||||||
|
|
||||||
|
getNumberOfSelectedRows() {
|
||||||
|
return this.allSelectedRows.count();
|
||||||
|
}
|
||||||
|
|
||||||
|
replaceRows(id) {
|
||||||
|
let rowID = this.getRowByRowNumber(id);
|
||||||
|
Util.waitUntilElementIsVisible(rowID);
|
||||||
|
this.replaceRowsElement.click();
|
||||||
|
Util.waitUntilElementIsNotOnPage(rowID);
|
||||||
|
}
|
||||||
|
|
||||||
|
replaceColumns() {
|
||||||
|
Util.waitUntilElementIsVisible(this.replaceColumnsElement);
|
||||||
|
this.replaceColumnsElement.click();
|
||||||
|
Util.waitUntilElementIsNotOnPage(this.createdOnColumn);
|
||||||
|
}
|
||||||
|
|
||||||
|
getRowsName(content) {
|
||||||
|
let row = element(by.css(`div[data-automation-id*='` + content + `']`));
|
||||||
|
Util.waitUntilElementIsPresent(row);
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
|
||||||
|
doubleClickRow(rowName) {
|
||||||
|
let row = this.getRowByRowName(rowName);
|
||||||
|
Util.waitUntilElementIsVisible(row);
|
||||||
|
Util.waitUntilElementIsClickable(row);
|
||||||
|
row.click();
|
||||||
|
Util.waitUntilElementIsVisible(row.all(by.css(`div[class*='--image'] mat-icon[svgicon*='selected']`)).first());
|
||||||
|
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
getRowByRowName(content) {
|
||||||
|
let rowByRowName = by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row')]`);
|
||||||
|
Util.waitUntilElementIsPresent(this.getRowsName(content).element(rowByRowName));
|
||||||
|
return this.getRowsName(content).element(rowByRowName);
|
||||||
|
}
|
||||||
|
|
||||||
|
waitForTableBody() {
|
||||||
|
Util.waitUntilElementIsVisible(this.tableBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
insertFilter(filterText) {
|
||||||
|
let inputFilter = element(by.css(`#adf-datatable-filter-input`));
|
||||||
|
inputFilter.clear();
|
||||||
|
return inputFilter.sendKeys(filterText);
|
||||||
|
}
|
||||||
|
|
||||||
|
getNodeIdFirstElement() {
|
||||||
|
let firstNode = element.all(by.css('adf-datatable div[title="Node id"] span')).first();
|
||||||
|
return firstNode.getText();
|
||||||
|
}
|
||||||
|
|
||||||
|
sortByColumn(sortOrder, locator) {
|
||||||
|
Util.waitUntilElementIsVisible(element(locator));
|
||||||
|
return element(locator).getAttribute('class').then(function (result) {
|
||||||
|
if (sortOrder === true) {
|
||||||
|
if (!result.includes('sorted-asc')) {
|
||||||
|
if (result.includes('sorted-desc') || result.includes('sortable')) {
|
||||||
|
element(locator).click();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (result.includes('sorted-asc')) {
|
||||||
|
element(locator).click();
|
||||||
|
} else if (result.includes('sortable')) {
|
||||||
|
element(locator).click();
|
||||||
|
element(locator).click();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Promise.resolve();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
checkContentIsDisplayed(content) {
|
||||||
|
let row = by.cssContainingText(`span`, content);
|
||||||
|
Util.waitUntilElementIsVisible(this.tableBody.all(row).first());
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkContentIsNotDisplayed(content) {
|
||||||
|
let row = by.cssContainingText(`span`, content);
|
||||||
|
Util.waitUntilElementIsNotOnPage(this.tableBody.all(row).first());
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
selectRowByContentName(content) {
|
||||||
|
let row = by.cssContainingText(`span`, content);
|
||||||
|
Util.waitUntilElementIsVisible(this.tableBody.element(row));
|
||||||
|
this.tableBody.element(row).click();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
contentInPosition(position) {
|
||||||
|
Util.waitUntilElementIsVisible(this.contents);
|
||||||
|
return this.contents.get(position - 1).getText();
|
||||||
|
}
|
||||||
|
|
||||||
|
checkSpinnerIsDisplayed() {
|
||||||
|
Util.waitUntilElementIsPresent(this.spinner);
|
||||||
|
}
|
||||||
|
|
||||||
|
checkRowIsDisplayedByName(filename) {
|
||||||
|
Util.waitUntilElementIsVisible(element.all(by.css(`div[filename="${filename}"]`)).first());
|
||||||
|
}
|
||||||
|
|
||||||
|
checkRowIsNotDisplayedByName(filename) {
|
||||||
|
Util.waitUntilElementIsNotOnPage(element.all(by.css(`div[filename="${filename}"]`)).first());
|
||||||
|
}
|
||||||
|
|
||||||
|
getNumberOfRowsDisplayedWithSameName(filename) {
|
||||||
|
Util.waitUntilElementIsVisible(element(by.css(`div[filename="${filename}"]`)));
|
||||||
|
return element.all(by.css(`div[title='Name'][filename="${filename}"]`)).count();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Util = require('../../../util/util');
|
import { Util } from '../../../util/util';
|
||||||
|
|
||||||
import { element, by } from 'protractor';
|
import { element, by } from 'protractor';
|
||||||
import { TaskFiltersPage } from '../process_services/taskFiltersPage';
|
import { TaskFiltersPage } from '../process_services/taskFiltersPage';
|
||||||
|
|||||||
@@ -15,14 +15,14 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Util = require('../../../util/util');
|
import { Util } from '../../../util/util';
|
||||||
import DataTable = require('../dataTablePage');
|
import { TasksListPage } from '../process_services/tasksListPage';
|
||||||
import TaskListPage = require('../process_services/tasksListPage');
|
import { PaginationPage } from '../paginationPage';
|
||||||
import PaginationPage = require('../paginationPage');
|
|
||||||
import { element, by } from 'protractor';
|
import { element, by } from 'protractor';
|
||||||
|
|
||||||
export class TaskListDemoPage {
|
export class TaskListDemoPage {
|
||||||
|
|
||||||
|
taskListPage: TasksListPage = new TasksListPage();
|
||||||
appId = element(by.css("input[data-automation-id='appId input']"));
|
appId = element(by.css("input[data-automation-id='appId input']"));
|
||||||
itemsPerPage = element(by.css("input[data-automation-id='items per page']"));
|
itemsPerPage = element(by.css("input[data-automation-id='items per page']"));
|
||||||
itemsPerPageForm = element(by.css("mat-form-field[data-automation-id='items per page']"));
|
itemsPerPageForm = element(by.css("mat-form-field[data-automation-id='items per page']"));
|
||||||
@@ -40,10 +40,11 @@ export class TaskListDemoPage {
|
|||||||
sortDropDownArrow = element(by.css("mat-form-field[data-automation-id='sort'] div[class*='arrow']"));
|
sortDropDownArrow = element(by.css("mat-form-field[data-automation-id='sort'] div[class*='arrow']"));
|
||||||
sortSelector = element(by.css("div[class*='mat-select-content']"));
|
sortSelector = element(by.css("div[class*='mat-select-content']"));
|
||||||
processDefinitionIdColumn = by.css("adf-datatable div[class*='adf-datatable-body'] div[class*='adf-datatable-row'] div[title='Process Definition Id'] span");
|
processDefinitionIdColumn = by.css("adf-datatable div[class*='adf-datatable-body'] div[class*='adf-datatable-row'] div[title='Process Definition Id'] span");
|
||||||
processInstanceIdColumn = by.css("adf-datatable div[class*='adf-datatable-body'] div[class*='adf-datatable-row'] div[title='Process Instance Id'] span");
|
processInstanceIdColumn = by.css("adf-datatable div[class*='adf-datatable-body'] div[class*='a" +
|
||||||
|
"df-datatable-row'] div[title='Process Instance Id'] span");
|
||||||
|
|
||||||
taskList() {
|
taskList(): TasksListPage {
|
||||||
return new TaskListPage();
|
return this.taskListPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
paginationPage() {
|
paginationPage() {
|
||||||
@@ -161,11 +162,6 @@ export class TaskListDemoPage {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
getDueAfter() {
|
|
||||||
Util.waitUntilElementIsVisible(this.dueAfter);
|
|
||||||
return this.dueAfter.getAttribute('value');
|
|
||||||
}
|
|
||||||
|
|
||||||
typeDueBefore(input) {
|
typeDueBefore(input) {
|
||||||
Util.waitUntilElementIsVisible(this.dueBefore);
|
Util.waitUntilElementIsVisible(this.dueBefore);
|
||||||
this.clearText(this.dueBefore);
|
this.clearText(this.dueBefore);
|
||||||
@@ -173,14 +169,9 @@ export class TaskListDemoPage {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
getDueBefore() {
|
clearText(input) {
|
||||||
Util.waitUntilElementIsVisible(this.dueBefore);
|
|
||||||
return this.dueBefore.getAttribute('value');
|
|
||||||
}
|
|
||||||
|
|
||||||
clearText(input) {
|
|
||||||
Util.waitUntilElementIsVisible(input);
|
Util.waitUntilElementIsVisible(input);
|
||||||
return input.clear();
|
return input.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
clickResetButton() {
|
clickResetButton() {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Util = require('../../../util/util');
|
import { Util } from '../../../util/util';
|
||||||
|
|
||||||
import { TaskFiltersCloudComponent } from '../process_cloud/taskFiltersCloudComponent';
|
import { TaskFiltersCloudComponent } from '../process_cloud/taskFiltersCloudComponent';
|
||||||
import { TaskListCloudComponent } from '../process_cloud/taskListCloudComponent';
|
import { TaskListCloudComponent } from '../process_cloud/taskListCloudComponent';
|
||||||
|
|||||||
@@ -1,391 +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 ContentList = function () {
|
|
||||||
|
|
||||||
var deleteContent = element(by.css("button[data-automation-id*='DELETE']"));
|
|
||||||
var metadataAction = element(by.css("button[data-automation-id*='METADATA']"));
|
|
||||||
var versionManagerAction = element(by.css("button[data-automation-id*='VERSIONS']"));
|
|
||||||
var moveContent = element(by.css("button[data-automation-id*='MOVE']"));
|
|
||||||
var copyContent = element(by.css("button[data-automation-id*='COPY']"));
|
|
||||||
var downloadContent = element(by.css("button[data-automation-id*='DOWNLOAD']"));
|
|
||||||
var actionMenu = element(by.css("div[role='menu']"));
|
|
||||||
var optionButton = by.css("button[data-automation-id*='action_menu_']");
|
|
||||||
var rowByRowName = by.xpath("ancestor::div[contains(@class, 'adf-datatable-row')]");
|
|
||||||
var nameColumn = by.css('div[class*="datatable-body"] div[class*="adf-data-table-cell"][title="Display name"]');
|
|
||||||
var nameColumnHeader = by.css("div[data-automation-id='auto_id_name']");
|
|
||||||
var createdByColumn = by.css("div[class*='--text'][title='Created by'] span");
|
|
||||||
var sizeColumn = by.css("div[id*='document-list-container'] div[class*='adf-datatable-row'] .adf-filesize-cell");
|
|
||||||
var createdByColumnHeader = by.css("div[data-automation-id*='auto_id_createdByUser']");
|
|
||||||
var createdColumn = by.css("div[class*='--date'] span");
|
|
||||||
var createdColumnHeader = by.css("div[data-automation-id*='auto_id_createdAt']");
|
|
||||||
var rows = by.css("div[id='document-list-container'] div[class*='adf-datatable-body'] div[class*='adf-datatable-row']");
|
|
||||||
var emptyFolderMessage = element(by.css("div[class='adf-empty-folder-this-space-is-empty']"));
|
|
||||||
var table = element(by.css("div[class*='upload-border']"));
|
|
||||||
var tableBody = element.all(by.css("adf-document-list div[class='adf-datatable-body']")).first();
|
|
||||||
|
|
||||||
this.getRowsName = function (content) {
|
|
||||||
var row = element.all(by.xpath("//div[@id='document-list-container']//div[@filename='" + content + "']")).first();
|
|
||||||
Util.waitUntilElementIsVisible(row);
|
|
||||||
return row;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getRowByRowName = function (content) {
|
|
||||||
Util.waitUntilElementIsOnPage(this.getRowsName(content).element(rowByRowName));
|
|
||||||
Util.waitUntilElementIsVisible(this.getRowsName(content).element(rowByRowName));
|
|
||||||
return this.getRowsName(content).element(rowByRowName);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getAllDisplayedRows = function () {
|
|
||||||
return element.all(rows).count();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getAllRowsNameColumn = function () {
|
|
||||||
return this.getAllRowsColumnValues(nameColumn);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getAllRowsColumnValues = function (locator) {
|
|
||||||
var deferred = protractor.promise.defer();
|
|
||||||
Util.waitUntilElementIsVisible(element.all(locator).first());
|
|
||||||
var initialList = [];
|
|
||||||
|
|
||||||
element.all(locator).each(function (element) {
|
|
||||||
element.getText().then(function (text) {
|
|
||||||
if (text !== '') {
|
|
||||||
initialList.push(text);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}).then(function () {
|
|
||||||
deferred.fulfill(initialList);
|
|
||||||
});
|
|
||||||
|
|
||||||
return deferred.promise;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.deleteContent = function (content) {
|
|
||||||
this.clickOnActionMenu(content);
|
|
||||||
this.waitForContentOptions();
|
|
||||||
deleteContent.click();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkDeleteIsDisabled = function (content) {
|
|
||||||
this.clickOnActionMenu(content);
|
|
||||||
this.waitForContentOptions();
|
|
||||||
let disabledDelete = element(by.css("button[data-automation-id*='DELETE'][disabled='true']"));
|
|
||||||
Util.waitUntilElementIsVisible(disabledDelete);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.metadataContent = function (content) {
|
|
||||||
this.clickOnActionMenu(content);
|
|
||||||
this.waitForContentOptions();
|
|
||||||
metadataAction.click();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.versionManagerContent = function (content) {
|
|
||||||
this.clickOnActionMenu(content);
|
|
||||||
this.waitForContentOptions();
|
|
||||||
versionManagerAction.click();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.moveContent = function (content) {
|
|
||||||
this.clickOnActionMenu(content);
|
|
||||||
moveContent.click();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.copyContent = function (content) {
|
|
||||||
this.clickOnActionMenu(content);
|
|
||||||
copyContent.click();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.waitForContentOptions = function () {
|
|
||||||
Util.waitUntilElementIsVisible(copyContent);
|
|
||||||
Util.waitUntilElementIsVisible(moveContent);
|
|
||||||
Util.waitUntilElementIsVisible(deleteContent);
|
|
||||||
Util.waitUntilElementIsVisible(downloadContent);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.clickOnActionMenu = function (content) {
|
|
||||||
this.getRowByRowName(content).element(optionButton).click();
|
|
||||||
Util.waitUntilElementIsVisible(actionMenu);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.sortByColumn = function (sortOrder, locator) {
|
|
||||||
Util.waitUntilElementIsVisible(element(locator));
|
|
||||||
return element(locator).getAttribute('class').then(function (result) {
|
|
||||||
if (sortOrder === true) {
|
|
||||||
if (!result.includes('sorted-asc')) {
|
|
||||||
if (result.includes('sorted-desc') || result.includes('sortable')) {
|
|
||||||
element(locator).click();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (result.includes('sorted-asc')) {
|
|
||||||
element(locator).click();
|
|
||||||
} else if (result.includes('sortable')) {
|
|
||||||
element(locator).click();
|
|
||||||
element(locator).click();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return Promise.resolve();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sort the list by name column.
|
|
||||||
*
|
|
||||||
* @param sortOrder: 'true' to sort the list ascendant and 'false' for descendant
|
|
||||||
*/
|
|
||||||
this.sortByName = function (sortOrder) {
|
|
||||||
this.sortByColumn(sortOrder, nameColumnHeader);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sort the list by author column.
|
|
||||||
*
|
|
||||||
* @param sortOrder: 'true' to sort the list ascendant and 'false' for descendant
|
|
||||||
*/
|
|
||||||
this.sortByAuthor = function (sortOrder) {
|
|
||||||
this.sortByColumn(sortOrder, createdByColumnHeader);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sort the list by created column.
|
|
||||||
*
|
|
||||||
* @param sortOrder: 'true' to sort the list ascendant and 'false' for descendant
|
|
||||||
*/
|
|
||||||
this.sortByCreated = function (sortOrder) {
|
|
||||||
this.sortByColumn(sortOrder, createdColumnHeader);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check the list is sorted by name column.
|
|
||||||
*
|
|
||||||
* @param sortOrder: 'true' if the list is expected to be sorted ascendant and 'false' for descendant
|
|
||||||
* @return sorted : 'true' if the list is sorted as expected and 'false' if it isn't
|
|
||||||
*/
|
|
||||||
this.checkListIsOrderedByNameColumn = function (sortOrder) {
|
|
||||||
var deferred = protractor.promise.defer();
|
|
||||||
deferred.fulfill(this.checkListIsSorted(sortOrder, nameColumn));
|
|
||||||
return deferred.promise;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check the list is sorted by author column.
|
|
||||||
*
|
|
||||||
* @param sortOrder: 'true' if the list is expected to be sorted ascendant and 'false' for descendant
|
|
||||||
* @return sorted : 'true' if the list is sorted as expected and 'false' if it isn't
|
|
||||||
*/
|
|
||||||
this.checkListIsOrderedByAuthorColumn = function (sortOrder) {
|
|
||||||
var deferred = protractor.promise.defer();
|
|
||||||
deferred.fulfill(this.checkListIsSorted(sortOrder, createdByColumn));
|
|
||||||
return deferred.promise;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkListIsOrderedBySizeColumn = function (sortOrder) {
|
|
||||||
var deferred = protractor.promise.defer();
|
|
||||||
deferred.fulfill(this.checkListIsSorted(sortOrder, sizeColumn));
|
|
||||||
return deferred.promise;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check the list is sorted by created column.
|
|
||||||
*
|
|
||||||
* @param sortOrder: 'true' if the list is expected to be sorted ascendant and 'false' for descendant
|
|
||||||
* @return sorted : 'true' if the list is sorted as expected and 'false' if it isn't
|
|
||||||
*/
|
|
||||||
this.checkListIsOrderedByCreatedColumn = function (sortOrder) {
|
|
||||||
var deferred = protractor.promise.defer();
|
|
||||||
var lastValue;
|
|
||||||
var sorted = true;
|
|
||||||
|
|
||||||
element.all(createdColumn).map(function (element) {
|
|
||||||
return element.getText();
|
|
||||||
}).then(function (texts) {
|
|
||||||
texts.forEach(function (text) {
|
|
||||||
if (lastValue !== undefined) {
|
|
||||||
var currentDate = new Date(text);
|
|
||||||
var lastDate = new Date(lastValue);
|
|
||||||
if (sortOrder === true && currentDate.getTime() < lastDate.getTime()) {
|
|
||||||
sorted = false;
|
|
||||||
}
|
|
||||||
if (sortOrder === false && currentDate.getTime() > lastDate.getTime()) {
|
|
||||||
sorted = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lastValue = text;
|
|
||||||
});
|
|
||||||
deferred.fulfill(sorted);
|
|
||||||
});
|
|
||||||
return deferred.promise;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check the list is sorted.
|
|
||||||
*
|
|
||||||
* @param sortOrder: 'true' if the list is expected to be sorted ascendant and 'false' for descendant
|
|
||||||
* @param locator: locator for column
|
|
||||||
* @return 'true' if the list is sorted as expected and 'false' if it isn't
|
|
||||||
*/
|
|
||||||
this.checkListIsSorted = function (sortOrder, locator) {
|
|
||||||
var deferred = protractor.promise.defer();
|
|
||||||
Util.waitUntilElementIsVisible(element.all(locator).first());
|
|
||||||
var initialList = [];
|
|
||||||
element.all(locator).each(function (element) {
|
|
||||||
element.getText().then(function (text) {
|
|
||||||
initialList.push(text);
|
|
||||||
});
|
|
||||||
}).then(function () {
|
|
||||||
var sortedList = initialList;
|
|
||||||
sortedList = sortedList.sort();
|
|
||||||
if (sortOrder === false) {
|
|
||||||
sortedList = sortedList.reverse();
|
|
||||||
}
|
|
||||||
deferred.fulfill(initialList.toString() === sortedList.toString());
|
|
||||||
});
|
|
||||||
return deferred.promise;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.navigateToFolder = function (folder) {
|
|
||||||
var row = this.getRowsName(folder);
|
|
||||||
Util.waitUntilElementIsVisible(row);
|
|
||||||
Util.waitUntilElementIsOnPage(row);
|
|
||||||
row.click();
|
|
||||||
this.checkRowIsSelected(folder);
|
|
||||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.doubleClickRow = function (selectRow) {
|
|
||||||
var row = this.getRowsName(selectRow);
|
|
||||||
Util.waitUntilElementIsVisible(row);
|
|
||||||
Util.waitUntilElementIsClickable(row);
|
|
||||||
row.click();
|
|
||||||
Util.waitUntilElementIsVisible(this.getRowByRowName(selectRow).element(by.css("div[class*='--image'] mat-icon[svgicon*='selected']")));
|
|
||||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.doubleClickEntireRow = function (selectRow) {
|
|
||||||
var row = this.getRowByRowName(selectRow);
|
|
||||||
Util.waitUntilElementIsVisible(row);
|
|
||||||
Util.waitUntilElementIsClickable(row);
|
|
||||||
row.click();
|
|
||||||
Util.waitUntilElementIsVisible(this.getRowByRowName(selectRow).element(by.css("div[class*='--image'] mat-icon[svgicon*='selected']")));
|
|
||||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkRowIsSelected = function (content) {
|
|
||||||
var isRowSelected = this.getRowsName(content).element(by.xpath("ancestor::div[contains(@class, 'is-selected')]"));
|
|
||||||
Util.waitUntilElementIsVisible(isRowSelected);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkContentIsDisplayed = function (content) {
|
|
||||||
Util.waitUntilElementIsVisible(this.getRowByRowName(content));
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
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;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.tableIsLoaded = function () {
|
|
||||||
Util.waitUntilElementIsVisible(table);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkIconColumn = function (file, extension) {
|
|
||||||
var row = this.getRowByRowName(file);
|
|
||||||
Util.waitUntilElementIsVisible(row.element(by.css("div[class*='--image'] img[alt*='" + extension + "']")));
|
|
||||||
};
|
|
||||||
|
|
||||||
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) {
|
|
||||||
let actionButton = element(by.css(`button[data-automation-id="context-${actionName}"`));
|
|
||||||
Util.waitUntilElementIsVisible(actionButton);
|
|
||||||
Util.waitUntilElementIsClickable(actionButton);
|
|
||||||
return actionButton;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.pressContextMenuActionNamed = function (actionName) {
|
|
||||||
let actionButton = this.checkContextActionIsVisible(actionName);
|
|
||||||
actionButton.click();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.clickRowToSelect = function (rowName) {
|
|
||||||
let row = this.getRowByRowName(rowName);
|
|
||||||
browser.actions().keyDown(protractor.Key.COMMAND).click(row).perform();
|
|
||||||
this.checkRowIsSelected(rowName);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.clickContentLockIcon = function (content) {
|
|
||||||
var lockIcon = element(by.css('div[filename="'+ content +'"] button'));
|
|
||||||
Util.waitUntilElementIsClickable(lockIcon);
|
|
||||||
lockIcon.click();
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkLockedIcon = function (content) {
|
|
||||||
var lockIcon = element(by.cssContainingText('div[filename="'+ content +'"] mat-icon', 'lock'));
|
|
||||||
Util.waitUntilElementIsVisible(lockIcon);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkUnlockedIcon = function (content) {
|
|
||||||
var lockIcon = element(by.cssContainingText('div[filename="'+ content +'"] mat-icon', 'lock_open'));
|
|
||||||
Util.waitUntilElementIsVisible(lockIcon);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.waitForTableBody = function () {
|
|
||||||
Util.waitUntilElementIsVisible(tableBody);
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
module.exports = ContentList;
|
|
||||||
@@ -0,0 +1,454 @@
|
|||||||
|
/*!
|
||||||
|
* @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 { browser, by, element } from 'protractor';
|
||||||
|
import { Util } from '../../../util/util';
|
||||||
|
|
||||||
|
export class ContentListPage {
|
||||||
|
|
||||||
|
deleteContentElement = element(by.css('button[data-automation-id*="DELETE"]'));
|
||||||
|
metadataAction = element(by.css('button[data-automation-id*="METADATA"]'));
|
||||||
|
versionManagerAction = element(by.css('button[data-automation-id*="VERSIONS"]'));
|
||||||
|
moveContentElement = element(by.css('button[data-automation-id*="MOVE"]'));
|
||||||
|
copyContentElement = element(by.css('button[data-automation-id*="COPY"]'));
|
||||||
|
lockContentElement = element(by.css('button[data-automation-id="DOCUMENT_LIST.ACTIONS.LOCK"]'));
|
||||||
|
downloadContent = element(by.css('button[data-automation-id*="DOWNLOAD"]'));
|
||||||
|
actionMenu = element(by.css('div[role="menu"]'));
|
||||||
|
optionButton = by.css('button[data-automation-id*="action_menu_"]');
|
||||||
|
rowByRowName = by.xpath('ancestor::div[contains(@class, "adf-datatable-row")]');
|
||||||
|
nameColumn = by.css('div[class*="datatable-body"] div[class*="adf-data-table-cell"][title="Display name"]');
|
||||||
|
nameColumnHeader = by.css('div[data-automation-id="auto_id_name"]');
|
||||||
|
createdByColumn = by.css('div[class*="--text"][title="Created by"] span');
|
||||||
|
sizeColumn = by.css('div[id*="document-list-container"] div[class*="adf-datatable-row"] .adf-filesize-cell');
|
||||||
|
createdByColumnHeader = by.css('div[data-automation-id*="auto_id_createdByUser"]');
|
||||||
|
createdColumn = by.css('div[class*="--date"] span');
|
||||||
|
createdColumnHeader = by.css('div[data-automation-id*="auto_id_createdAt"]');
|
||||||
|
rows = by.css('div[id="document-list-container"] div[class*="adf-datatable-body"] div[class*="adf-datatable-row"]');
|
||||||
|
emptyFolderMessage = element(by.css('div[class="adf-empty-folder-this-space-is-empty"]'));
|
||||||
|
table = element(by.css('div[class*="upload-border"]'));
|
||||||
|
tableBody = element.all(by.css('adf-document-list div[class="adf-datatable-body"]')).first();
|
||||||
|
|
||||||
|
getTooltip(nodeName) {
|
||||||
|
return this.getRowByRowName(nodeName).element(by.css(`#document-list-container span[title="${nodeName}"]`)).getAttribute('title');
|
||||||
|
}
|
||||||
|
|
||||||
|
getRowsName(content) {
|
||||||
|
let row = element.all(by.css(`#document-list-container span[title='${content}']`)).first();
|
||||||
|
Util.waitUntilElementIsVisible(row);
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
|
||||||
|
getRowByRowName(content) {
|
||||||
|
Util.waitUntilElementIsVisible(this.getRowsName(content).element(this.rowByRowName));
|
||||||
|
return this.getRowsName(content).element(this.rowByRowName);
|
||||||
|
}
|
||||||
|
|
||||||
|
getAllDisplayedRows() {
|
||||||
|
return element.all(this.rows).count();
|
||||||
|
}
|
||||||
|
|
||||||
|
getAllRowsNameColumn() {
|
||||||
|
return this.getAllRowsColumnValues(this.nameColumn);
|
||||||
|
}
|
||||||
|
|
||||||
|
getAllRowsColumnValues(locator) {
|
||||||
|
let deferred = protractor.promise.defer();
|
||||||
|
Util.waitUntilElementIsVisible(element.all(locator).first());
|
||||||
|
let initialList = [];
|
||||||
|
|
||||||
|
element.all(locator).each(function (currentElement) {
|
||||||
|
currentElement.getText().then(function (text) {
|
||||||
|
if (text !== '') {
|
||||||
|
initialList.push(text);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}).then(function () {
|
||||||
|
deferred.fulfill(initialList);
|
||||||
|
});
|
||||||
|
|
||||||
|
return deferred.promise;
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteContent(content) {
|
||||||
|
this.clickOnActionMenu(content);
|
||||||
|
this.waitForContentOptions();
|
||||||
|
this.deleteContentElement.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
checkDeleteIsDisabled(content) {
|
||||||
|
this.clickOnActionMenu(content);
|
||||||
|
this.waitForContentOptions();
|
||||||
|
let disabledDelete = element(by.css(`button[data-automation-id*='DELETE'][disabled='true']`));
|
||||||
|
Util.waitUntilElementIsVisible(disabledDelete);
|
||||||
|
}
|
||||||
|
|
||||||
|
metadataContent(content) {
|
||||||
|
this.clickOnActionMenu(content);
|
||||||
|
this.waitForContentOptions();
|
||||||
|
this.metadataAction.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
versionManagerContent(content) {
|
||||||
|
this.clickOnActionMenu(content);
|
||||||
|
this.waitForContentOptions();
|
||||||
|
this.versionManagerAction.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
moveContent(content) {
|
||||||
|
this.clickOnActionMenu(content);
|
||||||
|
this.moveContentElement.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
copyContent(content) {
|
||||||
|
this.clickOnActionMenu(content);
|
||||||
|
this.copyContentElement.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
lockContent(content) {
|
||||||
|
this.clickOnActionMenu(content);
|
||||||
|
this.lockContentElement.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
waitForContentOptions() {
|
||||||
|
Util.waitUntilElementIsVisible(this.copyContentElement);
|
||||||
|
Util.waitUntilElementIsVisible(this.moveContentElement);
|
||||||
|
Util.waitUntilElementIsVisible(this.deleteContentElement);
|
||||||
|
Util.waitUntilElementIsVisible(this.downloadContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
clickOnActionMenu(content) {
|
||||||
|
this.getRowByRowName(content).element(this.optionButton).click();
|
||||||
|
Util.waitUntilElementIsVisible(this.actionMenu);
|
||||||
|
browser.sleep(500);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
sortByColumn(sortOrder, locator) {
|
||||||
|
Util.waitUntilElementIsVisible(element(locator));
|
||||||
|
return element(locator).getAttribute('class').then(function (result) {
|
||||||
|
if (sortOrder === true) {
|
||||||
|
if (!result.includes('sorted-asc')) {
|
||||||
|
if (result.includes('sorted-desc') || result.includes('sortable')) {
|
||||||
|
element(locator).click();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (result.includes('sorted-asc')) {
|
||||||
|
element(locator).click();
|
||||||
|
} else if (result.includes('sortable')) {
|
||||||
|
element(locator).click();
|
||||||
|
element(locator).click();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Promise.resolve();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sort the list by name column.
|
||||||
|
*
|
||||||
|
* @param sortOrder: 'true' to sort the list ascendant and 'false' for descendant
|
||||||
|
*/
|
||||||
|
sortByName(sortOrder) {
|
||||||
|
this.sortByColumn(sortOrder, this.nameColumnHeader);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sort the list by author column.
|
||||||
|
*
|
||||||
|
* @param sortOrder: 'true' to sort the list ascendant and 'false' for descendant
|
||||||
|
*/
|
||||||
|
sortByAuthor(sortOrder) {
|
||||||
|
this.sortByColumn(sortOrder, this.createdByColumnHeader);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sort the list by created column.
|
||||||
|
*
|
||||||
|
* @param sortOrder: 'true' to sort the list ascendant and 'false' for descendant
|
||||||
|
*/
|
||||||
|
sortByCreated(sortOrder) {
|
||||||
|
this.sortByColumn(sortOrder, this.createdColumnHeader);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the list is sorted by name column.
|
||||||
|
*
|
||||||
|
* @param sortOrder: 'true' if the list is expected to be sorted ascendant and 'false' for descendant
|
||||||
|
* @return sorted : 'true' if the list is sorted as expected and 'false' if it isn't
|
||||||
|
*/
|
||||||
|
checkListIsOrderedByNameColumn(sortOrder) {
|
||||||
|
let deferred = protractor.promise.defer();
|
||||||
|
deferred.fulfill(this.checkListIsSorted(sortOrder, this.nameColumn));
|
||||||
|
return deferred.promise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the list is sorted by author column.
|
||||||
|
*
|
||||||
|
* @param sortOrder: 'true' if the list is expected to be sorted ascendant and 'false' for descendant
|
||||||
|
* @return sorted : 'true' if the list is sorted as expected and 'false' if it isn't
|
||||||
|
*/
|
||||||
|
checkListIsOrderedByAuthorColumn(sortOrder) {
|
||||||
|
let deferred = protractor.promise.defer();
|
||||||
|
deferred.fulfill(this.checkListIsSorted(sortOrder, this.createdByColumn));
|
||||||
|
return deferred.promise;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkListIsOrderedBySizeColumn(sortOrder) {
|
||||||
|
let deferred = protractor.promise.defer();
|
||||||
|
deferred.fulfill(this.checkListIsSorted(sortOrder, this.sizeColumn));
|
||||||
|
return deferred.promise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the list is sorted by created column.
|
||||||
|
*
|
||||||
|
* @param sortOrder: 'true' if the list is expected to be sorted ascendant and 'false' for descendant
|
||||||
|
* @return sorted : 'true' if the list is sorted as expected and 'false' if it isn't
|
||||||
|
*/
|
||||||
|
checkListIsOrderedByCreatedColumn(sortOrder) {
|
||||||
|
let deferred = protractor.promise.defer();
|
||||||
|
let lastValue;
|
||||||
|
let sorted = true;
|
||||||
|
|
||||||
|
element.all(this.createdColumn).map(function (currentElement) {
|
||||||
|
return currentElement.getText();
|
||||||
|
}).then(function (texts) {
|
||||||
|
texts.forEach(function (text) {
|
||||||
|
if (lastValue !== undefined) {
|
||||||
|
let currentDate = new Date(text);
|
||||||
|
let lastDate = new Date(lastValue);
|
||||||
|
if (sortOrder === true && currentDate.getTime() < lastDate.getTime()) {
|
||||||
|
sorted = false;
|
||||||
|
}
|
||||||
|
if (sortOrder === false && currentDate.getTime() > lastDate.getTime()) {
|
||||||
|
sorted = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lastValue = text;
|
||||||
|
});
|
||||||
|
deferred.fulfill(sorted);
|
||||||
|
});
|
||||||
|
return deferred.promise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the list is sorted.
|
||||||
|
*
|
||||||
|
* @param sortOrder: 'true' if the list is expected to be sorted ascendant and 'false' for descendant
|
||||||
|
* @param locator: locator for column
|
||||||
|
* @return 'true' if the list is sorted as expected and 'false' if it isn't
|
||||||
|
*/
|
||||||
|
checkListIsSorted(sortOrder, locator) {
|
||||||
|
let deferred = protractor.promise.defer();
|
||||||
|
Util.waitUntilElementIsVisible(element.all(locator).first());
|
||||||
|
let initialList = [];
|
||||||
|
element.all(locator).each(function (currentElement) {
|
||||||
|
currentElement.getText().then(function (text) {
|
||||||
|
initialList.push(text);
|
||||||
|
});
|
||||||
|
}).then(function () {
|
||||||
|
let sortedList = initialList;
|
||||||
|
sortedList = sortedList.sort();
|
||||||
|
if (sortOrder === false) {
|
||||||
|
sortedList = sortedList.reverse();
|
||||||
|
}
|
||||||
|
deferred.fulfill(initialList.toString() === sortedList.toString());
|
||||||
|
});
|
||||||
|
return deferred.promise;
|
||||||
|
}
|
||||||
|
|
||||||
|
navigateToFolder(folder) {
|
||||||
|
let row = this.getRowsName(folder);
|
||||||
|
Util.waitUntilElementIsVisible(row);
|
||||||
|
Util.waitUntilElementIsOnPage(row);
|
||||||
|
row.click();
|
||||||
|
this.checkRowIsSelected(folder);
|
||||||
|
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
doubleClickRow(selectRow) {
|
||||||
|
let row = this.getRowsName(selectRow);
|
||||||
|
Util.waitUntilElementIsVisible(row);
|
||||||
|
Util.waitUntilElementIsClickable(row);
|
||||||
|
row.click();
|
||||||
|
Util.waitUntilElementIsVisible(this.getRowByRowName(selectRow).element(by.css(`div[class*='--image'] mat-icon[svgicon*='selected']`)));
|
||||||
|
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
doubleClickEntireRow(selectRow) {
|
||||||
|
let row = this.getRowByRowName(selectRow);
|
||||||
|
Util.waitUntilElementIsVisible(row);
|
||||||
|
Util.waitUntilElementIsClickable(row);
|
||||||
|
row.click();
|
||||||
|
Util.waitUntilElementIsVisible(this.getRowByRowName(selectRow).element(by.css(`div[class*='--image'] mat-icon[svgicon*='selected']`)));
|
||||||
|
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkRowIsSelected(content) {
|
||||||
|
let isRowSelected = this.getRowsName(content).element(by.xpath(`ancestor::div[contains(@class, 'is-selected')]`));
|
||||||
|
Util.waitUntilElementIsVisible(isRowSelected);
|
||||||
|
}
|
||||||
|
|
||||||
|
checkContentIsDisplayed(content) {
|
||||||
|
Util.waitUntilElementIsVisible(this.getRowByRowName(content));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
getNodeIdByFilename(filename) {
|
||||||
|
let nodeIdColumn = element.all(by.xpath(`//div[@id='document-list-container']//div[@filename='${filename}' and @title='Node id']`));
|
||||||
|
return nodeIdColumn.getText();
|
||||||
|
}
|
||||||
|
|
||||||
|
async getAllNodeIdInList() {
|
||||||
|
let 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;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
checkEmptyFolderMessageIsDisplayed() {
|
||||||
|
Util.waitUntilElementIsVisible(this.emptyFolderMessage);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
tableIsLoaded() {
|
||||||
|
Util.waitUntilElementIsVisible(this.table);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkIconColumn(file, extension) {
|
||||||
|
let row = this.getRowByRowName(file);
|
||||||
|
Util.waitUntilElementIsVisible(row.element(by.css(`div[class*='--image'] img[alt*="${extension}"]`)));
|
||||||
|
}
|
||||||
|
|
||||||
|
rightClickOnRowNamed(rowName) {
|
||||||
|
let row = this.getRowByRowName(rowName);
|
||||||
|
browser.actions().click(row, protractor.Button.RIGHT).perform();
|
||||||
|
Util.waitUntilElementIsVisible(element(by.id('adf-context-menu-content')));
|
||||||
|
}
|
||||||
|
|
||||||
|
checkContextActionIsVisible(actionName) {
|
||||||
|
let actionButton = element(by.css(`button[data-automation-id="context-${actionName}"`));
|
||||||
|
Util.waitUntilElementIsVisible(actionButton);
|
||||||
|
Util.waitUntilElementIsClickable(actionButton);
|
||||||
|
return actionButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
pressContextMenuActionNamed(actionName) {
|
||||||
|
let actionButton = this.checkContextActionIsVisible(actionName);
|
||||||
|
actionButton.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
clickRowToSelect(rowName) {
|
||||||
|
let row = this.getRowByRowName(rowName);
|
||||||
|
browser.actions().keyDown(protractor.Key.COMMAND).click(row).perform();
|
||||||
|
this.checkRowIsSelected(rowName);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkLockedIcon(content) {
|
||||||
|
let lockIcon = element(by.cssContainingText('div[filename="' + content + '"] mat-icon', 'lock'));
|
||||||
|
Util.waitUntilElementIsVisible(lockIcon);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkUnlockedIcon(content) {
|
||||||
|
let lockIcon = element(by.cssContainingText('div[filename="' + content + '"] mat-icon', 'lock_open'));
|
||||||
|
Util.waitUntilElementIsVisible(lockIcon);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
waitForTableBody() {
|
||||||
|
Util.waitUntilElementIsVisible(this.tableBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
checkContentIsNotDisplayed(filename) {
|
||||||
|
Util.waitUntilElementIsNotVisible(element.all(by.css(`#document-list-container span[title='${filename}']`)).first());
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
getNodeIdByFilename(filename) {
|
||||||
|
let nodeIdColumn = element.all(by.xpath(`//div[@id='document-list-container']//div[@filename="${filename}" and @title='Node id']`));
|
||||||
|
let text = nodeIdColumn.getText();
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkEmptyFolderMessageIsDisplayed() {
|
||||||
|
Util.waitUntilElementIsVisible(this.emptyFolderMessage);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
tableIsLoaded() {
|
||||||
|
Util.waitUntilElementIsVisible(this.table);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkIconColumn(file, extension) {
|
||||||
|
let row = this.getRowByRowName(file);
|
||||||
|
Util.waitUntilElementIsVisible(row.element(by.css(`div[class*='--image'] img[alt*="${extension}"]`)));
|
||||||
|
}
|
||||||
|
|
||||||
|
rightClickOnRowNamed(rowName) {
|
||||||
|
let row = this.getRowByRowName(rowName);
|
||||||
|
browser.actions().click(row, protractor.Button.RIGHT).perform();
|
||||||
|
Util.waitUntilElementIsVisible(element(by.id('adf-context-menu-content')));
|
||||||
|
}
|
||||||
|
|
||||||
|
checkContextActionIsVisible(actionName) {
|
||||||
|
let actionButton = element(by.css(`button[data-automation-id="context-${actionName}"`));
|
||||||
|
Util.waitUntilElementIsVisible(actionButton);
|
||||||
|
Util.waitUntilElementIsClickable(actionButton);
|
||||||
|
return actionButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
pressContextMenuActionNamed(actionName) {
|
||||||
|
let actionButton = this.checkContextActionIsVisible(actionName);
|
||||||
|
actionButton.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
clickRowToSelect(rowName) {
|
||||||
|
let row = this.getRowByRowName(rowName);
|
||||||
|
browser.actions().keyDown(protractor.Key.COMMAND).click(row).perform();
|
||||||
|
this.checkRowIsSelected(rowName);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkLockedIcon(content) {
|
||||||
|
let lockIcon = element(by.cssContainingText('div[filename="' + content + '"] mat-icon', 'lock'));
|
||||||
|
Util.waitUntilElementIsVisible(lockIcon);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkUnlockedIcon(content) {
|
||||||
|
let lockIcon = element(by.cssContainingText('div[filename="' + content + '"] mat-icon', 'lock_open'));
|
||||||
|
Util.waitUntilElementIsVisible(lockIcon);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
waitForTableBody() {
|
||||||
|
Util.waitUntilElementIsVisible(this.tableBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,63 +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 CreateFolderDialog = function () {
|
|
||||||
|
|
||||||
var folderNameField = element(by.id('adf-folder-name-input'));
|
|
||||||
var folderDescriptionField = element(by.id('adf-folder-description-input'));
|
|
||||||
var createButton = element(by.id('adf-folder-create-button'));
|
|
||||||
var cancelButton = element(by.id('adf-folder-cancel-button'));
|
|
||||||
|
|
||||||
this.clickOnCreateButton = function () {
|
|
||||||
Util.waitUntilElementIsVisible(createButton);
|
|
||||||
createButton.click();
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkCreateBtnIsDisabled = function () {
|
|
||||||
Util.waitUntilElementIsVisible(createButton.getAttribute("disabled"));
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkCreateBtnIsEnabled = function () {
|
|
||||||
createButton.isEnabled();
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.clickOnCancelButton = function () {
|
|
||||||
Util.waitUntilElementIsVisible(cancelButton);
|
|
||||||
cancelButton.click();
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.addFolderName = function (folderName) {
|
|
||||||
Util.waitUntilElementIsVisible(folderNameField);
|
|
||||||
folderNameField.clear().sendKeys(folderName);
|
|
||||||
browser.driver.sleep(500);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.addFolderDescription = function (folderDescription) {
|
|
||||||
Util.waitUntilElementIsVisible(folderDescriptionField);
|
|
||||||
folderDescriptionField.clear().sendKeys(folderDescription);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
module.exports = CreateFolderDialog;
|
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
/*!
|
||||||
|
* @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 { browser, by, element } from 'protractor';
|
||||||
|
import { Util } from '../../../util/util';
|
||||||
|
|
||||||
|
export class CreateFolderDialog {
|
||||||
|
folderNameField = element(by.id('adf-folder-name-input'));
|
||||||
|
folderDescriptionField = element(by.id('adf-folder-description-input'));
|
||||||
|
createButton = element(by.id('adf-folder-create-button'));
|
||||||
|
cancelButton = element(by.id('adf-folder-cancel-button'));
|
||||||
|
|
||||||
|
clickOnCreateButton() {
|
||||||
|
Util.waitUntilElementIsVisible(this.createButton);
|
||||||
|
this.createButton.click();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkCreateBtnIsDisabled() {
|
||||||
|
Util.waitUntilElementIsVisible(this.createButton);
|
||||||
|
expect(this.createButton.getAttribute('disabled')).toEqual('true');
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkCreateBtnIsEnabled() {
|
||||||
|
this.createButton.isEnabled();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
clickOnCancelButton() {
|
||||||
|
Util.waitUntilElementIsVisible(this.cancelButton);
|
||||||
|
this.cancelButton.click();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
addFolderName(folderName) {
|
||||||
|
Util.waitUntilElementIsVisible(this.folderNameField);
|
||||||
|
this.folderNameField.clear();
|
||||||
|
this.folderNameField.sendKeys(folderName);
|
||||||
|
browser.driver.sleep(500);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
addFolderDescription(folderDescription) {
|
||||||
|
Util.waitUntilElementIsVisible(this.folderDescriptionField);
|
||||||
|
this.folderDescriptionField.clear();
|
||||||
|
this.folderDescriptionField.sendKeys(folderDescription);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,129 +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 SearchDialog = function () {
|
|
||||||
|
|
||||||
var searchIcon = element(by.css("button[class*='adf-search-button']"));
|
|
||||||
var searchBar = element(by.css("adf-search-control div[style*='translateX(0%)'] input"));
|
|
||||||
var searchBarNotExpanded = element(by.css("adf-search-control div[style*='translateX(81%)']"));
|
|
||||||
var no_result_message = element(by.css("p[class*='adf-search-fixed-text']"));
|
|
||||||
var rowsAuthor = by.css("div[class='mat-list-text'] p[class*='adf-search-fixed-text']");
|
|
||||||
var completeName = by.css("h4[class*='adf-search-fixed-text']");
|
|
||||||
var highlightName = by.css("div[id*='results-content'] span[class='highlight']");
|
|
||||||
var searchDialog = element(by.css("mat-list[id*='autocomplete-search-result-list']"));
|
|
||||||
|
|
||||||
this.pressDownArrowAndEnter = function () {
|
|
||||||
element(by.css("adf-search-control div input")).sendKeys(protractor.Key.ARROW_DOWN);
|
|
||||||
return browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
this.clickOnSearchIcon = function () {
|
|
||||||
Util.waitUntilElementIsVisible(searchIcon);
|
|
||||||
searchIcon.click();
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkSearchIconIsVisible = function () {
|
|
||||||
Util.waitUntilElementIsVisible(searchIcon);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkSearchBarIsVisible = function () {
|
|
||||||
Util.waitUntilElementIsVisible(searchBar);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkSearchBarIsNotVisible = function () {
|
|
||||||
Util.waitUntilElementIsVisible(searchBarNotExpanded);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkNoResultMessageIsDisplayed = function () {
|
|
||||||
Util.waitUntilElementIsVisible(no_result_message);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkNoResultMessageIsNotDisplayed = function () {
|
|
||||||
Util.waitUntilElementIsNotOnPage(no_result_message);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.enterText = function (text) {
|
|
||||||
Util.waitUntilElementIsVisible(searchBar);
|
|
||||||
searchBar.click();
|
|
||||||
searchBar.sendKeys(text);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.enterTextAndPressEnter = function (text) {
|
|
||||||
Util.waitUntilElementIsVisible(searchBar);
|
|
||||||
searchBar.click();
|
|
||||||
searchBar.sendKeys(text);
|
|
||||||
searchBar.sendKeys(protractor.Key.ENTER);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.resultTableContainsRow = function (name) {
|
|
||||||
Util.waitUntilElementIsVisible(searchDialog);
|
|
||||||
Util.waitUntilElementIsVisible(this.getRowByRowName(name));
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
this.clickOnSpecificRow = function (name) {
|
|
||||||
this.resultTableContainsRow(name);
|
|
||||||
this.getRowByRowName(name).click();
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getRowByRowName = function (name) {
|
|
||||||
return element(by.css("mat-list-item[data-automation-id='autocomplete_for_" + name + "']"));
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getSpecificRowsHighlightName = function (name) {
|
|
||||||
var deferred = protractor.promise.defer();
|
|
||||||
this.getRowByRowName(name).element(highlightName).getText().then(function (result) {
|
|
||||||
deferred.fulfill(result);
|
|
||||||
})
|
|
||||||
return deferred.promise;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getSpecificRowsCompleteName = function (name) {
|
|
||||||
var deferred = protractor.promise.defer();
|
|
||||||
this.getRowByRowName(name).element(completeName).getText().then(function (result) {
|
|
||||||
deferred.fulfill(result);
|
|
||||||
})
|
|
||||||
return deferred.promise;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getSpecificRowsAuthor = function (name) {
|
|
||||||
var deferred = protractor.promise.defer();
|
|
||||||
this.getRowByRowName(name).element(rowsAuthor).getText().then(function (result) {
|
|
||||||
deferred.fulfill(result);
|
|
||||||
})
|
|
||||||
return deferred.promise;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.clearText = function () {
|
|
||||||
Util.waitUntilElementIsVisible(searchBar);
|
|
||||||
var deferred = protractor.promise.defer();
|
|
||||||
searchBar.clear();
|
|
||||||
return deferred.promise;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
module.exports = SearchDialog;
|
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
/*!
|
||||||
|
* @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 } from '../../../util/util';
|
||||||
|
import { browser, by, element, protractor } from 'protractor';
|
||||||
|
|
||||||
|
export class SearchDialog {
|
||||||
|
|
||||||
|
searchIcon = element(by.css(`button[class*='adf-search-button']`));
|
||||||
|
searchBar = element(by.css(`adf-search-control div[style*='translateX(0%)'] input`));
|
||||||
|
searchBarNotExpanded = element(by.css(`adf-search-control div[style*='translateX(81%)'] input`));
|
||||||
|
noResultMessage = element(by.css(`p[class*='adf-search-fixed-text']`));
|
||||||
|
rowsAuthor = by.css(`div[class='mat-list-text'] p[class*='adf-search-fixed-text']`);
|
||||||
|
completeName = by.css(`h4[class*='adf-search-fixed-text']`);
|
||||||
|
highlightName = by.css(`.adf-highlight`);
|
||||||
|
searchDialog = element(by.css(`mat-list[id='autocomplete-search-result-list']`));
|
||||||
|
|
||||||
|
pressDownArrowAndEnter() {
|
||||||
|
element(by.css(`adf-search-control div input`)).sendKeys(protractor.Key.ARROW_DOWN);
|
||||||
|
return browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||||
|
}
|
||||||
|
|
||||||
|
clickOnSearchIcon() {
|
||||||
|
Util.waitUntilElementIsVisible(this.searchIcon);
|
||||||
|
this.searchIcon.click();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkSearchIconIsVisible() {
|
||||||
|
Util.waitUntilElementIsVisible(this.searchIcon);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkSearchBarIsVisible() {
|
||||||
|
Util.waitUntilElementIsVisible(this.searchBar);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkSearchBarIsNotVisible() {
|
||||||
|
browser.sleep(400);
|
||||||
|
Util.waitUntilElementIsVisible(this.searchBarNotExpanded);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkNoResultMessageIsDisplayed() {
|
||||||
|
Util.waitUntilElementIsVisible(this.noResultMessage);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkNoResultMessageIsNotDisplayed() {
|
||||||
|
Util.waitUntilElementIsNotOnPage(this.noResultMessage);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
enterText(text) {
|
||||||
|
Util.waitUntilElementIsVisible(this.searchBar);
|
||||||
|
this.searchBar.click();
|
||||||
|
this.searchBar.sendKeys(text);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
enterTextAndPressEnter(text) {
|
||||||
|
Util.waitUntilElementIsVisible(this.searchBar);
|
||||||
|
this.searchBar.click();
|
||||||
|
this.searchBar.sendKeys(text);
|
||||||
|
this.searchBar.sendKeys(protractor.Key.ENTER);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
resultTableContainsRow(name) {
|
||||||
|
Util.waitUntilElementIsVisible(this.searchDialog);
|
||||||
|
Util.waitUntilElementIsVisible(this.getRowByRowName(name));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
clickOnSpecificRow(name) {
|
||||||
|
this.resultTableContainsRow(name);
|
||||||
|
this.getRowByRowName(name).click();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
getRowByRowName(name) {
|
||||||
|
return element(by.css(`mat-list-item[data-automation-id='autocomplete_for_${name}']`));
|
||||||
|
}
|
||||||
|
|
||||||
|
getSpecificRowsHighlightName(name) {
|
||||||
|
return this.getRowByRowName(name).element(this.highlightName).getText();
|
||||||
|
}
|
||||||
|
|
||||||
|
getSpecificRowsCompleteName(name) {
|
||||||
|
return this.getRowByRowName(name).element(this.completeName).getText();
|
||||||
|
}
|
||||||
|
|
||||||
|
getSpecificRowsAuthor(name) {
|
||||||
|
return this.getRowByRowName(name).element(this.rowsAuthor).getText();
|
||||||
|
}
|
||||||
|
|
||||||
|
clearText() {
|
||||||
|
Util.waitUntilElementIsVisible(this.searchBar);
|
||||||
|
return this.searchBar.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,12 +16,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { element, by } from 'protractor';
|
import { element, by } from 'protractor';
|
||||||
import Util = require('../../../util/util');
|
import { Util } from '../../../util/util';
|
||||||
import { FormControllersPage } from '../material/formControllersPage';
|
import { FormControllersPage } from '../material/formControllersPage';
|
||||||
|
|
||||||
export class ShareDialog {
|
export class ShareDialog {
|
||||||
formControllersPage = new FormControllersPage();
|
|
||||||
|
|
||||||
|
formControllersPage = new FormControllersPage();
|
||||||
shareDialog = element(by.css('adf-share-dialog'));
|
shareDialog = element(by.css('adf-share-dialog'));
|
||||||
dialogTitle = element(by.css('[data-automation-id="adf-share-dialog-title"]'));
|
dialogTitle = element(by.css('[data-automation-id="adf-share-dialog-title"]'));
|
||||||
shareToggle = element(by.css('[data-automation-id="adf-share-toggle"] label'));
|
shareToggle = element(by.css('[data-automation-id="adf-share-toggle"] label'));
|
||||||
@@ -116,15 +116,16 @@ export class ShareDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setDefaultDay() {
|
setDefaultDay() {
|
||||||
const selector = '.mat-datetimepicker-calendar-body-active .mat-datetimepicker-calendar-body-cell-content';
|
const selector = '.mat-datetimepicker-calendar-body-cell:not(.mat-datetimepicker-calendar-body-disabled)';
|
||||||
Util.waitUntilElementIsVisible(this.dayPicker);
|
Util.waitUntilElementIsVisible(this.dayPicker);
|
||||||
let tomorrow = new Date(new Date().getTime() + 24 * 60 * 60 * 1000).getDate().toString();
|
let tomorrow = new Date(new Date().getTime() + 48 * 60 * 60 * 1000).getDate().toString();
|
||||||
this.dayPicker.element(by.cssContainingText(selector, tomorrow)).click();
|
this.dayPicker.element(by.cssContainingText(selector, tomorrow)).click();
|
||||||
}
|
}
|
||||||
|
|
||||||
setDefaultHour() {
|
setDefaultHour() {
|
||||||
const selector = '.mat-datetimepicker-clock-cell:not(.mat-datetimepicker-clock-cell-disabled)';
|
const selector = '.mat-datetimepicker-clock-cell:not(.mat-datetimepicker-clock-cell-disabled)';
|
||||||
Util.waitUntilElementIsVisible(this.clockPicker);
|
Util.waitUntilElementIsVisible(this.clockPicker);
|
||||||
|
Util.waitUntilElementIsVisible(this.hoursPicker);
|
||||||
this.hoursPicker.all(by.css(selector)).first().click();
|
this.hoursPicker.all(by.css(selector)).first().click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,191 +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 UploadDialog = function () {
|
|
||||||
|
|
||||||
var closeButton = element((by.css('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-close"]')));
|
|
||||||
var dialog = element(by.css("div[id='upload-dialog']"));
|
|
||||||
var minimizedDialog = element(by.css("div[class*='upload-dialog--minimized']"));
|
|
||||||
var uploadedStatusIcon = by.css("mat-icon[class*='status--done']");
|
|
||||||
var cancelledStatusIcon = by.css("div[class*='status--cancelled']");
|
|
||||||
var errorStatusIcon = by.css("div[class*='status--error']");
|
|
||||||
var cancelWhileUploadingIcon = by.css("mat-icon[class*='adf-file-uploading-row__action adf-file-uploading-row__action--cancel']");
|
|
||||||
var rowByRowName = by.xpath("ancestor::adf-file-uploading-list-row");
|
|
||||||
var title = element(by.css("span[class*='upload-dialog__title']"));
|
|
||||||
var minimizeButton = element(by.css("mat-icon[title='Minimize']"));
|
|
||||||
var maximizeButton = element(by.css("mat-icon[title='Maximize']"));
|
|
||||||
var sizeUploaded = by.css("span[class='adf-file-uploading-row__status']");
|
|
||||||
var canUploadConfirmationTitle = element(by.css("p[class='upload-dialog__confirmation--title']"));
|
|
||||||
var canUploadConfirmationDescription = element(by.css("p[class='upload-dialog__confirmation--text']"));
|
|
||||||
var confirmationDialogNoButton = element(by.partialButtonText("No"));
|
|
||||||
var confirmationDialogYesButton = element(by.partialButtonText("Yes"));
|
|
||||||
var cancelUploads = element((by.css('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-cancel-all"]')));
|
|
||||||
|
|
||||||
this.clickOnCloseButton = function () {
|
|
||||||
this.checkCloseButtonIsDisplayed();
|
|
||||||
closeButton.click();
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkCloseButtonIsDisplayed = function() {
|
|
||||||
Util.waitUntilElementIsVisible(closeButton);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.dialogIsDisplayed = function () {
|
|
||||||
Util.waitUntilElementIsVisible(dialog);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.dialogIsMinimized = function () {
|
|
||||||
Util.waitUntilElementIsVisible(minimizedDialog);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.dialogIsNotDisplayed = function () {
|
|
||||||
Util.waitUntilElementIsNotOnPage(dialog);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getRowsName = function (content) {
|
|
||||||
var row = element.all(by.css("div[class*='uploading-row'] span[title='" + content +"']")).first();
|
|
||||||
Util.waitUntilElementIsVisible(row);
|
|
||||||
return row;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getRowByRowName = function (content) {
|
|
||||||
return this.getRowsName(content).element(rowByRowName);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.fileIsUploaded = function (content) {
|
|
||||||
Util.waitUntilElementIsVisible(this.getRowByRowName(content).element(uploadedStatusIcon));
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.fileIsError = function (content) {
|
|
||||||
Util.waitUntilElementIsVisible(this.getRowByRowName(content).element(errorStatusIcon));
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.filesAreUploaded = function (content) {
|
|
||||||
for (var i=0; i<content.length; i++) {
|
|
||||||
this.fileIsUploaded(content[i]);
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.fileIsNotDisplayedInDialog = function (content) {
|
|
||||||
Util.waitUntilElementIsNotVisible(element(by.css("div[class*='uploading-row'] span[title='" + content +"']")));
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.cancelUploads = function () {
|
|
||||||
Util.waitUntilElementIsVisible(cancelUploads);
|
|
||||||
cancelUploads.click();
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.fileIsCancelled = function (content) {
|
|
||||||
Util.waitUntilElementIsVisible(this.getRowByRowName(content).element(cancelledStatusIcon));
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.removeUploadedFile = function (content) {
|
|
||||||
Util.waitUntilElementIsVisible(this.getRowByRowName(content).element(uploadedStatusIcon));
|
|
||||||
this.getRowByRowName(content).element(uploadedStatusIcon).click();
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.removeFileWhileUploading = function (content) {
|
|
||||||
browser.driver.actions().mouseMove(this.getRowByRowName(content).element(sizeUploaded)).perform();
|
|
||||||
this.getRowByRowName(content).element(cancelWhileUploadingIcon).click();
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getTitleText = function () {
|
|
||||||
Util.waitUntilElementIsVisible(title);
|
|
||||||
var deferred = protractor.promise.defer();
|
|
||||||
title.getText().then( function (text) {
|
|
||||||
deferred.fulfill(text);
|
|
||||||
});
|
|
||||||
return deferred.promise;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getConfirmationDialogTitleText = function () {
|
|
||||||
Util.waitUntilElementIsVisible(canUploadConfirmationTitle);
|
|
||||||
var deferred = protractor.promise.defer();
|
|
||||||
canUploadConfirmationTitle.getText().then( function (text) {
|
|
||||||
deferred.fulfill(text);
|
|
||||||
});
|
|
||||||
return deferred.promise;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getConfirmationDialogDescriptionText = function () {
|
|
||||||
Util.waitUntilElementIsVisible(canUploadConfirmationDescription);
|
|
||||||
var deferred = protractor.promise.defer();
|
|
||||||
canUploadConfirmationDescription.getText().then( function (text) {
|
|
||||||
deferred.fulfill(text);
|
|
||||||
});
|
|
||||||
return deferred.promise;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.clickOnConfirmationDialogYesButton = function () {
|
|
||||||
Util.waitUntilElementIsVisible(confirmationDialogYesButton);
|
|
||||||
confirmationDialogYesButton.click();
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.clickOnConfirmationDialogNoButton = function () {
|
|
||||||
Util.waitUntilElementIsVisible(confirmationDialogNoButton);
|
|
||||||
confirmationDialogNoButton.click();
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.numberOfCurrentFilesUploaded = function () {
|
|
||||||
var deferred = protractor.promise.defer();
|
|
||||||
this.getTitleText().then(function (text) {
|
|
||||||
deferred.fulfill(text.split('Uploaded ')[1].split(' / ')[0]);
|
|
||||||
});
|
|
||||||
return deferred.promise;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.numberOfInitialFilesUploaded = function () {
|
|
||||||
var deferred = protractor.promise.defer();
|
|
||||||
this.getTitleText().then(function (text) {
|
|
||||||
deferred.fulfill(text.split('Uploaded ')[1].split(' / ')[1]);
|
|
||||||
});
|
|
||||||
return deferred.promise;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.minimizeUploadDialog = function () {
|
|
||||||
Util.waitUntilElementIsVisible(minimizeButton);
|
|
||||||
minimizeButton.click();
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.maximizeUploadDialog = function () {
|
|
||||||
Util.waitUntilElementIsVisible(maximizeButton);
|
|
||||||
maximizeButton.click();
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
module.exports = UploadDialog;
|
|
||||||
|
|
||||||
@@ -0,0 +1,188 @@
|
|||||||
|
/*!
|
||||||
|
* @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 } from '../../../util/util';
|
||||||
|
|
||||||
|
export class UploadDialog {
|
||||||
|
|
||||||
|
closeButton = element((by.css('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-close"]')));
|
||||||
|
dialog = element(by.css('div[id="upload-dialog"]'));
|
||||||
|
minimizedDialog = element(by.css('div[class*="upload-dialog--minimized"]'));
|
||||||
|
uploadedStatusIcon = by.css('mat-icon[class*="status--done"]');
|
||||||
|
cancelledStatusIcon = by.css('div[class*="status--cancelled"]');
|
||||||
|
errorStatusIcon = by.css('div[class*="status--error"]');
|
||||||
|
cancelWhileUploadingIcon = by.css('mat-icon[class*="adf-file-uploading-row__action adf-file-uploading-row__action--cancel"]');
|
||||||
|
rowByRowName = by.xpath('ancestor::adf-file-uploading-list-row');
|
||||||
|
title = element(by.css('span[class*="upload-dialog__title"]'));
|
||||||
|
minimizeButton = element(by.css('mat-icon[title="Minimize"]'));
|
||||||
|
maximizeButton = element(by.css('mat-icon[title="Maximize"]'));
|
||||||
|
sizeUploaded = by.css('span[class="adf-file-uploading-row__status"]');
|
||||||
|
canUploadConfirmationTitle = element(by.css('p[class="upload-dialog__confirmation--title"]'));
|
||||||
|
canUploadConfirmationDescription = element(by.css('p[class="upload-dialog__confirmation--text"]'));
|
||||||
|
confirmationDialogNoButton = element(by.partialButtonText('No'));
|
||||||
|
confirmationDialogYesButton = element(by.partialButtonText('Yes'));
|
||||||
|
cancelUploadsElement = element((by.css('footer[class*="upload-dialog__actions"] button[id="adf-upload-dialog-cancel-all"]')));
|
||||||
|
|
||||||
|
clickOnCloseButton() {
|
||||||
|
this.checkCloseButtonIsDisplayed();
|
||||||
|
this.closeButton.click();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkCloseButtonIsDisplayed() {
|
||||||
|
Util.waitUntilElementIsVisible(this.closeButton);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
dialogIsDisplayed() {
|
||||||
|
Util.waitUntilElementIsVisible(this.dialog);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
dialogIsMinimized() {
|
||||||
|
Util.waitUntilElementIsVisible(this.minimizedDialog);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
dialogIsNotDisplayed() {
|
||||||
|
Util.waitUntilElementIsNotOnPage(this.dialog);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
getRowsName(content) {
|
||||||
|
let row = element.all(by.css(`div[class*='uploading-row'] span[title="${content}"]`)).first();
|
||||||
|
Util.waitUntilElementIsVisible(row);
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
|
||||||
|
getRowByRowName(content) {
|
||||||
|
return this.getRowsName(content).element(this.rowByRowName);
|
||||||
|
}
|
||||||
|
|
||||||
|
fileIsUploaded(content) {
|
||||||
|
Util.waitUntilElementIsVisible(this.getRowByRowName(content).element(this.uploadedStatusIcon));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
fileIsError(content) {
|
||||||
|
Util.waitUntilElementIsVisible(this.getRowByRowName(content).element(this.errorStatusIcon));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
filesAreUploaded(content) {
|
||||||
|
for (let i = 0; i < content.length; i++) {
|
||||||
|
this.fileIsUploaded(content[i]);
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
fileIsNotDisplayedInDialog(content) {
|
||||||
|
Util.waitUntilElementIsNotVisible(element(by.css(`div[class*='uploading-row'] span[title="${content}"]`)));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
cancelUploads() {
|
||||||
|
Util.waitUntilElementIsVisible(this.cancelUploadsElement);
|
||||||
|
this.cancelUploadsElement.click();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
fileIsCancelled(content) {
|
||||||
|
Util.waitUntilElementIsVisible(this.getRowByRowName(content).element(this.cancelledStatusIcon));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
removeUploadedFile(content) {
|
||||||
|
Util.waitUntilElementIsVisible(this.getRowByRowName(content).element(this.uploadedStatusIcon));
|
||||||
|
this.getRowByRowName(content).element(this.uploadedStatusIcon).click();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
removeFileWhileUploading(content) {
|
||||||
|
browser.driver.actions().mouseMove(this.getRowByRowName(content).element(this.sizeUploaded)).perform();
|
||||||
|
this.getRowByRowName(content).element(this.cancelWhileUploadingIcon).click();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
getTitleText() {
|
||||||
|
Util.waitUntilElementIsVisible(this.title);
|
||||||
|
let deferred = protractor.promise.defer();
|
||||||
|
this.title.getText().then((text) => {
|
||||||
|
deferred.fulfill(text);
|
||||||
|
});
|
||||||
|
return deferred.promise;
|
||||||
|
}
|
||||||
|
|
||||||
|
getConfirmationDialogTitleText() {
|
||||||
|
Util.waitUntilElementIsVisible(this.canUploadConfirmationTitle);
|
||||||
|
let deferred = protractor.promise.defer();
|
||||||
|
this.canUploadConfirmationTitle.getText().then((text) => {
|
||||||
|
deferred.fulfill(text);
|
||||||
|
});
|
||||||
|
return deferred.promise;
|
||||||
|
}
|
||||||
|
|
||||||
|
getConfirmationDialogDescriptionText() {
|
||||||
|
Util.waitUntilElementIsVisible(this.canUploadConfirmationDescription);
|
||||||
|
let deferred = protractor.promise.defer();
|
||||||
|
this.canUploadConfirmationDescription.getText().then((text) => {
|
||||||
|
deferred.fulfill(text);
|
||||||
|
});
|
||||||
|
return deferred.promise;
|
||||||
|
}
|
||||||
|
|
||||||
|
clickOnConfirmationDialogYesButton() {
|
||||||
|
Util.waitUntilElementIsVisible(this.confirmationDialogYesButton);
|
||||||
|
this.confirmationDialogYesButton.click();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
clickOnConfirmationDialogNoButton() {
|
||||||
|
Util.waitUntilElementIsVisible(this.confirmationDialogNoButton);
|
||||||
|
this.confirmationDialogNoButton.click();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
numberOfCurrentFilesUploaded() {
|
||||||
|
let deferred = protractor.promise.defer();
|
||||||
|
this.getTitleText().then((text) => {
|
||||||
|
deferred.fulfill(text.split('Uploaded ')[1].split(' / ')[0]);
|
||||||
|
});
|
||||||
|
return deferred.promise;
|
||||||
|
}
|
||||||
|
|
||||||
|
numberOfInitialFilesUploaded() {
|
||||||
|
let deferred = protractor.promise.defer();
|
||||||
|
this.getTitleText().then((text) => {
|
||||||
|
deferred.fulfill(text.split('Uploaded ')[1].split(' / ')[1]);
|
||||||
|
});
|
||||||
|
return deferred.promise;
|
||||||
|
}
|
||||||
|
|
||||||
|
minimizeUploadDialog() {
|
||||||
|
Util.waitUntilElementIsVisible(this.minimizeButton);
|
||||||
|
this.minimizeButton.click();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
maximizeUploadDialog() {
|
||||||
|
Util.waitUntilElementIsVisible(this.maximizeButton);
|
||||||
|
this.maximizeButton.click();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -17,7 +17,8 @@
|
|||||||
|
|
||||||
import { FormControllersPage } from '../material/formControllersPage';
|
import { FormControllersPage } from '../material/formControllersPage';
|
||||||
|
|
||||||
import Util = require('../../../util/util');
|
import { Util } from '../../../util/util';
|
||||||
|
import { by, element, protractor } from 'protractor';
|
||||||
|
|
||||||
export class UploadToggles {
|
export class UploadToggles {
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Util = require('../../../util/util');
|
import { Util } from '../../../util/util';
|
||||||
import { TabsPage } from '../material/tabsPage';
|
import { TabsPage } from '../material/tabsPage';
|
||||||
import { element, by, browser, protractor } from 'protractor';
|
import { element, by, browser, protractor } from 'protractor';
|
||||||
|
|
||||||
|
|||||||
@@ -1,778 +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 Page = require('astrolabe').Page;
|
|
||||||
var Util = require('../../util/util');
|
|
||||||
|
|
||||||
var contentServices = element(by.css("a[data-automation-id='files'] span"));
|
|
||||||
var siteList = element(by.css("md-select[class*='dropdown-list']"));
|
|
||||||
var folderID = element(by.css('adf-files-component p'));
|
|
||||||
var folderText = element(by.css("md-input-container[class*='adf-create-folder--name'] input"));
|
|
||||||
var createButtonDialog = element(by.xpath("//span[contains(text(), 'Create')]/ancestor::button"));
|
|
||||||
var createFolderButton = element(by.xpath("//md-icon[contains(text(), 'create_new_folder')]"));
|
|
||||||
var currentFolder = element(by.xpath("//div[@class='adf-breadcrumb-container']/li[last()]/div"));
|
|
||||||
var deleteContent = element(by.css("button[adf-node-permission='delete']"));
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides the Login Page.
|
|
||||||
* @module pages
|
|
||||||
* @submodule share
|
|
||||||
* @class pages.share.LoginPage
|
|
||||||
*/
|
|
||||||
module.exports = Page.create({
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides the document list.
|
|
||||||
* @property documentList
|
|
||||||
* @type protractor.Element
|
|
||||||
*/
|
|
||||||
documentList: {
|
|
||||||
get: function () {
|
|
||||||
return element(by.css("tr[class='alfresco-datatable__row'] > td"));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides the upload button.
|
|
||||||
* @property uploadButton
|
|
||||||
* @type protractor.Element
|
|
||||||
*/
|
|
||||||
uploadButton: {
|
|
||||||
get: function () {
|
|
||||||
return element(by.css("input[data-automation-id='upload-single-file']"));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides the mutiple upload button .
|
|
||||||
* @property uploadButton
|
|
||||||
* @type protractor.Elementx
|
|
||||||
*/
|
|
||||||
multipleUploadButton: {
|
|
||||||
get: function () {
|
|
||||||
return element(by.css("input[data-automation-id='upload-multiple-files']"));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides the mutiple upload button enabled
|
|
||||||
* @property multipleUploadEnabled
|
|
||||||
* @type protractor.Element
|
|
||||||
*/
|
|
||||||
multipleUploadEnabled: {
|
|
||||||
get: function () {
|
|
||||||
return element(by.css("alfresco-upload-button[data-automation-id='multiple-file-upload'][ng-reflect-multiple-files='true']"));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides the extensions accepted text field
|
|
||||||
* @property acceptedFilesText
|
|
||||||
* @type protractor.Element
|
|
||||||
*/
|
|
||||||
acceptedFilesText: {
|
|
||||||
get: function () {
|
|
||||||
return element(by.css("input[data-automation-id='accepted-files-type']"));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides the create folder button
|
|
||||||
* @property createFolderButton
|
|
||||||
* @type protractor.Element
|
|
||||||
*/
|
|
||||||
createFolderButton: {
|
|
||||||
get: function () {
|
|
||||||
return element(by.cssContainingText("button[id='actions'] > i", "add"));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides the create new folder button in dialog
|
|
||||||
* @property createFolderButton
|
|
||||||
* @type protractor.Element
|
|
||||||
*/
|
|
||||||
createFolderButtonDialog: {
|
|
||||||
get: function () {
|
|
||||||
return element(by.cssContainingText("span[class='mdl-menu__text']", "New Folder"));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides the longer wait required
|
|
||||||
* @property goToDocList
|
|
||||||
* @type protractor.Element
|
|
||||||
* */
|
|
||||||
goToDocList: {
|
|
||||||
value: function () {
|
|
||||||
Util.waitUntilElementIsVisible(contentServices);
|
|
||||||
contentServices.click();
|
|
||||||
Util.waitUntilElementIsVisible(siteList);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides the longer wait required
|
|
||||||
* @property waitForElements
|
|
||||||
* @type protractor.Element
|
|
||||||
* */
|
|
||||||
waitForElements: {
|
|
||||||
value: function () {
|
|
||||||
Util.waitUntilElementIsVisible(this.uploadButton);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates new folder
|
|
||||||
* @property createFolder
|
|
||||||
* */
|
|
||||||
createFolder: {
|
|
||||||
value: function (folderName) {
|
|
||||||
Util.waitUntilElementIsVisible(createFolderButton);
|
|
||||||
createFolderButton.click();
|
|
||||||
Util.waitUntilElementIsVisible(folderText);
|
|
||||||
folderText.sendKeys(folderName);
|
|
||||||
createButtonDialog.click();
|
|
||||||
this.checkItemInDocList(folderName);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Deletes content
|
|
||||||
* @property deleteContent
|
|
||||||
* */
|
|
||||||
deleteContent: {
|
|
||||||
value: function (contentName) {
|
|
||||||
var contentElement = element(by.css("div[data-automation-id*='text_" + contentName + "']"));
|
|
||||||
Util.waitUntilElementIsVisible(contentElement);
|
|
||||||
contentElement.click();
|
|
||||||
deleteContent.click();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve row by row number
|
|
||||||
*
|
|
||||||
* @param rowNumber
|
|
||||||
*/
|
|
||||||
getRowByRowNumber: {
|
|
||||||
value: function (rowNumber) {
|
|
||||||
return element(by.css("div[data-automation-id='text_" + rowNumber + "']"));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Go into folder
|
|
||||||
* @property goIntoFolder
|
|
||||||
* */
|
|
||||||
goIntoFolder: {
|
|
||||||
value: function (folderName) {
|
|
||||||
this.checkItemInDocList(folderName);
|
|
||||||
browser.actions().doubleClick(element(by.css("div[data-automation-id*='text_" + folderName + "']"))).perform();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Go into folder via breadcrumb
|
|
||||||
* @property goIntoFolderViaBreadcrumbs
|
|
||||||
* */
|
|
||||||
goIntoFolderViaBreadcrumbs: {
|
|
||||||
value: function (folderName) {
|
|
||||||
var breadcrumb = element(by.cssContainingText("a[data-automation-id='breadcrumb_" + folderName + "']", folderName));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(breadcrumb);
|
|
||||||
breadcrumb.click();
|
|
||||||
this.waitForElements();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
currentFolderName: {
|
|
||||||
value: function () {
|
|
||||||
var deferred = protractor.promise.defer();
|
|
||||||
Util.waitUntilElementIsVisible(currentFolder);
|
|
||||||
currentFolder.getText().then(function (result) {
|
|
||||||
deferred.fulfill(result);
|
|
||||||
})
|
|
||||||
return deferred.promise;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Go into folder
|
|
||||||
* @property goIntoFolder
|
|
||||||
* */
|
|
||||||
checkFolderInBreadcrumbs: {
|
|
||||||
value: function (folderName) {
|
|
||||||
var breadcrumb = element(by.cssContainingText("a[data-automation-id='breadcrumb_" + folderName + "']", folderName));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(breadcrumb);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check file/fodler in document list
|
|
||||||
* @property checkItemInDocList
|
|
||||||
* */
|
|
||||||
checkItemInDocList: {
|
|
||||||
value: function (fileName) {
|
|
||||||
Util.waitUntilElementIsVisible(element(by.cssContainingText("div[data-automation-id='text_" + fileName + "']", fileName)));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check file is not in document list
|
|
||||||
* @property checkFileIsNotInDocList
|
|
||||||
* */
|
|
||||||
checkFileIsNotInDocList: {
|
|
||||||
value: function (fileName) {
|
|
||||||
Util.waitUntilElementIsNotOnPage(element(by.cssContainingText("div[data-automation-id='text_" + fileName + "']", fileName)));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check number of times file appears in document list
|
|
||||||
* @property checkNumberOfFilesInDocList
|
|
||||||
* */
|
|
||||||
checkNumberOfFilesInDocList: {
|
|
||||||
value: function (fileName, numberOfFiles) {
|
|
||||||
this.checkItemInDocList(fileName);
|
|
||||||
|
|
||||||
var file = element.all(by.cssContainingText("div[data-automation-id='text_" + fileName + "']", fileName));
|
|
||||||
expect(file.count()).toEqual(numberOfFiles);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* uploads file
|
|
||||||
* @property uploadFile
|
|
||||||
* */
|
|
||||||
uploadFile: {
|
|
||||||
value: function (fileLocation, fileName) {
|
|
||||||
var uploadButton = element(by.css("input[data-automation-id='upload-single-file']"));
|
|
||||||
Util.waitUntilElementIsVisible(uploadButton);
|
|
||||||
Util.uploadFile(uploadButton, uploadButton, fileLocation);
|
|
||||||
this.checkItemInDocList(fileName);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* uploads file without checking document list
|
|
||||||
* @property uploadFileWithoutCheck
|
|
||||||
* */
|
|
||||||
uploadFileWithoutCheck: {
|
|
||||||
value: function (fileLocation) {
|
|
||||||
Util.waitUntilElementIsVisible(this.uploadButton);
|
|
||||||
Util.uploadFile(this.uploadButton, this.uploadButton, fileLocation);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check file in upload dialog
|
|
||||||
* @property checkFileInUploadDialog
|
|
||||||
* */
|
|
||||||
checkFileInUploadDialog: {
|
|
||||||
value: function (fileName) {
|
|
||||||
Util.waitUntilElementIsVisible(element(by.cssContainingText("td[data-automation-id='dialog_" + fileName + "'] > div", fileName)));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check all uploads are complete
|
|
||||||
* @property checkAllUploadsComplete
|
|
||||||
* */
|
|
||||||
checkAllUploadsComplete: {
|
|
||||||
value: function (fileName) {
|
|
||||||
var dialogUpload = element.all(by.css("td[data-automation-id*='dialog_']"));
|
|
||||||
var singleUpload = element(by.cssContainingText("div[ng-reflect-klass='file-dialog'] div[class='title'] ", "upload complete"));
|
|
||||||
var multipleUploads = element(by.cssContainingText("div[ng-reflect-klass='file-dialog'] div[class='title'] ", "uploads complete"));
|
|
||||||
|
|
||||||
dialogUpload.count().then(function (count) {
|
|
||||||
if (count === 1) {
|
|
||||||
Util.waitUntilElementIsVisible(singleUpload);
|
|
||||||
}
|
|
||||||
else if (count > 1) {
|
|
||||||
Util.waitUntilElementIsVisible(multipleUploads);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check done icon for file
|
|
||||||
* @property checkDoneIcon
|
|
||||||
* */
|
|
||||||
checkDoneIcon: {
|
|
||||||
value: function (fileName) {
|
|
||||||
Util.waitUntilElementIsVisible(element(by.xpath("//i[contains(@data-automation-id, 'done_icon')]/../../../td[contains(@data-automation-id, '" + fileName + "')]")));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check abort icon for file
|
|
||||||
* @property checkUploadAbortedIcon
|
|
||||||
* */
|
|
||||||
checkAbortedIcon: {
|
|
||||||
value: function (fileName) {
|
|
||||||
Util.waitUntilElementIsVisible(element(by.xpath("//i[contains(@data-automation-id, 'upload_stopped')]/../../../td[contains(@data-automation-id, '" + fileName + "')]")));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check progress bar in dialog
|
|
||||||
* @property checkDoneIcon
|
|
||||||
* */
|
|
||||||
checkProgressBar: {
|
|
||||||
value: function (fileName) {
|
|
||||||
Util.waitUntilElementIsVisible(element(by.css("div[data-automation-id='dialog_progress_" + fileName + "']")));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* check upload dialog
|
|
||||||
* @property checkUploadDialog
|
|
||||||
* */
|
|
||||||
checkUploadDialog: {
|
|
||||||
value: function (fileName) {
|
|
||||||
var uploadDialog = element(by.css("file-uploading-dialog[class='dialog-show'] > div[class='file-dialog show']"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(uploadDialog);
|
|
||||||
this.checkFileInUploadDialog(fileName);
|
|
||||||
this.checkAllUploadsComplete();
|
|
||||||
this.checkDoneIcon(fileName);
|
|
||||||
this.checkProgressBar(fileName);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Close upload dialog
|
|
||||||
* @property closeUploadDialog
|
|
||||||
* */
|
|
||||||
closeUploadDialog: {
|
|
||||||
value: function () {
|
|
||||||
var closeDialog = element(by.css("div[title='close upload list'] > i"));
|
|
||||||
Util.waitUntilElementIsVisible(closeDialog);
|
|
||||||
closeDialog.click();
|
|
||||||
Util.waitUntilElementIsNotOnPage(closeDialog);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Minimise upload dialog
|
|
||||||
* @property minimiseUploadDialog
|
|
||||||
* */
|
|
||||||
minimiseUploadDialog: {
|
|
||||||
value: function () {
|
|
||||||
var minimiseDialog = element(by.css("div[class='minimize-button'] > i[title='minimize upload list']"));
|
|
||||||
Util.waitUntilElementIsVisible(minimiseDialog);
|
|
||||||
minimiseDialog.click();
|
|
||||||
Util.waitUntilElementIsNotOnPage(minimiseDialog);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Maximise upload dialog
|
|
||||||
* @property maximiseUploadDialog
|
|
||||||
* */
|
|
||||||
maximiseUploadDialog: {
|
|
||||||
value: function () {
|
|
||||||
var maximiseDialog = element(by.css("div[class='minimize-button active'] > i[title='expand upload list']"));
|
|
||||||
Util.waitUntilElementIsVisible(maximiseDialog);
|
|
||||||
maximiseDialog.click();
|
|
||||||
Util.waitUntilElementIsNotOnPage(maximiseDialog);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Click undo upload via message window
|
|
||||||
* @property clickUndoUploadViaWindow
|
|
||||||
* */
|
|
||||||
clickUndoUploadViaWindow: {
|
|
||||||
value: function () {
|
|
||||||
var notificationWindow = element(by.css("div[id='undo-notification-bar']"));
|
|
||||||
var undoButton = element(by.css("alfresco-upload-button div[id='undo-notification-bar'] > button[data-automation-id='undo_upload_button']"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(notificationWindow);
|
|
||||||
Util.waitUntilElementIsVisible(undoButton);
|
|
||||||
undoButton.click();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Undo upload via window
|
|
||||||
* @property undoUploadViaWindow
|
|
||||||
* */
|
|
||||||
undoUploadViaWindow: {
|
|
||||||
value: function (fileName) {
|
|
||||||
this.clickUndoUploadViaWindow();
|
|
||||||
this.checkFileIsNotInDocList(fileName);
|
|
||||||
this.checkAbortedIcon(fileName);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Click undo upload via upload dialog
|
|
||||||
* @property clickUndoUploadViaWindow
|
|
||||||
* */
|
|
||||||
clickUndoUploadViaDialog: {
|
|
||||||
value: function (fileName) {
|
|
||||||
var dialog = element(by.css("file-uploading-dialog[class='dialog-show']"));
|
|
||||||
var undoIcon = element(by.xpath("//i[contains(@data-automation-id, 'abort_cancel_upload')]/../../../td[contains(@data-automation-id, '" + fileName + "')]"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(dialog);
|
|
||||||
Util.waitUntilElementIsVisible(undoIcon);
|
|
||||||
undoIcon.click();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Undo upload via dialog
|
|
||||||
* @property undoUploadViaDialog
|
|
||||||
* */
|
|
||||||
undoUploadViaDialog: {
|
|
||||||
value: function (fileName) {
|
|
||||||
this.clickUndoUploadViaDialog(fileName);
|
|
||||||
this.checkFileIsNotInDocList(fileName);
|
|
||||||
this.checkAbortedIcon(fileName);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Click cancel upload via upload dialog
|
|
||||||
* @property clickUndoUploadViaWindow
|
|
||||||
* */
|
|
||||||
clickCancelUploadViaDialog: {
|
|
||||||
value: function () {
|
|
||||||
var dialog = element(by.css("file-uploading-dialog[class='dialog-show']"));
|
|
||||||
var cancelButton = element(by.css("a[data-automation-id='cancel_upload_all']"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(dialog);
|
|
||||||
Util.waitUntilElementIsVisible(cancelButton);
|
|
||||||
cancelButton.click();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* cancel upload via dialog
|
|
||||||
* @property undoUploadViaDialog
|
|
||||||
* */
|
|
||||||
cancelUploadViaDialog: {
|
|
||||||
value: function (fileName) {
|
|
||||||
this.clickCancelUploadViaDialog();
|
|
||||||
this.checkFileIsNotInDocList(fileName);
|
|
||||||
this.checkAbortedIcon(fileName);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enable multiple file upload
|
|
||||||
* @property enableMultipleFileUpload
|
|
||||||
* */
|
|
||||||
enableMultipleFileUpload: {
|
|
||||||
value: function () {
|
|
||||||
var multiFileUploadSwitch = element(by.css("label[for='switch-multiple-file']"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(multiFileUploadSwitch);
|
|
||||||
multiFileUploadSwitch.click();
|
|
||||||
Util.waitUntilElementIsVisible(this.multipleUploadButton);
|
|
||||||
Util.waitUntilElementIsVisible(this.multipleUploadEnabled);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Disable multiple file upload
|
|
||||||
* @property diableMultipleFileUpload
|
|
||||||
* */
|
|
||||||
disableMultipleFileUpload: {
|
|
||||||
value: function () {
|
|
||||||
var multiFileUploadSwitch = element(by.css("label[for='switch-multiple-file']"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(multiFileUploadSwitch);
|
|
||||||
multiFileUploadSwitch.click();
|
|
||||||
Util.waitUntilElementIsNotOnPage(this.multipleUploadButton);
|
|
||||||
Util.waitUntilElementIsNotOnPage(this.multipleUploadEnabled);
|
|
||||||
Util.waitUntilElementIsVisible(this.uploadButton);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* upload mutiple files, 3
|
|
||||||
* @property uploadMutipleFiles
|
|
||||||
* */
|
|
||||||
uploadMutipleFiles: {
|
|
||||||
value: function (file1Location, file2Location) {
|
|
||||||
Util.waitUntilElementIsVisible(this.multipleUploadButton);
|
|
||||||
Util.waitUntilElementIsVisible(this.multipleUploadEnabled);
|
|
||||||
|
|
||||||
var firstFile = Util.uploadParentFolder(file1Location);
|
|
||||||
var secondFile = Util.uploadParentFolder(file2Location);
|
|
||||||
|
|
||||||
Util.uploadFile(this.multipleUploadButton, this.multipleUploadButton, firstFile + "\n" + secondFile);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enable filter on
|
|
||||||
* @property enableFilter
|
|
||||||
* */
|
|
||||||
enableFilter: {
|
|
||||||
value: function () {
|
|
||||||
var acceptedFileTypeSwitch = element(by.css("label[for='switch-accepted-file-type']"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(acceptedFileTypeSwitch);
|
|
||||||
acceptedFileTypeSwitch.click();
|
|
||||||
Util.waitUntilElementIsVisible(this.acceptedFilesText);
|
|
||||||
Util.waitUntilElementIsVisible(this.uploadButton);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Disable multiple file upload
|
|
||||||
* @property disableFilter
|
|
||||||
* */
|
|
||||||
disableFilter: {
|
|
||||||
value: function () {
|
|
||||||
var acceptedFileTypeSwitch = element(by.css("label[for='switch-accepted-file-type']"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(acceptedFileTypeSwitch);
|
|
||||||
acceptedFileTypeSwitch.click();
|
|
||||||
Util.waitUntilElementIsNotOnPage(this.acceptedFilesText);
|
|
||||||
Util.waitUntilElementIsVisible(this.uploadButton);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enter allowed file types
|
|
||||||
* @property allowedFileTypes
|
|
||||||
* */
|
|
||||||
setAllowedFileTypes: {
|
|
||||||
value: function (allowedFileTypes) {
|
|
||||||
var uploadButtonRestricted = element(by.css("input[data-automation-id='upload-single-file'][ng-reflect-accept='" + allowedFileTypes + "']"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(this.acceptedFilesText);
|
|
||||||
this.acceptedFilesText.clear();
|
|
||||||
this.acceptedFilesText.sendKeys(allowedFileTypes);
|
|
||||||
Util.waitUntilElementIsVisible(uploadButtonRestricted);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enable versioning
|
|
||||||
* @property enableVersioning
|
|
||||||
* */
|
|
||||||
enableVersioning: {
|
|
||||||
value: function () {
|
|
||||||
var versioningSwitch = element(by.css("label[for='switch-versioning']"));
|
|
||||||
var versioningEnabled = element(by.css("alfresco-upload-button[data-automation-id='multiple-file-upload'][ng-reflect-versioning='true']"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(versioningSwitch);
|
|
||||||
versioningSwitch.click();
|
|
||||||
Util.waitUntilElementIsVisible(versioningEnabled);
|
|
||||||
Util.waitUntilElementIsVisible(this.uploadButton);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Disable versioning
|
|
||||||
* @property disableVersioning
|
|
||||||
* */
|
|
||||||
disableVersioning: {
|
|
||||||
value: function () {
|
|
||||||
var versioningSwitch = element(by.css("label[for='switch-versioning']"));
|
|
||||||
var versioningEnabled = element(by.css("alfresco-upload-button[data-automation-id='multiple-file-upload'][ng-reflect-versioning='true']"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(versioningSwitch);
|
|
||||||
versioningSwitch.click();
|
|
||||||
Util.waitUntilElementIsNotOnPage(versioningEnabled);
|
|
||||||
Util.waitUntilElementIsVisible(this.uploadButton);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* adds versioning additon to to filename
|
|
||||||
* @property versionedFileName
|
|
||||||
* */
|
|
||||||
versionedFileName: {
|
|
||||||
value: function (fileName, versioningAddition) {
|
|
||||||
var fullFileName = fileName.split(".");
|
|
||||||
var nameWithoutExtension = fullFileName[0];
|
|
||||||
var extension = fullFileName[1];
|
|
||||||
return nameWithoutExtension + versioningAddition + "." + extension;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* sort document list by display name, ascending/descending
|
|
||||||
* @property sortDisplayName
|
|
||||||
* */
|
|
||||||
sortDisplayName: {
|
|
||||||
value: function (sorting) {
|
|
||||||
var sortingIcon = element(by.css("th[class*='header--sorted-" + sorting + "'][data-automation-id='auto_id_name']"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(sortingIcon);
|
|
||||||
sortingIcon.click();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* check first folder name
|
|
||||||
* @property checkFirstFolderName
|
|
||||||
* */
|
|
||||||
checkFirstFolderName: {
|
|
||||||
value: function (folderName) {
|
|
||||||
var firstFolder = element(by.xpath("//img[(contains(@src, 'folder.svg'))]/../../../../td/div/div[(contains(@data-automation-id, 'text_" + folderName + "'))]"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(firstFolder);
|
|
||||||
Util.waitUntilElementIsVisible(this.documentList);
|
|
||||||
expect(firstFolder.getText()).toEqual(folderName);
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* check first file's name
|
|
||||||
* @property checkFirstFilesName
|
|
||||||
* */
|
|
||||||
checkFirstFilesName: {
|
|
||||||
value: function (fileName) {
|
|
||||||
var firstFile = element(by.xpath("//img[not (contains(@src, 'folder.svg'))]/../../../../td/div/div[(contains(@data-automation-id, 'text_" + fileName + "'))]"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(firstFile);
|
|
||||||
Util.waitUntilElementIsVisible(this.documentList);
|
|
||||||
expect(firstFile.getText()).toEqual(fileName);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* click created by when no icon is displayed
|
|
||||||
* @property clickCreatedBy
|
|
||||||
* */
|
|
||||||
clickCreatedBy: {
|
|
||||||
value: function () {
|
|
||||||
var createdBy = element(by.css("th[data-automation-id='auto_id_createdByUser.displayName']"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(createdBy);
|
|
||||||
createdBy.click();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* sort document list by created by, ascending/descending
|
|
||||||
* @property sortCreatedBy
|
|
||||||
* */
|
|
||||||
sortCreatedBy: {
|
|
||||||
value: function (sorting) {
|
|
||||||
var sortingIcon = element(by.css("th[class*='header--sorted-" + sorting + "'][data-automation-id='auto_id_createdByUser.displayName']"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(sortingIcon);
|
|
||||||
sortingIcon.click();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* check first folder creator
|
|
||||||
* @property checkFirstFolderName
|
|
||||||
* */
|
|
||||||
checkFirstFolderCreator: {
|
|
||||||
value: function (folderName, creator) {
|
|
||||||
var firstFolder = element(by.xpath("//img[(contains(@src, 'folder.svg'))]/../../../../td/div/div[(contains(@data-automation-id, 'text_" + creator + "'))]"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(firstFolder);
|
|
||||||
Util.waitUntilElementIsVisible(this.documentList);
|
|
||||||
expect(firstFolder.getText()).toContain(creator);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* check first file creator
|
|
||||||
* @property checkFirstFileName
|
|
||||||
* */
|
|
||||||
checkFirstFilesCreator: {
|
|
||||||
value: function (fileName, creator) {
|
|
||||||
var firstFile = element(by.xpath("//img[not (contains(@src, 'folder.svg'))]/../../../../td/div/div[(contains(@data-automation-id, 'text_" + creator + "'))]"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(firstFile);
|
|
||||||
Util.waitUntilElementIsVisible(this.documentList);
|
|
||||||
expect(firstFile.getText()).toContain(creator);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* click created on when no icon is displayed
|
|
||||||
* @property clickCreatedOn
|
|
||||||
* */
|
|
||||||
clickCreatedOn: {
|
|
||||||
value: function () {
|
|
||||||
var createdOn = element(by.css("th[data-automation-id='auto_id_createdAt']"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(createdOn);
|
|
||||||
createdOn.click();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* sort document list by created on, ascending/descending
|
|
||||||
* @property sortCreatedBy
|
|
||||||
* */
|
|
||||||
sortCreatedBy: {
|
|
||||||
value: function (sorting) {
|
|
||||||
var sortingIcon = element(by.css("th[class*='header--sorted-" + sorting + "'][data-automation-id='auto_id_createdAt']"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(sortingIcon);
|
|
||||||
sortingIcon.click();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* check first folder created on date
|
|
||||||
* @property checkFirstFolderDate
|
|
||||||
* */
|
|
||||||
checkFirstFolderDate: {
|
|
||||||
value: function () {
|
|
||||||
var firstFolder = element(by.xpath("//img[not (contains(@src, 'folder.svg'))]/../../../../td/div/div[(contains(@data-automation-id, 'date_'))]"));
|
|
||||||
|
|
||||||
var todaysDate = Util.getCrtDateLongFormat();
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(firstFolder);
|
|
||||||
Util.waitUntilElementIsVisible(this.documentList);
|
|
||||||
expect(firstFolder.getText()).toContain(todaysDate);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* check first files created on date
|
|
||||||
* @property checkFirstFilesDate
|
|
||||||
* */
|
|
||||||
checkFirstFilesDate: {
|
|
||||||
value: function () {
|
|
||||||
var firstFile = element(by.xpath("//img[not (contains(@src, 'folder.svg'))]/../../../../td/div/div[(contains(@data-automation-id, 'date_'))]"));
|
|
||||||
|
|
||||||
var todaysDate = Util.getCrtDateLongFormat();
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(firstFile);
|
|
||||||
Util.waitUntilElementIsVisible(this.documentList);
|
|
||||||
expect(firstFile.getText()).toContain(todaysDate);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
getCurrentFolderID: {
|
|
||||||
value: function () {
|
|
||||||
return folderID.getText();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
});
|
|
||||||
@@ -1,76 +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 ErrorPage = function(){
|
|
||||||
|
|
||||||
var errorPage = element(by.css("adf-error-content"));
|
|
||||||
var errorPageCode = element(by.css("adf-error-content .adf-error-content-code"));
|
|
||||||
var errorPageTitle = element(by.css("adf-error-content .adf-error-content-title"));
|
|
||||||
var errorPageDescription = element(by.css("adf-error-content .adf-error-content-description"));
|
|
||||||
var backButton = element(by.id("adf-return-button"));
|
|
||||||
var secondButton = element(by.id("adf-secondary-button"));
|
|
||||||
|
|
||||||
this.checkErrorPage = function(){
|
|
||||||
Util.waitUntilElementIsVisible(errorPage);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.clickBackButton = function(){
|
|
||||||
Util.waitUntilElementIsVisible(backButton);
|
|
||||||
backButton.click();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.clickSecondButton = function(){
|
|
||||||
Util.waitUntilElementIsVisible(secondButton);
|
|
||||||
secondButton.click();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkErrorTitle = function(){
|
|
||||||
Util.waitUntilElementIsVisible(errorPageTitle);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkErrorCode = function(){
|
|
||||||
Util.waitUntilElementIsVisible(errorPageCode);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkErrorDescription = function(){
|
|
||||||
Util.waitUntilElementIsVisible(errorPageDescription);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getErrorCode = function() {
|
|
||||||
Util.waitUntilElementIsVisible(errorPageCode);
|
|
||||||
return errorPageCode.getText();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getErrorTitle = function() {
|
|
||||||
Util.waitUntilElementIsVisible(errorPageTitle);
|
|
||||||
return errorPageTitle.getText();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getErrorDescription = function() {
|
|
||||||
Util.waitUntilElementIsVisible(errorPageDescription);
|
|
||||||
return errorPageDescription.getText();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.checkBackButton = function () {
|
|
||||||
return Util.waitUntilElementIsVisible(backButton);
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = ErrorPage;
|
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
/*!
|
||||||
|
* @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 } from '../../util/util';
|
||||||
|
import { element, by } from 'protractor';
|
||||||
|
|
||||||
|
export class ErrorPage {
|
||||||
|
|
||||||
|
errorPageCode = element(by.css('adf-error-content .adf-error-content-code'));
|
||||||
|
errorPageTitle = element(by.css('adf-error-content .adf-error-content-title'));
|
||||||
|
errorPageDescription = element(by.css('adf-error-content .adf-error-content-description'));
|
||||||
|
backButton = element(by.id('adf-return-button'));
|
||||||
|
secondButton = element(by.id('adf-secondary-button'));
|
||||||
|
|
||||||
|
clickBackButton() {
|
||||||
|
Util.waitUntilElementIsVisible(this.backButton);
|
||||||
|
this.backButton.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
clickSecondButton() {
|
||||||
|
Util.waitUntilElementIsVisible(this.secondButton);
|
||||||
|
this.secondButton.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
checkErrorCode() {
|
||||||
|
Util.waitUntilElementIsVisible(this.errorPageCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
getErrorCode() {
|
||||||
|
Util.waitUntilElementIsVisible(this.errorPageCode);
|
||||||
|
return this.errorPageCode.getText();
|
||||||
|
}
|
||||||
|
|
||||||
|
getErrorTitle() {
|
||||||
|
Util.waitUntilElementIsVisible(this.errorPageTitle);
|
||||||
|
return this.errorPageTitle.getText();
|
||||||
|
}
|
||||||
|
|
||||||
|
getErrorDescription() {
|
||||||
|
Util.waitUntilElementIsVisible(this.errorPageDescription);
|
||||||
|
return this.errorPageDescription.getText();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,475 +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 Page = require('astrolabe').Page;
|
|
||||||
var Util = require('../../util/util');
|
|
||||||
var documentList = require('./documentListPage');
|
|
||||||
|
|
||||||
var pdfTitleFromSearch = element(by.css("span[id='adf-viewer-display-name']"));
|
|
||||||
var textLayer = element.all(by.css("div[class='textLayer']")).first();
|
|
||||||
var closeButton = element(by.css('button[data-automation-id="adf-toolbar-back"]'));
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides the file preview Page.
|
|
||||||
* @module pages
|
|
||||||
* @submodule share
|
|
||||||
* @class pages.adf.filePreviewPage
|
|
||||||
*/
|
|
||||||
module.exports = Page.create({
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wait for elements to appear
|
|
||||||
* @property waitForElements
|
|
||||||
* @type protractor.Element
|
|
||||||
* */
|
|
||||||
waitForElements: {
|
|
||||||
value: function () {
|
|
||||||
Util.waitUntilElementIsVisible(element(by.css("i[id='viewer-close-button']")));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Click view file
|
|
||||||
* @property viewFile
|
|
||||||
* */
|
|
||||||
viewFile: {
|
|
||||||
value: function (fileName) {
|
|
||||||
documentList.checkItemInDocList(fileName);
|
|
||||||
browser.actions().doubleClick(element(by.cssContainingText("div[data-automation-id='text_" + fileName + "']", fileName))).perform();
|
|
||||||
this.waitForElements();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get file title
|
|
||||||
* @method getPDFTitle
|
|
||||||
*/
|
|
||||||
getPDFTitleFromSearch: {
|
|
||||||
value: function () {
|
|
||||||
var deferred = protractor.promise.defer();
|
|
||||||
Util.waitUntilElementIsVisible(pdfTitleFromSearch);
|
|
||||||
Util.waitUntilElementIsVisible(textLayer);
|
|
||||||
pdfTitleFromSearch.getText().then(function (result) {
|
|
||||||
deferred.fulfill(result);
|
|
||||||
})
|
|
||||||
return deferred.promise;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check close button is displayed
|
|
||||||
* @method checkCloseButton
|
|
||||||
*/
|
|
||||||
checkCloseButton: {
|
|
||||||
value: function () {
|
|
||||||
Util.waitUntilElementIsVisible(element(by.css("i[id='viewer-close-button']")));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check original size button
|
|
||||||
* @method checkOriginalSizeButton
|
|
||||||
*/
|
|
||||||
checkOriginalSizeButton: {
|
|
||||||
value: function () {
|
|
||||||
Util.waitUntilElementIsVisible(element(by.cssContainingText("div[id='viewer-scale-page-button'] > i ", "zoom_out_map")));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check zoom in button
|
|
||||||
* @method checkZoomInButton
|
|
||||||
*/
|
|
||||||
checkZoomInButton: {
|
|
||||||
value: function () {
|
|
||||||
Util.waitUntilElementIsVisible(element(by.css("div[id='viewer-zoom-in-button']")));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check zoom out button
|
|
||||||
* @method checkZoomOutButton
|
|
||||||
*/
|
|
||||||
checkZoomOutButton: {
|
|
||||||
value: function () {
|
|
||||||
Util.waitUntilElementIsVisible(element(by.css("div[id='viewer-zoom-out-button']")));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check previous page button
|
|
||||||
* @method checkPreviousPageButton
|
|
||||||
*/
|
|
||||||
checkPreviousPageButton: {
|
|
||||||
value: function () {
|
|
||||||
Util.waitUntilElementIsVisible(element(by.css("div[id='viewer-previous-page-button']")));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check next page button
|
|
||||||
* @method checkNextPageButton
|
|
||||||
*/
|
|
||||||
checkNextPageButton: {
|
|
||||||
value: function () {
|
|
||||||
Util.waitUntilElementIsVisible(element(by.css("div[id='viewer-next-page-button']")));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check download button on unsupported documents
|
|
||||||
* @method checkDownloadButton
|
|
||||||
*/
|
|
||||||
checkDownloadButton: {
|
|
||||||
value: function () {
|
|
||||||
Util.waitUntilElementIsVisible(element(by.css("button[id='viewer-download-button']")));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check current pageNumber
|
|
||||||
* @method checkCurrentPageNumber
|
|
||||||
*/
|
|
||||||
checkCurrentPageNumber: {
|
|
||||||
value: function (pageNumber) {
|
|
||||||
Util.waitUntilElementIsVisible(element(by.css("input[id='viewer-pagenumber-input'][ng-reflect-value='" + pageNumber + "']")));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check text in file
|
|
||||||
* @method checkText
|
|
||||||
*/
|
|
||||||
checkText: {
|
|
||||||
value: function (pageNumber, text) {
|
|
||||||
var allPages = element.all(by.css("div[class='canvasWrapper'] > canvas")).first();
|
|
||||||
var pageLoaded = element(by.css("div[id='pageContainer" + pageNumber + "'][data-loaded='true']"));
|
|
||||||
var textLayerLoaded = element(by.css("div[id='pageContainer" + pageNumber + "'] div[class='textLayer'] > div"));
|
|
||||||
var specificText = element(by.cssContainingText("div[id='pageContainer" + pageNumber + "'] div[class='textLayer'] > div", text));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(allPages);
|
|
||||||
Util.waitUntilElementIsVisible(pageLoaded);
|
|
||||||
Util.waitUntilElementIsVisible(textLayerLoaded);
|
|
||||||
Util.waitUntilElementIsVisible(specificText);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check total amount of pages
|
|
||||||
* @method checkTitle
|
|
||||||
*/
|
|
||||||
checktotalPages: {
|
|
||||||
value: function (totalPages) {
|
|
||||||
var totalPagesElement = element(by.cssContainingText("div[id='viewer-total-pages']", totalPages));
|
|
||||||
Util.waitUntilElementIsVisible(totalPagesElement);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Go to next page
|
|
||||||
* @method goToNextPage
|
|
||||||
*/
|
|
||||||
goToNextPage: {
|
|
||||||
value: function () {
|
|
||||||
var nextPageIcon = element(by.css("div[id='viewer-next-page-button']"));
|
|
||||||
Util.waitUntilElementIsVisible(nextPageIcon);
|
|
||||||
nextPageIcon.click();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Go to previous page
|
|
||||||
* @method goToPreviousPage
|
|
||||||
*/
|
|
||||||
goToPreviousPage: {
|
|
||||||
value: function () {
|
|
||||||
var previousPageIcon = element(by.css("div[id='viewer-previous-page-button']"));
|
|
||||||
Util.waitUntilElementIsVisible(previousPageIcon);
|
|
||||||
previousPageIcon.click();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Go to certain page
|
|
||||||
* @method goToPage
|
|
||||||
*/
|
|
||||||
goToPage: {
|
|
||||||
value: function (page) {
|
|
||||||
var pageInput = element(by.css("input[id='viewer-pagenumber-input']"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(pageInput);
|
|
||||||
pageInput.clear().sendKeys(page);
|
|
||||||
pageInput.sendKeys(protractor.Key.ENTER);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Close preview with close option
|
|
||||||
* @method closePreviewWithButton
|
|
||||||
*/
|
|
||||||
closePreviewWithButton: {
|
|
||||||
value: function () {
|
|
||||||
Util.waitUntilElementIsVisible(closeButton);
|
|
||||||
closeButton.click();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Close preview by pressing esc key
|
|
||||||
* @method closePreviewWithEsc
|
|
||||||
*/
|
|
||||||
closePreviewWithEsc: {
|
|
||||||
value: function (fileName) {
|
|
||||||
var filePreview = element.all(by.css("div[class='canvasWrapper'] > canvas")).first();
|
|
||||||
|
|
||||||
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
|
||||||
documentList.checkItemInDocList(fileName);
|
|
||||||
Util.waitUntilElementIsNotOnPage(filePreview);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Close preview by pressing esc key
|
|
||||||
* @method clickDownload
|
|
||||||
*/
|
|
||||||
clickDownload: {
|
|
||||||
value: function (fileName) {
|
|
||||||
var downloadButton = element(by.css("button[id='viewer-download-button']"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(downloadButton);
|
|
||||||
downloadButton.click();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Click zoom in
|
|
||||||
* @method clickZoomIn
|
|
||||||
*/
|
|
||||||
clickZoomIn: {
|
|
||||||
value: function () {
|
|
||||||
var zoomInButton = element(by.css("div[id='viewer-zoom-in-button']"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(zoomInButton);
|
|
||||||
zoomInButton.click();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Click zoom in
|
|
||||||
* @method clickZoomIn
|
|
||||||
*/
|
|
||||||
clickZoomOut: {
|
|
||||||
value: function () {
|
|
||||||
var zoomOutButton = element(by.css("div[id='viewer-zoom-out-button']"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(zoomOutButton);
|
|
||||||
zoomOutButton.click();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Click actual size
|
|
||||||
* @method clickActualSize
|
|
||||||
*/
|
|
||||||
clickActualSize: {
|
|
||||||
value: function () {
|
|
||||||
var actualSizeButton = element(by.css("div[id='viewer-scale-page-button']"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(actualSizeButton);
|
|
||||||
actualSizeButton.click();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check canvas width
|
|
||||||
* @method checkCanvasWidth
|
|
||||||
*/
|
|
||||||
checkCanvasWidth: {
|
|
||||||
value: function () {
|
|
||||||
return element.all(by.css("div[class='canvasWrapper'] > canvas")).first().getAttribute("width").then(function(width) {
|
|
||||||
return width;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check canvas height
|
|
||||||
* @method checkCanvasHeight
|
|
||||||
*/
|
|
||||||
checkCanvasHeight: {
|
|
||||||
value: function () {
|
|
||||||
return element.all(by.css("div[class='canvasWrapper'] > canvas")).first().getAttribute("height").then(function(height) {
|
|
||||||
return height;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Zoom in and check
|
|
||||||
* @method zoomIn
|
|
||||||
*/
|
|
||||||
zoomIn: {
|
|
||||||
value: function () {
|
|
||||||
var canvasLayer = element.all(by.css("div[class='canvasWrapper'] > canvas")).first();
|
|
||||||
var textLayer = element(by.css("div[id*='pageContainer'] div[class='textLayer'] > div"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(canvasLayer);
|
|
||||||
Util.waitUntilElementIsVisible(textLayer);
|
|
||||||
|
|
||||||
var actualWidth,
|
|
||||||
zoomedInWidth,
|
|
||||||
actualHeight,
|
|
||||||
zoomedInHeight;
|
|
||||||
|
|
||||||
this.checkCanvasWidth().then(function (width) {
|
|
||||||
actualWidth = width;
|
|
||||||
if (actualWidth && zoomedInWidth) {
|
|
||||||
expect(zoomedInWidth).toBeGreaterThan(actualWidth);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.checkCanvasHeight().then(function (height) {
|
|
||||||
actualHeight = height;
|
|
||||||
if (actualHeight && zoomedInHeight) {
|
|
||||||
expect(zoomedInHeight).toBeGreaterThan(actualHeight);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.clickZoomIn();
|
|
||||||
|
|
||||||
this.checkCanvasWidth().then(function (width) {
|
|
||||||
zoomedInWidth = width;
|
|
||||||
if (actualWidth && zoomedInWidth) {
|
|
||||||
expect(zoomedInWidth).toBeGreaterThan(actualWidth);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.checkCanvasHeight().then(function (height) {
|
|
||||||
zoomedInHeight = height;
|
|
||||||
if (actualHeight && zoomedInHeight) {
|
|
||||||
expect(zoomedInHeight).toBeGreaterThan(actualHeight);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check actual size of document, zoom in, actual size
|
|
||||||
* @method zoomIn
|
|
||||||
*/
|
|
||||||
actualSize: {
|
|
||||||
value: function () {
|
|
||||||
var canvasLayer = element.all(by.css("div[class='canvasWrapper'] > canvas")).first();
|
|
||||||
var textLayer = element(by.css("div[id*='pageContainer'] div[class='textLayer'] > div"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(canvasLayer);
|
|
||||||
Util.waitUntilElementIsVisible(textLayer);
|
|
||||||
|
|
||||||
var actualWidth,
|
|
||||||
actualHeight,
|
|
||||||
zoomedWidth,
|
|
||||||
zoomedHeight,
|
|
||||||
newWidth,
|
|
||||||
newHeight;
|
|
||||||
|
|
||||||
this.checkCanvasWidth().then(function (width) {
|
|
||||||
actualWidth = width;
|
|
||||||
});
|
|
||||||
|
|
||||||
this.checkCanvasHeight().then(function (height) {
|
|
||||||
actualHeight = height;
|
|
||||||
});
|
|
||||||
|
|
||||||
this.clickZoomIn();
|
|
||||||
|
|
||||||
this.checkCanvasWidth().then(function (width) {
|
|
||||||
zoomedWidth = width;
|
|
||||||
});
|
|
||||||
|
|
||||||
this.checkCanvasHeight().then(function (height) {
|
|
||||||
zoomedHeight = height;
|
|
||||||
});
|
|
||||||
|
|
||||||
this.clickActualSize();
|
|
||||||
|
|
||||||
this.checkCanvasWidth().then(function (width) {
|
|
||||||
newWidth = width;
|
|
||||||
if (actualWidth && zoomedWidth && newWidth) {
|
|
||||||
expect(newWidth).toBeLessThan(zoomedWidth);
|
|
||||||
expect(newWidth).toEqual(actualWidth);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.checkCanvasHeight().then(function (height) {
|
|
||||||
newHeight = height;
|
|
||||||
if (actualHeight && zoomedHeight && newHeight) {
|
|
||||||
expect(newHeight).toBeLessThan(zoomedHeight);
|
|
||||||
expect(newHeight).toEqual(actualHeight);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Zoom out and check
|
|
||||||
* @method zoomOut
|
|
||||||
*/
|
|
||||||
zoomOut: {
|
|
||||||
value: function () {
|
|
||||||
var canvasLayer = element.all(by.css("div[class='canvasWrapper'] > canvas")).first();
|
|
||||||
var textLayer = element(by.css("div[id*='pageContainer'] div[class='textLayer'] > div"));
|
|
||||||
|
|
||||||
Util.waitUntilElementIsVisible(canvasLayer);
|
|
||||||
Util.waitUntilElementIsVisible(textLayer);
|
|
||||||
|
|
||||||
var actualWidth,
|
|
||||||
zoomedOutWidth,
|
|
||||||
actualHeight,
|
|
||||||
zoomedOutHeight;
|
|
||||||
|
|
||||||
this.checkCanvasWidth().then(function (width) {
|
|
||||||
actualWidth = width;
|
|
||||||
if (actualWidth && zoomedOutWidth) {
|
|
||||||
expect(zoomedOutWidth).toBeLessThan(actualWidth);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.checkCanvasHeight().then(function (height) {
|
|
||||||
actualHeight = height;
|
|
||||||
if (actualHeight && zoomedOutHeight) {
|
|
||||||
expect(zoomedOutHeight).toBeLessThan(actualHeight);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.clickZoomOut();
|
|
||||||
|
|
||||||
this.checkCanvasWidth().then(function (width) {
|
|
||||||
zoomedOutWidth = width;
|
|
||||||
if (actualWidth && zoomedOutWidth) {
|
|
||||||
expect(zoomedOutWidth).toBeLessThan(actualWidth);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.checkCanvasHeight().then(function (height) {
|
|
||||||
zoomedInHeight = height;
|
|
||||||
if (actualHeight && zoomedOutHeight) {
|
|
||||||
expect(zoomedOutHeight).toBeLessThan(actualHeight);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
@@ -0,0 +1,303 @@
|
|||||||
|
/*!
|
||||||
|
* @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 { browser, by, element, protractor } from 'protractor';
|
||||||
|
import { Util } from '../../util/util';
|
||||||
|
|
||||||
|
export class FilePreviewPage {
|
||||||
|
|
||||||
|
pdfTitleFromSearch = element(by.css(`span[id='adf-viewer-display-name']`));
|
||||||
|
textLayer = element.all(by.css(`div[class='textLayer']`)).first();
|
||||||
|
closeButton = element(by.css('button[data-automation-id="adf-toolbar-back"]'));
|
||||||
|
|
||||||
|
waitForElements() {
|
||||||
|
Util.waitUntilElementIsVisible(element(by.css(`i[id='viewer-close-button']`)));
|
||||||
|
}
|
||||||
|
|
||||||
|
viewFile(fileName) {
|
||||||
|
Util.waitUntilElementIsVisible(element(by.cssContainingText(`div[data-automation-id="${filename}"]`, fileName)));
|
||||||
|
browser.actions().doubleClick(element(by.cssContainingText(`div[data-automation-id="${filename}"]`, fileName))).perform();
|
||||||
|
this.waitForElements();
|
||||||
|
}
|
||||||
|
|
||||||
|
getPDFTitleFromSearch() {
|
||||||
|
let deferred = protractor.promise.defer();
|
||||||
|
Util.waitUntilElementIsVisible(this.pdfTitleFromSearch);
|
||||||
|
Util.waitUntilElementIsVisible(this.textLayer);
|
||||||
|
this.pdfTitleFromSearch.getText().then(function (result) {
|
||||||
|
deferred.fulfill(result);
|
||||||
|
});
|
||||||
|
return deferred.promise;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkCloseButton() {
|
||||||
|
Util.waitUntilElementIsVisible(element(by.css(`i[id='viewer-close-button']`)));
|
||||||
|
}
|
||||||
|
|
||||||
|
checkOriginalSizeButton() {
|
||||||
|
Util.waitUntilElementIsVisible(element(by.cssContainingText(`div[id='viewer-scale-page-button'] > i `, `zoom_out_map`)));
|
||||||
|
}
|
||||||
|
|
||||||
|
checkZoomInButton() {
|
||||||
|
Util.waitUntilElementIsVisible(element(by.css(`div[id='viewer-zoom-in-button']`)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
checkZoomOutButton() {
|
||||||
|
Util.waitUntilElementIsVisible(element(by.css(`div[id='viewer-zoom-out-button']`)));
|
||||||
|
}
|
||||||
|
|
||||||
|
checkPreviousPageButton() {
|
||||||
|
Util.waitUntilElementIsVisible(element(by.css(`div[id='viewer-previous-page-button']`)));
|
||||||
|
}
|
||||||
|
|
||||||
|
checkNextPageButton() {
|
||||||
|
Util.waitUntilElementIsVisible(element(by.css(`div[id='viewer-next-page-button']`)));
|
||||||
|
}
|
||||||
|
|
||||||
|
checkDownloadButton() {
|
||||||
|
Util.waitUntilElementIsVisible(element(by.css(`button[id='viewer-download-button']`)));
|
||||||
|
}
|
||||||
|
|
||||||
|
checkCurrentPageNumber(pageNumber) {
|
||||||
|
Util.waitUntilElementIsVisible(element(by.css(`input[id='viewer-pagenumber-input'][ng-reflect-value="${pageNumber}"]`)));
|
||||||
|
}
|
||||||
|
|
||||||
|
checkText(pageNumber, text) {
|
||||||
|
let allPages = element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first();
|
||||||
|
let pageLoaded = element(by.css(`div[id="pageContainer${pageNumber}"][data-loaded='true']`));
|
||||||
|
let textLayerLoaded = element(by.css(`div[id="pageContainer${pageNumber}"] div[class='textLayer'] > div`));
|
||||||
|
let specificText = element(by.cssContainingText(`div[id="pageContainer${pageNumber}"] div[class='textLayer'] > div`, text));
|
||||||
|
|
||||||
|
Util.waitUntilElementIsVisible(allPages);
|
||||||
|
Util.waitUntilElementIsVisible(pageLoaded);
|
||||||
|
Util.waitUntilElementIsVisible(textLayerLoaded);
|
||||||
|
Util.waitUntilElementIsVisible(specificText);
|
||||||
|
}
|
||||||
|
|
||||||
|
goToNextPage() {
|
||||||
|
let nextPageIcon = element(by.css(`div[id='viewer-next-page-button']`));
|
||||||
|
Util.waitUntilElementIsVisible(nextPageIcon);
|
||||||
|
nextPageIcon.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
goToPreviousPage() {
|
||||||
|
let previousPageIcon = element(by.css(`div[id='viewer-previous-page-button']`));
|
||||||
|
Util.waitUntilElementIsVisible(previousPageIcon);
|
||||||
|
previousPageIcon.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
goToPage(page) {
|
||||||
|
let pageInput = element(by.css(`input[id='viewer-pagenumber-input']`));
|
||||||
|
|
||||||
|
Util.waitUntilElementIsVisible(pageInput);
|
||||||
|
pageInput.clear();
|
||||||
|
pageInput.sendKeys(page);
|
||||||
|
pageInput.sendKeys(protractor.Key.ENTER);
|
||||||
|
}
|
||||||
|
|
||||||
|
closePreviewWithButton() {
|
||||||
|
Util.waitUntilElementIsVisible(this.closeButton);
|
||||||
|
this.closeButton.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
closePreviewWithEsc(fileName) {
|
||||||
|
let filePreview = element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first();
|
||||||
|
|
||||||
|
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||||
|
Util.waitUntilElementIsVisible(element(by.cssContainingText(`div[data-automation-id="text_${fileName}"]`, fileName)));
|
||||||
|
Util.waitUntilElementIsNotOnPage(filePreview);
|
||||||
|
}
|
||||||
|
|
||||||
|
clickDownload(fileName) {
|
||||||
|
let downloadButton = element(by.css(`button[id='viewer-download-button']`));
|
||||||
|
|
||||||
|
Util.waitUntilElementIsVisible(downloadButton);
|
||||||
|
downloadButton.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
clickZoomIn() {
|
||||||
|
let zoomInButton = element(by.css(`div[id='viewer-zoom-in-button']`));
|
||||||
|
|
||||||
|
Util.waitUntilElementIsVisible(zoomInButton);
|
||||||
|
zoomInButton.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
clickZoomOut() {
|
||||||
|
let zoomOutButton = element(by.css(`div[id='viewer-zoom-out-button']`));
|
||||||
|
|
||||||
|
Util.waitUntilElementIsVisible(zoomOutButton);
|
||||||
|
zoomOutButton.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
clickActualSize() {
|
||||||
|
let actualSizeButton = element(by.css(`div[id='viewer-scale-page-button']`));
|
||||||
|
|
||||||
|
Util.waitUntilElementIsVisible(actualSizeButton);
|
||||||
|
actualSizeButton.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
checkCanvasWidth() {
|
||||||
|
return element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first().getAttribute(`width`).then(function (width) {
|
||||||
|
return width;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
checkCanvasHeight() {
|
||||||
|
return element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first().getAttribute(`height`).then(function (height) {
|
||||||
|
return height;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
zoomIn() {
|
||||||
|
let canvasLayer = element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first();
|
||||||
|
let textLayer = element(by.css(`div[id*='pageContainer'] div[class='textLayer'] > div`));
|
||||||
|
|
||||||
|
Util.waitUntilElementIsVisible(canvasLayer);
|
||||||
|
Util.waitUntilElementIsVisible(textLayer);
|
||||||
|
|
||||||
|
let actualWidth,
|
||||||
|
zoomedInWidth,
|
||||||
|
actualHeight,
|
||||||
|
zoomedInHeight;
|
||||||
|
|
||||||
|
this.checkCanvasWidth().then(function (width) {
|
||||||
|
actualWidth = width;
|
||||||
|
if (actualWidth && zoomedInWidth) {
|
||||||
|
expect(zoomedInWidth).toBeGreaterThan(actualWidth);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.checkCanvasHeight().then(function (height) {
|
||||||
|
actualHeight = height;
|
||||||
|
if (actualHeight && zoomedInHeight) {
|
||||||
|
expect(zoomedInHeight).toBeGreaterThan(actualHeight);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.clickZoomIn();
|
||||||
|
|
||||||
|
this.checkCanvasWidth().then(function (width) {
|
||||||
|
zoomedInWidth = width;
|
||||||
|
if (actualWidth && zoomedInWidth) {
|
||||||
|
expect(zoomedInWidth).toBeGreaterThan(actualWidth);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.checkCanvasHeight().then(function (height) {
|
||||||
|
zoomedInHeight = height;
|
||||||
|
if (actualHeight && zoomedInHeight) {
|
||||||
|
expect(zoomedInHeight).toBeGreaterThan(actualHeight);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
actualSize() {
|
||||||
|
let canvasLayer = element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first();
|
||||||
|
let textLayer = element(by.css(`div[id*='pageContainer'] div[class='textLayer'] > div`));
|
||||||
|
|
||||||
|
Util.waitUntilElementIsVisible(canvasLayer);
|
||||||
|
Util.waitUntilElementIsVisible(textLayer);
|
||||||
|
|
||||||
|
let actualWidth,
|
||||||
|
actualHeight,
|
||||||
|
zoomedWidth,
|
||||||
|
zoomedHeight,
|
||||||
|
newWidth,
|
||||||
|
newHeight;
|
||||||
|
|
||||||
|
this.checkCanvasWidth().then(function (width) {
|
||||||
|
actualWidth = width;
|
||||||
|
});
|
||||||
|
|
||||||
|
this.checkCanvasHeight().then(function (height) {
|
||||||
|
actualHeight = height;
|
||||||
|
});
|
||||||
|
|
||||||
|
this.clickZoomIn();
|
||||||
|
|
||||||
|
this.checkCanvasWidth().then(function (width) {
|
||||||
|
zoomedWidth = width;
|
||||||
|
});
|
||||||
|
|
||||||
|
this.checkCanvasHeight().then(function (height) {
|
||||||
|
zoomedHeight = height;
|
||||||
|
});
|
||||||
|
|
||||||
|
this.clickActualSize();
|
||||||
|
|
||||||
|
this.checkCanvasWidth().then(function (width) {
|
||||||
|
newWidth = width;
|
||||||
|
if (actualWidth && zoomedWidth && newWidth) {
|
||||||
|
expect(newWidth).toBeLessThan(zoomedWidth);
|
||||||
|
expect(newWidth).toEqual(actualWidth);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.checkCanvasHeight().then(function (height) {
|
||||||
|
newHeight = height;
|
||||||
|
if (actualHeight && zoomedHeight && newHeight) {
|
||||||
|
expect(newHeight).toBeLessThan(zoomedHeight);
|
||||||
|
expect(newHeight).toEqual(actualHeight);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
zoomOut() {
|
||||||
|
let canvasLayer = element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first();
|
||||||
|
let textLayer = element(by.css(`div[id*='pageContainer'] div[class='textLayer'] > div`));
|
||||||
|
|
||||||
|
Util.waitUntilElementIsVisible(canvasLayer);
|
||||||
|
Util.waitUntilElementIsVisible(textLayer);
|
||||||
|
|
||||||
|
let actualWidth,
|
||||||
|
zoomedOutWidth,
|
||||||
|
actualHeight,
|
||||||
|
zoomedOutHeight,
|
||||||
|
zoomedInHeight;
|
||||||
|
|
||||||
|
this.checkCanvasWidth().then(function (width) {
|
||||||
|
actualWidth = width;
|
||||||
|
if (actualWidth && zoomedOutWidth) {
|
||||||
|
expect(zoomedOutWidth).toBeLessThan(actualWidth);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.checkCanvasHeight().then(function (height) {
|
||||||
|
actualHeight = height;
|
||||||
|
if (actualHeight && zoomedOutHeight) {
|
||||||
|
expect(zoomedOutHeight).toBeLessThan(actualHeight);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.clickZoomOut();
|
||||||
|
|
||||||
|
this.checkCanvasWidth().then(function (width) {
|
||||||
|
zoomedOutWidth = width;
|
||||||
|
if (actualWidth && zoomedOutWidth) {
|
||||||
|
expect(zoomedOutWidth).toBeLessThan(actualWidth);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.checkCanvasHeight().then(function (height) {
|
||||||
|
zoomedInHeight = height;
|
||||||
|
if (actualHeight && zoomedOutHeight) {
|
||||||
|
expect(zoomedOutHeight).toBeLessThan(actualHeight);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
import { element, by } from 'protractor';
|
import { element, by } from 'protractor';
|
||||||
|
|
||||||
export class LockFilePage {
|
export class LockFilePage {
|
||||||
@@ -23,7 +23,7 @@ export class LockFilePage {
|
|||||||
cancelButton = element(by.css('button[aria-label="Close dialog"]'));
|
cancelButton = element(by.css('button[aria-label="Close dialog"]'));
|
||||||
saveButton = element(by.cssContainingText('button span', 'Save'));
|
saveButton = element(by.cssContainingText('button span', 'Save'));
|
||||||
lockFileCheckboxText = element(by.cssContainingText('mat-checkbox label span', ' Lock file '));
|
lockFileCheckboxText = element(by.cssContainingText('mat-checkbox label span', ' Lock file '));
|
||||||
lockFileCheckbox = element(by.css('mat-checkbox[class*="adf-lock-file-name"]'));
|
lockFileCheckbox = element(by.css('mat-checkbox[data-automation-id="adf-lock-node-checkbox"]'));
|
||||||
allowOwnerCheckbox = element(by.cssContainingText('mat-checkbox[class*="adf-lock-file-name"] span', ' Allow the owner to modify this file '));
|
allowOwnerCheckbox = element(by.cssContainingText('mat-checkbox[class*="adf-lock-file-name"] span', ' Allow the owner to modify this file '));
|
||||||
|
|
||||||
checkLockFileCheckboxIsDisplayed() {
|
checkLockFileCheckboxIsDisplayed() {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { FormControllersPage } from './material/formControllersPage';
|
import { FormControllersPage } from './material/formControllersPage';
|
||||||
|
|
||||||
import Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
import TestConfig = require('../../test.config');
|
import TestConfig = require('../../test.config');
|
||||||
import { SettingsPage } from './settingsPage';
|
import { SettingsPage } from './settingsPage';
|
||||||
import { element, by, protractor, browser } from 'protractor';
|
import { element, by, protractor, browser } from 'protractor';
|
||||||
@@ -161,9 +161,8 @@ export class LoginPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
goToLoginPage() {
|
goToLoginPage() {
|
||||||
browser.controlFlow().execute(async () => {
|
browser.waitForAngularEnabled(true);
|
||||||
await browser.driver.get(TestConfig.adf.url + TestConfig.adf.port + '/login');
|
browser.driver.get(TestConfig.adf.url + TestConfig.adf.port + '/login');
|
||||||
});
|
|
||||||
this.waitForElements();
|
this.waitForElements();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,42 +15,46 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Util = require('../../util/util');
|
import { Util } from '../../util/util';
|
||||||
import { element, by } from 'protractor';
|
import { element, by, browser, protractor } from 'protractor';
|
||||||
|
|
||||||
export class LoginAPSPage {
|
export class LoginSSOPage {
|
||||||
|
|
||||||
ssoButton = element(by.css(`[data-automation-id="login-button-sso"]`));
|
ssoButton = element(by.css(`[data-automation-id="login-button-sso"]`));
|
||||||
usernameField = element(by.id('username'));
|
usernameField = element(by.id('username'));
|
||||||
passwordField = element(by.id('password'));
|
passwordField = element(by.id('password'));
|
||||||
loginButton = element(by.id('kc-login'));
|
loginButton = element(by.id('kc-login'));
|
||||||
|
header = element(by.id('adf-header'));
|
||||||
|
|
||||||
async loginAPS (username, password) {
|
loginAPS(username, password) {
|
||||||
await this.enterUsername(username);
|
browser.ignoreSynchronization = true;
|
||||||
await this.enterPassword(password);
|
this.enterUsername(username);
|
||||||
await this.clickLoginButton();
|
this.enterPassword(password);
|
||||||
|
this.clickLoginButton();
|
||||||
|
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||||
|
return Util.waitUntilElementIsVisible(this.header);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickOnSSOButton () {
|
clickOnSSOButton() {
|
||||||
Util.waitUntilElementIsVisible(this.ssoButton);
|
Util.waitUntilElementIsVisible(this.ssoButton);
|
||||||
await this.ssoButton.click();
|
this.ssoButton.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
async enterUsername (username) {
|
enterUsername(username) {
|
||||||
Util.waitUntilElementIsVisible(this.usernameField);
|
Util.waitUntilElementIsVisible(this.usernameField);
|
||||||
await this.usernameField.clear();
|
this.usernameField.clear();
|
||||||
await this.usernameField.sendKeys(username);
|
this.usernameField.sendKeys(username);
|
||||||
}
|
}
|
||||||
|
|
||||||
async enterPassword (password) {
|
enterPassword(password) {
|
||||||
Util.waitUntilElementIsVisible(this.passwordField);
|
Util.waitUntilElementIsVisible(this.passwordField);
|
||||||
await this.passwordField.clear();
|
this.passwordField.clear();
|
||||||
await this.passwordField.sendKeys(password);
|
this.passwordField.sendKeys(password);
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickLoginButton () {
|
clickLoginButton() {
|
||||||
Util.waitUntilElementIsVisible(this.loginButton);
|
Util.waitUntilElementIsVisible(this.loginButton);
|
||||||
await this.loginButton.click();
|
return this.loginButton.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Util = require('../../../util/util');
|
import { Util } from '../../../util/util';
|
||||||
import { element, by, browser, protractor } from 'protractor';
|
import { element, by, browser, protractor } from 'protractor';
|
||||||
|
|
||||||
export class DatePickerPage {
|
export class DatePickerPage {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Util = require('../../../util/util');
|
import { Util } from '../../../util/util';
|
||||||
|
|
||||||
export class FormControllersPage {
|
export class FormControllersPage {
|
||||||
|
|
||||||
@@ -23,7 +23,8 @@ export class FormControllersPage {
|
|||||||
Util.waitUntilElementIsVisible(toggle);
|
Util.waitUntilElementIsVisible(toggle);
|
||||||
toggle.getAttribute('class').then((check) => {
|
toggle.getAttribute('class').then((check) => {
|
||||||
if (check.indexOf('mat-checked') < 0) {
|
if (check.indexOf('mat-checked') < 0) {
|
||||||
toggle.click();
|
Util.waitUntilElementIsClickable(toggle.element(by.css('div')));
|
||||||
|
toggle.element(by.css('div')).click();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -32,7 +33,8 @@ export class FormControllersPage {
|
|||||||
Util.waitUntilElementIsVisible(toggle);
|
Util.waitUntilElementIsVisible(toggle);
|
||||||
toggle.getAttribute('class').then((check) => {
|
toggle.getAttribute('class').then((check) => {
|
||||||
if (check.indexOf('mat-checked') >= 0) {
|
if (check.indexOf('mat-checked') >= 0) {
|
||||||
toggle.click();
|
Util.waitUntilElementIsClickable(toggle.element(by.css('div')));
|
||||||
|
toggle.element(by.css('div')).click();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user