diff --git a/.gitignore b/.gitignore
index 082d3efc1..3a5b6bbee 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,6 +40,7 @@ testem.log
/e2e/*.js
/e2e/*.map
/e2e-output
+/e2e-downloads
# System Files
.DS_Store
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 000000000..dbbfe7e84
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,6 @@
+[submodule "alfresco-js-api"]
+ path = alfresco-js-api
+ url = https://github.com/Alfresco/alfresco-js-api
+[submodule "alfresco-ng2-components"]
+ path = alfresco-ng2-components
+ url = https://github.com/Alfresco/alfresco-ng2-components
diff --git a/README.md b/README.md
index 20ca051d8..3bea9eca0 100644
--- a/README.md
+++ b/README.md
@@ -32,8 +32,8 @@ Please include a clear description, steps to reproduce and screenshots where app
#### What's new in the latest release
-- Single Log Out
-- WCAG AA accessibility improvements
+- Create (file/folder) Templates
+- More WCAG AA accessibility improvements
Please refer to the [release notes] for details of all changes.
@@ -59,6 +59,7 @@ Read up on our guidelines for [contributing] and then check out one of our issue
| ACA Version | Built with | Tested on |
| ----------- | ---------- | --------- |
+| ACA 1.10 | ADF 3.7.0 | ACS 6.2 |
| ACA 1.9 | ADF 3.6.0 | ACS 6.2 |
| ACA 1.8 | ADF 3.3.0 | ACS 6.1 |
| ACA 1.7 | ADF 3.0.0 | ACS 6.1 |
@@ -100,6 +101,7 @@ Read up on our guidelines for [contributing] and then check out one of our issue
| 1.8 | Extensibility improvements | Various - see [release notes](https://github.com/Alfresco/alfresco-content-app/releases) for details |
| 1.9 | Single Log Out | Users will be automatically logged out from the Content App after logging out from another application in the same browser session |
| 1.9 | Accessibility improvements | Various - see [release notes](https://github.com/Alfresco/alfresco-content-app/releases) for details |
+ 1.10 | Create (file/folder) from template | Users can create files and folders structures from pre-set templates |
[contributing]: https://github.com/Alfresco/alfresco-content-app/blob/master/CONTRIBUTING.md
[github]: https://github.com/Alfresco/alfresco-content-app/issues
diff --git a/alfresco-js-api b/alfresco-js-api
new file mode 160000
index 000000000..a7e88e552
--- /dev/null
+++ b/alfresco-js-api
@@ -0,0 +1 @@
+Subproject commit a7e88e55269df1969c98340516290555738df18b
diff --git a/alfresco-ng2-components b/alfresco-ng2-components
new file mode 160000
index 000000000..94e02c055
--- /dev/null
+++ b/alfresco-ng2-components
@@ -0,0 +1 @@
+Subproject commit 94e02c0552bf1cfd84af87a92fbf237ee75e5744
diff --git a/docker-compose-keycloak.yml b/docker-compose-keycloak.yml
deleted file mode 100644
index 9ef10c92c..000000000
--- a/docker-compose-keycloak.yml
+++ /dev/null
@@ -1,210 +0,0 @@
-version: '2'
-
-services:
- alfresco:
- image: alfresco/alfresco-content-repository-community:latest
- mem_limit: 1500m
- depends_on:
- - auth
- environment:
- HOST_IP: ${HOST_IP}
- JAVA_OPTS: '
- -Ddb.driver=org.postgresql.Driver
- -Ddb.username=alfresco
- -Ddb.password=alfresco
- -Ddb.url=jdbc:postgresql://postgres:5432/alfresco
- -Dsolr.host=solr6
- -Dsolr.port=8983
- -Dsolr.secureComms=none
- -Dsolr.base.url=/solr
- -Dindex.subsystem.name=solr6
- -Dshare.host=localhost
- -Dalfresco.port=8080
- -Daos.baseUrlOverwrite=http://${HOST_IP}:8080/alfresco/aos
- -Dmessaging.broker.url="failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true"
- -Ddeployment.method=DOCKER_COMPOSE
- -Dcsrf.filter.enabled=false
- -Xms1g -Xmx1g
-
- -Dlocal.transform.service.enabled=true
- -DlocalTransform.pdfrenderer.url=http://alfresco-pdf-renderer:8090/
- -DlocalTransform.imagemagick.url=http://imagemagick:8090/
- -DlocalTransform.libreoffice.url=http://libreoffice:8090/
- -DlocalTransform.tika.url=http://tika:8090/
- -DlocalTransform.misc.url=http://transform-misc:8090/
-
- -Dlegacy.transform.service.enabled=true
- -Dalfresco-pdf-renderer.url=http://alfresco-pdf-renderer:8090/
- -Djodconverter.url=http://libreoffice:8090/
- -Dimg.url=http://imagemagick:8090/
- -Dtika.url=http://tika:8090/
- -Dtransform.misc.url=http://transform-misc:8090/
-
- -Dauthentication.chain=identity-service1:identity-service,alfrescoNtlm1:alfrescoNtlm
- -Didentity-service.enable-basic-auth=true
- -Didentity-service.authentication.validation.failure.silent=false
- -Didentity-service.auth-server-url=http://${HOST_IP}:8085/auth
- -Didentity-service.realm=alfresco
- -Didentity-service.resource=alfresco
- '
- networks:
- - internal
- ports:
- - 8080:8080 #Browser port
-
- alfresco-pdf-renderer:
- image: alfresco/alfresco-pdf-renderer:2.1.0-EA4
- environment:
- JAVA_OPTS: ' -Xms256m -Xmx256m'
- networks:
- - internal
- ports:
- - 8090:8090
-
- imagemagick:
- image: alfresco/alfresco-imagemagick:2.1.0-EA4
- environment:
- JAVA_OPTS: ' -Xms256m -Xmx256m'
- networks:
- - internal
- ports:
- - 8091:8090
-
- libreoffice:
- image: alfresco/alfresco-libreoffice:2.1.0-EA4
- environment:
- JAVA_OPTS: ' -Xms256m -Xmx256m'
- networks:
- - internal
- ports:
- - 8092:8090
-
- tika:
- image: alfresco/alfresco-tika:2.1.0-EA4
- environment:
- JAVA_OPTS: ' -Xms256m -Xmx256m'
- networks:
- - internal
- ports:
- - 8093:8090
-
- transform-misc:
- image: alfresco/alfresco-transform-misc:2.1.0-EA4
- environment:
- JAVA_OPTS: ' -Xms256m -Xmx256m'
- networks:
- - internal
- ports:
- - 8094:8090
-
- share:
- image: alfresco/alfresco-share:6.1.0-RC3
- mem_limit: 1g
- depends_on:
- - alfresco
- environment:
- - REPO_HOST=alfresco
- - REPO_PORT=8080
- - 'CATALINA_OPTS= -Xms500m -Xmx500m'
- networks:
- - internal
- ports:
- - 8083:8080
-
- postgres:
- image: postgres:10.1
- mem_limit: 1500m
- environment:
- - POSTGRES_PASSWORD=alfresco
- - POSTGRES_USER=alfresco
- - POSTGRES_DB=alfresco
- command: postgres -c max_connections=300 -c log_min_messages=LOG
- networks:
- - internal
- ports:
- - 5432:5432
-
- solr6:
- image: alfresco/alfresco-search-services:1.3.0-RC2
- mem_limit: 2500m
- depends_on:
- - alfresco
- environment:
- #Solr needs to know how to register itself with Alfresco
- - SOLR_ALFRESCO_HOST=alfresco
- - SOLR_ALFRESCO_PORT=8080
- #Alfresco needs to know how to call solr
- - SOLR_SOLR_HOST=solr6
- - SOLR_SOLR_PORT=8983
- #Create the default alfresco and archive cores
- - SOLR_CREATE_ALFRESCO_DEFAULTS=alfresco,archive
- - 'SOLR_JAVA_MEM=-Xms2g -Xmx2g'
- networks:
- - internal
- ports:
- - 8983:8983 #Browser port
-
- activemq:
- image: alfresco/alfresco-activemq:5.15.6
- mem_limit: 2048m
- networks:
- - internal
- ports:
- - 8161:8161 # Web Console
- - 5672:5672 # AMQP
- - 61616:61616 # OpenWire
- - 61613:61613 # STOMP
-
- content-app:
- image: alfresco/alfresco-content-app:latest
- build: .
- environment:
- # BASEPATH: ./
- APP_CONFIG_OAUTH2_HOST: ${APP_CONFIG_OAUTH2_HOST}
- APP_CONFIG_AUTH_TYPE: ${APP_CONFIG_AUTH_TYPE}
- APP_CONFIG_OAUTH2_CLIENTID: ${APP_CONFIG_OAUTH2_CLIENTID}
- APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI: ${APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI}
- APP_CONFIG_OAUTH2_REDIRECT_LOGIN: ${APP_CONFIG_OAUTH2_REDIRECT_LOGIN}
- APP_CONFIG_OAUTH2_REDIRECT_LOGOUT: ${APP_CONFIG_OAUTH2_REDIRECT_LOGOUT}
- networks:
- - internal
- depends_on:
- - alfresco
- ports:
- - 4001:80
- # volumes:
- # - ./app.config.json:/usr/share/nginx/html/app.config.json
- # - ./nginx.conf:/etc/nginx/conf.d/default.conf
-
- proxy:
- image: nginx:stable-alpine
- depends_on:
- - content-app
- - alfresco
- volumes:
- - ./docker/proxy/nginx.conf:/etc/nginx/conf.d/default.conf
- networks:
- - internal
- links:
- - content-app
- - alfresco
- - share
- ports:
- - 8080:8080
-
- auth:
- image: jboss/keycloak:4.8.3.Final
- volumes:
- - ./docker/auth/alfresco-realm.json:/tmp/alfresco-realm.json
- networks:
- - internal
- environment:
- - KEYCLOAK_USER=admin
- - KEYCLOAK_PASSWORD=admin
- - KEYCLOAK_IMPORT=/tmp/alfresco-realm.json
- - DB_VENDOR=h2
- ports:
- - 8085:8080
-
-networks:
- internal:
diff --git a/docker-compose.yml b/docker-compose.yml
index a110f11ad..8eb77ff1e 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -4,6 +4,8 @@ services:
alfresco:
image: alfresco/alfresco-content-repository-community:latest
mem_limit: 1500m
+ depends_on:
+ - auth
volumes:
- ./docker/acs-cm:/usr/local/tomcat/shared/classes/alfresco/extension
environment:
@@ -37,6 +39,14 @@ services:
-Dtika.url=http://tika:8090/
-Dtransform.misc.url=http://transform-misc:8090/
-Dcsrf.filter.enabled=false
+
+ -Didentity-service.enable-basic-auth=true
+ -Didentity-service.authentication.validation.failure.silent=false
+ -Didentity-service.auth-server-url=http://${HOST_IP}:8085/auth
+ -Didentity-service.realm=alfresco
+ -Didentity-service.resource=alfresco
+
+ ${AIMS_PROPS}
-Xms1500m -Xmx1500m
'
@@ -132,6 +142,15 @@ services:
build: .
depends_on:
- alfresco
+ environment:
+ BASE_PATH: ./
+ APP_CONFIG_OAUTH2_HOST: ${APP_CONFIG_OAUTH2_HOST}
+ APP_CONFIG_AUTH_TYPE: ${APP_CONFIG_AUTH_TYPE}
+ APP_CONFIG_OAUTH2_CLIENTID: ${APP_CONFIG_OAUTH2_CLIENTID}
+ APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI: ${APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI}
+ APP_CONFIG_OAUTH2_REDIRECT_LOGIN: ${APP_CONFIG_OAUTH2_REDIRECT_LOGIN}
+ APP_CONFIG_OAUTH2_REDIRECT_LOGOUT: ${APP_CONFIG_OAUTH2_REDIRECT_LOGOUT}
+ APP_BASE_SHARE_URL: '{protocol}//{hostname}{:port}/content-app/#/preview/s'
ports:
- 4001:8080
@@ -148,3 +167,15 @@ services:
- alfresco
- share
- content-app
+
+ auth:
+ image: jboss/keycloak:4.8.3.Final
+ volumes:
+ - ./docker/auth/alfresco-realm.json:/tmp/alfresco-realm.json
+ environment:
+ - KEYCLOAK_USER=admin
+ - KEYCLOAK_PASSWORD=admin
+ - KEYCLOAK_IMPORT=/tmp/alfresco-realm.json
+ - DB_VENDOR=h2
+ ports:
+ - 8085:8080
diff --git a/docker/proxy/nginx.conf b/docker/proxy/nginx.conf
index 25f275517..a98763ab3 100644
--- a/docker/proxy/nginx.conf
+++ b/docker/proxy/nginx.conf
@@ -26,7 +26,11 @@ http {
proxy_pass_header Set-Cookie;
location / {
- proxy_pass http://content-app:8080;
+ proxy_pass http://alfresco:8080;
+ }
+
+ location /content-app/ {
+ proxy_pass http://content-app:8080/;
}
location /alfresco/ {
diff --git a/docs/extending/application-actions.md b/docs/extending/application-actions.md
index cd48959b2..4e14b50b3 100644
--- a/docs/extending/application-actions.md
+++ b/docs/extending/application-actions.md
@@ -124,3 +124,6 @@ Below is the list of public actions types you can use in the plugin definitions
| 1.8.0 | VIEW_NODE | NodeId<`string`> , [ViewNodeExtras](../features/file-viewer.md#details)<`any`> | Lightweight preview of a node by id. Can be invoked from extensions. For details also see [File Viewer](../features/file-viewer.md#details) |
| 1.8.0 | CLOSE_PREVIEW | n/a | Closes the viewer ( preview of the item ) |
| 1.9.0 | RESET_SELECTION | n/a | Resets active document list selection |
+| 1.10.0 | FILE_FROM_TEMPLATE | n/a | Invoke dialogs flow for creating a file from a template into current folder |
+| 1.10.0 | FOLDER_FROM_TEMPLATE | n/a | Invoke dialogs flow for creating a folder structure from a template into current folder |
+| 1.10.0 | CONTEXT_MENU | MouseEvent | Invoke context menu for [DocumentListComponent](https://www.alfresco.com/abn/adf/docs/content-services/components/document-list.component) |
diff --git a/docs/extending/rules.md b/docs/extending/rules.md
index 7096c6c3d..7ca46ea0b 100644
--- a/docs/extending/rules.md
+++ b/docs/extending/rules.md
@@ -166,6 +166,8 @@ The button will be visible only when the linked rule evaluates to `true`.
| 1.8.0 | canManagePermissions | Checks if user can manage permissions for the selected node. |
| 1.8.0 | canToggleEditOffline | Checks if user can toggle **Edit Offline** mode for selected node. |
| 1.8.0 | user.isAdmin | Checks if user is admin. |
+| 1.9.0 | app.canShowLanguagePicker | Whether language picker menu should be present or not. |
+| 1.9.0 | app.canShowLogout | Whether logout action should be present or not. |
## Navigation Evaluators
diff --git a/docs/ja/README.md b/docs/ja/README.md
index b2806a1c2..3b64127cd 100644
--- a/docs/ja/README.md
+++ b/docs/ja/README.md
@@ -25,6 +25,7 @@ Alfresco Content Application は、[Alfresco Application Development Framework (
| ACA バージョン | 構築バージョン | テスト済み環境 |
| ----------- | ---------- | --------- |
+| ACA 1.9 | ADF 3.6.0 | ACS 6.2 |
| ACA 1.8 | ADF 3.3.0 | ACS 6.1 |
| ACA 1.7 | ADF 3.0.0 | ACS 6.1 |
| ACA 1.6 | ADF 2.6.1 | ACS 6.1 |
diff --git a/e2e/components/breadcrumb/breadcrumb.ts b/e2e/components/breadcrumb/breadcrumb.ts
index b32e29c22..2cb117f42 100755
--- a/e2e/components/breadcrumb/breadcrumb.ts
+++ b/e2e/components/breadcrumb/breadcrumb.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -36,7 +36,7 @@ export class Breadcrumb extends Component {
items: ElementArrayFinder = this.component.all(by.css(Breadcrumb.selectors.item));
currentItem: ElementFinder = this.component.element(by.css(Breadcrumb.selectors.currentItem));
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super(Breadcrumb.selectors.root, ancestor);
}
diff --git a/e2e/components/breadcrumb/dropdown-breadcrumb.ts b/e2e/components/breadcrumb/dropdown-breadcrumb.ts
new file mode 100755
index 000000000..9a5cbed69
--- /dev/null
+++ b/e2e/components/breadcrumb/dropdown-breadcrumb.ts
@@ -0,0 +1,77 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { ElementFinder, ElementArrayFinder, by, browser, ExpectedConditions as EC } from 'protractor';
+import { BROWSER_WAIT_TIMEOUT } from '../../configs';
+import { Component } from '../component';
+
+export class DropDownBreadcrumb extends Component {
+ private static selectors = {
+ root: '.adf-dropdown-breadcrumb',
+ trigger: '.adf-dropdown-breadcrumb-trigger',
+
+ currentFolder: '.adf-current-folder',
+
+ pathOption: '.adf-dropdown-breadcrumb-path-option .mat-option-text'
+ };
+
+ trigger: ElementFinder = this.component.element(by.css(DropDownBreadcrumb.selectors.trigger));
+ pathItems: ElementArrayFinder = browser.$$(DropDownBreadcrumb.selectors.pathOption);
+ pathItemsContainer: ElementFinder = browser.element(by.css('.mat-select-panel'));
+ currentFolder: ElementFinder = this.component.element(by.css(DropDownBreadcrumb.selectors.currentFolder));
+
+ constructor(ancestor?: string) {
+ super(DropDownBreadcrumb.selectors.root, ancestor);
+ }
+
+ async waitForPathListDropdownToOpen(): Promise {
+ await browser.wait(EC.presenceOf(this.pathItemsContainer), BROWSER_WAIT_TIMEOUT, 'Timeout waiting for breadcrumb dropdown to open');
+ }
+
+ async waitForPathListDropdownToClose(): Promise {
+ await browser.wait(EC.stalenessOf(browser.$(DropDownBreadcrumb.selectors.pathOption)), BROWSER_WAIT_TIMEOUT, 'Timeout waiting for breadcrumb dropdown to close');
+ }
+
+ async getCurrentFolderName(): Promise {
+ return this.currentFolder.getText();
+ }
+
+ async openPath(): Promise {
+ await this.trigger.click();
+ await this.waitForPathListDropdownToOpen();
+ }
+
+ async clickPathItem(name: string): Promise {
+ const elem = browser.element(by.cssContainingText(DropDownBreadcrumb.selectors.pathOption, name));
+ await elem.click();
+ }
+
+ async getPathItems(): Promise {
+ const items: string[] = await this.pathItems.map(async elem => {
+ return elem.getText();
+ });
+ return items;
+ }
+}
diff --git a/e2e/components/component.ts b/e2e/components/component.ts
index a4153987c..6a43ea35e 100755
--- a/e2e/components/component.ts
+++ b/e2e/components/component.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -29,11 +29,11 @@ import { BROWSER_WAIT_TIMEOUT } from '../configs';
export abstract class Component {
component: ElementFinder;
- constructor(selector: string, ancestor?: ElementFinder) {
+ constructor(selector: string, ancestor?: string) {
const locator = selector;
this.component = ancestor
- ? ancestor.$$(locator).first()
+ ? browser.$$(ancestor).first().$$(locator).first()
: browser.$$(locator).first();
}
diff --git a/e2e/components/components.ts b/e2e/components/components.ts
index 252410cb3..9407625f5 100755
--- a/e2e/components/components.ts
+++ b/e2e/components/components.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/components/data-table/data-table.ts b/e2e/components/data-table/data-table.ts
index 19f244641..054bb1c73 100755
--- a/e2e/components/data-table/data-table.ts
+++ b/e2e/components/data-table/data-table.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -34,11 +34,11 @@ export class DataTable extends Component {
root: 'adf-datatable',
head: '.adf-datatable-header',
- columnHeader: '.adf-datatable-row .adf-datatable-cell-header',
+ columnHeader: '.adf-datatable-row .adf-datatable-cell-header .adf-datatable-cell-value',
sortedColumnHeader: `
- .adf-datatable__header--sorted-asc,
- .adf-datatable__header--sorted-desc
- `,
+ .adf-datatable__header--sorted-asc .adf-datatable-cell-value,
+ .adf-datatable__header--sorted-desc .adf-datatable-cell-value
+ `,
body: '.adf-datatable-body',
row: '.adf-datatable-row[role]',
@@ -57,7 +57,6 @@ export class DataTable extends Component {
emptyListTitle: '.adf-empty-content__title',
emptyListSubtitle: '.adf-empty-content__subtitle',
- emptyListText: '.adf-empty-content__text',
emptySearchText: '.empty-search__text',
@@ -73,60 +72,59 @@ export class DataTable extends Component {
emptyFolderDragAndDrop: ElementFinder = this.component.element(by.css(DataTable.selectors.emptyFolderDragAndDrop));
emptyListTitle: ElementFinder = this.component.element(by.css(DataTable.selectors.emptyListTitle));
emptyListSubtitle: ElementFinder = this.component.element(by.css(DataTable.selectors.emptyListSubtitle));
- emptyListText: ElementArrayFinder = this.component.all(by.css(DataTable.selectors.emptyListText));
emptySearchText: ElementFinder = this.component.element(by.css(DataTable.selectors.emptySearchText));
menu: Menu = new Menu();
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super(DataTable.selectors.root, ancestor);
}
// Wait methods (waits for elements)
- async waitForHeader() {
+ async waitForHeader(): Promise {
await browser.wait(EC.presenceOf(this.head), BROWSER_WAIT_TIMEOUT, '--- timeout waitForHeader ---');
}
- async waitForBody() {
+ async waitForBody(): Promise {
await browser.wait(EC.presenceOf(this.body), BROWSER_WAIT_TIMEOUT, '--- timeout waitForBody ---');
}
- async waitForEmptyState() {
+ async waitForEmptyState(): Promise {
await browser.wait(EC.presenceOf(this.emptyList), BROWSER_WAIT_TIMEOUT);
}
// Header/Column methods
- getColumnHeaders() {
+ getColumnHeaders(): ElementArrayFinder {
const locator = by.css(DataTable.selectors.columnHeader);
return this.head.all(locator);
}
- async getColumnHeadersText() {
+ async getColumnHeadersText(): Promise {
const el = this.getColumnHeaders();
return el.getText();
}
- getNthColumnHeader(nth: number) {
+ getNthColumnHeader(nth: number): ElementFinder {
return this.getColumnHeaders().get(nth - 1);
}
- getColumnHeaderByLabel(label: string) {
+ getColumnHeaderByLabel(label: string): ElementFinder {
const locator = by.cssContainingText(DataTable.selectors.columnHeader, label);
return this.head.element(locator);
}
- getSortedColumnHeader() {
+ getSortedColumnHeader(): ElementFinder {
const locator = by.css(DataTable.selectors.sortedColumnHeader);
return this.head.element(locator);
}
- async getSortedColumnHeaderText() {
+ async getSortedColumnHeaderText(): Promise {
return this.getSortedColumnHeader().getText();
}
async getSortingOrder(): Promise {
- const str = await this.getSortedColumnHeader().getAttribute('class');
+ const str = await this.getSortedColumnHeader().element(by.xpath('..')).getAttribute('class');
if (str.includes('asc')) {
return 'asc';
}
@@ -138,7 +136,7 @@ export class DataTable extends Component {
return 'none';
}
- async sortByColumn(columnName: string) {
+ async sortByColumn(columnName: string): Promise {
const column = this.getColumnHeaderByLabel(columnName);
const click = browser.actions().mouseMove(column).click();
@@ -146,27 +144,38 @@ export class DataTable extends Component {
}
// Rows methods
- getRows() {
+ getRows(): ElementArrayFinder {
return this.body.all(by.css(DataTable.selectors.row));
}
- async countRows() {
+ async getRowsCount(): Promise {
return this.getRows().count();
}
- getSelectedRows() {
+ async waitForRowToBeSelected(): Promise {
+ await browser.wait(EC.presenceOf(this.component.element(by.css(DataTable.selectors.selectedRow))), BROWSER_WAIT_TIMEOUT, 'timeout waiting for row to be selected');
+ }
+
+ getSelectedRows(): ElementArrayFinder {
return this.body.all(by.css(DataTable.selectors.selectedRow));
}
- async countSelectedRows() {
+ async getSelectedRowsNames(): Promise {
+ const rowsText: string[] = await this.getSelectedRows().map((row) => {
+ return row.element(by.css('.adf-datatable-cell[title="Name"]')).getText();
+ });
+ return rowsText;
+ }
+
+ async getSelectedRowsCount(): Promise {
return this.getSelectedRows().count();
}
- getNthRow(nth: number) {
+ getNthRow(nth: number): ElementFinder {
return this.getRows().get(nth - 1);
}
- getRowByName(name: string, location: string = '') {
+ getRowByName(name: string, location: string = ''): ElementFinder {
if (location) {
return this.body.all(by.cssContainingText(DataTable.selectors.row, name))
.filter(async (elem) => await browser.isElementPresent(elem.element(by.cssContainingText(DataTable.selectors.cell, location))))
@@ -175,46 +184,46 @@ export class DataTable extends Component {
return this.body.element(by.cssContainingText(DataTable.selectors.row, name));
}
- getRowCells(name: string, location: string = '') {
+ getRowCells(name: string, location: string = ''): ElementArrayFinder {
return this.getRowByName(name, location).all(by.css(DataTable.selectors.cell));
}
- async getRowCellsCount(itemName: string) {
+ async getRowCellsCount(itemName: string): Promise {
return this.getRowCells(itemName).count();
}
- getRowFirstCell(name: string, location: string = '') {
+ getRowFirstCell(name: string, location: string = ''): ElementFinder {
return this.getRowCells(name, location).get(0);
}
- getRowNameCell(name: string, location: string = '') {
+ getRowNameCell(name: string, location: string = ''): ElementFinder {
return this.getRowCells(name, location).get(1);
}
- getRowNameCellSpan(name: string, location: string = '') {
+ getRowNameCellSpan(name: string, location: string = ''): ElementFinder {
return this.getRowNameCell(name, location).$('span');
}
- async getItemNameTooltip(name: string, location: string = '') {
+ async getItemNameTooltip(name: string, location: string = ''): Promise {
return this.getRowNameCellSpan(name, location).getAttribute('title');
}
- async hasCheckMarkIcon(itemName: string, location: string = '') {
- const row = this.getRowByName(itemName, location);
+ async hasCheckMarkIcon(itemName: string, location: string = ''): Promise {
+ const row: ElementFinder = this.getRowByName(itemName, location);
return row.element(by.css(DataTable.selectors.selectedIcon)).isPresent();
}
- async hasLockIcon(itemName: string, location: string = '') {
- const row = this.getRowByName(itemName, location);
+ async hasLockIcon(itemName: string, location: string = ''): Promise {
+ const row: ElementFinder = this.getRowByName(itemName, location);
return row.element(by.css(DataTable.selectors.lockIcon)).isPresent();
}
- async hasLockOwnerInfo(itemName: string, location: string = '') {
- const row = this.getRowByName(itemName, location);
+ async hasLockOwnerInfo(itemName: string, location: string = ''): Promise {
+ const row: ElementFinder = this.getRowByName(itemName, location);
return row.element(by.css(DataTable.selectors.lockOwner)).isPresent();
}
- async getLockOwner(itemName: string, location: string = '') {
+ async getLockOwner(itemName: string, location: string = ''): Promise {
if (await this.hasLockOwnerInfo(itemName, location)) {
const row = this.getRowByName(itemName, location);
return row.$(DataTable.selectors.lockOwner).$('.locked_by--name').getText();
@@ -222,16 +231,16 @@ export class DataTable extends Component {
return '';
}
- getNameLink(itemName: string) {
+ getNameLink(itemName: string): ElementFinder {
return this.getRowNameCell(itemName).$(DataTable.selectors.nameLink);
}
- async hasLinkOnName(itemName: string) {
+ async hasLinkOnName(itemName: string): Promise {
return this.getNameLink(itemName).isPresent();
}
// Navigation/selection methods
- async doubleClickOnRowByName(name: string, location: string = '') {
+ async doubleClickOnRowByName(name: string, location: string = ''): Promise {
try {
const item = this.getRowFirstCell(name, location);
await Utils.waitUntilElementClickable(item);
@@ -242,7 +251,7 @@ export class DataTable extends Component {
}
}
- async selectItem(name: string, location: string = '') {
+ async selectItem(name: string, location: string = ''): Promise {
const isSelected = await this.hasCheckMarkIcon(name, location);
if (!isSelected) {
try {
@@ -253,30 +262,42 @@ export class DataTable extends Component {
console.log('--- select item catch : ', e);
}
}
-
}
- async clickItem(name: string, location: string = '') {
+ async unselectItem(name: string, location: string = ''): Promise {
+ const isSelected = await this.hasCheckMarkIcon(name, location);
+ if (isSelected) {
+ try {
+ const item = this.getRowFirstCell(name, location);
+ await item.click();
+
+ } catch (e) {
+ console.log('--- unselect item catch : ', e);
+ }
+ }
+ }
+
+ async clickItem(name: string, location: string = ''): Promise {
const item = this.getRowFirstCell(name, location);
await item.click();
}
- async clickNameLink(itemName: string) {
+ async clickNameLink(itemName: string): Promise {
await this.getNameLink(itemName).click();
}
- async selectMultipleItems(names: string[], location: string = '') {
+ async selectMultipleItems(names: string[], location: string = ''): Promise {
await this.clearSelection();
- await browser.actions().sendKeys(protractor.Key.COMMAND).perform();
+ await Utils.pressCmd();
for (const name of names) {
await this.selectItem(name, location);
}
- await browser.actions().sendKeys(protractor.Key.NULL).perform();
+ await Utils.releaseKeyPressed();
}
- async clearSelection() {
+ async clearSelection(): Promise {
try {
- const count = await this.countSelectedRows();
+ const count = await this.getSelectedRowsCount();
if (count !== 0) {
await browser.refresh();
await this.wait();
@@ -286,27 +307,27 @@ export class DataTable extends Component {
}
}
- async rightClickOnItem(itemName: string) {
+ async rightClickOnItem(itemName: string): Promise {
const item = this.getRowFirstCell(itemName);
await browser.actions().mouseMove(item).perform();
await browser.actions().click(protractor.Button.RIGHT).perform();
}
- async rightClickOnMultipleSelection() {
+ async rightClickOnMultipleSelection(): Promise {
const itemFromSelection = this.getSelectedRows().get(0);
await browser.actions().mouseMove(itemFromSelection).perform();
await browser.actions().click(protractor.Button.RIGHT).perform();
}
- getItemLocationEl(name: string) {
+ getItemLocationEl(name: string): ElementFinder {
return this.getRowByName(name).element(by.css(DataTable.selectors.locationLink));
}
- async getItemLocation(name: string) {
+ async getItemLocation(name: string): Promise {
return this.getItemLocationEl(name).getText();
}
- async getItemLocationTooltip(name: string) {
+ async getItemLocationTooltip(name: string): Promise {
const location = this.getItemLocationEl(name).$('a');
const condition = () => location.getAttribute('title').then(value => value && value.length > 0);
@@ -316,16 +337,16 @@ export class DataTable extends Component {
return location.getAttribute('title');
}
- async clickItemLocation(name: string) {
+ async clickItemLocation(name: string): Promise {
await this.getItemLocationEl(name).click();
}
// empty state methods
- async isEmptyList() {
+ async isEmpty(): Promise {
return this.emptyList.isPresent();
}
- async isEmptyWithDragAndDrop() {
+ async isEmptyWithDragAndDrop(): Promise {
return this.emptyFolderDragAndDrop.isDisplayed();
}
@@ -334,66 +355,68 @@ export class DataTable extends Component {
if (isEmpty) {
return this.emptyFolderDragAndDrop.getText();
}
-
return '';
}
async getEmptyStateTitle(): Promise {
- const isEmpty = await this.isEmptyList();
+ const isEmpty = await this.isEmpty();
if (isEmpty) {
return this.emptyListTitle.getText();
}
-
return '';
}
async getEmptyStateSubtitle(): Promise {
- const isEmpty = await this.isEmptyList();
+ const isEmpty = await this.isEmpty();
if (isEmpty) {
return this.emptyListSubtitle.getText();
}
-
return '';
}
- async getEmptyStateText(): Promise {
- const isEmpty = await this.isEmptyList();
+ async getEmptyListText(): Promise {
+ const isEmpty = await this.isEmpty();
if (isEmpty) {
- return this.emptyListText.getText();
+ return this.component.element(by.css('adf-custom-empty-content-template')).getText();
}
-
return '';
}
- async getEmptySearchResultsText() {
+ async getEmptySearchResultsText(): Promise {
return this.emptySearchText.getText();
}
- async getCellsContainingName(name: string) {
- const rows = this.getRows().all(by.cssContainingText(DataTable.selectors.cell, name));
- return rows.map(async cell => await cell.getText());
+ async getCellsContainingName(name: string): Promise {
+ const rows: ElementArrayFinder = this.getRows().all(by.cssContainingText(DataTable.selectors.cell, name));
+ const cellsText: string[] = await rows.map(async cell => {
+ return cell.getText();
+ });
+ return cellsText;
}
- async hasContextMenu() {
+ async hasContextMenu(): Promise {
const count = await this.menu.getItemsCount();
return count > 0;
}
- async getLibraryRole(name: string) {
+ async getLibraryRole(name: string): Promise {
return this.getRowByName(name).element(by.css(DataTable.selectors.libraryRole)).getText();
}
- async isItemPresent(name: string, location? : string) {
+ async isItemPresent(name: string, location? : string): Promise {
return this.getRowByName(name, location).isPresent();
}
- async getEntireDataTableText() {
- return this.getRows().map((row) => {
- return row.all(by.css(DataTable.selectors.cell)).map(async cell => await cell.getText());
+ async getEntireDataTableText(): Promise {
+ const text: string[] = await this.getRows().map((row) => {
+ return row.all(by.css(DataTable.selectors.cell)).map(async cell => {
+ return cell.getText();
+ });
});
+ return text;
}
- async getSitesNameAndVisibility() {
+ async getSitesNameAndVisibility(): Promise<{}> {
const data = await this.getEntireDataTableText();
return data.reduce((acc, cell) => {
acc[cell[1]] = cell[3].toUpperCase();
@@ -401,7 +424,7 @@ export class DataTable extends Component {
}, {});
}
- async getSitesNameAndRole() {
+ async getSitesNameAndRole(): Promise<{}> {
const data = await this.getEntireDataTableText();
return data.reduce((acc, cell) => {
acc[cell[1]] = cell[2];
@@ -409,7 +432,15 @@ export class DataTable extends Component {
}, {});
}
- getSearchResultsRowByName(name: string, location: string = '') {
+ getSearchResultsRows(): ElementArrayFinder {
+ return this.body.all(by.css(DataTable.selectors.searchResultsRow));
+ }
+
+ getNthSearchResultsRow(nth: number): ElementFinder {
+ return this.getSearchResultsRows().get(nth - 1);
+ }
+
+ getSearchResultsRowByName(name: string, location: string = ''): ElementFinder {
if (location) {
return this.body.all(by.cssContainingText(DataTable.selectors.searchResultsRow, name))
.filter(async (elem) => await browser.isElementPresent(elem.element(by.cssContainingText(DataTable.selectors.searchResultsRowLine, location))))
@@ -418,43 +449,43 @@ export class DataTable extends Component {
return this.body.element(by.cssContainingText(DataTable.selectors.searchResultsRow, name));
}
- getSearchResultRowLines(name: string, location: string = '') {
+ getSearchResultRowLines(name: string, location: string = ''): ElementArrayFinder {
return this.getSearchResultsRowByName(name, location).all(by.css(DataTable.selectors.searchResultsRowLine));
}
- async getSearchResultLinesCount(name: string, location: string = '') {
+ async getSearchResultLinesCount(name: string, location: string = ''): Promise {
return this.getSearchResultRowLines(name, location).count();
}
- getSearchResultNthLine(name: string, location: string = '', index: number) {
+ getSearchResultNthLine(name: string, location: string = '', index: number): ElementFinder {
return this.getSearchResultRowLines(name, location).get(index);
}
- async getSearchResultNameAndTitle(name: string, location: string = '') {
+ async getSearchResultNameAndTitle(name: string, location: string = ''): Promise {
return this.getSearchResultNthLine(name, location, 0).getText();
}
- async getSearchResultDescription(name: string, location: string = '') {
+ async getSearchResultDescription(name: string, location: string = ''): Promise {
return this.getSearchResultNthLine(name, location, 1).getText();
}
- async getSearchResultModified(name: string, location: string = '') {
+ async getSearchResultModified(name: string, location: string = ''): Promise {
return this.getSearchResultNthLine(name, location, 2).getText();
}
- async getSearchResultLocation(name: string, location: string = '') {
+ async getSearchResultLocation(name: string, location: string = ''): Promise {
return this.getSearchResultNthLine(name, location, 3).getText();
}
- getSearchResultNameLink(itemName: string, location: string = '') {
+ getSearchResultNameLink(itemName: string, location: string = ''): ElementFinder {
return this.getSearchResultsRowByName(itemName, location).$(DataTable.selectors.searchResultsNameLink);
}
- async hasLinkOnSearchResultName(itemName: string, location: string = '') {
+ async hasLinkOnSearchResultName(itemName: string, location: string = ''): Promise {
return this.getSearchResultNameLink(itemName, location).isPresent();
}
- async clickSearchResultNameLink(itemName: string, location: string = '') {
+ async clickSearchResultNameLink(itemName: string, location: string = ''): Promise {
await this.getSearchResultNameLink(itemName, location).click();
}
diff --git a/e2e/components/datetime-picker/datetime-picker.ts b/e2e/components/datetime-picker/datetime-picker.ts
index 6716c635b..c23eafbce 100755
--- a/e2e/components/datetime-picker/datetime-picker.ts
+++ b/e2e/components/datetime-picker/datetime-picker.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -48,7 +48,7 @@ export class DateTimePicker extends Component {
headerYear: ElementFinder = this.component.element(by.css(DateTimePicker.selectors.year));
dayPicker: ElementFinder = this.component.element(by.css(DateTimePicker.selectors.dayPicker));
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super(DateTimePicker.selectors.root, ancestor);
}
diff --git a/e2e/components/dialog/confirm-dialog.ts b/e2e/components/dialog/confirm-dialog.ts
index 0c008ec05..9bed516b9 100755
--- a/e2e/components/dialog/confirm-dialog.ts
+++ b/e2e/components/dialog/confirm-dialog.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -44,7 +44,7 @@ export class ConfirmDialog extends Component {
cancelButton: ElementFinder = this.component.element(by.id(ConfirmDialog.selectors.cancel));
actionButton: ElementFinder = this.component.element(by.id(ConfirmDialog.selectors.actionButton));
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super(ConfirmDialog.selectors.root, ancestor);
}
diff --git a/e2e/components/dialog/content-node-selector-dialog.ts b/e2e/components/dialog/content-node-selector-dialog.ts
new file mode 100755
index 000000000..0bac88b04
--- /dev/null
+++ b/e2e/components/dialog/content-node-selector-dialog.ts
@@ -0,0 +1,157 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { ElementFinder, by, browser, ExpectedConditions as EC, protractor } from 'protractor';
+import { BROWSER_WAIT_TIMEOUT } from '../../configs';
+import { Component } from '../component';
+import { Utils } from '../../utilities/utils';
+import { DropDownBreadcrumb } from '../breadcrumb/dropdown-breadcrumb';
+import { DataTable } from '../data-table/data-table';
+
+export class ContentNodeSelectorDialog extends Component {
+ private static selectors = {
+ root: '.adf-content-node-selector-dialog',
+
+ title: '.mat-dialog-title',
+ locationDropDown: 'site-dropdown-container',
+ locationOption: '.mat-option .mat-option-text',
+
+ dataTable: '.adf-datatable-body',
+ selectedRow: '.adf-is-selected',
+
+ button: '.mat-dialog-actions button',
+ chooseAction: '.adf-choose-action',
+
+ searchInput: '#searchInput',
+ toolbarTitle: '.adf-toolbar-title'
+ };
+
+ title: ElementFinder = this.component.element(by.css(ContentNodeSelectorDialog.selectors.title));
+ locationDropDown: ElementFinder = this.component.element(by.id(ContentNodeSelectorDialog.selectors.locationDropDown));
+ locationPersonalFiles: ElementFinder = browser.element(by.cssContainingText(ContentNodeSelectorDialog.selectors.locationOption, 'Personal Files'));
+ locationFileLibraries: ElementFinder = browser.element(by.cssContainingText(ContentNodeSelectorDialog.selectors.locationOption, 'File Libraries'));
+
+ cancelButton: ElementFinder = this.component.element(by.cssContainingText(ContentNodeSelectorDialog.selectors.button, 'Cancel'));
+ copyButton: ElementFinder = this.component.element(by.css(ContentNodeSelectorDialog.selectors.chooseAction));
+ moveButton: ElementFinder = this.component.element(by.cssContainingText(ContentNodeSelectorDialog.selectors.button, 'Move'));
+
+ searchInput: ElementFinder = this.component.element(by.css(ContentNodeSelectorDialog.selectors.searchInput));
+ toolbarTitle: ElementFinder = this.component.element(by.css(ContentNodeSelectorDialog.selectors.toolbarTitle));
+
+ breadcrumb: DropDownBreadcrumb = new DropDownBreadcrumb();
+ dataTable: DataTable = new DataTable(ContentNodeSelectorDialog.selectors.root);
+
+ constructor(ancestor?: string) {
+ super(ContentNodeSelectorDialog.selectors.root, ancestor);
+ }
+
+ async waitForDialogToOpen(): Promise {
+ await browser.wait(EC.presenceOf(this.title), BROWSER_WAIT_TIMEOUT, 'timeout waiting for dialog title');
+ await browser.wait(EC.presenceOf(browser.element(by.css('.cdk-overlay-backdrop'))), BROWSER_WAIT_TIMEOUT, 'timeout waiting for overlay backdrop');
+ }
+
+ async waitForDialogToClose(): Promise {
+ await browser.wait(EC.stalenessOf(this.title), BROWSER_WAIT_TIMEOUT);
+ }
+
+ async waitForDropDownToOpen(): Promise {
+ await browser.wait(EC.presenceOf(this.locationPersonalFiles), BROWSER_WAIT_TIMEOUT);
+ }
+
+ async waitForDropDownToClose(): Promise {
+ await browser.wait(EC.stalenessOf(browser.$(ContentNodeSelectorDialog.selectors.locationOption)), BROWSER_WAIT_TIMEOUT);
+ }
+
+ async waitForRowToBeSelected(): Promise {
+ await browser.wait(EC.presenceOf(this.component.element(by.css(ContentNodeSelectorDialog.selectors.selectedRow))), BROWSER_WAIT_TIMEOUT);
+ }
+
+ async isDialogOpen(): Promise {
+ return browser.$(ContentNodeSelectorDialog.selectors.root).isDisplayed();
+ }
+
+ async getTitle(): Promise {
+ return this.title.getText();
+ }
+
+ async clickCancel(): Promise {
+ await this.cancelButton.click();
+ await this.waitForDialogToClose();
+ }
+
+ async clickCopy(): Promise {
+ await this.copyButton.click();
+ }
+
+ async clickMove(): Promise {
+ await this.moveButton.click();
+ }
+
+ async selectLocation(location: 'Personal Files' | 'File Libraries'): Promise {
+ await this.locationDropDown.click();
+ await this.waitForDropDownToOpen();
+
+ if (location === 'Personal Files') {
+ await this.locationPersonalFiles.click();
+ } else {
+ await this.locationFileLibraries.click();
+ }
+
+ await this.waitForDropDownToClose();
+ }
+
+ async selectDestination(folderName: string): Promise {
+ const row = this.dataTable.getRowByName(folderName);
+ await Utils.waitUntilElementClickable(row);
+ await row.click();
+ await this.waitForRowToBeSelected();
+ }
+
+ async isSearchInputPresent(): Promise {
+ return await this.searchInput.isPresent();
+ }
+
+ async isSelectLocationDropdownDisplayed(): Promise {
+ return (await this.locationDropDown.isPresent()) && (await this.locationDropDown.isDisplayed());
+ }
+
+ async isCopyButtonEnabled(): Promise {
+ return (await this.copyButton.isPresent()) && (await this.copyButton.isEnabled());
+ }
+
+ async isCancelButtonEnabled(): Promise {
+ return (await this.cancelButton.isPresent()) && (await this.cancelButton.isEnabled());
+ }
+
+ async searchFor(text: string): Promise {
+ await Utils.clearFieldWithBackspace(this.searchInput);
+ await this.searchInput.sendKeys(text);
+ await this.searchInput.sendKeys(protractor.Key.ENTER);
+ }
+
+ async getToolbarTitle(): Promise {
+ return await this.toolbarTitle.getText();
+ }
+}
diff --git a/e2e/components/dialog/copy-move-dialog.ts b/e2e/components/dialog/copy-move-dialog.ts
deleted file mode 100755
index 6f5321c46..000000000
--- a/e2e/components/dialog/copy-move-dialog.ts
+++ /dev/null
@@ -1,131 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { ElementFinder, by, browser, ExpectedConditions as EC } from 'protractor';
-import { BROWSER_WAIT_TIMEOUT } from '../../configs';
-import { Component } from '../component';
-import { Utils } from './../../utilities/utils';
-
-export class CopyMoveDialog extends Component {
- private static selectors = {
- root: '.adf-content-node-selector-dialog',
-
- title: '.mat-dialog-title',
- content: '.mat-dialog-content',
- locationDropDown: 'site-dropdown-container',
- locationOption: '.mat-option .mat-option-text',
-
- dataTable: '.adf-datatable-body',
- row: '.adf-datatable-row[role]',
- selectedRow: '.adf-is-selected',
-
- button: '.mat-dialog-actions button'
- };
-
- title: ElementFinder = this.component.element(by.css(CopyMoveDialog.selectors.title));
- content: ElementFinder = this.component.element(by.css(CopyMoveDialog.selectors.content));
- dataTable: ElementFinder = this.component.element(by.css(CopyMoveDialog.selectors.dataTable));
- locationDropDown: ElementFinder = this.component.element(by.id(CopyMoveDialog.selectors.locationDropDown));
- locationPersonalFiles: ElementFinder = browser.element(by.cssContainingText(CopyMoveDialog.selectors.locationOption, 'Personal Files'));
- locationFileLibraries: ElementFinder = browser.element(by.cssContainingText(CopyMoveDialog.selectors.locationOption, 'File Libraries'));
-
- row: ElementFinder = this.component.element(by.css(CopyMoveDialog.selectors.row));
-
- cancelButton: ElementFinder = this.component.element(by.cssContainingText(CopyMoveDialog.selectors.button, 'Cancel'));
- copyButton: ElementFinder = this.component.element(by.cssContainingText(CopyMoveDialog.selectors.button, 'Copy'));
- moveButton: ElementFinder = this.component.element(by.cssContainingText(CopyMoveDialog.selectors.button, 'Move'));
-
- constructor(ancestor?: ElementFinder) {
- super(CopyMoveDialog.selectors.root, ancestor);
- }
-
- async waitForDialogToClose() {
- await browser.wait(EC.stalenessOf(this.title), BROWSER_WAIT_TIMEOUT);
- }
-
- async waitForDropDownToOpen() {
- await browser.wait(EC.presenceOf(this.locationPersonalFiles), BROWSER_WAIT_TIMEOUT);
- }
-
- async waitForDropDownToClose() {
- await browser.wait(EC.stalenessOf(browser.$(CopyMoveDialog.selectors.locationOption)), BROWSER_WAIT_TIMEOUT);
- }
-
- async waitForRowToBeSelected() {
- await browser.wait(EC.presenceOf(this.component.element(by.css(CopyMoveDialog.selectors.selectedRow))), BROWSER_WAIT_TIMEOUT);
- }
-
- async isDialogOpen() {
- return browser.$(CopyMoveDialog.selectors.root).isDisplayed();
- }
-
- async getTitle() {
- return this.title.getText();
- }
-
- async clickCancel() {
- await this.cancelButton.click();
- await this.waitForDialogToClose();
- }
-
- async clickCopy() {
- await this.copyButton.click();
- }
-
- async clickMove() {
- await this.moveButton.click();
- }
-
- getRow(folderName: string) {
- return this.dataTable.element(by.cssContainingText('.adf-name-location-cell', folderName));
- }
-
- async doubleClickOnRow(name: string) {
- const item = this.getRow(name);
- await Utils.waitUntilElementClickable(item);
- await browser.actions().mouseMove(item).perform();
- await browser.actions().click().click().perform();
- }
-
- async selectLocation(location: 'Personal Files' | 'File Libraries') {
- await this.locationDropDown.click();
- await this.waitForDropDownToOpen();
-
- if (location === 'Personal Files') {
- await this.locationPersonalFiles.click();
- } else {
- await this.locationFileLibraries.click();
- }
-
- await this.waitForDropDownToClose();
- }
-
- async selectDestination(folderName: string) {
- const row = this.getRow(folderName);
- await Utils.waitUntilElementClickable(row);
- await row.click();
- await this.waitForRowToBeSelected();
- }
-}
diff --git a/e2e/components/dialog/create-edit-folder-dialog.ts b/e2e/components/dialog/create-edit-folder-dialog.ts
index 467404bae..d19d7a5df 100755
--- a/e2e/components/dialog/create-edit-folder-dialog.ts
+++ b/e2e/components/dialog/create-edit-folder-dialog.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -47,7 +47,7 @@ export class CreateOrEditFolderDialog extends Component {
updateButton: ElementFinder = this.component.element(by.cssContainingText(CreateOrEditFolderDialog.selectors.button, 'Update'));
validationMessage: ElementFinder = this.component.element(by.css(CreateOrEditFolderDialog.selectors.validationMessage));
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super(CreateOrEditFolderDialog.selectors.root, ancestor);
}
@@ -68,8 +68,8 @@ export class CreateOrEditFolderDialog extends Component {
return this.title.getText();
}
- async isValidationMessageDisplayed() {
- return this.validationMessage.isDisplayed();
+ async isValidationMessageDisplayed(): Promise {
+ return (await this.validationMessage.isPresent()) && (await this.validationMessage.isDisplayed());
}
async isUpdateButtonEnabled() {
@@ -92,9 +92,12 @@ export class CreateOrEditFolderDialog extends Component {
return this.descriptionTextArea.isDisplayed();
}
- async getValidationMessage() {
- await this.isValidationMessageDisplayed();
- return this.validationMessage.getText();
+ async getValidationMessage(): Promise {
+ if (await this.isValidationMessageDisplayed()) {
+ return this.validationMessage.getText();
+ } else {
+ return '';
+ }
}
async getName() {
diff --git a/e2e/components/dialog/create-from-template-dialog.ts b/e2e/components/dialog/create-from-template-dialog.ts
new file mode 100755
index 000000000..c98b245b5
--- /dev/null
+++ b/e2e/components/dialog/create-from-template-dialog.ts
@@ -0,0 +1,140 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { ElementFinder, by, browser, protractor, ExpectedConditions as EC } from 'protractor';
+import { BROWSER_WAIT_TIMEOUT } from '../../configs';
+import { Component } from '../component';
+
+export class CreateFromTemplateDialog extends Component {
+ private static selectors = {
+ root: '.aca-create-from-template-dialog',
+
+ title: '.mat-dialog-title',
+ nameInput: 'input[placeholder="Name" i]',
+ titleInput: 'input[placeholder="Title" i]',
+ descriptionTextArea: 'textarea[placeholder="Description" i]',
+ button: '.mat-dialog-actions button',
+ validationMessage: '.mat-error'
+ };
+
+ title: ElementFinder = this.component.element(by.css(CreateFromTemplateDialog.selectors.title));
+ nameInput: ElementFinder = this.component.element(by.css(CreateFromTemplateDialog.selectors.nameInput));
+ titleInput: ElementFinder = this.component.element(by.css(CreateFromTemplateDialog.selectors.titleInput));
+ descriptionTextArea: ElementFinder = this.component.element(by.css(CreateFromTemplateDialog.selectors.descriptionTextArea));
+ createButton: ElementFinder = this.component.element(by.cssContainingText(CreateFromTemplateDialog.selectors.button, 'Create'));
+ cancelButton: ElementFinder = this.component.element(by.cssContainingText(CreateFromTemplateDialog.selectors.button, 'CANCEL'));
+ validationMessage: ElementFinder = this.component.element(by.css(CreateFromTemplateDialog.selectors.validationMessage));
+
+ constructor(ancestor?: string) {
+ super(CreateFromTemplateDialog.selectors.root, ancestor);
+ }
+
+ async waitForDialogToOpen(): Promise {
+ await browser.wait(EC.presenceOf(this.title), BROWSER_WAIT_TIMEOUT, 'timeout waiting for dialog title');
+ await browser.wait(EC.presenceOf(browser.element(by.css('.cdk-overlay-backdrop'))), BROWSER_WAIT_TIMEOUT, 'timeout waiting for overlay backdrop');
+ }
+
+ async waitForDialogToClose(): Promise {
+ await browser.wait(EC.stalenessOf(this.title), BROWSER_WAIT_TIMEOUT, '---- timeout waiting for dialog to close ----');
+ }
+
+ async isDialogOpen(): Promise {
+ return browser.isElementPresent(by.css(CreateFromTemplateDialog.selectors.root));
+ }
+
+ async getTitle(): Promise {
+ return this.title.getText();
+ }
+
+ async isValidationMessageDisplayed(): Promise {
+ return (await this.validationMessage.isPresent()) && (await this.validationMessage.isDisplayed());
+ }
+
+ async isCreateButtonEnabled(): Promise {
+ return this.createButton.isEnabled();
+ }
+
+ async isCancelButtonEnabled(): Promise {
+ return this.cancelButton.isEnabled();
+ }
+
+ async isNameFieldDisplayed(): Promise {
+ return this.nameInput.isDisplayed();
+ }
+
+ async isTitleFieldDisplayed(): Promise {
+ return this.titleInput.isDisplayed();
+ }
+
+ async isDescriptionFieldDisplayed(): Promise {
+ return this.descriptionTextArea.isDisplayed();
+ }
+
+ async getValidationMessage(): Promise {
+ if (await this.isValidationMessageDisplayed()) {
+ return this.validationMessage.getText();
+ } else {
+ return '';
+ }
+ }
+
+ async getName(): Promise {
+ return this.nameInput.getAttribute('value');
+ }
+
+ async getDescription(): Promise {
+ return this.descriptionTextArea.getAttribute('value');
+ }
+
+ async enterName(name: string): Promise {
+ await this.nameInput.clear();
+ await this.nameInput.sendKeys(name);
+ }
+
+ async enterTitle(title: string): Promise {
+ await this.titleInput.clear();
+ await this.titleInput.sendKeys(title);
+ }
+
+ async enterDescription(description: string): Promise {
+ await this.descriptionTextArea.clear();
+ await this.descriptionTextArea.sendKeys(description);
+ }
+
+ async deleteNameWithBackspace(): Promise {
+ await this.nameInput.clear();
+ await this.nameInput.sendKeys(' ', protractor.Key.CONTROL, 'a', protractor.Key.NULL, protractor.Key.BACK_SPACE);
+ }
+
+ async clickCreate(): Promise {
+ await this.createButton.click();
+ }
+
+ async clickCancel(): Promise {
+ await this.cancelButton.click();
+ await this.waitForDialogToClose();
+ }
+
+}
diff --git a/e2e/components/dialog/create-library-dialog.ts b/e2e/components/dialog/create-library-dialog.ts
index c6929acf9..897c76d40 100755
--- a/e2e/components/dialog/create-library-dialog.ts
+++ b/e2e/components/dialog/create-library-dialog.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -53,7 +53,7 @@ export class CreateLibraryDialog extends Component {
cancelButton: ElementFinder = this.component.element(by.cssContainingText(CreateLibraryDialog.selectors.button, 'Cancel'));
errorMessage: ElementFinder = this.component.element(by.css(CreateLibraryDialog.selectors.errorMessage));
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super(CreateLibraryDialog.selectors.root, ancestor);
}
diff --git a/e2e/components/dialog/manage-versions-dialog.ts b/e2e/components/dialog/manage-versions-dialog.ts
index 15e4e3ca0..16eebbd1f 100755
--- a/e2e/components/dialog/manage-versions-dialog.ts
+++ b/e2e/components/dialog/manage-versions-dialog.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -40,7 +40,7 @@ export class ManageVersionsDialog extends Component {
content: ElementFinder = this.component.element(by.css(ManageVersionsDialog.selectors.content));
closeButton: ElementFinder = this.component.element(by.cssContainingText(ManageVersionsDialog.selectors.button, 'Close'));
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super(ManageVersionsDialog.selectors.root, ancestor);
}
diff --git a/e2e/components/dialog/password-dialog.ts b/e2e/components/dialog/password-dialog.ts
index f451e9288..2ab7ce5e7 100755
--- a/e2e/components/dialog/password-dialog.ts
+++ b/e2e/components/dialog/password-dialog.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -45,7 +45,7 @@ export class PasswordDialog extends Component {
closeButton: ElementFinder = this.component.element(by.buttonText('Close'));
submitButton: ElementFinder = this.component.element(by.buttonText('Submit'));
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super(PasswordDialog.selectors.root, ancestor);
}
@@ -58,7 +58,13 @@ export class PasswordDialog extends Component {
}
async isDialogOpen() {
- return browser.isElementPresent(by.css(PasswordDialog.selectors.root));
+ try {
+ const dialog = await browser.wait(until.elementLocated(by.css(PasswordDialog.selectors.root)), BROWSER_WAIT_TIMEOUT, '------- timeout waiting for dialog')
+ return dialog.isDisplayed();
+ } catch (error) {
+ return false;
+ }
+
}
async getTitle() {
diff --git a/e2e/components/dialog/select-template-dialog.ts b/e2e/components/dialog/select-template-dialog.ts
new file mode 100755
index 000000000..39acbada4
--- /dev/null
+++ b/e2e/components/dialog/select-template-dialog.ts
@@ -0,0 +1,86 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { ElementFinder, by, browser, ExpectedConditions as EC } from 'protractor';
+import { BROWSER_WAIT_TIMEOUT } from '../../configs';
+import { Component } from '../component';
+import { DropDownBreadcrumb } from '../breadcrumb/dropdown-breadcrumb';
+import { DataTable } from '../data-table/data-table';
+
+export class SelectTemplateDialog extends Component {
+ private static selectors = {
+ root: '.aca-template-node-selector-dialog',
+ title: '.mat-dialog-title',
+ button: '.mat-dialog-actions button'
+ };
+
+ title: ElementFinder = this.component.element(by.css(SelectTemplateDialog.selectors.title));
+ nextButton: ElementFinder = this.component.element(by.cssContainingText(SelectTemplateDialog.selectors.button, 'Next'));
+ cancelButton: ElementFinder = this.component.element(by.cssContainingText(SelectTemplateDialog.selectors.button, 'Cancel'));
+
+ breadcrumb: DropDownBreadcrumb = new DropDownBreadcrumb();
+ dataTable: DataTable = new DataTable(SelectTemplateDialog.selectors.root);
+
+ constructor(ancestor?: string) {
+ super(SelectTemplateDialog.selectors.root, ancestor);
+ }
+
+ async waitForDialogToOpen(): Promise {
+ await browser.wait(EC.presenceOf(this.title), BROWSER_WAIT_TIMEOUT, 'timeout waiting for dialog title');
+ await browser.wait(EC.presenceOf(browser.element(by.css('.cdk-overlay-backdrop'))), BROWSER_WAIT_TIMEOUT, 'timeout waiting for overlay backdrop');
+ }
+
+ async waitForDialogToClose(): Promise {
+ await browser.wait(EC.stalenessOf(this.title), BROWSER_WAIT_TIMEOUT, '---- timeout waiting for dialog to close ----');
+ }
+
+ async isDialogOpen(): Promise {
+ return browser.isElementPresent(by.css(SelectTemplateDialog.selectors.root));
+ }
+
+ async getTitle(): Promise {
+ return this.title.getText();
+ }
+
+ // action buttons
+
+ async isCancelButtonEnabled(): Promise {
+ return this.cancelButton.isEnabled();
+ }
+
+ async isNextButtonEnabled(): Promise {
+ return this.nextButton.isEnabled();
+ }
+
+ async clickCancel(): Promise {
+ await this.cancelButton.click();
+ await this.waitForDialogToClose();
+ }
+
+ async clickNext(): Promise {
+ await this.nextButton.click();
+ await this.waitForDialogToClose();
+ }
+}
diff --git a/e2e/components/dialog/share-dialog.ts b/e2e/components/dialog/share-dialog.ts
index c7c284158..e9da01d9c 100755
--- a/e2e/components/dialog/share-dialog.ts
+++ b/e2e/components/dialog/share-dialog.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -58,7 +58,7 @@ export class ShareDialog extends Component {
closeButton: ElementFinder = this.component.element(by.css(ShareDialog.selectors.button));
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super(ShareDialog.selectors.root, ancestor);
}
diff --git a/e2e/components/dialog/upload-new-version-dialog.ts b/e2e/components/dialog/upload-new-version-dialog.ts
index 2e88c17da..3d9279875 100755
--- a/e2e/components/dialog/upload-new-version-dialog.ts
+++ b/e2e/components/dialog/upload-new-version-dialog.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -51,7 +51,7 @@ export class UploadNewVersionDialog extends Component {
description: ElementFinder = this.component.element(by.css(UploadNewVersionDialog.selectors.descriptionTextArea));
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super(UploadNewVersionDialog.selectors.root, ancestor);
}
diff --git a/e2e/components/header/header.ts b/e2e/components/header/header.ts
index 9cfed3b87..3faf45cf1 100755
--- a/e2e/components/header/header.ts
+++ b/e2e/components/header/header.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -47,12 +47,12 @@ export class Header extends Component {
moreActions: ElementFinder = browser.element(Header.selectors.moreActions);
sidenavToggle: ElementFinder = this.component.element(by.css(Header.selectors.sidenavToggle));
- userInfo: UserInfo = new UserInfo(this.component);
+ userInfo: UserInfo = new UserInfo();
menu: Menu = new Menu();
toolbar: Toolbar = new Toolbar();
searchInput: SearchInput = new SearchInput();
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super('adf-layout-header', ancestor);
}
diff --git a/e2e/components/header/user-info.ts b/e2e/components/header/user-info.ts
index 71c77b548..88a3c9b93 100755
--- a/e2e/components/header/user-info.ts
+++ b/e2e/components/header/user-info.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -39,7 +39,7 @@ export class UserInfo extends Component {
menu: Menu = new Menu();
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super('aca-current-user', ancestor);
}
diff --git a/e2e/components/info-drawer/info-drawer-comments-tab.ts b/e2e/components/info-drawer/info-drawer-comments-tab.ts
index 8f8f5da49..5c5f8b877 100755
--- a/e2e/components/info-drawer/info-drawer-comments-tab.ts
+++ b/e2e/components/info-drawer/info-drawer-comments-tab.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -58,7 +58,7 @@ export class CommentsTab extends Component {
commentTime = by.id(CommentsTab.selectors.commentTime);
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super(CommentsTab.selectors.root, ancestor);
}
diff --git a/e2e/components/info-drawer/info-drawer-metadata-content.ts b/e2e/components/info-drawer/info-drawer-metadata-content.ts
index dda4a77ba..f9e836fc7 100755
--- a/e2e/components/info-drawer/info-drawer-metadata-content.ts
+++ b/e2e/components/info-drawer/info-drawer-metadata-content.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -53,7 +53,7 @@ export class ContentMetadata extends Component {
imagePropertiesPanel: ElementFinder = this.component.element(by.css(`[data-automation-id='adf-metadata-group-APP.CONTENT_METADATA.EXIF_GROUP_TITLE']`));
expandedImagePropertiesPanel: ElementFinder = this.component.element(by.css(`[data-automation-id='adf-metadata-group-APP.CONTENT_METADATA.EXIF_GROUP_TITLE'].mat-expanded`));
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super(ContentMetadata.selectors.root, ancestor);
}
diff --git a/e2e/components/info-drawer/info-drawer-metadata-library.ts b/e2e/components/info-drawer/info-drawer-metadata-library.ts
index b60546f37..047d2b13c 100755
--- a/e2e/components/info-drawer/info-drawer-metadata-library.ts
+++ b/e2e/components/info-drawer/info-drawer-metadata-library.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -58,7 +58,7 @@ export class LibraryMetadata extends Component {
error: ElementFinder = this.component.element(by.css(LibraryMetadata.selectors.error));
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super(LibraryMetadata.selectors.root, ancestor);
}
diff --git a/e2e/components/info-drawer/info-drawer.ts b/e2e/components/info-drawer/info-drawer.ts
index fe9f65663..3caf2854b 100755
--- a/e2e/components/info-drawer/info-drawer.ts
+++ b/e2e/components/info-drawer/info-drawer.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -23,7 +23,7 @@
* along with Alfresco. If not, see .
*/
-import { ElementFinder, ElementArrayFinder, by, browser, ExpectedConditions as EC, $ } from 'protractor';
+import { ElementFinder, ElementArrayFinder, by, browser, ExpectedConditions as EC } from 'protractor';
import { Component } from '../component';
import { BROWSER_WAIT_TIMEOUT } from '../../configs';
import { CommentsTab } from './info-drawer-comments-tab';
@@ -48,9 +48,9 @@ export class InfoDrawer extends Component {
headerTitle: '.adf-info-drawer-layout-header-title'
};
- commentsTab = new CommentsTab($(InfoDrawer.selectors.root));
- aboutTab = new LibraryMetadata($(InfoDrawer.selectors.root));
- propertiesTab = new ContentMetadata($(InfoDrawer.selectors.root));
+ commentsTab = new CommentsTab(InfoDrawer.selectors.root);
+ aboutTab = new LibraryMetadata(InfoDrawer.selectors.root);
+ propertiesTab = new ContentMetadata(InfoDrawer.selectors.root);
header: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.header));
headerTitle: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.headerTitle));
@@ -64,7 +64,7 @@ export class InfoDrawer extends Component {
previousButton: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.previous));
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super(InfoDrawer.selectors.root, ancestor);
}
diff --git a/e2e/components/login/login.ts b/e2e/components/login/login.ts
index 3c7f4cd42..cd7872e28 100755
--- a/e2e/components/login/login.ts
+++ b/e2e/components/login/login.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -45,7 +45,7 @@ export class LoginComponent extends Component {
copyright: ElementFinder = this.component.element(LoginComponent.selectors.copyright);
passwordVisibility: ElementFinder = this.component.element(LoginComponent.selectors.passwordVisibility);
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super(LoginComponent.selectors.root, ancestor);
}
diff --git a/e2e/components/menu/menu.ts b/e2e/components/menu/menu.ts
index 408eedaaf..e6b44d3a6 100755
--- a/e2e/components/menu/menu.ts
+++ b/e2e/components/menu/menu.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -33,7 +33,15 @@ export class Menu extends Component {
root: '.mat-menu-panel',
item: '.mat-menu-item',
icon: '.mat-icon',
- uploadFiles: 'app-upload-files',
+
+ uploadFilesInput: 'app-upload-files',
+
+ uploadFile: 'app.create.uploadFile',
+ uploadFolder: 'app.create.uploadFolder',
+ createFolder: 'app.create.folder',
+ createLibrary: 'app.create.library',
+ createFileFromTemplate: 'app.create.fileFromTemplate',
+ createFolderFromTemplate: 'app.create.folderFromTemplate',
submenu: 'app-context-menu-item .mat-menu-item',
@@ -46,14 +54,20 @@ export class Menu extends Component {
items: ElementArrayFinder = this.component.all(by.css(Menu.selectors.item));
backdrop: ElementFinder = browser.element(by.css('.cdk-overlay-backdrop'));
- uploadFiles: ElementFinder = browser.element(by.id(Menu.selectors.uploadFiles));
+
+ uploadFilesInput: ElementFinder = browser.element(by.id(Menu.selectors.uploadFilesInput));
submenus: ElementArrayFinder = browser.element.all(by.css(Menu.selectors.submenu));
+ uploadFileAction: ElementFinder = this.component.element(by.id(Menu.selectors.uploadFile));
+ uploadFolderAction: ElementFinder = this.component.element(by.id(Menu.selectors.uploadFolder));
+ createFolderAction: ElementFinder = this.component.element(by.id(Menu.selectors.createFolder));
+ createLibraryAction: ElementFinder = this.component.element(by.id(Menu.selectors.createLibrary));
+ createFileFromTemplateAction: ElementFinder = this.component.element(by.id(Menu.selectors.createFileFromTemplate));
+ createFolderFromTemplateAction: ElementFinder = this.component.element(by.id(Menu.selectors.createFolderFromTemplate));
+
cancelEditingAction: ElementFinder = this.component.element(by.css(Menu.selectors.cancelEditing));
cancelJoinAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Cancel Join'));
copyAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Copy'));
- createFolderAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Create Folder'));
- createLibraryAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Create Library'));
deleteAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Delete'));
downloadAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Download'));
editFolderAction: ElementFinder = this.component.element(by.css(Menu.selectors.editFolder));
@@ -72,69 +86,88 @@ export class Menu extends Component {
restoreAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Restore'));
shareAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Share'));
shareEditAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Shared Link Settings'));
- uploadFileAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Upload File'));
- uploadFolderAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Upload Folder'));
viewAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'View'));
viewDetailsAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'View Details'));
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super(Menu.selectors.root, ancestor);
}
- async waitForMenuToOpen() {
+ async waitForMenuToOpen(): Promise {
await browser.wait(EC.presenceOf(browser.element(by.css('.cdk-overlay-container .mat-menu-panel'))), BROWSER_WAIT_TIMEOUT);
await browser.wait(EC.visibilityOf(this.items.get(0)), BROWSER_WAIT_TIMEOUT);
}
- async waitForMenuToClose() {
+ async waitForMenuToClose(): Promise {
await browser.wait(EC.not(EC.presenceOf(browser.element(by.css('.cdk-overlay-container .mat-menu-panel')))), BROWSER_WAIT_TIMEOUT);
}
- async closeMenu() {
+ async closeMenu(): Promise {
await Utils.pressEscape();
await this.waitForMenuToClose();
}
- getNthItem(nth: number) {
+ getNthItem(nth: number): ElementFinder {
return this.items.get(nth - 1);
}
- getItemByLabel(menuItem: string) {
+ getItemByLabel(menuItem: string): ElementFinder {
return this.component.element(by.cssContainingText(Menu.selectors.item, menuItem));
}
- getSubItemByLabel(subMenuItem: string) {
+ getSubItemByLabel(subMenuItem: string): ElementFinder {
return this.component.element(by.cssContainingText(Menu.selectors.submenu, subMenuItem));
}
- getItemById(id: string) {
+ getItemById(id: string): ElementFinder {
return this.component.element(by.id(id));
}
- async getItemTooltip(menuItem: string) {
+ async getItemTooltip(menuItem: string): Promise {
return this.getItemByLabel(menuItem).getAttribute('title');
}
- async getItemIconText(menuItem: string) {
+ async getTooltipForUploadFile(): Promise {
+ return this.getItemTooltip('Upload File');
+ }
+
+ async getTooltipForUploadFolder(): Promise {
+ return this.getItemTooltip('Upload Folder');
+ }
+
+ async getTooltipForCreateFolder(): Promise {
+ return this.getItemTooltip('Create Folder');
+ }
+
+ async getTooltipForCreateLibrary(): Promise {
+ return this.getItemTooltip('Create Library');
+ }
+
+ async getTooltipForCreateFileFromTemplate(): Promise {
+ return this.getItemTooltip('Create file from template');
+ }
+
+ async getItemIconText(menuItem: string): Promise {
return this.getItemByLabel(menuItem).element(by.css(Menu.selectors.icon)).getText();
}
- async getItemIdAttribute(menuItem: string) {
+ async getItemIdAttribute(menuItem: string): Promise {
return this.getItemByLabel(menuItem).getAttribute('id');
}
- async getItemsCount() {
+ async getItemsCount(): Promise {
return this.items.count();
}
async getMenuItems(): Promise {
- return this.items.map(async (elem) => {
- const text = await elem.element(by.css('span')).getText();
- return text;
+ const items: string[] = await this.items.map(async (elem) => {
+ const span: ElementFinder = elem.element(by.css('span'));
+ return span.getText();
});
+ return items;
}
- async clickNthItem(nth: number) {
+ async clickNthItem(nth: number): Promise {
try {
const elem = this.getNthItem(nth);
await browser.wait(EC.elementToBeClickable(elem), BROWSER_WAIT_TIMEOUT, 'timeout waiting for menu item to be clickable');
@@ -146,7 +179,7 @@ export class Menu extends Component {
}
}
- async clickMenuItem(menuItem: string) {
+ async clickMenuItem(menuItem: string): Promise {
try {
const elem = this.getItemByLabel(menuItem);
await browser.wait(EC.elementToBeClickable(elem), BROWSER_WAIT_TIMEOUT, 'timeout waiting for menu item to be clickable');
@@ -156,7 +189,7 @@ export class Menu extends Component {
}
}
- async mouseOverMenuItem(menuItem: string) {
+ async mouseOverMenuItem(menuItem: string): Promise {
try {
const elem = this.getItemByLabel(menuItem);
await browser.wait(EC.elementToBeClickable(elem), BROWSER_WAIT_TIMEOUT);
@@ -179,7 +212,7 @@ export class Menu extends Component {
}
}
- async clickSubMenuItem(subMenuItem: string) {
+ async clickSubMenuItem(subMenuItem: string): Promise {
try {
const elem = this.getSubItemByLabel(subMenuItem);
await browser.wait(EC.elementToBeClickable(elem), BROWSER_WAIT_TIMEOUT);
@@ -189,15 +222,15 @@ export class Menu extends Component {
}
}
- async isMenuItemPresent(title: string) {
+ async isMenuItemPresent(title: string): Promise {
return browser.element(by.cssContainingText(Menu.selectors.item, title)).isPresent();
}
- async isSubMenuItemPresent(title: string) {
+ async isSubMenuItemPresent(title: string): Promise {
return browser.element(by.cssContainingText(Menu.selectors.submenu, title)).isPresent();
}
- async getSubmenuItemsCount() {
+ async getSubmenuItemsCount(): Promise {
return this.submenus.count();
}
@@ -212,164 +245,157 @@ export class Menu extends Component {
}
}
- uploadFile() {
- return this.uploadFiles;
+ uploadFile(): ElementFinder {
+ return this.uploadFilesInput;
}
- async clickEditFolder() {
+ async clickEditFolder(): Promise {
await this.editFolderAction.click();
}
- async clickShare() {
+ async clickShare(): Promise {
const action = this.shareAction;
await action.click();
}
- async clickSharedLinkSettings() {
+ async clickSharedLinkSettings(): Promise {
const action = this.shareEditAction;
await action.click();
}
-
- async isViewPresent() {
+ async isViewPresent(): Promise {
return this.viewAction.isPresent();
}
- async isDownloadPresent() {
+ async isDownloadPresent(): Promise {
return this.downloadAction.isPresent();
}
- async isEditFolderPresent() {
+ async isEditFolderPresent(): Promise {
return this.editFolderAction.isPresent();
}
- async isEditOfflinePresent() {
+ async isEditOfflinePresent(): Promise {
return this.editOfflineAction.isPresent();
}
- async isCancelEditingPresent() {
+ async isCancelEditingPresent(): Promise {
return this.cancelEditingAction.isPresent();
}
- async isCopyPresent() {
+ async isCopyPresent(): Promise {
return this.copyAction.isPresent();
}
- async isMovePresent() {
+ async isMovePresent(): Promise {
return this.moveAction.isPresent();
}
- async isDeletePresent() {
+ async isDeletePresent(): Promise {
return this.deleteAction.isPresent();
}
- async isManagePermissionsPresent() {
+ async isManagePermissionsPresent(): Promise {
return this.managePermissionsAction.isPresent();
}
- async isManageVersionsPresent() {
+ async isManageVersionsPresent(): Promise {
return this.manageVersionsAction.isPresent();
}
- async isUploadNewVersionPresent() {
+ async isUploadNewVersionPresent(): Promise {
return this.uploadNewVersionAction.isPresent();
}
- async isFavoritePresent() {
+ async isFavoritePresent(): Promise {
return this.favoriteAction.isPresent();
}
- async isRemoveFavoritePresent() {
+ async isRemoveFavoritePresent(): Promise {
return this.removeFavoriteAction.isPresent();
}
- async isToggleFavoritePresent() {
+ async isToggleFavoritePresent(): Promise {
return this.toggleFavoriteAction.isPresent();
}
- async isToggleRemoveFavoritePresent() {
+ async isToggleRemoveFavoritePresent(): Promise {
return this.toggleRemoveFavoriteAction.isPresent();
}
- async isJoinLibraryPresent() {
+ async isJoinLibraryPresent(): Promise {
return this.joinAction.isPresent();
}
- async isCancelJoinPresent() {
+ async isCancelJoinPresent(): Promise {
return this.cancelJoinAction.isPresent();
}
- async isLeaveLibraryPresent() {
+ async isLeaveLibraryPresent(): Promise {
return this.leaveAction.isPresent();
}
- async isPermanentDeletePresent() {
+ async isPermanentDeletePresent(): Promise {
return this.permanentDeleteAction.isPresent();
}
- async isRestorePresent() {
+ async isRestorePresent(): Promise {
return this.restoreAction.isPresent();
}
- async isSharePresent() {
+ async isSharePresent(): Promise {
return this.shareAction.isPresent();
}
- async isSharedLinkSettingsPresent() {
+ async isSharedLinkSettingsPresent(): Promise {
return this.shareEditAction.isPresent();
}
- async isViewDetailsPresent() {
+ async isViewDetailsPresent(): Promise {
return this.viewDetailsAction.isPresent();
}
- async isCreateFolderPresent() {
- return this.createFolderAction.isPresent();
- }
- async isCreateFolderEnabled() {
- return this.createFolderAction.isEnabled();
+ async isCreateFolderEnabled(): Promise {
+ return (await this.createFolderAction.isPresent()) && (await this.createFolderAction.isEnabled());
}
- async isCreateLibraryPresent() {
- return this.createLibraryAction.isPresent();
- }
- async isCreateLibraryEnabled() {
- return this.createLibraryAction.isEnabled();
+ async isCreateLibraryEnabled(): Promise {
+ return (await this.createLibraryAction.isPresent()) && (await this.createLibraryAction.isEnabled());
}
- async isUploadFilePresent() {
- return this.uploadFileAction.isPresent();
- }
- async isUploadFileEnabled() {
- return this.uploadFileAction.isEnabled();
+ async isUploadFileEnabled(): Promise {
+ return (await this.uploadFileAction.isPresent()) && (await this.uploadFileAction.isEnabled());
}
- async isUploadFolderPresent() {
- return this.uploadFolderAction.isPresent();
- }
- async isUploadFolderEnabled() {
- return this.uploadFolderAction.isEnabled();
+ async isUploadFolderEnabled(): Promise {
+ return (await this.uploadFolderAction.isPresent()) && (await this.uploadFolderAction.isEnabled());
}
+ async isCreateFileFromTemplateEnabled(): Promise {
+ return (await this.createFileFromTemplateAction.isPresent()) && (await this.createFileFromTemplateAction.isEnabled());
+ }
- async clickCreateFolder() {
+ async isCreateFolderFromTemplateEnabled(): Promise {
+ return (await this.createFolderFromTemplateAction.isPresent()) && (await this.createFolderFromTemplateAction.isEnabled());
+ }
+
+ async clickCreateFolder(): Promise {
const action = this.createFolderAction;
await action.click();
}
- async clickCreateLibrary() {
+ async clickCreateLibrary(): Promise {
const action = this.createLibraryAction;
await action.click();
}
- async clickUploadFile() {
- const action = this.uploadFileAction;
+ async clickCreateFileFromTemplate(): Promise {
+ const action = this.createFileFromTemplateAction;
await action.click();
}
- async clickUploadFolder() {
- const action = this.uploadFolderAction;
+ async clickCreateFolderFromTemplate(): Promise {
+ const action = this.createFolderFromTemplateAction;
await action.click();
}
-
}
diff --git a/e2e/components/metadata-card/metadata-card.ts b/e2e/components/metadata-card/metadata-card.ts
index b451bb380..3dfd5cd3e 100644
--- a/e2e/components/metadata-card/metadata-card.ts
+++ b/e2e/components/metadata-card/metadata-card.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -39,7 +39,7 @@ export class MetadataCard extends Component {
expandButton: ElementFinder = this.component.element(by.css(MetadataCard.selectors.expandButton));
expansionPanels: ElementArrayFinder = this.component.all(by.css(MetadataCard.selectors.expansionPanel));
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super(MetadataCard.selectors.root, ancestor);
}
diff --git a/e2e/components/pagination/pagination.ts b/e2e/components/pagination/pagination.ts
index 49e05a198..1d118016b 100755
--- a/e2e/components/pagination/pagination.ts
+++ b/e2e/components/pagination/pagination.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -53,7 +53,7 @@ export class Pagination extends Component {
menu: Menu = new Menu();
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super(Pagination.selectors.root, ancestor);
}
diff --git a/e2e/components/search/filters/created-date-filter.ts b/e2e/components/search/filters/created-date-filter.ts
new file mode 100755
index 000000000..ed413039f
--- /dev/null
+++ b/e2e/components/search/filters/created-date-filter.ts
@@ -0,0 +1,137 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { ElementFinder, by, protractor } from 'protractor';
+import { GenericFilterPanel } from './generic-filter-panel';
+import { Utils } from '../../../utilities/utils';
+
+export class CreatedDateFilter extends GenericFilterPanel {
+ constructor() {
+ super('Created date');
+ }
+
+ fromField: ElementFinder = this.panelExpanded.element(by.cssContainingText('.adf-search-date-range .mat-form-field', 'From'));
+ fromInput: ElementFinder = this.fromField.element(by.css(`[data-automation-id='date-range-from-input']`));
+ fromFieldError: ElementFinder = this.fromField.element(by.css(`[data-automation-id='date-range-from-error']`));
+ toField: ElementFinder = this.panelExpanded.element(by.cssContainingText('.adf-search-date-range .mat-form-field', 'To'));
+ toInput: ElementFinder = this.toField.element(by.css(`[data-automation-id='date-range-to-input']`))
+ toFieldError: ElementFinder = this.toField.element(by.css(`[data-automation-id='date-range-to-error']`))
+ clearButton: ElementFinder = this.panel.element(by.css('.adf-facet-buttons [data-automation-id="date-range-clear-btn"]'));
+ applyButton: ElementFinder = this.panel.element(by.css('.adf-facet-buttons [data-automation-id="date-range-apply-btn"]'));
+
+ async isFromFieldDisplayed(): Promise {
+ return (await this.fromField.isPresent()) && (await this.fromField.isDisplayed());
+ }
+
+ async isFromErrorDisplayed(): Promise {
+ return (await this.fromFieldError.isPresent()) && (await this.fromFieldError.isDisplayed());
+ }
+
+ async isToFieldDisplayed(): Promise {
+ return (await this.toField.isPresent()) && (await this.toField.isDisplayed());
+ }
+
+ async isToErrorDisplayed(): Promise {
+ return (await this.toFieldError.isPresent()) && (await this.toFieldError.isDisplayed());
+ }
+
+ async isClearButtonEnabled(): Promise {
+ return await this.clearButton.isEnabled();
+ }
+
+ async isApplyButtonEnabled(): Promise {
+ return await this.applyButton.isEnabled();
+ }
+
+ async clickClearButton(): Promise {
+ if ( await this.isClearButtonEnabled() ) {
+ await this.clearButton.click();
+ }
+ }
+
+ async clickApplyButton(): Promise {
+ if ( await this.isApplyButtonEnabled() ) {
+ await this.applyButton.click();
+ }
+ }
+
+ async getFromValue(): Promise {
+ try {
+ const value = await this.fromInput.getAttribute('value');
+ return value;
+ } catch (error) {
+ return '';
+ }
+ }
+
+ async getFromError(): Promise {
+ try {
+ const error = await this.fromFieldError.getText();
+ return error;
+ } catch (err) {
+ return '';
+ }
+ }
+
+ async getToValue(): Promise {
+ try {
+ const value = await this.toInput.getAttribute('value');
+ return value;
+ } catch (err) {
+ return '';
+ }
+ }
+
+ async getToError(): Promise {
+ try {
+ const error = await this.toFieldError.getText();
+ return error;
+ } catch (err) {
+ return '';
+ }
+ }
+
+ async resetPanel(): Promise {
+ const fromValue = await this.getFromValue();
+ const toValue = await this.getToValue();
+ if ( fromValue.length > 0 || toValue.length > 0 ) {
+ await this.expandPanel();
+ await this.clickClearButton();
+ await this.collapsePanel();
+ }
+ }
+
+ async enterFromDate(date: string): Promise {
+ await this.expandPanel();
+ await Utils.clearFieldWithBackspace(this.fromInput);
+ await this.fromInput.sendKeys(date, protractor.Key.TAB);
+ }
+
+ async enterToDate(date: string): Promise {
+ await this.expandPanel();
+ await Utils.clearFieldWithBackspace(this.toInput);
+ await this.toInput.sendKeys(date, protractor.Key.TAB);
+ }
+}
diff --git a/e2e/components/search/filters/facet-filter.ts b/e2e/components/search/filters/facet-filter.ts
new file mode 100755
index 000000000..42f196c30
--- /dev/null
+++ b/e2e/components/search/filters/facet-filter.ts
@@ -0,0 +1,96 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { ElementFinder, ElementArrayFinder, by, browser } from 'protractor';
+import { GenericFilterPanel } from './generic-filter-panel';
+
+export class FacetFilter extends GenericFilterPanel {
+ private readonly locators = {
+ checkbox: '.mat-checkbox',
+ checkboxChecked: '.mat-checkbox.mat-checkbox-checked',
+ button: '.adf-facet-buttons button',
+ categoryInput: 'input[placeholder="Filter category"',
+ facetsFilter: '.adf-facet-result-filter'
+ }
+
+ get facets(): ElementArrayFinder { return this.panelExpanded.all(by.css(this.locators.checkbox)); }
+ get selectedFacets(): ElementArrayFinder { return this.panel.all(by.css(this.locators.checkboxChecked)); }
+ get clearButton(): ElementFinder { return this.panel.element(by.cssContainingText(this.locators.button, 'Clear all')); }
+ get facetsFilter(): ElementFinder { return this.panelExpanded.element(by.css(this.locators.facetsFilter)); }
+ get filterCategoryInput(): ElementFinder { return this.facetsFilter.element(by.css(this.locators.categoryInput)); }
+
+ async getFiltersValues(): Promise {
+ const list: string[] = await this.facets.map(option => {
+ return option.getText();
+ });
+ return list;
+ }
+
+ async getFiltersCheckedValues(): Promise {
+ const list: string[] = await this.selectedFacets.map(option => {
+ return option.getText();
+ });
+ return list;
+ }
+
+ async resetPanel(): Promise {
+ if ( (await this.selectedFacets.count()) > 0 ) {
+ await this.expandPanel();
+ await this.selectedFacets.each(async elem => {
+ await elem.click();
+ });
+ }
+ await this.expandPanel();
+ }
+
+ async isFilterFacetsDisplayed(): Promise {
+ return await this.facetsFilter.isDisplayed();
+ }
+
+ async isClearButtonEnabled(): Promise {
+ return await this.clearButton.isEnabled();
+ }
+
+ async clickClearButton(): Promise {
+ if ( await this.isClearButtonEnabled() ) {
+ await this.clearButton.click();
+ }
+ }
+
+ async isFilterCategoryInputDisplayed(): Promise {
+ return await this.filterCategoryInput.isDisplayed();
+ }
+
+ async checkCategory(name: string): Promise {
+ const option = this.facets.filter(async (elem) => (await elem.getText()).includes(name)).first();
+ await browser.executeScript(`arguments[0].scrollIntoView();`, option);
+ await browser.actions().mouseMove(option).perform();
+ await browser.actions().click().perform();
+ }
+
+ async filterCategoriesBy(name: string): Promise {
+ await this.filterCategoryInput.sendKeys(name);
+ }
+}
diff --git a/e2e/components/search/filters/generic-filter-panel.ts b/e2e/components/search/filters/generic-filter-panel.ts
new file mode 100755
index 000000000..44648d04e
--- /dev/null
+++ b/e2e/components/search/filters/generic-filter-panel.ts
@@ -0,0 +1,71 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { ElementFinder, by, browser } from 'protractor';
+
+export class GenericFilterPanel {
+ private filterName: string;
+
+ constructor(filterName: string) {
+ this.filterName = filterName;
+ }
+
+ private readonly selectors = {
+ root: 'adf-search-filter',
+
+ panel: '.mat-expansion-panel',
+ panelExpanded: '.mat-expansion-panel.mat-expanded',
+ panelHeader: '.mat-expansion-panel-header'
+ }
+
+ get panel(): ElementFinder { return browser.element(by.cssContainingText(this.selectors.panel, this.filterName)); }
+ get panelExpanded(): ElementFinder { return browser.element(by.cssContainingText(this.selectors.panelExpanded, this.filterName)); }
+ get panelHeader(): ElementFinder { return this.panel.element(by.css(this.selectors.panelHeader)); }
+
+ async clickPanelHeader(): Promise {
+ await this.panelHeader.click();
+ }
+
+ async isPanelDisplayed(): Promise {
+ return (await browser.isElementPresent(this.panel)) && (await this.panel.isDisplayed());
+ }
+
+ async isPanelExpanded(): Promise {
+ return (await this.panelExpanded.isPresent()) && (await this.panelExpanded.isDisplayed());
+ }
+
+ async expandPanel(): Promise {
+ if ( !(await this.isPanelExpanded()) ) {
+ await this.clickPanelHeader();
+ }
+ }
+
+ async collapsePanel(): Promise {
+ if ( await this.isPanelExpanded() ) {
+ await this.clickPanelHeader();
+ }
+ }
+
+}
diff --git a/e2e/components/search/filters/size-filter.ts b/e2e/components/search/filters/size-filter.ts
new file mode 100755
index 000000000..2c4caf76f
--- /dev/null
+++ b/e2e/components/search/filters/size-filter.ts
@@ -0,0 +1,92 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { ElementFinder, by, ElementArrayFinder } from 'protractor';
+import { GenericFilterPanel } from './generic-filter-panel';
+
+export class SizeFilter extends GenericFilterPanel {
+ constructor() {
+ super('Size');
+ }
+
+ facets: ElementArrayFinder = this.panelExpanded.all(by.css('.mat-checkbox'));
+ selectedFacets: ElementArrayFinder = this.panel.all(by.css('.mat-checkbox.mat-checkbox-checked'));
+ clearButton: ElementFinder = this.panel.element(by.cssContainingText('.adf-facet-buttons button', 'Clear all'));
+
+ async getFiltersValues(): Promise {
+ const list: string[] = await this.facets.map(option => {
+ return option.getText();
+ });
+ return list;
+ }
+
+ async getFiltersCheckedValues(): Promise {
+ const list: string[] = await this.selectedFacets.map(option => {
+ return option.getText();
+ });
+ return list;
+ }
+
+ async resetPanel(): Promise {
+ if ( (await this.selectedFacets.count()) > 0 ) {
+ await this.expandPanel();
+ await this.selectedFacets.each(async elem => {
+ await elem.click();
+ });
+ }
+ await this.collapsePanel();
+ }
+
+ async isClearButtonEnabled(): Promise {
+ return await this.clearButton.isEnabled();
+ }
+
+ async clickClearButton(): Promise {
+ if ( await this.isClearButtonEnabled() ) {
+ await this.clearButton.click();
+ }
+ }
+
+ async checkSizeSmall(): Promise {
+ const small = this.facets.filter(async (elem) => await elem.getText() === 'Small').first();
+ await small.click();
+ }
+
+ async checkSizeMedium(): Promise {
+ const medium = this.facets.filter(async (elem) => await elem.getText() === 'Medium').first();
+ await medium.click();
+ }
+
+ async checkSizeLarge(): Promise {
+ const large = this.facets.filter(async (elem) => await elem.getText() === 'Large').first();
+ await large.click();
+ }
+
+ async checkSizeHuge(): Promise {
+ const huge = this.facets.filter(async (elem) => await elem.getText() === 'Huge').first();
+ await huge.click();
+ }
+
+}
diff --git a/e2e/components/search/search-filters.ts b/e2e/components/search/search-filters.ts
new file mode 100755
index 000000000..271462fad
--- /dev/null
+++ b/e2e/components/search/search-filters.ts
@@ -0,0 +1,60 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { ElementFinder, by, browser } from 'protractor';
+import { Component } from '../component';
+import { SizeFilter } from './filters/size-filter';
+import { CreatedDateFilter } from './filters/created-date-filter';
+import { FacetFilter } from './filters/facet-filter';
+
+export class SearchFilters extends Component {
+ private static selectors = {
+ root: 'adf-search-filter',
+ };
+
+ mainPanel: ElementFinder = browser.element(by.css(SearchFilters.selectors.root));
+ resetAllButton: ElementFinder = this.component.element(by.cssContainingText('.mat-button', 'Reset all'));
+
+ size = new SizeFilter();
+ createdDate = new CreatedDateFilter();
+ fileType = new FacetFilter('File type');
+ creator = new FacetFilter('Creator');
+ modifier = new FacetFilter('Modifier');
+ location = new FacetFilter('Location');
+ modifiedDate = new FacetFilter('Modified date');
+
+ constructor(ancestor?: string) {
+ super(SearchFilters.selectors.root, ancestor);
+ }
+
+ async isSearchFiltersPanelDisplayed(): Promise {
+ return (await this.mainPanel.isPresent()) && (await this.mainPanel.isDisplayed());
+ }
+
+ async clickResetAllButton(): Promise {
+ await this.resetAllButton.click();
+ }
+
+}
diff --git a/e2e/components/search/search-input.ts b/e2e/components/search/search-input.ts
index 091cb5046..c72a65dd6 100755
--- a/e2e/components/search/search-input.ts
+++ b/e2e/components/search/search-input.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -34,7 +34,7 @@ export class SearchInput extends Component {
searchContainer: '.app-search-container',
searchButton: '.app-search-button',
searchControl: '.app-search-control',
- searchInput: 'app-control-input',
+ searchInput: `input[id='app-control-input']`,
searchOptionsArea: 'search-options',
optionCheckbox: '.mat-checkbox',
clearButton: '.app-clear-icon'
@@ -43,14 +43,14 @@ export class SearchInput extends Component {
searchButton: ElementFinder = this.component.element(by.css(SearchInput.selectors.searchButton));
searchContainer: ElementFinder = browser.element(by.css(SearchInput.selectors.searchContainer));
searchControl: ElementFinder = browser.element(by.css(SearchInput.selectors.searchControl));
- searchBar: ElementFinder = browser.element(by.id(SearchInput.selectors.searchInput));
+ searchInput: ElementFinder = browser.element(by.css(SearchInput.selectors.searchInput));
searchOptionsArea: ElementFinder = browser.element(by.id(SearchInput.selectors.searchOptionsArea));
searchFilesOption: ElementFinder = this.searchOptionsArea.element(by.cssContainingText(SearchInput.selectors.optionCheckbox, 'Files'));
searchFoldersOption: ElementFinder = this.searchOptionsArea.element(by.cssContainingText(SearchInput.selectors.optionCheckbox, 'Folders'));
searchLibrariesOption: ElementFinder = this.searchOptionsArea.element(by.cssContainingText(SearchInput.selectors.optionCheckbox, 'Libraries'));
clearSearchButton: ElementFinder = this.searchContainer.$(SearchInput.selectors.clearButton);
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super(SearchInput.selectors.root, ancestor);
}
@@ -58,6 +58,10 @@ export class SearchInput extends Component {
await browser.wait(EC.presenceOf(this.searchControl), BROWSER_WAIT_TIMEOUT, '--- timeout waitForSearchControl ---');
}
+ async waitForSearchInputToBeInteractive() {
+ await browser.wait(EC.elementToBeClickable(this.searchControl), BROWSER_WAIT_TIMEOUT, '--- timeout waitForSearchControl ---');
+ }
+
async isSearchContainerDisplayed() {
return (await this.searchContainer.isDisplayed()) && (await this.searchButton.isDisplayed());
}
@@ -162,9 +166,9 @@ export class SearchInput extends Component {
}
async searchFor(text: string) {
- await browser.wait(EC.elementToBeClickable(this.searchBar), BROWSER_WAIT_TIMEOUT, '---- timeout waiting for searchBar to be clickable');
- await this.searchBar.clear();
- await this.searchBar.sendKeys(text);
- await this.searchBar.sendKeys(protractor.Key.ENTER);
+ await this.waitForSearchInputToBeInteractive();
+ await Utils.clearFieldWithBackspace(this.searchInput);
+ await this.searchInput.sendKeys(text);
+ await this.searchInput.sendKeys(protractor.Key.ENTER);
}
}
diff --git a/e2e/components/search/search-sorting-picker.ts b/e2e/components/search/search-sorting-picker.ts
new file mode 100755
index 000000000..71ca87ca1
--- /dev/null
+++ b/e2e/components/search/search-sorting-picker.ts
@@ -0,0 +1,141 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { ElementFinder, by, browser, ExpectedConditions as EC, ElementArrayFinder } from 'protractor';
+import { BROWSER_WAIT_TIMEOUT } from '../../configs';
+import { Component } from '../component';
+
+export class SearchSortingPicker extends Component {
+ private static selectors = {
+ root: 'adf-search-sorting-picker',
+
+ sortByOption: '.mat-option .mat-option-text'
+ };
+
+ sortOrderButton: ElementFinder = this.component.element(by.css('button[mat-icon-button]'));
+ sortByDropdownCollapsed: ElementFinder = this.component.element(by.css('.mat-select'));
+ sortByDropdownExpanded: ElementFinder = browser.element(by.css('.mat-select-panel'));
+ sortByList: ElementArrayFinder = this.sortByDropdownExpanded.all(by.css(SearchSortingPicker.selectors.sortByOption));
+
+ constructor(ancestor?: string) {
+ super(SearchSortingPicker.selectors.root, ancestor);
+ }
+
+ async waitForSortByDropdownToExpand(): Promise {
+ await browser.wait(EC.visibilityOf(this.sortByDropdownExpanded), BROWSER_WAIT_TIMEOUT, 'Timeout waiting for sortBy dropdown to expand');
+ }
+
+ async isSortOrderButtonDisplayed(): Promise {
+ return (await this.sortOrderButton.isPresent()) && (await this.sortOrderButton.isDisplayed());
+ }
+
+ async getSortOrder(): Promise<'ASC' | 'DESC' | ''> {
+ const orderArrow = await this.sortOrderButton.getText();
+
+ if ( orderArrow.includes('upward') ) {
+ return 'ASC'
+ } else if ( orderArrow.includes('downward') ) {
+ return 'DESC'
+ } else {
+ return '';
+ }
+ }
+
+ async isSortByOptionDisplayed(): Promise {
+ return (await this.sortByDropdownCollapsed.isPresent()) && (await this.sortByDropdownCollapsed.isDisplayed());
+ }
+
+ async isSortByDropdownExpanded(): Promise {
+ return (await this.sortByDropdownExpanded.isPresent()) && (await this.sortByDropdownExpanded.isDisplayed());
+ }
+
+ async getSelectedSortByOption(): Promise {
+ return await this.sortByDropdownCollapsed.getText();
+ }
+
+ async clickSortByDropdown(): Promise {
+ await this.sortByDropdownCollapsed.click();
+ await this.waitForSortByDropdownToExpand();
+ }
+
+ async getSortByOptionsList(): Promise {
+ const list: string[] = await this.sortByList.map(async option => {
+ return option.getText();
+ });
+ return list;
+ }
+
+ async sortByOption(option: string): Promise {
+ if ( !(await this.isSortByDropdownExpanded()) ) {
+ await this.clickSortByDropdown();
+ }
+ const elem = browser.element(by.cssContainingText(SearchSortingPicker.selectors.sortByOption, option));
+ await elem.click();
+ }
+
+ async sortByName(): Promise {
+ await this.sortByOption('Filename');
+ }
+
+ async sortByRelevance(): Promise {
+ await this.sortByOption('Relevance');
+ }
+
+ async sortByTitle(): Promise {
+ await this.sortByOption('Title');
+ }
+
+ async sortByModifiedDate(): Promise {
+ await this.sortByOption('Modified date');
+ }
+
+ async sortByModifier(): Promise {
+ await this.sortByOption('Modifier');
+ }
+
+ async sortByCreatedDate(): Promise {
+ await this.sortByOption('Created date');
+ }
+
+ async sortBySize(): Promise {
+ await this.sortByOption('Size');
+ }
+
+ async sortByType(): Promise {
+ await this.sortByOption('Type');
+ }
+
+ async setSortOrderASC(): Promise {
+ if ( (await this.getSortOrder()) !== 'ASC' ) {
+ await this.sortOrderButton.click();
+ }
+ }
+
+ async setSortOrderDESC(): Promise {
+ if ( (await this.getSortOrder()) !== 'DESC' ) {
+ await this.sortOrderButton.click();
+ }
+ }
+}
diff --git a/e2e/components/sidenav/sidenav.ts b/e2e/components/sidenav/sidenav.ts
index 6a57252b2..24b231f2f 100755
--- a/e2e/components/sidenav/sidenav.ts
+++ b/e2e/components/sidenav/sidenav.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -55,6 +55,7 @@ export class Sidenav extends Component {
links: ElementArrayFinder = this.component.all(by.css(Sidenav.selectors.link));
activeLink: ElementFinder = this.component.element(by.css(Sidenav.selectors.activeClass));
+
newButton: ElementArrayFinder = this.component.all(by.css(Sidenav.selectors.newButton));
personalFiles: ElementFinder = this.component.element(by.css(Sidenav.selectors.personalFiles));
@@ -68,11 +69,11 @@ export class Sidenav extends Component {
menu: Menu = new Menu();
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super(Sidenav.selectors.root, ancestor);
}
- private async expandMenu(name: string) {
+ private async expandMenu(name: string): Promise {
try{
if (await element(by.cssContainingText('.mat-expanded', name)).isPresent()) {
@@ -89,37 +90,45 @@ export class Sidenav extends Component {
}
}
- async openNewMenu() {
- const { menu, newButton } = this;
-
- await newButton.click();
- await menu.waitForMenuToOpen();
+ async openNewMenu(): Promise {
+ await this.newButton.click();
+ await this.menu.waitForMenuToOpen();
}
- async openCreateFolderDialog() {
+ async openCreateFolderDialog(): Promise {
await this.openNewMenu();
- await this.menu.clickMenuItem('Create Folder');
+ await this.menu.clickCreateFolder();
}
- async openCreateLibraryDialog() {
+ async openCreateLibraryDialog(): Promise {
await this.openNewMenu();
- await this.menu.clickMenuItem('Create Library');
+ await this.menu.clickCreateLibrary();
}
- async isActive(name: string) {
+ async openCreateFileFromTemplateDialog(): Promise {
+ await this.openNewMenu();
+ await this.menu.clickCreateFileFromTemplate();
+ }
+
+ async openCreateFolderFromTemplateDialog(): Promise {
+ await this.openNewMenu();
+ await this.menu.clickCreateFolderFromTemplate();
+ }
+
+ async isActive(name: string): Promise {
return (await this.getLinkLabel(name).getAttribute('class')).includes(Sidenav.selectors.activeClassName);
}
- async childIsActive(name: string) {
+ async childIsActive(name: string): Promise {
const childClass = await this.getLinkLabel(name).element(by.css('span')).getAttribute('class');
return childClass.includes(Sidenav.selectors.activeChild);
}
- getLink(name: string) {
+ getLink(name: string): ElementFinder {
return this.getLinkLabel(name).element(by.xpath('..'));
}
- getLinkLabel(name: string) {
+ getLinkLabel(name: string): ElementFinder {
switch (name) {
case 'Personal Files': return this.personalFiles;
case 'File Libraries': return this.fileLibraries;
@@ -133,37 +142,35 @@ export class Sidenav extends Component {
}
}
- getActiveLink() {
+ getActiveLink(): ElementFinder {
return this.activeLink;
}
- async getLinkTooltip(name: string) {
+ async getLinkTooltip(name: string): Promise {
const link = this.getLinkLabel(name);
-
const condition = () => link.getAttribute('title').then(value => value && value.length > 0);
await browser.actions().mouseMove(link).perform();
-
await browser.wait(condition, BROWSER_WAIT_TIMEOUT);
return link.getAttribute('title');
}
- async clickLink(name: string) {
+ async clickLink(name: string): Promise {
try{
const link = this.getLinkLabel(name);
await Utils.waitUntilElementClickable(link);
- return await link.click();
+ await link.click();
} catch (error) {
console.log('---- sidebar navigation clickLink catch error: ', error);
}
}
- async isFileLibrariesMenuExpanded() {
+ async isFileLibrariesMenuExpanded(): Promise {
return element(by.cssContainingText('.mat-expanded', SIDEBAR_LABELS.FILE_LIBRARIES)).isPresent();
}
- async expandFileLibraries() {
+ async expandFileLibraries(): Promise {
await this.expandMenu(SIDEBAR_LABELS.FILE_LIBRARIES);
}
diff --git a/e2e/components/toolbar/toolbar.ts b/e2e/components/toolbar/toolbar.ts
index 7c5627512..e0e69dfdd 100755
--- a/e2e/components/toolbar/toolbar.ts
+++ b/e2e/components/toolbar/toolbar.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -64,7 +64,7 @@ export class Toolbar extends Component {
permanentlyDeleteButton: ElementFinder = this.component.element(by.css(Toolbar.selectors.permanentlyDelete));
restoreButton: ElementFinder = this.component.element(by.css(Toolbar.selectors.restore));
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super(Toolbar.selectors.root, ancestor);
}
diff --git a/e2e/components/viewer/viewer.ts b/e2e/components/viewer/viewer.ts
index ed6af6c02..43be053c4 100755
--- a/e2e/components/viewer/viewer.ts
+++ b/e2e/components/viewer/viewer.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -50,9 +50,9 @@ export class Viewer extends Component {
viewerExtensionContent: ElementFinder = this.component.element(by.css(Viewer.selectors.viewerExtensionContent));
pdfViewerContentPages: ElementArrayFinder = this.component.all(by.css(Viewer.selectors.pdfViewerContentPage));
- toolbar = new Toolbar(this.component);
+ toolbar = new Toolbar(Viewer.selectors.root);
- constructor(ancestor?: ElementFinder) {
+ constructor(ancestor?: string) {
super(Viewer.selectors.root, ancestor);
}
diff --git a/e2e/configs.ts b/e2e/configs.ts
index 5d5414620..4ca9262c4 100755
--- a/e2e/configs.ts
+++ b/e2e/configs.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/pages/browsing-page.ts b/e2e/pages/browsing-page.ts
index f11b78f20..c3d86b06d 100755
--- a/e2e/pages/browsing-page.ts
+++ b/e2e/pages/browsing-page.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -28,12 +28,12 @@ import { SIDEBAR_LABELS } from './../configs';
import { Page } from './page';
export class BrowsingPage extends Page {
- header = new Header(this.app);
- sidenav = new Sidenav(this.app);
- toolbar = new Toolbar(this.app);
- breadcrumb = new Breadcrumb(this.app);
- dataTable = new DataTable(this.app);
- pagination = new Pagination(this.app);
+ header = new Header(this.appRoot);
+ sidenav = new Sidenav(this.appRoot);
+ toolbar = new Toolbar(this.appRoot);
+ breadcrumb = new Breadcrumb(this.appRoot);
+ dataTable = new DataTable(this.appRoot);
+ pagination = new Pagination(this.appRoot);
async signOut() {
await this.header.userInfo.signOut();
diff --git a/e2e/pages/login-page.ts b/e2e/pages/login-page.ts
index 4bcc34750..479defe76 100755
--- a/e2e/pages/login-page.ts
+++ b/e2e/pages/login-page.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -29,7 +29,7 @@ import { Page } from './page';
import { ADMIN_USERNAME, ADMIN_PASSWORD, BROWSER_WAIT_TIMEOUT, APP_ROUTES } from '../configs';
export class LoginPage extends Page {
- login: LoginComponent = new LoginComponent(this.app);
+ login: LoginComponent = new LoginComponent(this.appRoot);
/** @override */
constructor() {
diff --git a/e2e/pages/page.ts b/e2e/pages/page.ts
index 541a271b7..eb05cc09b 100755
--- a/e2e/pages/page.ts
+++ b/e2e/pages/page.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -29,7 +29,7 @@ import { Utils } from '../utilities/utils';
export abstract class Page {
protected static locators = {
- app: 'app-root',
+ root: 'app-root',
layout: 'app-layout',
overlay: '.cdk-overlay-container',
dialogContainer: '.mat-dialog-container',
@@ -42,7 +42,8 @@ export abstract class Page {
genericErrorTitle: '.generic-error__title'
};
- app: ElementFinder = browser.element(by.css(Page.locators.app));
+ appRoot: string = Page.locators.root;
+
layout: ElementFinder = browser.element(by.css(Page.locators.layout));
overlay: ElementFinder = browser.element(by.css(Page.locators.overlay));
snackBar: ElementFinder = browser.element(by.css(Page.locators.snackBar));
diff --git a/e2e/pages/pages.ts b/e2e/pages/pages.ts
index 1a2bd70d3..22950897c 100755
--- a/e2e/pages/pages.ts
+++ b/e2e/pages/pages.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/pages/search-results-page.ts b/e2e/pages/search-results-page.ts
index f45bb32aa..038c6663a 100755
--- a/e2e/pages/search-results-page.ts
+++ b/e2e/pages/search-results-page.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -23,37 +23,53 @@
* along with Alfresco. If not, see .
*/
-import { browser, by } from 'protractor';
+import { browser, by, By, ElementFinder, ElementArrayFinder } from 'protractor';
import { BrowsingPage } from './browsing-page';
+import { SearchSortingPicker } from '../components/search/search-sorting-picker';
+import { SearchFilters } from '../components/search/search-filters';
export class SearchResultsPage extends BrowsingPage {
private static selectors = {
root: 'aca-search-results',
- filter: 'adf-search-filter',
- expansionPanel: 'mat-expansion-panel',
- size: '#expansion-panel-SEARCH.CATEGORIES.SIZE',
- createdDate: '#expansion-panel-SEARCH.CATEGORIES.CREATED_DATE',
- modifiedDate: '#expansion-panel-SEARCH.CATEGORIES.MODIFIED_DATE',
- fileType: '#expansion-panel-SEARCH.FACET_FIELDS.FILE_TYPE',
- creator: '#expansion-panel-SEARCH.CATEGORIES.CREATOR',
- modifier: '#expansion-panel-SEARCH.CATEGORIES.MODIFIER',
- location: '#expansion-panel-SEARCH.CATEGORIES.LOCATION',
-
- resultsContent: 'adf-search-results__content',
resultsContentHeader: '.adf-search-results__content-header',
- resultsInfoText: 'adf-search-results--info-text',
- resultsFacets: 'adf-search-results__facets',
-
- sortingPicker: 'adf-sorting-picker'
+ infoText: '.adf-search-results--info-text',
+ chipList: '.adf-search-chip-list',
+ chip: '.mat-chip',
+ chipCloseIcon: '.mat-chip-remove'
};
- async waitForResults() {
+ root: ElementFinder = browser.element(by.css(SearchResultsPage.selectors.root));
+ chipList: ElementFinder = this.root.element(by.css(SearchResultsPage.selectors.chipList));
+ infoText: ElementFinder = this.root.element(by.css(SearchResultsPage.selectors.infoText));
+
+ sortingPicker = new SearchSortingPicker(SearchResultsPage.selectors.root);
+ filters = new SearchFilters(SearchResultsPage.selectors.root);
+
+ async waitForResults(): Promise {
await this.dataTable.waitForBody();
}
- async getResultsHeader() {
- return browser.element(by.css(SearchResultsPage.selectors.resultsContentHeader)).getText();
+ async getResultsHeader(): Promise {
+ return await browser.element(by.css(SearchResultsPage.selectors.resultsContentHeader)).getText();
+ }
+
+ async getResultsFoundText(): Promise {
+ return await this.infoText.getText();
+ }
+
+ async getResultsChipsValues(): Promise {
+ const chips: ElementArrayFinder = this.chipList.all(by.css(SearchResultsPage.selectors.chip));
+ const chipsValues: string[] = await chips.map(async elem => {
+ return (await elem.getText()).replace(`\ncancel`, '');
+ });
+ return chipsValues;
+ }
+
+ async removeChip(chipName: string): Promise {
+ const chip: ElementFinder = browser.element(By.cssContainingText(SearchResultsPage.selectors.chip, chipName));
+ const closeChip: ElementFinder = chip.element(by.css(SearchResultsPage.selectors.chipCloseIcon));
+ await closeChip.click();
}
}
diff --git a/e2e/suites/actions-available/files-folders/favorites.test.ts b/e2e/suites/actions-available/files-folders/favorites.test.ts
deleted file mode 100755
index 2351ed679..000000000
--- a/e2e/suites/actions-available/files-folders/favorites.test.ts
+++ /dev/null
@@ -1,182 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { LoginPage, BrowsingPage } from '../../../pages/pages';
-import { FILES } from '../../../configs';
-import { RepoClient } from '../../../utilities/repo-client/repo-client';
-import { Utils } from '../../../utilities/utils';
-import * as data from './test-data-files-folders';
-import * as testUtil from '../test-util';
-
-describe('File/folder actions : on Favorites : ', () => {
-
- const random = Utils.random();
-
- const username = `user-${random}`;
-
- const parent = `parent-${random}`; let parentId;
-
- let fileDocxFavId, fileFavId, fileDocxSharedFavId, fileSharedFavId, fileFavLockedId, fileSharedFavLockedId;
- let folderFavId, folderFav2Id;
-
- const apis = {
- admin: new RepoClient(),
- user: new RepoClient(username, username)
- };
-
- const loginPage = new LoginPage();
- const page = new BrowsingPage();
-
- beforeAll(async (done) => {
- await apis.admin.people.createUser({ username });
-
- parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
-
- fileDocxFavId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxFav.name)).entry.id;
- fileFavId = (await apis.user.nodes.createFile(data.fileFav.name, parentId)).entry.id;
- fileDocxSharedFavId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxSharedFav.name)).entry.id;
- fileSharedFavId = (await apis.user.nodes.createFile(data.fileSharedFav.name, parentId)).entry.id;
- fileFavLockedId = (await apis.user.nodes.createFile(data.fileFavLocked.name, parentId)).entry.id;
- fileSharedFavLockedId = (await apis.user.nodes.createFile(data.fileSharedFavLocked.name, parentId)).entry.id;
-
- folderFavId = (await apis.user.nodes.createFolder(data.folderFav.name, parentId)).entry.id;
- folderFav2Id = (await apis.user.nodes.createFolder(data.folderFav2.name, parentId)).entry.id;
- await apis.user.favorites.addFavoriteById('folder', folderFavId);
- await apis.user.favorites.addFavoriteById('folder', folderFav2Id);
-
- await apis.user.shared.shareFilesByIds([
- fileDocxSharedFavId,
- fileSharedFavId,
- fileSharedFavLockedId
- ]);
-
- await apis.user.favorites.addFavoritesByIds('file', [
- fileDocxFavId,
- fileFavId,
- fileDocxSharedFavId,
- fileSharedFavId,
- fileFavLockedId,
- fileSharedFavLockedId
- ]);
-
- await apis.user.nodes.lockFile(fileFavLockedId);
- await apis.user.nodes.lockFile(fileSharedFavLockedId);
-
- await apis.user.favorites.waitForApi({ expect: 8 });
- await apis.user.shared.waitForApi({ expect: 3 });
-
- await loginPage.loginWith(username);
- done();
- });
-
- afterAll(async (done) => {
- await apis.user.nodes.deleteNodeById(parentId);
- done();
- });
-
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await page.clickFavoritesAndWait();
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- describe('on a file', () => {
-
- it('File Office, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocxFav.name, data.fileDocxFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.favoritesToolbarMore);
- await testUtil.checkContextMenu(data.fileDocxFav.name, data.fileDocxFav.favoritesContextMenu);
- });
-
- it('File favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileFav.name, data.fileFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileFav.name, data.fileFav.favoritesToolbarMore);
- await testUtil.checkContextMenu(data.fileFav.name, data.fileFav.favoritesContextMenu);
- });
-
- it('File Office, shared, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocxSharedFav.name, data.fileDocxSharedFav.favoritesToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.favoritesToolbarMore);
- await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.favoritesContextMenu);
- });
-
- it('File shared, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedFav.name, data.fileSharedFav.favoritesToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.favoritesToolbarMore);
- await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.favoritesContextMenu);
- });
-
- it('File favorite, locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileFavLocked.name, data.fileFavLocked.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.favoritesToolbarMore);
- await testUtil.checkContextMenu(data.fileFavLocked.name, data.fileFavLocked.favoritesContextMenu);
- });
-
- it('File shared, favorite, locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedFavLocked.name, data.fileSharedFavLocked.favoritesToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.favoritesToolbarMore);
- await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.favoritesContextMenu);
- });
- });
-
- describe('on a folder', () => {
- it('Folder favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.folderFav.name, data.folderFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.folderFav.name, data.folderFav.favoritesToolbarMore);
- await testUtil.checkContextMenu(data.folderFav.name, data.folderFav.favoritesContextMenu);
- });
- });
-
- describe('on multiple selection', () => {
- it('multiple files - [C280656]', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.favoritesContextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.favoritesToolbarMore);
- });
-
- it('multiple locked files - [C297631]', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileFavLocked.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.favoritesContextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileFavLocked.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileFavLocked.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.favoritesToolbarMore);
- });
-
- it('multiple folders - [C280664]', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.folderFav.name, data.folderFav2.name ], data.multipleSelAllFav.favoritesContextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.folderFav.name, data.folderFav2.name ], data.multipleSelAllFav.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.folderFav.name, data.folderFav2.name ], data.multipleSelAllFav.favoritesToolbarMore);
- });
-
- it('both files and folders - [C280657]', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileFav.name, data.folderFav.name ], data.multipleSelAllFav.favoritesContextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileFav.name, data.folderFav.name ], data.multipleSelAllFav.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileFav.name, data.folderFav.name ], data.multipleSelAllFav.favoritesToolbarMore);
- });
- });
-});
diff --git a/e2e/suites/actions-available/files-folders/favorites.ts b/e2e/suites/actions-available/files-folders/favorites.ts
new file mode 100755
index 000000000..bcda94375
--- /dev/null
+++ b/e2e/suites/actions-available/files-folders/favorites.ts
@@ -0,0 +1,106 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { Utils } from '../../../utilities/utils';
+import * as testData from './test-data';
+import * as testUtil from '../test-util';
+import { BrowsingPage } from '../../../pages/pages';
+
+export function favoritesTests() {
+ const page = new BrowsingPage();
+
+ describe('available actions : ', () => {
+
+ beforeAll(async () => {
+ await page.clickFavoritesAndWait();
+ });
+
+ beforeEach(async () => {
+ await Utils.pressEscape();
+ });
+
+ describe('on a file', () => {
+
+ it('File Office, favorite - [C297618]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocxFav.name, testData.fileDocxFav.toolbarPrimary, testData.fileDocxFav.favoritesToolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocxFav.name, testData.fileDocxFav.favoritesContextMenu);
+ });
+
+ it('File favorite - [C280461]', async () => {
+ await testUtil.checkToolbarActions(testData.fileFav.name, testData.fileFav.toolbarPrimary, testData.fileFav.favoritesToolbarMore);
+ await testUtil.checkContextMenu(testData.fileFav.name, testData.fileFav.favoritesContextMenu);
+ });
+
+ it('File Office, shared, favorite - [C297620]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.favoritesToolbarPrimary, testData.fileDocxSharedFav.favoritesToolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.favoritesContextMenu);
+ });
+
+ it('File shared, favorite - [C280462]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.favoritesToolbarPrimary, testData.fileSharedFav.favoritesToolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.favoritesContextMenu);
+ });
+
+ it('File favorite, locked - [C280463]', async () => {
+ await testUtil.checkToolbarActions(testData.fileFavLocked.name, testData.fileFavLocked.toolbarPrimary, testData.fileFavLocked.favoritesToolbarMore);
+ await testUtil.checkContextMenu(testData.fileFavLocked.name, testData.fileFavLocked.favoritesContextMenu);
+ });
+
+ it('File shared, favorite, locked - [C280469]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.favoritesToolbarPrimary, testData.fileSharedFavLocked.favoritesToolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.favoritesContextMenu);
+ });
+ });
+
+ describe('on a folder', () => {
+ it('Folder favorite - [C291817]', async () => {
+ await testUtil.checkToolbarActions(testData.folderFav.name, testData.folderFav.toolbarPrimary, testData.folderFav.favoritesToolbarMore);
+ await testUtil.checkContextMenu(testData.folderFav.name, testData.folderFav.favoritesContextMenu);
+ });
+ });
+
+ describe('on multiple selection', () => {
+ it('multiple files - [C280656]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileDocxFav.name, testData.fileDocxSharedFav.name ], testData.multipleSelAllFav.favoritesContextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileDocxFav.name, testData.fileDocxSharedFav.name ], testData.multipleSelAllFav.toolbarPrimary, testData.multipleSelAllFav.favoritesToolbarMore);
+ });
+
+ it('multiple locked files - [C297631]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileFavLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSelAllFav.favoritesContextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileFavLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSelAllFav.toolbarPrimary, testData.multipleSelAllFav.favoritesToolbarMore);
+ });
+
+ it('multiple folders - [C280664]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.folderFav.name, testData.folderFav2.name ], testData.multipleSelAllFav.favoritesContextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.folderFav.name, testData.folderFav2.name ], testData.multipleSelAllFav.toolbarPrimary, testData.multipleSelAllFav.favoritesToolbarMore);
+ });
+
+ it('both files and folders - [C280657]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileFav.name, testData.folderFav.name ], testData.multipleSelAllFav.favoritesContextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileFav.name, testData.folderFav.name ], testData.multipleSelAllFav.toolbarPrimary, testData.multipleSelAllFav.favoritesToolbarMore);
+ });
+ });
+ });
+}
diff --git a/e2e/suites/actions-available/files-folders/files-folders-actions.test.ts b/e2e/suites/actions-available/files-folders/files-folders-actions.test.ts
new file mode 100644
index 000000000..d371c2369
--- /dev/null
+++ b/e2e/suites/actions-available/files-folders/files-folders-actions.test.ts
@@ -0,0 +1,174 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { RepoClient } from '../../../utilities/repo-client/repo-client';
+import { Utils } from '../../../utilities/utils';
+import { AdminActions } from '../../../utilities/admin-actions';
+import { LoginPage } from '../../../pages/pages';
+import { FILES } from '../../../configs';
+import * as testData from './test-data';
+import { personalFilesTests } from './personal-files';
+import { recentFilesTests } from './recent-files';
+import { favoritesTests } from './favorites';
+import { searchResultsTests } from './search-results';
+import { sharedFilesTests } from './shared-files';
+import { viewerTests } from './viewer';
+import { trashTests } from './trash';
+
+describe('Files / folders actions : ', () => {
+ const random = Utils.random();
+
+ const username = `user-${random}`
+
+ const parent = `parent-${random}`;
+
+ let parentId: string;
+ let fileDocxFavId: string;
+ let fileFavId: string;
+ let fileDocxSharedId: string;
+ let fileDocxSharedFavId: string;
+ let fileSharedId: string;
+ let fileSharedFavId: string;
+ let fileLockedId: string;
+ let fileFavLockedId: string;
+ let fileSharedLockedId: string;
+ let fileSharedFavLockedId: string;
+ let folderFavId: string;
+ let folderFav2Id: string;
+ let fileInTrashId: string;
+ let file2InTrashId: string;
+ let folderInTrashId: string;
+ let folder2InTrashId: string;
+
+ const userApi = new RepoClient(username, username);
+ const adminApiActions = new AdminActions();
+
+ const loginPage = new LoginPage();
+
+ beforeAll(async () => {
+ await adminApiActions.createUser({ username });
+
+ parentId = (await userApi.nodes.createFolder(parent)).entry.id;
+
+ await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, testData.fileDocx.name );
+ fileDocxFavId = (await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, testData.fileDocxFav.name)).entry.id;
+ await userApi.nodes.createFile(testData.file.name, parentId);
+ fileFavId = (await userApi.nodes.createFile(testData.fileFav.name, parentId)).entry.id;
+ fileDocxSharedId = (await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, testData.fileDocxShared.name)).entry.id;
+ fileDocxSharedFavId = (await userApi.upload.uploadFileWithRename(FILES.docxFile, parentId, testData.fileDocxSharedFav.name)).entry.id;
+ fileSharedId = (await userApi.nodes.createFile(testData.fileShared.name, parentId)).entry.id;
+ fileSharedFavId = (await userApi.nodes.createFile(testData.fileSharedFav.name, parentId)).entry.id;
+ fileLockedId = (await userApi.nodes.createFile(testData.fileLocked.name, parentId)).entry.id;
+ fileFavLockedId = (await userApi.nodes.createFile(testData.fileFavLocked.name, parentId)).entry.id;
+ fileSharedLockedId = (await userApi.nodes.createFile(testData.fileSharedLocked.name, parentId)).entry.id;
+ fileSharedFavLockedId = (await userApi.nodes.createFile(testData.fileSharedFavLocked.name, parentId)).entry.id;
+
+ await userApi.nodes.createFolder(testData.folder.name, parentId);
+ folderFavId = (await userApi.nodes.createFolder(testData.folderFav.name, parentId)).entry.id;
+ folderFav2Id = (await userApi.nodes.createFolder(testData.folderFav2.name, parentId)).entry.id;
+
+ await userApi.favorites.addFavoritesByIds('folder', [folderFavId, folderFav2Id]);
+
+ await userApi.favorites.addFavoritesByIds('file', [
+ fileDocxFavId,
+ fileFavId,
+ fileDocxSharedFavId,
+ fileSharedFavId,
+ fileFavLockedId,
+ fileSharedFavLockedId
+ ]);
+
+ await userApi.shared.shareFilesByIds([
+ fileDocxSharedId,
+ fileDocxSharedFavId,
+ fileSharedId,
+ fileSharedFavId,
+ fileSharedLockedId,
+ fileSharedFavLockedId
+ ]);
+
+ await userApi.nodes.lockFile(fileLockedId);
+ await userApi.nodes.lockFile(fileFavLockedId);
+ await userApi.nodes.lockFile(fileSharedLockedId);
+ await userApi.nodes.lockFile(fileSharedFavLockedId);
+
+ fileInTrashId = (await userApi.nodes.createFile(testData.fileInTrash.name)).entry.id;
+ file2InTrashId = (await userApi.nodes.createFile(testData.file2InTrash.name)).entry.id;
+ folderInTrashId = (await userApi.nodes.createFolder(testData.folderInTrash.name)).entry.id;
+ folder2InTrashId = (await userApi.nodes.createFolder(testData.folder2InTrash.name)).entry.id;
+
+ await userApi.nodes.deleteNodeById(fileInTrashId, false);
+ await userApi.nodes.deleteNodeById(file2InTrashId, false);
+ await userApi.nodes.deleteNodeById(folderInTrashId, false);
+ await userApi.nodes.deleteNodeById(folder2InTrashId, false);
+
+ await Promise.all([
+ userApi.favorites.waitForApi({ expect: 8 }),
+ userApi.shared.waitForApi({ expect: 6 }),
+ userApi.search.waitForApi(username, { expect: 12 }),
+ userApi.trashcan.waitForApi({ expect: 4 })
+ ]);
+
+ await loginPage.loginWith(username);
+ });
+
+ afterAll(async () => {
+ await userApi.nodes.deleteNodeById(parentId);
+ await userApi.trashcan.emptyTrash();
+ });
+
+ beforeEach(async () => {
+ await Utils.pressEscape();
+ });
+
+ describe('on Personal Files : ', () => {
+ personalFilesTests(parent);
+ });
+
+ describe('on Recent Files : ', () => {
+ recentFilesTests();
+ });
+
+ describe('on Favorites : ', () => {
+ favoritesTests();
+ });
+
+ describe('on Search Results : ', () => {
+ searchResultsTests();
+ });
+
+ describe('on Shared Files : ', () => {
+ sharedFilesTests();
+ });
+
+ describe('on Viewer : ', () => {
+ viewerTests(parent);
+ });
+
+ describe('on Trash : ', () => {
+ trashTests();
+ });
+
+});
diff --git a/e2e/suites/actions-available/files-folders/personal-files.ts b/e2e/suites/actions-available/files-folders/personal-files.ts
new file mode 100755
index 000000000..b18256bdf
--- /dev/null
+++ b/e2e/suites/actions-available/files-folders/personal-files.ts
@@ -0,0 +1,150 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { Utils } from '../../../utilities/utils';
+import * as testData from './test-data';
+import * as testUtil from '../test-util';
+import { BrowsingPage } from '../../../pages/pages';
+
+export function personalFilesTests(parentName?: string) {
+ const page = new BrowsingPage();
+ const { dataTable } = page;
+
+ describe('available actions : ', () => {
+
+ beforeAll(async () => {
+ await page.clickPersonalFilesAndWait();
+ await dataTable.doubleClickOnRowByName(parentName);
+ await dataTable.waitForHeader();
+ });
+
+ beforeEach(async () => {
+ await Utils.pressEscape();
+ });
+
+ describe('on a file', () => {
+
+ it('File Office - [C213122]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocx.name, testData.fileDocx.toolbarPrimary, testData.fileDocx.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocx.name, testData.fileDocx.contextMenu);
+ });
+
+ it('File Office, favorite - [C297612]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocxFav.name, testData.fileDocxFav.toolbarPrimary, testData.fileDocxFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocxFav.name, testData.fileDocxFav.contextMenu);
+ });
+
+ it('File simple - [C286265]', async () => {
+ await testUtil.checkToolbarActions(testData.file.name, testData.file.toolbarPrimary, testData.file.toolbarMore);
+ await testUtil.checkContextMenu(testData.file.name, testData.file.contextMenu);
+ });
+
+ it('File favorite - [C297615]', async () => {
+ await testUtil.checkToolbarActions(testData.fileFav.name, testData.fileFav.toolbarPrimary, testData.fileFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileFav.name, testData.fileFav.contextMenu);
+ });
+
+ it('File Office, shared - [C280448]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocxShared.name, testData.fileDocxShared.toolbarPrimary, testData.fileDocxShared.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocxShared.name, testData.fileDocxShared.contextMenu);
+ });
+
+ it('File Office, shared, favorite - [C297616]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.toolbarPrimary, testData.fileDocxSharedFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.contextMenu);
+ });
+
+ it('File shared - [C286323]', async () => {
+ await testUtil.checkToolbarActions(testData.fileShared.name, testData.fileShared.toolbarPrimary, testData.fileShared.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileShared.name, testData.fileShared.contextMenu);
+ });
+
+ it('File shared, favorite - [C280450]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.toolbarPrimary, testData.fileSharedFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.contextMenu);
+ });
+
+ it('File locked - [C297617]', async () => {
+ await testUtil.checkToolbarActions(testData.fileLocked.name, testData.fileLocked.toolbarPrimary, testData.fileLocked.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileLocked.name, testData.fileLocked.contextMenu);
+ });
+
+ it('File favorite, locked - [C291816]', async () => {
+ await testUtil.checkToolbarActions(testData.fileFavLocked.name, testData.fileFavLocked.toolbarPrimary, testData.fileFavLocked.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileFavLocked.name, testData.fileFavLocked.contextMenu);
+ });
+
+ it('File shared, locked - [C280453]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedLocked.name, testData.fileSharedLocked.toolbarPrimary, testData.fileSharedLocked.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedLocked.name, testData.fileSharedLocked.contextMenu);
+ });
+
+ it('File shared, favorite, locked - [C280454]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.toolbarPrimary, testData.fileSharedFavLocked.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.contextMenu);
+ });
+ });
+
+ describe('on a folder', () => {
+
+ it('Folder not favorite - [C213123]', async () => {
+ await testUtil.checkToolbarActions(testData.folder.name, testData.folder.toolbarPrimary, testData.folder.toolbarMore);
+ await testUtil.checkContextMenu(testData.folder.name, testData.folder.contextMenu);
+ });
+
+ it('Folder favorite - [C280451]', async () => {
+ await testUtil.checkToolbarActions(testData.folderFav.name, testData.folderFav.toolbarPrimary, testData.folderFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.folderFav.name, testData.folderFav.contextMenu);
+ });
+ });
+
+ describe('on multiple selection', () => {
+ it('multiple files - [C217112]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileDocx.name, testData.fileDocxSharedFav.name ], testData.multipleSel.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileDocx.name, testData.fileDocxSharedFav.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
+ });
+
+ it('multiple files - all favorite - [C297619]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileDocxFav.name, testData.fileDocxSharedFav.name ], testData.multipleSelAllFav.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileDocxFav.name, testData.fileDocxSharedFav.name ], testData.multipleSel.toolbarPrimary, testData.multipleSelAllFav.toolbarMore);
+ });
+
+ it('multiple locked files - [C326688]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
+ });
+
+ it('multiple folders - [C280459]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.folderFav.name, testData.folder.name ], testData.multipleSel.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.folderFav.name, testData.folder.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
+ });
+
+ it('both files and folders - [C280460]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.file.name, testData.folder.name ], testData.multipleSel.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.file.name, testData.folder.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
+ });
+ });
+ });
+}
diff --git a/e2e/suites/actions-available/files-folders/personal.test.ts b/e2e/suites/actions-available/files-folders/personal.test.ts
deleted file mode 100755
index 27eb29841..000000000
--- a/e2e/suites/actions-available/files-folders/personal.test.ts
+++ /dev/null
@@ -1,244 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { LoginPage, BrowsingPage } from '../../../pages/pages';
-import { FILES } from '../../../configs';
-import { RepoClient } from '../../../utilities/repo-client/repo-client';
-import { Utils } from '../../../utilities/utils';
-import * as data from './test-data-files-folders';
-import * as testUtil from '../test-util';
-
-describe('File/folder actions : on Personal Files: ', () => {
-
- const random = Utils.random();
-
- const username = `user-${random}`;
-
- const parent = `parent-${random}`; let parentId;
-
- let fileDocxFavId, fileFavId, fileDocxSharedId, fileDocxSharedFavId, fileSharedId, fileSharedFavId, fileLockedId, fileFavLockedId, fileSharedLockedId, fileSharedFavLockedId;
- let folderFavId;
-
- const apis = {
- admin: new RepoClient(),
- user: new RepoClient(username, username)
- };
-
- const loginPage = new LoginPage();
- const page = new BrowsingPage();
- const { dataTable } = page;
-
- beforeAll(async (done) => {
- await apis.admin.people.createUser({ username });
-
- parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
-
- await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocx.name );
- fileDocxFavId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxFav.name)).entry.id;
- await apis.user.nodes.createFile(data.file.name, parentId);
- fileFavId = (await apis.user.nodes.createFile(data.fileFav.name, parentId)).entry.id;
- fileDocxSharedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxShared.name)).entry.id;
- fileDocxSharedFavId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxSharedFav.name)).entry.id;
- fileSharedId = (await apis.user.nodes.createFile(data.fileShared.name, parentId)).entry.id;
- fileSharedFavId = (await apis.user.nodes.createFile(data.fileSharedFav.name, parentId)).entry.id;
- fileLockedId = (await apis.user.nodes.createFile(data.fileLocked.name, parentId)).entry.id;
- fileFavLockedId = (await apis.user.nodes.createFile(data.fileFavLocked.name, parentId)).entry.id;
- fileSharedLockedId = (await apis.user.nodes.createFile(data.fileSharedLocked.name, parentId)).entry.id;
- fileSharedFavLockedId = (await apis.user.nodes.createFile(data.fileSharedFavLocked.name, parentId)).entry.id;
-
- await apis.user.nodes.createFolder(data.folder.name, parentId);
- folderFavId = (await apis.user.nodes.createFolder(data.folderFav.name, parentId)).entry.id;
- await apis.user.favorites.addFavoriteById('folder', folderFavId);
-
- await apis.user.favorites.addFavoritesByIds('file', [
- fileDocxFavId,
- fileFavId,
- fileDocxSharedFavId,
- fileSharedFavId,
- fileFavLockedId,
- fileSharedFavLockedId
- ]);
-
- await apis.user.shared.shareFilesByIds([
- fileDocxSharedId,
- fileDocxSharedFavId,
- fileSharedId,
- fileSharedFavId,
- fileSharedLockedId,
- fileSharedFavLockedId
- ]);
-
- await apis.user.nodes.lockFile(fileLockedId);
- await apis.user.nodes.lockFile(fileFavLockedId);
- await apis.user.nodes.lockFile(fileSharedLockedId);
- await apis.user.nodes.lockFile(fileSharedFavLockedId);
-
- await apis.user.favorites.waitForApi({ expect: 7 });
- await apis.user.shared.waitForApi({ expect: 6 });
-
- await loginPage.loginWith(username);
- done();
- });
-
- afterAll(async (done) => {
- await apis.user.nodes.deleteNodeById(parentId);
- done();
- });
-
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await page.clickPersonalFilesAndWait();
- await dataTable.doubleClickOnRowByName(parent);
- await dataTable.waitForHeader();
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- describe('on a file', () => {
-
- it('File Office - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocx.name, data.fileDocx.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocx.name, data.fileDocx.toolbarMore);
- await testUtil.checkContextMenu(data.fileDocx.name, data.fileDocx.contextMenu);
- });
-
- it('File Office, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocxFav.name, data.fileDocxFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.toolbarMore);
- await testUtil.checkContextMenu(data.fileDocxFav.name, data.fileDocxFav.contextMenu);
- });
-
- it('File simple - []', async () => {
- await testUtil.checkToolbarPrimary(data.file.name, data.file.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.file.name, data.file.toolbarMore);
- await testUtil.checkContextMenu(data.file.name, data.file.contextMenu);
- });
-
- it('File favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileFav.name, data.fileFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileFav.name, data.fileFav.toolbarMore);
- await testUtil.checkContextMenu(data.fileFav.name, data.fileFav.contextMenu);
- });
-
- it('File Office, shared - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocxShared.name, data.fileDocxShared.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.toolbarMore);
- await testUtil.checkContextMenu(data.fileDocxShared.name, data.fileDocxShared.contextMenu);
- });
-
- it('File Office, shared, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocxSharedFav.name, data.fileDocxSharedFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.toolbarMore);
- await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.contextMenu);
- });
-
- it('File shared - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileShared.name, data.fileShared.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileShared.name, data.fileShared.toolbarMore);
- await testUtil.checkContextMenu(data.fileShared.name, data.fileShared.contextMenu);
- });
-
- it('File shared, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedFav.name, data.fileSharedFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.toolbarMore);
- await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.contextMenu);
- });
-
- it('File locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileLocked.name, data.fileLocked.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileLocked.name, data.fileLocked.toolbarMore);
- await testUtil.checkContextMenu(data.fileLocked.name, data.fileLocked.contextMenu);
- });
-
- it('File favorite, locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileFavLocked.name, data.fileFavLocked.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.toolbarMore);
- await testUtil.checkContextMenu(data.fileFavLocked.name, data.fileFavLocked.contextMenu);
- });
-
- it('File shared, locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedLocked.name, data.fileSharedLocked.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.toolbarMore);
- await testUtil.checkContextMenu(data.fileSharedLocked.name, data.fileSharedLocked.contextMenu);
- });
-
- it('File shared, favorite, locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedFavLocked.name, data.fileSharedFavLocked.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.toolbarMore);
- await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.contextMenu);
- });
- });
-
- describe('on a folder', () => {
-
- it('Folder not favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.folder.name, data.folder.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.folder.name, data.folder.toolbarMore);
- await testUtil.checkContextMenu(data.folder.name, data.folder.contextMenu);
- });
-
- it('Folder favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.folderFav.name, data.folderFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.folderFav.name, data.folderFav.toolbarMore);
- await testUtil.checkContextMenu(data.folderFav.name, data.folderFav.contextMenu);
- });
- });
-
- describe('on multiple selection', () => {
- it('multiple files - [C217112]', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileDocx.name, data.fileDocxSharedFav.name ], data.multipleSel.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocx.name, data.fileDocxSharedFav.name ], data.multipleSel.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocx.name, data.fileDocxSharedFav.name ], data.multipleSel.toolbarMore);
- });
-
- it('multiple files - all favorite - []', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSel.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.toolbarMore);
- });
-
- it('multiple locked files - [C297619]', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarMore);
- });
-
- it('multiple folders - [C280459]', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.folderFav.name, data.folder.name ], data.multipleSel.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.folderFav.name, data.folder.name ], data.multipleSel.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.folderFav.name, data.folder.name ], data.multipleSel.toolbarMore);
- });
-
- it('both files and folders - [C280460]', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.file.name, data.folder.name ], data.multipleSel.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.file.name, data.folder.name ], data.multipleSel.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.file.name, data.folder.name ], data.multipleSel.toolbarMore);
- });
- });
-});
diff --git a/e2e/suites/actions-available/files-folders/recent-files.ts b/e2e/suites/actions-available/files-folders/recent-files.ts
new file mode 100755
index 000000000..de1243444
--- /dev/null
+++ b/e2e/suites/actions-available/files-folders/recent-files.ts
@@ -0,0 +1,124 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { Utils } from '../../../utilities/utils';
+import * as testData from './test-data';
+import * as testUtil from '../test-util';
+import { BrowsingPage } from '../../../pages/pages';
+
+export function recentFilesTests() {
+ const page = new BrowsingPage();
+
+ describe('available actions : ', () => {
+
+ beforeAll(async () => {
+ await page.clickRecentFilesAndWait();
+ });
+
+ beforeEach(async () => {
+ await Utils.pressEscape();
+ });
+
+ describe('on single selection', () => {
+ it('File Office - [C297625]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocx.name, testData.fileDocx.toolbarPrimary, testData.fileDocx.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocx.name, testData.fileDocx.contextMenu);
+ });
+
+ it('File Office, favorite - [C280470]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocxFav.name, testData.fileDocxFav.toolbarPrimary, testData.fileDocxFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocxFav.name, testData.fileDocxFav.contextMenu);
+ });
+
+ it('File simple - [C280471]', async () => {
+ await testUtil.checkToolbarActions(testData.file.name, testData.file.toolbarPrimary, testData.file.toolbarMore);
+ await testUtil.checkContextMenu(testData.file.name, testData.file.contextMenu);
+ });
+
+ it('File favorite - [C280615]', async () => {
+ await testUtil.checkToolbarActions(testData.fileFav.name, testData.fileFav.toolbarPrimary, testData.fileFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileFav.name, testData.fileFav.contextMenu);
+ });
+
+ it('File Office, shared - [C297633]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocxShared.name, testData.fileDocxShared.toolbarPrimary, testData.fileDocxShared.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocxShared.name, testData.fileDocxShared.contextMenu);
+ });
+
+ it('File Office, shared, favorite - [C280616]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.toolbarPrimary, testData.fileDocxSharedFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.contextMenu);
+ });
+
+ it('File shared - [C280601]', async () => {
+ await testUtil.checkToolbarActions(testData.fileShared.name, testData.fileShared.toolbarPrimary, testData.fileShared.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileShared.name, testData.fileShared.contextMenu);
+ });
+
+ it('File shared, favorite - [C297635]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.toolbarPrimary, testData.fileSharedFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.contextMenu);
+ });
+
+ it('File locked - [C280622]', async () => {
+ await testUtil.checkToolbarActions(testData.fileLocked.name, testData.fileLocked.toolbarPrimary, testData.fileLocked.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileLocked.name, testData.fileLocked.contextMenu);
+ });
+
+ it('File favorite, locked - [C280608]', async () => {
+ await testUtil.checkToolbarActions(testData.fileFavLocked.name, testData.fileFavLocked.toolbarPrimary, testData.fileFavLocked.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileFavLocked.name, testData.fileFavLocked.contextMenu);
+ });
+
+ it('File shared, locked - [C297636]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedLocked.name, testData.fileSharedLocked.toolbarPrimary, testData.fileSharedLocked.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedLocked.name, testData.fileSharedLocked.contextMenu);
+ });
+
+ it('File shared, favorite, locked - [C286324]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.toolbarPrimary, testData.fileSharedFavLocked.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.contextMenu);
+ });
+ });
+
+ describe('on multiple selection', () => {
+ it('multiple files - [C280468]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileDocxFav.name, testData.fileLocked.name ], testData.multipleSel.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileDocxFav.name, testData.fileLocked.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
+ });
+
+ it('multiple files - all favorite - [C326689]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileDocxFav.name, testData.fileFav.name ], testData.multipleSelAllFav.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileDocxFav.name, testData.fileFav.name ], testData.multipleSel.toolbarPrimary, testData.multipleSelAllFav.toolbarMore);
+ });
+
+ it('multiple locked files - [C297624]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
+ });
+ });
+
+ });
+}
diff --git a/e2e/suites/actions-available/files-folders/recent.test.ts b/e2e/suites/actions-available/files-folders/recent.test.ts
deleted file mode 100755
index e6e13bbb5..000000000
--- a/e2e/suites/actions-available/files-folders/recent.test.ts
+++ /dev/null
@@ -1,212 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { LoginPage, BrowsingPage } from '../../../pages/pages';
-import { FILES } from '../../../configs';
-import { RepoClient } from '../../../utilities/repo-client/repo-client';
-import { Utils } from '../../../utilities/utils';
-import * as data from './test-data-files-folders';
-import * as testUtil from '../test-util';
-
-describe('File actions : on Recent Files: ', () => {
-
- const random = Utils.random();
-
- const username = `user-${random}`;
-
- const parent = `parent-${random}`; let parentId;
-
- let fileDocxFavId, fileFavId, fileDocxSharedId, fileDocxSharedFavId, fileSharedId, fileSharedFavId, fileLockedId, fileFavLockedId, fileSharedLockedId, fileSharedFavLockedId;
-
- const apis = {
- admin: new RepoClient(),
- user: new RepoClient(username, username)
- };
-
- const loginPage = new LoginPage();
- const page = new BrowsingPage();
- const { dataTable } = page;
-
- beforeAll(async (done) => {
- await apis.admin.people.createUser({ username });
-
- parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
-
- await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocx.name);
- fileDocxFavId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxFav.name)).entry.id;
- await apis.user.nodes.createFile(data.file.name, parentId);
- fileFavId = (await apis.user.nodes.createFile(data.fileFav.name, parentId)).entry.id;
- fileDocxSharedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxShared.name)).entry.id;
- fileDocxSharedFavId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxSharedFav.name)).entry.id;
- fileSharedId = (await apis.user.nodes.createFile(data.fileShared.name, parentId)).entry.id;
- fileSharedFavId = (await apis.user.nodes.createFile(data.fileSharedFav.name, parentId)).entry.id;
- fileLockedId = (await apis.user.nodes.createFile(data.fileLocked.name, parentId)).entry.id;
- fileFavLockedId = (await apis.user.nodes.createFile(data.fileFavLocked.name, parentId)).entry.id;
- fileSharedLockedId = (await apis.user.nodes.createFile(data.fileSharedLocked.name, parentId)).entry.id;
- fileSharedFavLockedId = (await apis.user.nodes.createFile(data.fileSharedFavLocked.name, parentId)).entry.id;
-
- await apis.user.favorites.addFavoritesByIds('file', [
- fileDocxFavId,
- fileFavId,
- fileDocxSharedFavId,
- fileSharedFavId,
- fileFavLockedId,
- fileSharedFavLockedId
- ]);
-
- await apis.user.shared.shareFilesByIds([
- fileDocxSharedId,
- fileDocxSharedFavId,
- fileSharedId,
- fileSharedFavId,
- fileSharedLockedId,
- fileSharedFavLockedId
- ]);
-
- await apis.user.nodes.lockFile(fileLockedId);
- await apis.user.nodes.lockFile(fileFavLockedId);
- await apis.user.nodes.lockFile(fileSharedLockedId);
- await apis.user.nodes.lockFile(fileSharedFavLockedId);
-
- await apis.user.favorites.waitForApi({ expect: 6 });
- await apis.user.shared.waitForApi({ expect: 6 });
- await apis.user.search.waitForApi(username, { expect: 12 });
-
- await loginPage.loginWith(username);
- done();
- });
-
- afterAll(async (done) => {
- await apis.user.nodes.deleteNodeById(parentId);
- done();
- });
-
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await page.clickRecentFilesAndWait();
- await dataTable.waitForHeader();
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- describe('on single selection', () => {
- it('File Office - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocx.name, data.fileDocx.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocx.name, data.fileDocx.toolbarMore);
- await testUtil.checkContextMenu(data.fileDocx.name, data.fileDocx.contextMenu);
- });
-
- it('File Office, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocxFav.name, data.fileDocxFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.toolbarMore);
- await testUtil.checkContextMenu(data.fileDocxFav.name, data.fileDocxFav.contextMenu);
- });
-
- it('File simple - []', async () => {
- await testUtil.checkToolbarPrimary(data.file.name, data.file.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.file.name, data.file.toolbarMore);
- await testUtil.checkContextMenu(data.file.name, data.file.contextMenu);
- });
-
- it('File favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileFav.name, data.fileFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileFav.name, data.fileFav.toolbarMore);
- await testUtil.checkContextMenu(data.fileFav.name, data.fileFav.contextMenu);
- });
-
- it('File Office, shared - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocxShared.name, data.fileDocxShared.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.toolbarMore);
- await testUtil.checkContextMenu(data.fileDocxShared.name, data.fileDocxShared.contextMenu);
- });
-
- it('File Office, shared, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocxSharedFav.name, data.fileDocxSharedFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.toolbarMore);
- await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.contextMenu);
- });
-
- it('File shared - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileShared.name, data.fileShared.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileShared.name, data.fileShared.toolbarMore);
- await testUtil.checkContextMenu(data.fileShared.name, data.fileShared.contextMenu);
- });
-
- it('File shared, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedFav.name, data.fileSharedFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.toolbarMore);
- await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.contextMenu);
- });
-
- it('File locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileLocked.name, data.fileLocked.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileLocked.name, data.fileLocked.toolbarMore);
- await testUtil.checkContextMenu(data.fileLocked.name, data.fileLocked.contextMenu);
- });
-
- it('File favorite, locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileFavLocked.name, data.fileFavLocked.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.toolbarMore);
- await testUtil.checkContextMenu(data.fileFavLocked.name, data.fileFavLocked.contextMenu);
- });
-
- it('File shared, locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedLocked.name, data.fileSharedLocked.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.toolbarMore);
- await testUtil.checkContextMenu(data.fileSharedLocked.name, data.fileSharedLocked.contextMenu);
- });
-
- it('File shared, favorite, locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedFavLocked.name, data.fileSharedFavLocked.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.toolbarMore);
- await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.contextMenu);
- });
- });
-
- describe('on multiple selection', () => {
- it('multiple files - [C280468]', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileLocked.name ], data.multipleSel.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocxFav.name, data.fileLocked.name ], data.multipleSel.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocxFav.name, data.fileLocked.name ], data.multipleSel.toolbarMore);
- });
-
- it('multiple files - all favorite - []', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileFav.name ], data.multipleSelAllFav.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocxFav.name, data.fileFav.name ], data.multipleSel.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocxFav.name, data.fileFav.name ], data.multipleSelAllFav.toolbarMore);
- });
-
- it('multiple locked files - [C297624]', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarMore);
- });
- });
-
-});
diff --git a/e2e/suites/actions-available/files-folders/search-results.ts b/e2e/suites/actions-available/files-folders/search-results.ts
new file mode 100755
index 000000000..5a3ea878b
--- /dev/null
+++ b/e2e/suites/actions-available/files-folders/search-results.ts
@@ -0,0 +1,179 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { BrowsingPage, SearchResultsPage } from '../../../pages/pages';
+import { Utils } from '../../../utilities/utils';
+import * as testData from './test-data';
+import * as testUtil from '../test-util';
+
+export function searchResultsTests() {
+ const page = new BrowsingPage();
+ const { searchInput } = page.header;
+ const searchResultsPage = new SearchResultsPage();
+
+ describe('available actions : ', () => {
+
+ beforeAll(async () => {
+ await page.clickPersonalFiles();
+ });
+
+ beforeEach(async () => {
+ await Utils.pressEscape();
+ });
+
+ describe('on a file', () => {
+
+ beforeAll(async () => {
+ await page.clickPersonalFiles();
+ await searchInput.clickSearchButton();
+ await searchInput.searchFor('file-');
+ await searchResultsPage.waitForResults();
+ });
+
+ it('File Office - [C297637]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocx.name, testData.fileDocx.searchToolbarPrimary, testData.fileDocx.searchToolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocx.name, testData.fileDocx.searchContextMenu);
+ });
+
+ it('File Office, favorite - [C291827]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocxFav.name, testData.fileDocxFav.searchToolbarPrimary, testData.fileDocxFav.searchToolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocxFav.name, testData.fileDocxFav.searchContextMenu);
+ });
+
+ it('File simple - [C297638]', async () => {
+ await testUtil.checkToolbarActions(testData.file.name, testData.file.searchToolbarPrimary, testData.file.searchToolbarMore);
+ await testUtil.checkContextMenu(testData.file.name, testData.file.searchContextMenu);
+ });
+
+ it('File favorite - [C280661]', async () => {
+ await testUtil.checkToolbarActions(testData.fileFav.name, testData.fileFav.searchToolbarPrimary, testData.fileFav.searchToolbarMore);
+ await testUtil.checkContextMenu(testData.fileFav.name, testData.fileFav.searchContextMenu);
+ });
+
+ it('File Office, shared - [C297627]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocxShared.name, testData.fileDocxShared.searchToolbarPrimary, testData.fileDocxShared.searchToolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocxShared.name, testData.fileDocxShared.searchContextMenu);
+ });
+
+ it('File Office, shared, favorite - [C280631]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.searchToolbarPrimary, testData.fileDocxSharedFav.searchToolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.searchContextMenu);
+ });
+
+ it('File shared - [C280632]', async () => {
+ await testUtil.checkToolbarActions(testData.fileShared.name, testData.fileShared.searchToolbarPrimary, testData.fileShared.searchToolbarMore);
+ await testUtil.checkContextMenu(testData.fileShared.name, testData.fileShared.searchContextMenu);
+ });
+
+ it('File shared, favorite - [C280641]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.searchToolbarPrimary, testData.fileSharedFav.searchToolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.searchContextMenu);
+ });
+
+ it('File locked - [C297628]', async () => {
+ await testUtil.checkToolbarActions(testData.fileLocked.name, testData.fileLocked.searchToolbarPrimary, testData.fileLocked.searchToolbarMore);
+ await testUtil.checkContextMenu(testData.fileLocked.name, testData.fileLocked.searchContextMenu);
+ });
+
+ it('File favorite, locked - [C280648]', async () => {
+ await testUtil.checkToolbarActions(testData.fileFavLocked.name, testData.fileFavLocked.searchToolbarPrimary, testData.fileFavLocked.searchToolbarMore);
+ await testUtil.checkContextMenu(testData.fileFavLocked.name, testData.fileFavLocked.searchContextMenu);
+ });
+
+ it('File shared, locked - [C280574]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedLocked.name, testData.fileSharedLocked.searchToolbarPrimary, testData.fileSharedLocked.searchToolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedLocked.name, testData.fileSharedLocked.searchContextMenu);
+ });
+
+ it('File shared, favorite, locked - [C280642]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.searchToolbarPrimary, testData.fileSharedFavLocked.searchToolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.searchContextMenu);
+ });
+ });
+
+ describe('on a folder', () => {
+
+ beforeAll(async () => {
+ await page.clickPersonalFiles();
+ await searchInput.clickSearchButton();
+ await searchInput.searchFor('folder-');
+ await searchResultsPage.waitForResults();
+ });
+
+ it('Folder not favorite - [C280609]', async () => {
+ await testUtil.checkToolbarActions(testData.folder.name, testData.folder.searchToolbarPrimary, testData.folder.searchToolbarMore);
+ await testUtil.checkContextMenu(testData.folder.name, testData.folder.searchContextMenu);
+ });
+
+ it('Folder favorite - [C291828]', async () => {
+ await testUtil.checkToolbarActions(testData.folderFav.name, testData.folderFav.searchToolbarPrimary, testData.folderFav.searchToolbarMore);
+ await testUtil.checkContextMenu(testData.folderFav.name, testData.folderFav.searchContextMenu);
+ });
+ });
+
+ describe('on multiple selection', () => {
+
+ beforeAll(async () => {
+ await page.clickPersonalFiles();
+ await searchInput.clickSearchButton();
+ await searchInput.searchFor('file-');
+ await searchResultsPage.waitForResults();
+ });
+
+ it('multiple files - [C291820]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.file.name, testData.fileDocxShared.name ], testData.multipleSel.searchContextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.file.name, testData.fileDocxShared.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSel.searchToolbarMore);
+ });
+
+ it('multiple files - all favorite - [C326690]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileDocxFav.name, testData.fileSharedFav.name ], testData.multipleSelAllFav.searchContextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileDocxFav.name, testData.fileSharedFav.name ], testData.multipleSelAllFav.searchToolbarPrimary, testData.multipleSelAllFav.searchToolbarMore);
+ });
+
+ it('multiple locked files - [C297626]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.searchContextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSel.searchToolbarMore);
+ });
+
+ it('multiple folders - [C291821]', async () => {
+ await searchInput.clickSearchButton();
+ await searchInput.searchFor('folder-');
+ await searchResultsPage.waitForResults();
+
+ await testUtil.checkMultipleSelContextMenu([ testData.folder.name, testData.folderFav.name ], testData.multipleSel.searchContextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.folder.name, testData.folderFav.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSel.searchToolbarMore);
+ });
+
+ it('both files and folders - [C291822]', async () => {
+ await searchInput.clickSearchButton();
+ await searchInput.searchFor(`=${testData.file.name} or =${testData.folderFav.name}`);
+ await searchResultsPage.waitForResults();
+
+ await testUtil.checkMultipleSelContextMenu([ testData.file.name, testData.folderFav.name ], testData.multipleSel.searchContextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.file.name, testData.folderFav.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSel.searchToolbarMore);
+ });
+ });
+ });
+}
diff --git a/e2e/suites/actions-available/files-folders/search.test.ts b/e2e/suites/actions-available/files-folders/search.test.ts
deleted file mode 100755
index 44ca36573..000000000
--- a/e2e/suites/actions-available/files-folders/search.test.ts
+++ /dev/null
@@ -1,291 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { LoginPage, BrowsingPage } from '../../../pages/pages';
-import { FILES } from '../../../configs';
-import { RepoClient } from '../../../utilities/repo-client/repo-client';
-import { Utils } from '../../../utilities/utils';
-import * as data from './test-data-files-folders';
-import * as testUtil from '../test-util';
-
-describe('File/folder actions : on Search Results : ', () => {
-
- const random = Utils.random();
-
- const username = `user-${random}`;
-
- const parent = `parent-${random}`; let parentId;
-
- let fileDocxFavId, fileFavId, fileDocxSharedId, fileDocxSharedFavId, fileSharedId, fileSharedFavId, fileLockedId, fileFavLockedId, fileSharedLockedId, fileSharedFavLockedId;
- let folderFavId;
-
- const apis = {
- admin: new RepoClient(),
- user: new RepoClient(username, username)
- };
-
- const loginPage = new LoginPage();
- const page = new BrowsingPage();
- const { searchInput } = page.header;
-
- beforeAll(async (done) => {
- await apis.admin.people.createUser({ username });
-
- parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
-
- await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocx.name );
- fileDocxFavId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxFav.name)).entry.id;
- await apis.user.nodes.createFile(data.file.name, parentId);
- fileFavId = (await apis.user.nodes.createFile(data.fileFav.name, parentId)).entry.id;
- fileDocxSharedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxShared.name)).entry.id;
- fileDocxSharedFavId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxSharedFav.name)).entry.id;
- fileSharedId = (await apis.user.nodes.createFile(data.fileShared.name, parentId)).entry.id;
- fileSharedFavId = (await apis.user.nodes.createFile(data.fileSharedFav.name, parentId)).entry.id;
- fileLockedId = (await apis.user.nodes.createFile(data.fileLocked.name, parentId)).entry.id;
- fileFavLockedId = (await apis.user.nodes.createFile(data.fileFavLocked.name, parentId)).entry.id;
- fileSharedLockedId = (await apis.user.nodes.createFile(data.fileSharedLocked.name, parentId)).entry.id;
- fileSharedFavLockedId = (await apis.user.nodes.createFile(data.fileSharedFavLocked.name, parentId)).entry.id;
-
- await apis.user.nodes.createFolder(data.folder.name, parentId);
- folderFavId = (await apis.user.nodes.createFolder(data.folderFav.name, parentId)).entry.id;
- await apis.user.favorites.addFavoriteById('folder', folderFavId);
-
- await apis.user.favorites.addFavoritesByIds('file', [
- fileDocxFavId,
- fileFavId,
- fileDocxSharedFavId,
- fileSharedFavId,
- fileFavLockedId,
- fileSharedFavLockedId
- ]);
-
- await apis.user.shared.shareFilesByIds([
- fileDocxSharedId,
- fileDocxSharedFavId,
- fileSharedId,
- fileSharedFavId,
- fileSharedLockedId,
- fileSharedFavLockedId
- ]);
-
- await apis.user.nodes.lockFile(fileLockedId);
- await apis.user.nodes.lockFile(fileFavLockedId);
- await apis.user.nodes.lockFile(fileSharedLockedId);
- await apis.user.nodes.lockFile(fileSharedFavLockedId);
-
- await apis.user.favorites.waitForApi({ expect: 7 });
- await apis.user.shared.waitForApi({ expect: 6 });
- await apis.user.search.waitForApi(username, { expect: 12 });
-
- await loginPage.loginWith(username);
- done();
- });
-
- afterAll(async (done) => {
- await apis.user.nodes.deleteNodeById(parentId);
- done();
- });
-
- describe('on a file', () => {
-
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await page.clickPersonalFiles();
- await searchInput.clickSearchButton();
- await searchInput.checkOnlyFiles();
- await searchInput.searchFor('file-');
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- it('File Office - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocx.name, data.fileDocx.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocx.name, data.fileDocx.searchToolbarMore);
- await testUtil.checkContextMenu(data.fileDocx.name, data.fileDocx.searchContextMenu);
- });
-
- it('File Office, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocxFav.name, data.fileDocxFav.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.searchToolbarMore);
- await testUtil.checkContextMenu(data.fileDocxFav.name, data.fileDocxFav.searchContextMenu);
- });
-
- it('File simple - []', async () => {
- await testUtil.checkToolbarPrimary(data.file.name, data.file.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.file.name, data.file.searchToolbarMore);
- await testUtil.checkContextMenu(data.file.name, data.file.searchContextMenu);
- });
-
- it('File favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileFav.name, data.fileFav.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileFav.name, data.fileFav.searchToolbarMore);
- await testUtil.checkContextMenu(data.fileFav.name, data.fileFav.searchContextMenu);
- });
-
- it('File Office, shared - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocxShared.name, data.fileDocxShared.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.searchToolbarMore);
- await testUtil.checkContextMenu(data.fileDocxShared.name, data.fileDocxShared.searchContextMenu);
- });
-
- it('File Office, shared, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocxSharedFav.name, data.fileDocxSharedFav.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.searchToolbarMore);
- await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.searchContextMenu);
- });
-
- it('File shared - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileShared.name, data.fileShared.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileShared.name, data.fileShared.searchToolbarMore);
- await testUtil.checkContextMenu(data.fileShared.name, data.fileShared.searchContextMenu);
- });
-
- it('File shared, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedFav.name, data.fileSharedFav.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.searchToolbarMore);
- await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.searchContextMenu);
- });
-
- it('File locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileLocked.name, data.fileLocked.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileLocked.name, data.fileLocked.searchToolbarMore);
- await testUtil.checkContextMenu(data.fileLocked.name, data.fileLocked.searchContextMenu);
- });
-
- it('File favorite, locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileFavLocked.name, data.fileFavLocked.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.searchToolbarMore);
- await testUtil.checkContextMenu(data.fileFavLocked.name, data.fileFavLocked.searchContextMenu);
- });
-
- it('File shared, locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedLocked.name, data.fileSharedLocked.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.searchToolbarMore);
- await testUtil.checkContextMenu(data.fileSharedLocked.name, data.fileSharedLocked.searchContextMenu);
- });
-
- it('File shared, favorite, locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedFavLocked.name, data.fileSharedFavLocked.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.searchToolbarMore);
- await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.searchContextMenu);
- });
- });
-
- describe('on a folder', () => {
-
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await page.clickPersonalFiles();
- await searchInput.clickSearchButton();
- await searchInput.checkOnlyFolders();
- await searchInput.searchFor('folder-');
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- it('Folder not favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.folder.name, data.folder.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.folder.name, data.folder.searchToolbarMore);
- await testUtil.checkContextMenu(data.folder.name, data.folder.searchContextMenu);
- });
-
- it('Folder favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.folderFav.name, data.folderFav.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.folderFav.name, data.folderFav.searchToolbarMore);
- await testUtil.checkContextMenu(data.folderFav.name, data.folderFav.searchContextMenu);
- });
- });
-
- describe('on multiple selection', () => {
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await page.clickPersonalFiles();
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- it('multiple files - [C291820]', async () => {
- await searchInput.clickSearchButton();
- await searchInput.checkOnlyFiles();
- await searchInput.searchFor('file-');
-
- await testUtil.checkMultipleSelContextMenu([ data.file.name, data.fileDocxShared.name ], data.multipleSel.searchContextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.file.name, data.fileDocxShared.name ], data.multipleSel.searchToolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.file.name, data.fileDocxShared.name ], data.multipleSel.searchToolbarMore);
- });
-
- it('multiple files - all favorite - []', async () => {
- await searchInput.clickSearchButton();
- await searchInput.checkOnlyFiles();
- await searchInput.searchFor('file-');
-
- await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileSharedFav.name ], data.multipleSelAllFav.searchContextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocxFav.name, data.fileSharedFav.name ], data.multipleSelAllFav.searchToolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocxFav.name, data.fileSharedFav.name ], data.multipleSelAllFav.searchToolbarMore);
- });
-
- it('multiple locked files - [C297626]', async () => {
- await searchInput.clickSearchButton();
- await searchInput.checkOnlyFiles();
- await searchInput.searchFor('file-');
-
- await testUtil.checkMultipleSelContextMenu([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.searchContextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.searchToolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.searchToolbarMore);
- });
-
- it('multiple folders - [C291821]', async () => {
- await searchInput.clickSearchButton();
- await searchInput.checkOnlyFolders();
- await searchInput.searchFor('folder-');
-
- await testUtil.checkMultipleSelContextMenu([ data.folder.name, data.folderFav.name ], data.multipleSel.searchContextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.folder.name, data.folderFav.name ], data.multipleSel.searchToolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.folder.name, data.folderFav.name ], data.multipleSel.searchToolbarMore);
- });
-
- it('both files and folders - [C291822]', async () => {
- await searchInput.clickSearchButton();
- await searchInput.checkFilesAndFolders();
- await searchInput.searchFor(`=${data.file.name} or =${data.folderFav.name}`);
-
- await testUtil.checkMultipleSelContextMenu([ data.file.name, data.folderFav.name ], data.multipleSel.searchContextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.file.name, data.folderFav.name ], data.multipleSel.searchToolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.file.name, data.folderFav.name ], data.multipleSel.searchToolbarMore);
- });
- });
-});
diff --git a/e2e/suites/actions-available/files-folders/shared-files.ts b/e2e/suites/actions-available/files-folders/shared-files.ts
new file mode 100755
index 000000000..aa94eee39
--- /dev/null
+++ b/e2e/suites/actions-available/files-folders/shared-files.ts
@@ -0,0 +1,94 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { BrowsingPage } from '../../../pages/pages';
+import { Utils } from '../../../utilities/utils';
+import * as testData from './test-data';
+import * as testUtil from '../test-util';
+
+export function sharedFilesTests() {
+ const page = new BrowsingPage();
+
+ describe('available actions : ', () => {
+
+ beforeAll(async () => {
+ await page.clickSharedFilesAndWait();
+ });
+
+ beforeEach(async () => {
+ await Utils.pressEscape();
+ });
+
+ describe('single selection', () => {
+ it('File Office, shared - [C297629]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocxShared.name, testData.fileDocxShared.toolbarPrimary, testData.fileDocxShared.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocxShared.name, testData.fileDocxShared.contextMenu);
+ });
+
+ it('File Office, shared, favorite - [C280652]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.toolbarPrimary, testData.fileDocxSharedFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.contextMenu);
+ });
+
+ it('File shared - [C297630]', async () => {
+ await testUtil.checkToolbarActions(testData.fileShared.name, testData.fileShared.toolbarPrimary, testData.fileShared.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileShared.name, testData.fileShared.contextMenu);
+ });
+
+ it('File shared, favorite - [C286273]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.toolbarPrimary, testData.fileSharedFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.contextMenu);
+ });
+
+ it('File shared, locked - [C286274]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedLocked.name, testData.fileSharedLocked.toolbarPrimary, testData.fileSharedLocked.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedLocked.name, testData.fileSharedLocked.contextMenu);
+ });
+
+ it('File shared, favorite, locked - [C286275]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.toolbarPrimary, testData.fileSharedFavLocked.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.contextMenu);
+ });
+ });
+
+ describe('multiple selection', () => {
+ it('multiple files - [C280467]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileShared.name, testData.fileSharedFav.name ], testData.multipleSel.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileShared.name, testData.fileSharedFav.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
+ });
+
+ it('multiple files - all favorite - [C326691]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileSharedFav.name, testData.fileSharedFavLocked.name ], testData.multipleSelAllFav.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileSharedFav.name, testData.fileSharedFavLocked.name ], testData.multipleSelAllFav.toolbarPrimary, testData.multipleSelAllFav.toolbarMore);
+ });
+
+ it('multiple locked files - [C297623]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileSharedLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileSharedLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
+ });
+ });
+
+ });
+}
diff --git a/e2e/suites/actions-available/files-folders/shared.test.ts b/e2e/suites/actions-available/files-folders/shared.test.ts
deleted file mode 100755
index 105e365f4..000000000
--- a/e2e/suites/actions-available/files-folders/shared.test.ts
+++ /dev/null
@@ -1,162 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { LoginPage, BrowsingPage } from '../../../pages/pages';
-import { FILES } from '../../../configs';
-import { RepoClient } from '../../../utilities/repo-client/repo-client';
-import { Utils } from '../../../utilities/utils';
-import * as data from './test-data-files-folders';
-import * as testUtil from '../test-util';
-
-describe('File actions : on Shared Files : ', () => {
-
- const random = Utils.random();
-
- const username = `user-${random}`;
-
- const parent = `parent-${random}`; let parentId;
-
- let fileDocxSharedId, fileDocxSharedFavId, fileSharedId, fileSharedFavId, fileSharedLockedId, fileSharedFavLockedId;
-
- const apis = {
- admin: new RepoClient(),
- user: new RepoClient(username, username)
- };
-
- const loginPage = new LoginPage();
- const page = new BrowsingPage();
-
- beforeAll(async (done) => {
- await apis.admin.people.createUser({ username });
-
- parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
-
- fileDocxSharedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxShared.name)).entry.id;
- fileDocxSharedFavId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxSharedFav.name)).entry.id;
- fileSharedId = (await apis.user.nodes.createFile(data.fileShared.name, parentId)).entry.id;
- fileSharedFavId = (await apis.user.nodes.createFile(data.fileSharedFav.name, parentId)).entry.id;
- fileSharedLockedId = (await apis.user.nodes.createFile(data.fileSharedLocked.name, parentId)).entry.id;
- fileSharedFavLockedId = (await apis.user.nodes.createFile(data.fileSharedFavLocked.name, parentId)).entry.id;
-
- await apis.user.favorites.addFavoritesByIds('file', [
- fileDocxSharedFavId,
- fileSharedFavId,
- fileSharedFavLockedId
- ]);
-
- await apis.user.shared.shareFilesByIds([
- fileDocxSharedId,
- fileDocxSharedFavId,
- fileSharedId,
- fileSharedFavId,
- fileSharedLockedId,
- fileSharedFavLockedId
- ]);
-
- await apis.user.nodes.lockFile(fileSharedLockedId);
- await apis.user.nodes.lockFile(fileSharedFavLockedId);
-
- await apis.user.favorites.waitForApi({ expect: 3 });
- await apis.user.shared.waitForApi({ expect: 6 });
-
- await loginPage.loginWith(username);
- done();
- });
-
- afterAll(async (done) => {
- await apis.user.nodes.deleteNodeById(parentId);
- done();
- });
-
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await page.clickSharedFilesAndWait();
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- describe('single selection', () => {
- it('File Office, shared - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocxShared.name, data.fileDocxShared.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.sharedToolbarMore);
- await testUtil.checkContextMenu(data.fileDocxShared.name, data.fileDocxShared.sharedContextMenu);
- });
-
- it('File Office, shared, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocxSharedFav.name, data.fileDocxSharedFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.sharedToolbarMore);
- await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.sharedContextMenu);
- });
-
- it('File shared - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileShared.name, data.fileShared.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileShared.name, data.fileShared.sharedToolbarMore);
- await testUtil.checkContextMenu(data.fileShared.name, data.fileShared.sharedContextMenu);
- });
-
- it('File shared, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedFav.name, data.fileSharedFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.sharedToolbarMore);
- await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.sharedContextMenu);
- });
-
- it('File shared, locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedLocked.name, data.fileSharedLocked.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.sharedToolbarMore);
- await testUtil.checkContextMenu(data.fileSharedLocked.name, data.fileSharedLocked.sharedContextMenu);
- });
-
- it('File shared, favorite, locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedFavLocked.name, data.fileSharedFavLocked.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.sharedToolbarMore);
- await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.sharedContextMenu);
- });
- });
-
- describe('multiple selection', () => {
- it('multiple files - [C280467]', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileShared.name, data.fileSharedFav.name ], data.multipleSel.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileShared.name, data.fileSharedFav.name ], data.multipleSel.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileShared.name, data.fileSharedFav.name ], data.multipleSel.toolbarMore);
- });
-
- it('multiple files - all favorite - []', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileSharedFav.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileSharedFav.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileSharedFav.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.toolbarMore);
- });
-
- it('multiple locked files - [C297623]', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileSharedLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileSharedLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileSharedLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarMore);
- });
- });
-
-});
diff --git a/e2e/suites/actions-available/files-folders/test-data-files-folders.ts b/e2e/suites/actions-available/files-folders/test-data.ts
similarity index 83%
rename from e2e/suites/actions-available/files-folders/test-data-files-folders.ts
rename to e2e/suites/actions-available/files-folders/test-data.ts
index c2c24971e..10cb960af 100644
--- a/e2e/suites/actions-available/files-folders/test-data-files-folders.ts
+++ b/e2e/suites/actions-available/files-folders/test-data.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -64,22 +64,18 @@ const viewerLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Favori
// ---- FAVORITES workarounds ----
-// TODO: add Edit Offline when ACA-2174 is fixed
-// TODO: change 'Share' into 'Shared Link Settings' when ACA-2175 is done
-// TODO: investigate why 'Edit in Microsoft Office™' and 'Permissions' are not displayed and raise issue
-
-// TODO: change 'Share' into 'Shared Link Settings' when ACA-2175 is done
-const favoritesSharedToolbarPrimary = ['Share', 'Download', 'View', 'View Details', 'More Actions'];
-// TODO: add Edit Offline when ACA-2174 is fixed
-// TODO: investigate why 'Edit in Microsoft Office™' and 'Permissions' are not displayed and raise issue
+// TODO: investigate why 'Edit Offline', 'Edit in Microsoft Office™' and 'Permissions' are not displayed and raise issue
const favoritesContextMenu = ['Share', 'Download', 'View', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
-// TODO: add Edit Offline when ACA-2174 is fixed
-// TODO: investigate why 'Edit in Microsoft Office™' and 'Permissions' are not displayed and raise issue
+// TODO: investigate why 'Permissions' is not displayed and raise issue
+const favoritesLockedContextMenu = ['Share', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
+// TODO: investigate why 'Edit Offline', 'Edit in Microsoft Office™' and 'Permissions' are not displayed and raise issue
const favoritesToolbarMore = ['Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
-// TODO: add Edit Offline when ACA-2174 is fixed
-// TODO: investigate why 'Edit in Microsoft Office™' and 'Permissions' are not displayed and raise issue
-// TODO: change 'Share' into 'Shared Link Settings' when ACA-2175 is done
-const favoritesSharedContextMenu = ['Share', 'Download', 'View', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
+// TODO: investigate why 'Permissions' is not displayed and raise issue
+const favoritesLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
+// TODO: investigate why 'Edit Offline', 'Edit in Microsoft Office™' and 'Permissions' are not displayed and raise issue
+const favoritesSharedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
+// TODO: investigate why 'Permissions' is not displayed and raise issue
+const favoritesSharedLockedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
// ---- SEARCH workarounds ----
@@ -111,27 +107,6 @@ const searchViewerFavLockedToolbarMore = ['Cancel Editing', 'Upload New Version'
const searchViewerDocxFavToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
const searchViewerLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions'];
-// ---- SHARED workarounds ----
-
-// TODO: add Edit Offline to expectedContextMenu when ACA-2173 is fixed
-const sharedFilesDocxContextMenu = ['Shared Link Settings', 'Download', 'View', 'Edit in Microsoft Office™', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
-// TODO: add Edit Offline to expectedToolbarMore when ACA-2173 is fixed
-const sharedFilesDocxToolbarMore = ['Edit in Microsoft Office™', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
-// TODO: add Edit Offline to expectedContextMenu when ACA-2173 is fixed
-const sharedFilesDocxSharedFavContextMenu = ['Shared Link Settings', 'Download', 'View', 'Edit in Microsoft Office™', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
-// TODO: add Edit Offline to expectedToolbarMore when ACA-2173 is fixed
-const sharedFilesDocxSharedFavToolbarMore = ['Edit in Microsoft Office™', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
-// TODO: add Cancel Editing to expectedContextMenu when ACA-2173 is fixed
-const sharedFilesSharedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
-// TODO: add Cancel Editing to expectedToolbarMore when ACA-2173 is fixed
-const sharedFilesSharedToolbarMore = ['Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
-// TODO: add Edit Offline to expectedToolbarMore when ACA-2173 is fixed
-const sharedFilesFavSharedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
-// TODO: add Cancel Editing to expectedToolbarMore when ACA-2173 is fixed
-const sharedFilesSharedFavToolbarMore = ['Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
-
-
-
export const fileDocx = {
name: `file-docx-${Utils.random()}.docx`,
@@ -216,10 +191,7 @@ export const fileDocxShared = {
searchContextMenu: searchDocxSharedContextMenu,
searchToolbarPrimary: searchSharedToolbarPrimary,
searchToolbarMore: searchDocxToolbarMore,
- searchViewerToolbarMore: searchViewerDocxToolbarMore,
-
- sharedContextMenu: sharedFilesDocxContextMenu,
- sharedToolbarMore: sharedFilesDocxToolbarMore
+ searchViewerToolbarMore: searchViewerDocxToolbarMore
};
export const fileDocxSharedFav = {
@@ -233,16 +205,13 @@ export const fileDocxSharedFav = {
viewerToolbarMore: viewerDocxFavToolbarMore,
favoritesContextMenu: favoritesSharedContextMenu,
- favoritesToolbarPrimary: favoritesSharedToolbarPrimary,
+ favoritesToolbarPrimary: fileSharedToolbarPrimary,
favoritesToolbarMore,
searchContextMenu: searchDocxSharedFavContextMenu,
searchToolbarPrimary: searchSharedToolbarPrimary,
searchToolbarMore: searchDocxFavToolbarMore,
- searchViewerToolbarMore: searchViewerDocxFavToolbarMore,
-
- sharedContextMenu: sharedFilesDocxSharedFavContextMenu,
- sharedToolbarMore: sharedFilesDocxSharedFavToolbarMore
+ searchViewerToolbarMore: searchViewerDocxFavToolbarMore
};
export const fileShared = {
@@ -258,10 +227,7 @@ export const fileShared = {
searchContextMenu: searchSharedContextMenu,
searchToolbarPrimary: searchSharedToolbarPrimary,
searchToolbarMore,
- searchViewerToolbarMore,
-
- sharedContextMenu: sharedFilesSharedContextMenu,
- sharedToolbarMore: sharedFilesSharedToolbarMore
+ searchViewerToolbarMore
};
export const fileSharedFav = {
@@ -275,16 +241,13 @@ export const fileSharedFav = {
viewerToolbarMore: viewerFavToolbarMore,
favoritesContextMenu: favoritesSharedContextMenu,
- favoritesToolbarPrimary: favoritesSharedToolbarPrimary,
+ favoritesToolbarPrimary: fileSharedToolbarPrimary,
favoritesToolbarMore,
searchContextMenu: searchSharedFavContextMenu,
searchToolbarPrimary: searchSharedToolbarPrimary,
searchToolbarMore: searchFavToolbarMore,
- searchViewerToolbarMore: searchViewerFavToolbarMore,
-
- sharedContextMenu: sharedFilesFavSharedContextMenu,
- sharedToolbarMore: sharedFilesSharedFavToolbarMore
+ searchViewerToolbarMore: searchViewerFavToolbarMore
};
export const fileLocked = {
@@ -313,8 +276,8 @@ export const fileFavLocked = {
viewerToolbarPrimary,
viewerToolbarMore: viewerFavLockedToolbarMore,
- favoritesContextMenu,
- favoritesToolbarMore,
+ favoritesContextMenu: favoritesLockedContextMenu,
+ favoritesToolbarMore: favoritesLockedToolbarMore,
searchContextMenu: searchFavLockedContextMenu,
searchToolbarPrimary,
@@ -335,10 +298,7 @@ export const fileSharedLocked = {
searchContextMenu: searchSharedLockedContextMenu,
searchToolbarPrimary: searchSharedToolbarPrimary,
searchToolbarMore: searchLockedToolbarMore,
- searchViewerToolbarMore: searchViewerLockedToolbarMore,
-
- sharedContextMenu: sharedFilesSharedContextMenu,
- sharedToolbarMore: sharedFilesSharedToolbarMore
+ searchViewerToolbarMore: searchViewerLockedToolbarMore
};
export const fileSharedFavLocked = {
@@ -351,17 +311,14 @@ export const fileSharedFavLocked = {
viewerToolbarPrimary: viewerSharedToolbarPrimary,
viewerToolbarMore: viewerFavLockedToolbarMore,
- favoritesContextMenu: favoritesSharedContextMenu,
- favoritesToolbarPrimary: favoritesSharedToolbarPrimary,
- favoritesToolbarMore,
+ favoritesToolbarMore: favoritesLockedToolbarMore,
+ favoritesContextMenu: favoritesSharedLockedContextMenu,
+ favoritesToolbarPrimary: fileSharedToolbarPrimary,
searchContextMenu: searchSharedFavLockedContextMenu,
searchToolbarPrimary: searchSharedToolbarPrimary,
searchToolbarMore: searchFavLockedToolbarMore,
- searchViewerToolbarMore: searchViewerFavLockedToolbarMore,
-
- sharedContextMenu: sharedFilesFavSharedContextMenu,
- sharedToolbarMore: sharedFilesSharedFavToolbarMore
+ searchViewerToolbarMore: searchViewerFavLockedToolbarMore
};
export const fileInTrash = {
diff --git a/e2e/suites/actions-available/files-folders/trash.test.ts b/e2e/suites/actions-available/files-folders/trash.test.ts
deleted file mode 100755
index af1e1e19d..000000000
--- a/e2e/suites/actions-available/files-folders/trash.test.ts
+++ /dev/null
@@ -1,106 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { LoginPage, BrowsingPage } from '../../../pages/pages';
-import { RepoClient } from '../../../utilities/repo-client/repo-client';
-import { Utils } from '../../../utilities/utils';
-import * as data from './test-data-files-folders';
-import * as testUtil from '../test-util';
-
-describe('File/folder actions : on Trash : ', () => {
-
- const username = `user-${Utils.random()}`;
-
- let fileInTrashId, file2InTrashId, folderInTrashId, folder2InTrashId;
-
- const apis = {
- admin: new RepoClient(),
- user: new RepoClient(username, username)
- };
-
- const loginPage = new LoginPage();
- const page = new BrowsingPage();
-
- beforeAll(async (done) => {
- await apis.admin.people.createUser({ username });
-
- fileInTrashId = (await apis.user.nodes.createFile(data.fileInTrash.name)).entry.id;
- file2InTrashId = (await apis.user.nodes.createFile(data.file2InTrash.name)).entry.id;
- folderInTrashId = (await apis.user.nodes.createFolder(data.folderInTrash.name)).entry.id;
- folder2InTrashId = (await apis.user.nodes.createFolder(data.folder2InTrash.name)).entry.id;
-
- await apis.user.nodes.deleteNodeById(fileInTrashId, false);
- await apis.user.nodes.deleteNodeById(file2InTrashId, false);
- await apis.user.nodes.deleteNodeById(folderInTrashId, false);
- await apis.user.nodes.deleteNodeById(folder2InTrashId, false);
-
- await apis.user.trashcan.waitForApi({ expect: 4 });
-
- await loginPage.loginWith(username);
- done();
- });
-
- afterAll(async (done) => {
- await apis.user.trashcan.emptyTrash();
- done();
- });
-
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await page.clickTrashAndWait();
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- it('on a file - [C286258]', async () => {
- await testUtil.checkToolbarPrimary(data.fileInTrash.name, data.fileInTrash.trashActions);
- await testUtil.checkContextMenu(data.fileInTrash.name, data.fileInTrash.trashActions);
- });
-
- it('on a folder - [C286259]', async () => {
- await testUtil.checkToolbarPrimary(data.folderInTrash.name, data.folderInTrash.trashActions);
- await testUtil.checkContextMenu(data.folderInTrash.name, data.folderInTrash.trashActions);
- });
-
- it('multiple files - [C280472]', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileInTrash.name, data.file2InTrash.name ], data.trashActions);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileInTrash.name, data.file2InTrash.name ], data.trashActions);
- });
-
- it('multiple folders - [C280473]', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.folderInTrash.name, data.folder2InTrash.name ], data.trashActions);
- await testUtil.checkMultipleSelToolbarPrimary([ data.folderInTrash.name, data.folder2InTrash.name ], data.trashActions);
- });
-
- it('both files and folders - [C280474]', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileInTrash.name, data.folderInTrash.name ], data.trashActions);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileInTrash.name, data.folderInTrash.name ], data.trashActions);
- });
-
-});
diff --git a/e2e/suites/actions-available/files-folders/trash.ts b/e2e/suites/actions-available/files-folders/trash.ts
new file mode 100755
index 000000000..7521a56c2
--- /dev/null
+++ b/e2e/suites/actions-available/files-folders/trash.ts
@@ -0,0 +1,70 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { BrowsingPage } from '../../../pages/pages';
+import { Utils } from '../../../utilities/utils';
+import * as testData from './test-data';
+import * as testUtil from '../test-util';
+
+export function trashTests() {
+ const page = new BrowsingPage();
+
+ describe('available actions : ', () => {
+
+ beforeAll(async () => {
+ await page.clickTrashAndWait();
+ });
+
+ beforeEach(async () => {
+ await Utils.pressEscape();
+ });
+
+ it('on a file - [C286258]', async () => {
+ await testUtil.checkToolbarPrimary(testData.fileInTrash.name, testData.fileInTrash.trashActions);
+ await testUtil.checkContextMenu(testData.fileInTrash.name, testData.fileInTrash.trashActions);
+ });
+
+ it('on a folder - [C286259]', async () => {
+ await testUtil.checkToolbarPrimary(testData.folderInTrash.name, testData.folderInTrash.trashActions);
+ await testUtil.checkContextMenu(testData.folderInTrash.name, testData.folderInTrash.trashActions);
+ });
+
+ it('multiple files - [C280472]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileInTrash.name, testData.file2InTrash.name ], testData.trashActions);
+ await testUtil.checkMultipleSelToolbarPrimary([ testData.fileInTrash.name, testData.file2InTrash.name ], testData.trashActions);
+ });
+
+ it('multiple folders - [C280473]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.folderInTrash.name, testData.folder2InTrash.name ], testData.trashActions);
+ await testUtil.checkMultipleSelToolbarPrimary([ testData.folderInTrash.name, testData.folder2InTrash.name ], testData.trashActions);
+ });
+
+ it('both files and folders - [C280474]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileInTrash.name, testData.folderInTrash.name ], testData.trashActions);
+ await testUtil.checkMultipleSelToolbarPrimary([ testData.fileInTrash.name, testData.folderInTrash.name ], testData.trashActions);
+ });
+
+ });
+}
diff --git a/e2e/suites/actions-available/files-folders/viewer.test.ts b/e2e/suites/actions-available/files-folders/viewer.test.ts
deleted file mode 100755
index fbb575534..000000000
--- a/e2e/suites/actions-available/files-folders/viewer.test.ts
+++ /dev/null
@@ -1,421 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { LoginPage, BrowsingPage } from '../../../pages/pages';
-import { FILES } from '../../../configs';
-import { RepoClient } from '../../../utilities/repo-client/repo-client';
-import { Utils } from '../../../utilities/utils';
-import * as data from './test-data-files-folders';
-import * as testUtil from '../test-util';
-
-describe('File/folder actions : in the viewer : ', () => {
-
- const random = Utils.random();
-
- const username = `user-${random}`;
-
- const parent = `parent-${random}`; let parentId;
-
- let fileDocxFavId, fileFavId, fileDocxSharedId, fileDocxSharedFavId, fileSharedId, fileSharedFavId, fileLockedId, fileFavLockedId, fileSharedLockedId, fileSharedFavLockedId;
-
- const apis = {
- admin: new RepoClient(),
- user: new RepoClient(username, username)
- };
-
- const loginPage = new LoginPage();
- const page = new BrowsingPage();
- const { dataTable } = page;
- const { searchInput } = page.header;
-
- beforeAll(async (done) => {
- await apis.admin.people.createUser({ username });
-
- parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
-
- await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocx.name );
- fileDocxFavId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxFav.name)).entry.id;
- await apis.user.nodes.createFile(data.file.name, parentId);
- fileFavId = (await apis.user.nodes.createFile(data.fileFav.name, parentId)).entry.id;
- fileDocxSharedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxShared.name)).entry.id;
- fileDocxSharedFavId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxSharedFav.name)).entry.id;
- fileSharedId = (await apis.user.nodes.createFile(data.fileShared.name, parentId)).entry.id;
- fileSharedFavId = (await apis.user.nodes.createFile(data.fileSharedFav.name, parentId)).entry.id;
- fileLockedId = (await apis.user.nodes.createFile(data.fileLocked.name, parentId)).entry.id;
- fileFavLockedId = (await apis.user.nodes.createFile(data.fileFavLocked.name, parentId)).entry.id;
- fileSharedLockedId = (await apis.user.nodes.createFile(data.fileSharedLocked.name, parentId)).entry.id;
- fileSharedFavLockedId = (await apis.user.nodes.createFile(data.fileSharedFavLocked.name, parentId)).entry.id;
-
- await apis.user.favorites.addFavoritesByIds('file', [
- fileDocxFavId,
- fileFavId,
- fileDocxSharedFavId,
- fileSharedFavId,
- fileFavLockedId,
- fileSharedFavLockedId
- ]);
-
- await apis.user.shared.shareFilesByIds([
- fileDocxSharedId,
- fileDocxSharedFavId,
- fileSharedId,
- fileSharedFavId,
- fileSharedLockedId,
- fileSharedFavLockedId
- ]);
-
- await apis.user.nodes.lockFile(fileLockedId);
- await apis.user.nodes.lockFile(fileFavLockedId);
- await apis.user.nodes.lockFile(fileSharedLockedId);
- await apis.user.nodes.lockFile(fileSharedFavLockedId);
-
- await apis.user.favorites.waitForApi({ expect: 6 });
- await apis.user.shared.waitForApi({ expect: 6 });
-
- await loginPage.loginWith(username);
- done();
- });
-
- afterAll(async (done) => {
- await apis.user.nodes.deleteNodeById(parentId);
- done();
- });
-
- describe('file opened from Personal Files', () => {
-
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await page.clickPersonalFilesAndWait();
- await dataTable.doubleClickOnRowByName(parent);
- await dataTable.waitForHeader();
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- it('File Office - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocx.name, data.fileDocx.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocx.name, data.fileDocx.viewerToolbarMore);
- });
-
- it('File Office, favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarMore);
- });
-
- it('File simple - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.file.name, data.file.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.file.name, data.file.viewerToolbarMore);
- });
-
- it('File favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileFav.name, data.fileFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileFav.name, data.fileFav.viewerToolbarMore);
- });
-
- it('File Office, shared - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarMore);
- });
-
- it('File Office, shared, favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarMore);
- });
-
- it('File shared - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileShared.name, data.fileShared.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileShared.name, data.fileShared.viewerToolbarMore);
- });
-
- it('File shared, favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarMore);
- });
-
- it('File locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileLocked.name, data.fileLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileLocked.name, data.fileLocked.viewerToolbarMore);
- });
-
- it('File favorite, locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarMore);
- });
-
- it('File shared, locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarMore);
- });
-
- it('File shared, favorite, locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarMore);
- });
- });
-
- describe('file opened from Recent Files', () => {
-
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await page.clickRecentFilesAndWait();
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- it('File Office - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocx.name, data.fileDocx.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocx.name, data.fileDocx.viewerToolbarMore);
- });
-
- it('File Office, favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarMore);
- });
-
- it('File simple - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.file.name, data.file.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.file.name, data.file.viewerToolbarMore);
- });
-
- it('File favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileFav.name, data.fileFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileFav.name, data.fileFav.viewerToolbarMore);
- });
-
- it('File Office, shared - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarMore);
- });
-
- it('File Office, shared, favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarMore);
- });
-
- it('File shared - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileShared.name, data.fileShared.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileShared.name, data.fileShared.viewerToolbarMore);
- });
-
- it('File shared, favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarMore);
- });
-
- it('File locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileLocked.name, data.fileLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileLocked.name, data.fileLocked.viewerToolbarMore);
- });
-
- it('File favorite, locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarMore);
- });
-
- it('File shared, locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarMore);
- });
-
- it('File shared, favorite, locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarMore);
- });
- });
-
- describe('file opened from Favorites', () => {
-
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await page.clickFavoritesAndWait();
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- it('File Office, favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarMore);
- });
-
- it('File favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileFav.name, data.fileFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileFav.name, data.fileFav.viewerToolbarMore);
- });
-
- it('File Office, shared, favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarMore);
- });
-
- it('File shared, favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarMore);
- });
-
- it('File favorite, locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarMore);
- });
-
- it('File shared, favorite, locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarMore);
- });
- });
-
- describe('file opened from Shared Files', () => {
-
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await page.clickSharedFilesAndWait();
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- it('File Office, shared - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarMore);
- });
-
- it('File Office, shared, favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarMore);
- });
-
- it('File shared - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileShared.name, data.fileShared.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileShared.name, data.fileShared.viewerToolbarMore);
- });
-
- it('File shared, favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarMore);
- });
-
- it('File shared, locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarMore);
- });
-
- it('File shared, favorite, locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarMore);
- });
- });
-
- describe('file opened from Search Results', () => {
-
- beforeAll(async (done) => {
- await Utils.pressEscape();
- await page.clickPersonalFiles();
- await searchInput.clickSearchButton();
- await searchInput.checkOnlyFiles();
- await searchInput.searchFor('file-');
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- it('File Office - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocx.name, data.fileDocx.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocx.name, data.fileDocx.searchViewerToolbarMore);
- });
-
- it('File Office, favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.searchViewerToolbarMore);
- });
-
- it('File simple - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.file.name, data.file.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.file.name, data.file.searchViewerToolbarMore);
- });
-
- it('File favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileFav.name, data.fileFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileFav.name, data.fileFav.searchViewerToolbarMore);
- });
-
- it('File Office, shared - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.searchViewerToolbarMore);
- });
-
- it('File Office, shared, favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.searchViewerToolbarMore);
- });
-
- it('File shared - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileShared.name, data.fileShared.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileShared.name, data.fileShared.searchViewerToolbarMore);
- });
-
- it('File shared, favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.searchViewerToolbarMore);
- });
-
- it('File locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileLocked.name, data.fileLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileLocked.name, data.fileLocked.searchViewerToolbarMore);
- });
-
- it('File favorite, locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.searchViewerToolbarMore);
- });
-
- it('File shared, locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.searchViewerToolbarMore);
- });
-
- it('File shared, favorite, locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.searchViewerToolbarMore);
- });
- });
-
-});
diff --git a/e2e/suites/actions-available/files-folders/viewer.ts b/e2e/suites/actions-available/files-folders/viewer.ts
new file mode 100755
index 000000000..9c6a9babc
--- /dev/null
+++ b/e2e/suites/actions-available/files-folders/viewer.ts
@@ -0,0 +1,283 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { BrowsingPage, SearchResultsPage } from '../../../pages/pages';
+import { Utils } from '../../../utilities/utils';
+import * as testData from './test-data';
+import * as testUtil from '../test-util';
+
+export function viewerTests(parentName?: string) {
+ const page = new BrowsingPage();
+ const searchResultsPage = new SearchResultsPage();
+ const { dataTable } = page;
+ const { searchInput } = page.header;
+
+ describe('available actions : ', () => {
+
+ beforeAll(async () => {
+ await page.clickPersonalFiles();
+ });
+
+ beforeEach(async () => {
+ await Utils.pressEscape();
+ });
+
+ afterEach(async () => {
+ await page.closeOpenDialogs();
+ });
+
+ describe('file opened from Personal Files', () => {
+
+ beforeAll(async () => {
+ await page.clickPersonalFilesAndWait();
+ await dataTable.doubleClickOnRowByName(parentName);
+ await dataTable.waitForHeader();
+ });
+
+ it('File Office - [C282025]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocx.name, testData.fileDocx.viewerToolbarPrimary, testData.fileDocx.viewerToolbarMore);
+ });
+
+ it('File Office, favorite - [C297583]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocxFav.name, testData.fileDocxFav.viewerToolbarPrimary, testData.fileDocxFav.viewerToolbarMore);
+ });
+
+ it('File simple - [C297587]', async () => {
+ await testUtil.checkViewerActions(testData.file.name, testData.file.viewerToolbarPrimary, testData.file.viewerToolbarMore);
+ });
+
+ it('File favorite - [C297588]', async () => {
+ await testUtil.checkViewerActions(testData.fileFav.name, testData.fileFav.viewerToolbarPrimary, testData.fileFav.viewerToolbarMore);
+ });
+
+ it('File Office, shared - [C297597]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocxShared.name, testData.fileDocxShared.viewerToolbarPrimary, testData.fileDocxShared.viewerToolbarMore);
+ });
+
+ it('File Office, shared, favorite - [C297598]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.viewerToolbarPrimary, testData.fileDocxSharedFav.viewerToolbarMore);
+ });
+
+ it('File shared - [C291831]', async () => {
+ await testUtil.checkViewerActions(testData.fileShared.name, testData.fileShared.viewerToolbarPrimary, testData.fileShared.viewerToolbarMore);
+ });
+
+ it('File shared, favorite - [C297632]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.viewerToolbarMore);
+ });
+
+ it('File locked - [C291832]', async () => {
+ await testUtil.checkViewerActions(testData.fileLocked.name, testData.fileLocked.viewerToolbarPrimary, testData.fileLocked.viewerToolbarMore);
+ });
+
+ it('File favorite, locked - [C297593]', async () => {
+ await testUtil.checkViewerActions(testData.fileFavLocked.name, testData.fileFavLocked.viewerToolbarPrimary, testData.fileFavLocked.viewerToolbarMore);
+ });
+
+ it('File shared, locked - [C291833]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedLocked.name, testData.fileSharedLocked.viewerToolbarPrimary, testData.fileSharedLocked.viewerToolbarMore);
+ });
+
+ it('File shared, favorite, locked - [C297592]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.viewerToolbarPrimary, testData.fileSharedFavLocked.viewerToolbarMore);
+ });
+ });
+
+ describe('file opened from Recent Files', () => {
+
+ beforeAll(async () => {
+ await page.clickRecentFilesAndWait();
+ });
+
+ it('File Office - [C297599]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocx.name, testData.fileDocx.viewerToolbarPrimary, testData.fileDocx.viewerToolbarMore);
+ });
+
+ it('File Office, favorite - [C297600]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocxFav.name, testData.fileDocxFav.viewerToolbarPrimary, testData.fileDocxFav.viewerToolbarMore);
+ });
+
+ it('File simple - [C326692]', async () => {
+ await testUtil.checkViewerActions(testData.file.name, testData.file.viewerToolbarPrimary, testData.file.viewerToolbarMore);
+ });
+
+ it('File favorite - [C326693]', async () => {
+ await testUtil.checkViewerActions(testData.fileFav.name, testData.fileFav.viewerToolbarPrimary, testData.fileFav.viewerToolbarMore);
+ });
+
+ it('File Office, shared - [C326694]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocxShared.name, testData.fileDocxShared.viewerToolbarPrimary, testData.fileDocxShared.viewerToolbarMore);
+ });
+
+ it('File Office, shared, favorite - [C326695]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.viewerToolbarPrimary, testData.fileDocxSharedFav.viewerToolbarMore);
+ });
+
+ it('File shared - [C326696]', async () => {
+ await testUtil.checkViewerActions(testData.fileShared.name, testData.fileShared.viewerToolbarPrimary, testData.fileShared.viewerToolbarMore);
+ });
+
+ it('File shared, favorite - [C326697]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.viewerToolbarMore);
+ });
+
+ it('File locked - [C326698]', async () => {
+ await testUtil.checkViewerActions(testData.fileLocked.name, testData.fileLocked.viewerToolbarPrimary, testData.fileLocked.viewerToolbarMore);
+ });
+
+ it('File favorite, locked - [C326701]', async () => {
+ await testUtil.checkViewerActions(testData.fileFavLocked.name, testData.fileFavLocked.viewerToolbarPrimary, testData.fileFavLocked.viewerToolbarMore);
+ });
+
+ it('File shared, locked - [C326699]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedLocked.name, testData.fileSharedLocked.viewerToolbarPrimary, testData.fileSharedLocked.viewerToolbarMore);
+ });
+
+ it('File shared, favorite, locked - [C326700]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.viewerToolbarPrimary, testData.fileSharedFavLocked.viewerToolbarMore);
+ });
+ });
+
+ describe('file opened from Favorites', () => {
+
+ beforeAll(async () => {
+ await page.clickFavoritesAndWait();
+ });
+
+ it('File Office, favorite - [C326702]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocxFav.name, testData.fileDocxFav.viewerToolbarPrimary, testData.fileDocxFav.viewerToolbarMore);
+ });
+
+ it('File favorite - [C326703]', async () => {
+ await testUtil.checkViewerActions(testData.fileFav.name, testData.fileFav.viewerToolbarPrimary, testData.fileFav.viewerToolbarMore);
+ });
+
+ it('File Office, shared, favorite - [C326704]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.viewerToolbarPrimary, testData.fileDocxSharedFav.viewerToolbarMore);
+ });
+
+ it('File shared, favorite - [C326705]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.viewerToolbarMore);
+ });
+
+ it('File favorite, locked - [C326707]', async () => {
+ await testUtil.checkViewerActions(testData.fileFavLocked.name, testData.fileFavLocked.viewerToolbarPrimary, testData.fileFavLocked.viewerToolbarMore);
+ });
+
+ it('File shared, favorite, locked - [C326706]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.viewerToolbarPrimary, testData.fileSharedFavLocked.viewerToolbarMore);
+ });
+ });
+
+ describe('file opened from Shared Files', () => {
+
+ beforeAll(async () => {
+ await page.clickSharedFilesAndWait();
+ });
+
+ it('File Office, shared - [C326708]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocxShared.name, testData.fileDocxShared.viewerToolbarPrimary, testData.fileDocxShared.viewerToolbarMore);
+ });
+
+ it('File Office, shared, favorite - [C326709]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.viewerToolbarPrimary, testData.fileDocxSharedFav.viewerToolbarMore);
+ });
+
+ it('File shared - [C326710]', async () => {
+ await testUtil.checkViewerActions(testData.fileShared.name, testData.fileShared.viewerToolbarPrimary, testData.fileShared.viewerToolbarMore);
+ });
+
+ it('File shared, favorite - [C326711]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.viewerToolbarMore);
+ });
+
+ it('File shared, locked - [C326712]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedLocked.name, testData.fileSharedLocked.viewerToolbarPrimary, testData.fileSharedLocked.viewerToolbarMore);
+ });
+
+ it('File shared, favorite, locked - [C326713]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.viewerToolbarPrimary, testData.fileSharedFavLocked.viewerToolbarMore);
+ });
+ });
+
+ describe('file opened from Search Results', () => {
+
+ beforeAll(async () => {
+ await searchInput.clickSearchButton();
+ await searchInput.searchFor('file-');
+ await searchResultsPage.waitForResults();
+ });
+
+ it('File Office - [C326714]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocx.name, testData.fileDocx.viewerToolbarPrimary, testData.fileDocx.searchViewerToolbarMore);
+ });
+
+ it('File Office, favorite - [C326715]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocxFav.name, testData.fileDocxFav.viewerToolbarPrimary, testData.fileDocxFav.searchViewerToolbarMore);
+ });
+
+ it('File simple - [C326716]', async () => {
+ await testUtil.checkViewerActions(testData.file.name, testData.file.viewerToolbarPrimary, testData.file.searchViewerToolbarMore);
+ });
+
+ it('File favorite - [C326717]', async () => {
+ await testUtil.checkViewerActions(testData.fileFav.name, testData.fileFav.viewerToolbarPrimary, testData.fileFav.searchViewerToolbarMore);
+ });
+
+ it('File Office, shared - [C326718]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocxShared.name, testData.fileDocxShared.viewerToolbarPrimary, testData.fileDocxShared.searchViewerToolbarMore);
+ });
+
+ it('File Office, shared, favorite - [C326719]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.viewerToolbarPrimary, testData.fileDocxSharedFav.searchViewerToolbarMore);
+ });
+
+ it('File shared - [C326720]', async () => {
+ await testUtil.checkViewerActions(testData.fileShared.name, testData.fileShared.viewerToolbarPrimary, testData.fileShared.searchViewerToolbarMore);
+ });
+
+ it('File shared, favorite - [C326721]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.searchViewerToolbarMore);
+ });
+
+ it('File locked - [C326722]', async () => {
+ await testUtil.checkViewerActions(testData.fileLocked.name, testData.fileLocked.viewerToolbarPrimary, testData.fileLocked.searchViewerToolbarMore);
+ });
+
+ it('File favorite, locked - [C326725]', async () => {
+ await testUtil.checkViewerActions(testData.fileFavLocked.name, testData.fileFavLocked.viewerToolbarPrimary, testData.fileFavLocked.searchViewerToolbarMore);
+ });
+
+ it('File shared, locked - [C326723]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedLocked.name, testData.fileSharedLocked.viewerToolbarPrimary, testData.fileSharedLocked.searchViewerToolbarMore);
+ });
+
+ it('File shared, favorite, locked - [C326724]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.viewerToolbarPrimary, testData.fileSharedFavLocked.searchViewerToolbarMore);
+ });
+ });
+
+ });
+}
diff --git a/e2e/suites/actions-available/generic.test.ts b/e2e/suites/actions-available/generic.test.ts
index 467b2d5c2..c92cd1571 100755
--- a/e2e/suites/actions-available/generic.test.ts
+++ b/e2e/suites/actions-available/generic.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -23,202 +23,194 @@
* along with Alfresco. If not, see .
*/
-import { browser, protractor } from 'protractor';
import { LoginPage, BrowsingPage } from '../../pages/pages';
-import { RepoClient } from '../../utilities/repo-client/repo-client';
+import { RepoClient, NodeContentTree } from '../../utilities/repo-client/repo-client';
import { Utils } from '../../utilities/utils';
-
+import { AdminActions } from '../../utilities/admin-actions';
describe('Generic tests : ', () => {
-
const random = Utils.random();
const username = `user-${random}`;
- const parent = `parent-${random}`; let parentId;
+ const parent = `parent-${random}`;
const file1 = `file1-${random}.txt`;
const file2 = `file2-${random}.txt`;
- const folder1 = `my-folder1-${Utils.random()}`;
- const folder2 = `my-folder2-${Utils.random()}`;
+ const folder1 = `my-folder1-${random}`;
+ const folder2 = `my-folder2-${random}`;
- const apis = {
- admin: new RepoClient(),
- user: new RepoClient(username, username)
+ const content: NodeContentTree = {
+ name: parent,
+ files: [file1, file2],
+ folders: [folder1, folder2]
};
+ const userApi = new RepoClient(username, username);
+
+ const adminApiActions = new AdminActions();
+
const loginPage = new LoginPage();
const page = new BrowsingPage();
const { dataTable, toolbar } = page;
const { searchInput } = page.header;
const contextMenu = dataTable.menu;
- beforeAll(async (done) => {
- await apis.admin.people.createUser({ username });
+ beforeAll(async () => {
+ await adminApiActions.createUser({ username });
- parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
- await apis.user.nodes.createFile(file1, parentId);
- await apis.user.nodes.createFile(file2, parentId);
-
- await apis.user.nodes.createFolder(folder1, parentId);
- await apis.user.nodes.createFolder(folder2, parentId);
+ await userApi.nodes.createContent(content);
await loginPage.loginWith(username);
- done();
});
- afterAll(async (done) => {
- await apis.user.nodes.deleteNodeById(parentId);
- done();
+ afterAll(async () => {
+ await userApi.nodes.deleteNodeByPath(parent);
});
- beforeEach(async (done) => {
+ beforeEach(async () => {
await Utils.pressEscape();
- await page.clickPersonalFilesAndWait();
- await dataTable.doubleClickOnRowByName(parent);
- await dataTable.waitForHeader();
- done();
});
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
+ describe('single selection', () => {
+ beforeEach(async () => {
+ await page.clickPersonalFilesAndWait();
+ await dataTable.doubleClickOnRowByName(parent);
+ await dataTable.waitForHeader();
+ });
- it('selected row is marked with a check circle icon - [C213134]', async () => {
- await dataTable.selectItem(file1);
- expect(await dataTable.hasCheckMarkIcon(file1)).toBe(true, 'check mark missing');
- });
+ it('selected row is marked with a check circle icon - [C213134]', async () => {
+ await dataTable.selectItem(file1);
+ expect(await dataTable.hasCheckMarkIcon(file1)).toBe(true, 'check mark missing');
+ });
- it('Row is marked with a check circle icon on direct right click - [C286252]', async () => {
- await dataTable.rightClickOnItem(file2);
- expect(await dataTable.hasCheckMarkIcon(file2)).toBe(true, 'check mark missing');
- });
+ it('Row is marked with a check circle icon on direct right click - [C286252]', async () => {
+ await dataTable.rightClickOnItem(file2);
+ expect(await dataTable.hasCheckMarkIcon(file2)).toBe(true, 'check mark missing');
+ });
- it('Context menu appears on direct right click on an item - [C286253]', async () => {
- await dataTable.rightClickOnItem(file1);
- expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed');
- });
+ it('Context menu appears on direct right click on an item - [C286253]', async () => {
+ await dataTable.rightClickOnItem(file1);
+ expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed');
+ });
- it('Context menu appears when selecting an item and then right clicking on it - [C286254]', async () => {
- await dataTable.selectItem(file2);
- await dataTable.rightClickOnItem(file2);
- expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed');
- });
+ it('Context menu appears when selecting an item and then right clicking on it - [C286254]', async () => {
+ await dataTable.selectItem(file2);
+ await dataTable.rightClickOnItem(file2);
+ expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed');
+ });
- it('Context menu appears correctly when right clicking on another item - [C284666]', async () => {
- await dataTable.selectItem(file1);
- await dataTable.rightClickOnItem(file2);
- expect(await dataTable.hasContextMenu()).toBe(true, `Context menu is not displayed`);
- expect(await dataTable.hasCheckMarkIcon(file2)).toBe(true, `${file2} is not selected`);
- expect(await dataTable.hasCheckMarkIcon(file1)).toBe(false, `${file1} is not selected`);
- });
+ it('Context menu appears correctly when right clicking on another item - [C284666]', async () => {
+ await dataTable.selectItem(file1);
+ await dataTable.rightClickOnItem(file2);
+ expect(await dataTable.hasContextMenu()).toBe(true, `Context menu is not displayed`);
+ expect(await dataTable.hasCheckMarkIcon(file2)).toBe(true, `${file2} is not selected`);
+ expect(await dataTable.hasCheckMarkIcon(file1)).toBe(false, `${file1} is not selected`);
+ });
- it('Context menu closes when clicking away from it - [C280619]', async () => {
- await dataTable.rightClickOnItem(file1);
- expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed');
- await page.breadcrumb.getCurrentItem().click();
- expect(await dataTable.hasContextMenu()).toBe(false, 'Context menu is displayed');
+ it('Context menu closes when clicking away from it - [C280619]', async () => {
+ await dataTable.rightClickOnItem(file1);
+ expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed');
+ await page.breadcrumb.getCurrentItem().click();
+ expect(await dataTable.hasContextMenu()).toBe(false, 'Context menu is displayed');
+ });
});
describe('Actions are not displayed when no item is selected', () => {
+
it('on Personal Files - [C213120]', async () => {
await page.clickPersonalFilesAndWait();
- await dataTable.clearSelection();
expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`);
});
it('on Trash - [C280452]', async () => {
await page.clickTrash();
- await dataTable.clearSelection();
expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`);
});
it('on Favorites - [C280449]', async () => {
await page.clickFavorites();
- await dataTable.clearSelection();
expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`);
});
it('on Recent Files - [C280447]', async () => {
+ await userApi.search.waitForApi(username, { expect: 2 });
await page.clickRecentFilesAndWait();
- await dataTable.clearSelection();
expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`);
});
it('on Shared Files - [C280445]', async () => {
await page.clickSharedFiles();
- await dataTable.clearSelection();
expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`);
});
it('on My Libraries - [C280439]', async () => {
await page.goToMyLibraries();
- await dataTable.clearSelection();
expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`);
});
it('on Favorite Libraries - [C280439]', async () => {
await page.goToFavoriteLibraries();
- await dataTable.clearSelection();
expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`);
});
it('on Search Results - [C291815]', async () => {
await searchInput.clickSearchButton();
- await searchInput.checkFilesAndFolders();
await searchInput.searchFor('*');
- expect(await toolbar.isToggleSearchFiltersPresent()).toBe(true, `Search filter toggle is not displayed`);
- expect(await toolbar.numberOfAvailableActions()).toBe(1, `more than 1 action is present`);
+ expect(await toolbar.getButtons()).toEqual(['Toggle search filter']);
});
});
- it('Context menu appears on right click on a multiple selection of items - [C286268]', async () => {
- await dataTable.selectMultipleItems([ file1, file2 ]);
- await dataTable.rightClickOnMultipleSelection();
+ describe('multiple selection', () => {
+ beforeEach(async () => {
+ await page.clickPersonalFilesAndWait();
+ await dataTable.doubleClickOnRowByName(parent);
+ await dataTable.waitForHeader();
+ });
- expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed');
- });
+ it('Context menu appears on right click on a multiple selection of items - [C286268]', async () => {
+ await dataTable.selectMultipleItems([ file1, file2 ]);
+ await dataTable.rightClickOnMultipleSelection();
- it('Context menu appears when right clicking on a single item while having multiple items selected - [C286269]', async () => {
- await dataTable.selectMultipleItems([ file2, folder1 ]);
- await dataTable.rightClickOnItem(file1);
+ expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed');
+ });
- expect(await dataTable.hasContextMenu()).toBe(true, `Context menu is not displayed for ${file1}`);
- expect(await dataTable.countSelectedRows()).toEqual(1, 'incorrect number of selected rows');
- expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`);
- expect(await dataTable.hasCheckMarkIcon(file1)).toBe(true, `${file1} is not selected`);
- expect(await dataTable.hasCheckMarkIcon(file2)).toBe(false, `${file2} is selected`);
- expect(await dataTable.hasCheckMarkIcon(folder1)).toBe(false, `${folder1} is selected`);
- });
+ it('Context menu appears when right clicking on a single item while having multiple items selected - [C286269]', async () => {
+ await dataTable.selectMultipleItems([ file2, folder1 ]);
+ await dataTable.rightClickOnItem(file1);
- it('Unselect items with single click - [C280458]', async () => {
- await dataTable.selectMultipleItems([file1, file2, folder1, folder2]);
+ expect(await dataTable.hasContextMenu()).toBe(true, `Context menu is not displayed for ${file1}`);
+ expect(await dataTable.getSelectedRowsCount()).toEqual(1, 'incorrect number of selected rows');
+ expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`);
+ expect(await dataTable.hasCheckMarkIcon(file1)).toBe(true, `${file1} is not selected`);
+ expect(await dataTable.hasCheckMarkIcon(file2)).toBe(false, `${file2} is selected`);
+ expect(await dataTable.hasCheckMarkIcon(folder1)).toBe(false, `${folder1} is selected`);
+ });
- expect(await dataTable.countSelectedRows()).toEqual(4, 'incorrect selected rows number');
+ it('Unselect items with single click - [C280458]', async () => {
+ await dataTable.selectMultipleItems([file1, file2, folder1, folder2]);
+ expect(await dataTable.getSelectedRowsCount()).toEqual(4, 'incorrect selected rows number');
- await dataTable.clickItem(file1);
+ await dataTable.clickItem(file1);
+ expect(await dataTable.getSelectedRowsCount()).toEqual(1, 'incorrect selected rows number');
+ });
- expect(await dataTable.countSelectedRows()).toEqual(1, 'incorrect selected rows number');
- });
+ it('Select / unselect items by CMD+click - [C217110]', async () => {
+ await Utils.pressCmd();
+ await dataTable.clickItem(file1);
+ await dataTable.clickItem(file2);
+ await dataTable.clickItem(folder1);
+ await dataTable.clickItem(folder2);
+ await Utils.releaseKeyPressed();
+ expect(await dataTable.getSelectedRowsCount()).toEqual(4, 'incorrect selected rows number');
- it('Select / unselect items by CMD+click - [C217110]', async () => {
- await browser.actions().sendKeys(protractor.Key.COMMAND).perform();
- await dataTable.clickItem(file1);
- await dataTable.clickItem(file2);
- await dataTable.clickItem(folder1);
- await dataTable.clickItem(folder2);
- await browser.actions().sendKeys(protractor.Key.NULL).perform();
-
- expect(await dataTable.countSelectedRows()).toEqual(4, 'incorrect selected rows number');
-
- await browser.actions().sendKeys(protractor.Key.COMMAND).perform();
- await dataTable.clickItem(file1);
- await dataTable.clickItem(file2);
- await browser.actions().sendKeys(protractor.Key.NULL).perform();
-
- expect(await dataTable.countSelectedRows()).toEqual(2, 'incorrect selected rows number');
+ await Utils.pressCmd();
+ await dataTable.clickItem(file1);
+ await dataTable.clickItem(file2);
+ await Utils.releaseKeyPressed();
+ expect(await dataTable.getSelectedRowsCount()).toEqual(2, 'incorrect selected rows number');
+ });
});
});
diff --git a/e2e/suites/actions-available/libraries/library.test.ts b/e2e/suites/actions-available/libraries/library.test.ts
index 5d2ad5fe4..d650b5056 100755
--- a/e2e/suites/actions-available/libraries/library.test.ts
+++ b/e2e/suites/actions-available/libraries/library.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -24,305 +24,269 @@
*/
import { LoginPage, BrowsingPage, SearchResultsPage } from '../../../pages/pages';
-import { SITE_VISIBILITY } from '../../../configs';
import { RepoClient } from '../../../utilities/repo-client/repo-client';
import { Utils } from '../../../utilities/utils';
-import * as data from './test-data-libraries';
+import { AdminActions } from '../../../utilities/admin-actions';
+import * as testData from './test-data-libraries';
import * as testUtil from '../test-util';
describe('Library actions : ', () => {
const username = `user-${Utils.random()}`;
- const apis = {
- admin: new RepoClient(),
- user: new RepoClient(username, username)
- };
+ const userApi = new RepoClient(username, username);
+
+ const adminApiActions = new AdminActions();
const loginPage = new LoginPage();
const page = new BrowsingPage();
const searchResultsPage = new SearchResultsPage();
const { searchInput } = searchResultsPage.header;
- beforeAll(async (done) => {
- await apis.admin.people.createUser({ username });
+ beforeAll(async () => {
+ await adminApiActions.createUser({ username });
- await apis.user.sites.createSite(data.publicUserMemberFav.name);
- await apis.user.sites.createSite(data.privateUserMemberFav.name, SITE_VISIBILITY.PRIVATE);
- await apis.user.sites.createSite(data.moderatedUserMemberFav.name, SITE_VISIBILITY.MODERATED);
+ await userApi.sites.createSite(testData.publicUserMemberFav.name);
+ await userApi.sites.createSitePrivate(testData.privateUserMemberFav.name);
+ await userApi.sites.createSiteModerated(testData.moderatedUserMemberFav.name);
- const publicUserMemberNotFavId = (await apis.user.sites.createSite(data.publicUserMemberNotFav.name)).entry.guid;
- const privateUserMemberNotFavId = (await apis.user.sites.createSite(data.privateUserMemberNotFav.name, SITE_VISIBILITY.PRIVATE)).entry.guid;
- const moderatedUserMemberNotFavId = (await apis.user.sites.createSite(data.moderatedUserMemberNotFav.name, SITE_VISIBILITY.MODERATED)).entry.guid;
+ const publicUserMemberNotFavId = (await userApi.sites.createSite(testData.publicUserMemberNotFav.name)).entry.guid;
+ const privateUserMemberNotFavId = (await userApi.sites.createSitePrivate(testData.privateUserMemberNotFav.name)).entry.guid;
+ const moderatedUserMemberNotFavId = (await userApi.sites.createSiteModerated(testData.moderatedUserMemberNotFav.name)).entry.guid;
- await apis.admin.sites.createSite(data.publicNotMemberFav.name);
- await apis.admin.sites.createSite(data.moderatedNotMemberFav.name, SITE_VISIBILITY.MODERATED);
+ await adminApiActions.sites.createSite(testData.publicNotMemberFav.name);
+ await adminApiActions.sites.createSiteModerated(testData.moderatedNotMemberFav.name);
- await apis.admin.sites.createSite(data.publicNotMemberNotFav.name);
- await apis.admin.sites.createSite(data.moderatedNotMemberNotFav.name, SITE_VISIBILITY.MODERATED);
+ await adminApiActions.sites.createSite(testData.publicNotMemberNotFav.name);
+ await adminApiActions.sites.createSiteModerated(testData.moderatedNotMemberNotFav.name);
- await apis.admin.sites.createSite(data.moderatedRequestedJoinFav.name, SITE_VISIBILITY.MODERATED);
- await apis.admin.sites.createSite(data.moderatedRequestedJoinNotFav.name, SITE_VISIBILITY.MODERATED);
+ await adminApiActions.sites.createSiteModerated(testData.moderatedRequestedJoinFav.name);
+ await adminApiActions.sites.createSiteModerated(testData.moderatedRequestedJoinNotFav.name);
- await apis.user.sites.createSite(data.siteInTrash.name, SITE_VISIBILITY.PUBLIC);
- await apis.user.sites.createSite(data.site2InTrash.name, SITE_VISIBILITY.PUBLIC);
+ await userApi.sites.createSite(testData.siteInTrash.name);
+ await userApi.sites.createSite(testData.site2InTrash.name);
- await apis.user.sites.waitForApi({ expect: 8 });
- await apis.admin.sites.waitForApi({ expect: 6 });
+ await Promise.all([
+ userApi.sites.waitForApi({ expect: 8 }),
+ adminApiActions.sites.waitForApi({ expect: 6 + 1 })
+ ]);
- await apis.user.favorites.removeFavoriteById(publicUserMemberNotFavId);
- await apis.user.favorites.removeFavoriteById(privateUserMemberNotFavId);
- await apis.user.favorites.removeFavoriteById(moderatedUserMemberNotFavId);
+ await userApi.favorites.removeFavoritesByIds([publicUserMemberNotFavId, privateUserMemberNotFavId, moderatedUserMemberNotFavId]);
- await apis.user.favorites.addFavoriteById('site', data.publicNotMemberFav.name);
- await apis.user.favorites.addFavoriteById('site', data.moderatedNotMemberFav.name);
- await apis.user.favorites.addFavoriteById('site', data.moderatedRequestedJoinFav.name);
+ await userApi.favorites.addFavoritesByIds('site', [testData.publicNotMemberFav.name, testData.moderatedNotMemberFav.name, testData.moderatedRequestedJoinFav.name]);
- await apis.user.sites.requestToJoin(data.moderatedRequestedJoinFav.name);
- await apis.user.sites.requestToJoin(data.moderatedRequestedJoinNotFav.name);
+ await userApi.sites.requestToJoin(testData.moderatedRequestedJoinFav.name);
+ await userApi.sites.requestToJoin(testData.moderatedRequestedJoinNotFav.name);
- await apis.user.queries.waitForSites('site-', { expect: 13 });
+ await userApi.queries.waitForSites('site-', { expect: 14 + 1 });
- await apis.user.sites.deleteSite(data.siteInTrash.name, false);
- await apis.user.sites.deleteSite(data.site2InTrash.name, false);
+ await userApi.sites.deleteSite(testData.siteInTrash.name, false);
+ await userApi.sites.deleteSite(testData.site2InTrash.name, false);
- await apis.user.trashcan.waitForApi({ expect: 2 });
+ await userApi.trashcan.waitForApi({ expect: 2 });
await loginPage.loginWith(username);
- done();
});
- afterAll(async (done) => {
+ afterAll(async () => {
await Promise.all([
- apis.user.sites.deleteSites([
- data.publicUserMemberFav.name,
- data.privateUserMemberFav.name,
- data.moderatedUserMemberFav.name,
- data.publicUserMemberNotFav.name,
- data.privateUserMemberNotFav.name,
- data.moderatedUserMemberNotFav.name
+ userApi.sites.deleteSites([
+ testData.publicUserMemberFav.name,
+ testData.privateUserMemberFav.name,
+ testData.moderatedUserMemberFav.name,
+ testData.publicUserMemberNotFav.name,
+ testData.privateUserMemberNotFav.name,
+ testData.moderatedUserMemberNotFav.name
]),
- apis.admin.sites.deleteSites([
- data.publicNotMemberFav.name,
- data.moderatedNotMemberFav.name,
- data.publicNotMemberNotFav.name,
- data.moderatedNotMemberNotFav.name,
- data.moderatedRequestedJoinFav.name,
- data.moderatedRequestedJoinNotFav.name
+ adminApiActions.sites.deleteSites([
+ testData.publicNotMemberFav.name,
+ testData.moderatedNotMemberFav.name,
+ testData.publicNotMemberNotFav.name,
+ testData.moderatedNotMemberNotFav.name,
+ testData.moderatedRequestedJoinFav.name,
+ testData.moderatedRequestedJoinNotFav.name
]),
- apis.user.trashcan.emptyTrash()
+ userApi.trashcan.emptyTrash()
]);
- done();
});
describe('on My Libraries', () => {
- beforeEach(async (done) => {
+ beforeAll(async () => {
await Utils.pressEscape();
await page.goToMyLibrariesAndWait();
- done();
});
- afterEach(async (done) => {
+ beforeEach(async () => {
await Utils.pressEscape();
- done();
});
- it('Public library, user is a member, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.publicUserMemberFav.name, data.publicUserMemberFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.publicUserMemberFav.name, data.publicUserMemberFav.toolbarMore);
- await testUtil.checkContextMenu(data.publicUserMemberFav.name, data.publicUserMemberFav.contextMenu);
+ it('Public library, user is a member, favorite - [C213135]', async () => {
+ await testUtil.checkToolbarActions(testData.publicUserMemberFav.name, testData.publicUserMemberFav.toolbarPrimary, testData.publicUserMemberFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.publicUserMemberFav.name, testData.publicUserMemberFav.contextMenu);
});
- it('Private library, user is a member, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.privateUserMemberFav.name, data.privateUserMemberFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.privateUserMemberFav.name, data.privateUserMemberFav.toolbarMore);
- await testUtil.checkContextMenu(data.privateUserMemberFav.name, data.privateUserMemberFav.contextMenu);
+ it('Private library, user is a member, favorite - [C290080]', async () => {
+ await testUtil.checkToolbarActions(testData.privateUserMemberFav.name, testData.privateUserMemberFav.toolbarPrimary, testData.privateUserMemberFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.privateUserMemberFav.name, testData.privateUserMemberFav.contextMenu);
});
- it('Moderated library, user is a member, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.toolbarMore);
- await testUtil.checkContextMenu(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.contextMenu);
+ it('Moderated library, user is a member, favorite - [C326676]', async () => {
+ await testUtil.checkToolbarActions(testData.moderatedUserMemberFav.name, testData.moderatedUserMemberFav.toolbarPrimary, testData.moderatedUserMemberFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.moderatedUserMemberFav.name, testData.moderatedUserMemberFav.contextMenu);
});
- it('Public library, user is a member, not favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.publicUserMemberNotFav.name, data.publicUserMemberNotFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.publicUserMemberNotFav.name, data.publicUserMemberNotFav.toolbarMore);
- await testUtil.checkContextMenu(data.publicUserMemberNotFav.name, data.publicUserMemberNotFav.contextMenu);
+ it('Public library, user is a member, not favorite - [C326677]', async () => {
+ await testUtil.checkToolbarActions(testData.publicUserMemberNotFav.name, testData.publicUserMemberNotFav.toolbarPrimary, testData.publicUserMemberNotFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.publicUserMemberNotFav.name, testData.publicUserMemberNotFav.contextMenu);
});
- it('Private library, user is a member, not favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.privateUserMemberNotFav.name, data.privateUserMemberNotFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.privateUserMemberNotFav.name, data.privateUserMemberNotFav.toolbarMore);
- await testUtil.checkContextMenu(data.privateUserMemberNotFav.name, data.privateUserMemberNotFav.contextMenu);
+ it('Private library, user is a member, not favorite - [C326678]', async () => {
+ await testUtil.checkToolbarActions(testData.privateUserMemberNotFav.name, testData.privateUserMemberNotFav.toolbarPrimary, testData.privateUserMemberNotFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.privateUserMemberNotFav.name, testData.privateUserMemberNotFav.contextMenu);
});
- it('Moderated library, user is a member, not favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.moderatedUserMemberNotFav.name, data.moderatedUserMemberNotFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.moderatedUserMemberNotFav.name, data.moderatedUserMemberNotFav.toolbarMore);
- await testUtil.checkContextMenu(data.moderatedUserMemberNotFav.name, data.moderatedUserMemberNotFav.contextMenu);
+ it('Moderated library, user is a member, not favorite - [C326679]', async () => {
+ await testUtil.checkToolbarActions(testData.moderatedUserMemberNotFav.name, testData.moderatedUserMemberNotFav.toolbarPrimary, testData.moderatedUserMemberNotFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.moderatedUserMemberNotFav.name, testData.moderatedUserMemberNotFav.contextMenu);
});
});
describe('on Favorite Libraries', () => {
- beforeEach(async (done) => {
+ beforeAll(async () => {
await Utils.pressEscape();
await page.goToFavoriteLibrariesAndWait();
- done();
});
- afterEach(async (done) => {
+ beforeEach(async () => {
await Utils.pressEscape();
- done();
});
- it('Public library, user is a member, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.publicUserMemberFav.name, data.publicUserMemberFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.publicUserMemberFav.name, data.publicUserMemberFav.toolbarMore);
- await testUtil.checkContextMenu(data.publicUserMemberFav.name, data.publicUserMemberFav.contextMenu);
+ it('Public library, user is a member, favorite - [C289892]', async () => {
+ await testUtil.checkToolbarActions(testData.publicUserMemberFav.name, testData.publicUserMemberFav.toolbarPrimary, testData.publicUserMemberFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.publicUserMemberFav.name, testData.publicUserMemberFav.contextMenu);
});
- it('Private library, user is a member, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.privateUserMemberFav.name, data.privateUserMemberFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.privateUserMemberFav.name, data.privateUserMemberFav.toolbarMore);
- await testUtil.checkContextMenu(data.privateUserMemberFav.name, data.privateUserMemberFav.contextMenu);
+ it('Private library, user is a member, favorite - [C290090]', async () => {
+ await testUtil.checkToolbarActions(testData.privateUserMemberFav.name, testData.privateUserMemberFav.toolbarPrimary, testData.privateUserMemberFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.privateUserMemberFav.name, testData.privateUserMemberFav.contextMenu);
});
- it('Moderated library, user is a member, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.toolbarMore);
- await testUtil.checkContextMenu(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.contextMenu);
+ it('Moderated library, user is a member, favorite - [C290091]', async () => {
+ await testUtil.checkToolbarActions(testData.moderatedUserMemberFav.name, testData.moderatedUserMemberFav.toolbarPrimary, testData.moderatedUserMemberFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.moderatedUserMemberFav.name, testData.moderatedUserMemberFav.contextMenu);
});
- it('Public library, user not a member, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.publicNotMemberFav.name, data.publicNotMemberFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.publicNotMemberFav.name, data.publicNotMemberFav.toolbarMore);
- await testUtil.checkContextMenu(data.publicNotMemberFav.name, data.publicNotMemberFav.contextMenu);
+ it('Public library, user not a member, favorite - [C290081]', async () => {
+ await testUtil.checkToolbarActions(testData.publicNotMemberFav.name, testData.publicNotMemberFav.toolbarPrimary, testData.publicNotMemberFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.publicNotMemberFav.name, testData.publicNotMemberFav.contextMenu);
});
- it('Moderated library, user not a member, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.moderatedNotMemberFav.name, data.moderatedNotMemberFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.moderatedNotMemberFav.name, data.moderatedNotMemberFav.toolbarMore);
- await testUtil.checkContextMenu(data.moderatedNotMemberFav.name, data.moderatedNotMemberFav.contextMenu);
+ it('Moderated library, user not a member, favorite - [C290082]', async () => {
+ await testUtil.checkToolbarActions(testData.moderatedNotMemberFav.name, testData.moderatedNotMemberFav.toolbarPrimary, testData.moderatedNotMemberFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.moderatedNotMemberFav.name, testData.moderatedNotMemberFav.contextMenu);
});
- it('Moderated library, user requested to join, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.moderatedRequestedJoinFav.name, data.moderatedRequestedJoinFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.moderatedRequestedJoinFav.name, data.moderatedRequestedJoinFav.toolbarMore);
- await testUtil.checkContextMenu(data.moderatedRequestedJoinFav.name, data.moderatedRequestedJoinFav.contextMenu);
+ it('Moderated library, user requested to join, favorite - [C290089]', async () => {
+ await testUtil.checkToolbarActions(testData.moderatedRequestedJoinFav.name, testData.moderatedRequestedJoinFav.toolbarPrimary, testData.moderatedRequestedJoinFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.moderatedRequestedJoinFav.name, testData.moderatedRequestedJoinFav.contextMenu);
});
});
describe('on Search Results', () => {
- beforeEach(async (done) => {
+ beforeAll(async () => {
await Utils.pressEscape();
await page.clickPersonalFiles();
await searchInput.clickSearchButton();
await searchInput.checkLibraries();
await searchInput.searchFor('site-');
- done();
});
- afterEach(async (done) => {
+ beforeEach(async () => {
await Utils.pressEscape();
- done();
});
- it('Public library, user is a member, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.publicUserMemberFav.name, data.publicUserMemberFav.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.publicUserMemberFav.name, data.publicUserMemberFav.toolbarMore);
- await testUtil.checkContextMenu(data.publicUserMemberFav.name, data.publicUserMemberFav.contextMenu);
+ it('Public library, user is a member, favorite - [C290084]', async () => {
+ await testUtil.checkToolbarActions(testData.publicUserMemberFav.name, testData.publicUserMemberFav.searchToolbarPrimary, testData.publicUserMemberFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.publicUserMemberFav.name, testData.publicUserMemberFav.contextMenu);
});
- it('Private library, user is a member, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.privateUserMemberFav.name, data.privateUserMemberFav.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.privateUserMemberFav.name, data.privateUserMemberFav.toolbarMore);
- await testUtil.checkContextMenu(data.privateUserMemberFav.name, data.privateUserMemberFav.contextMenu);
+ it('Private library, user is a member, favorite - [C290085]', async () => {
+ await testUtil.checkToolbarActions(testData.privateUserMemberFav.name, testData.privateUserMemberFav.searchToolbarPrimary, testData.privateUserMemberFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.privateUserMemberFav.name, testData.privateUserMemberFav.contextMenu);
});
- it('Moderated library, user is a member, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.toolbarMore);
- await testUtil.checkContextMenu(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.contextMenu);
+ it('Moderated library, user is a member, favorite - [C290086]', async () => {
+ await testUtil.checkToolbarActions(testData.moderatedUserMemberFav.name, testData.moderatedUserMemberFav.searchToolbarPrimary, testData.moderatedUserMemberFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.moderatedUserMemberFav.name, testData.moderatedUserMemberFav.contextMenu);
});
- it('Public library, user is a member, not favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.publicUserMemberNotFav.name, data.publicUserMemberNotFav.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.publicUserMemberNotFav.name, data.publicUserMemberNotFav.toolbarMore);
- await testUtil.checkContextMenu(data.publicUserMemberNotFav.name, data.publicUserMemberNotFav.contextMenu);
+ it('Public library, user is a member, not favorite - [C291812]', async () => {
+ await testUtil.checkToolbarActions(testData.publicUserMemberNotFav.name, testData.publicUserMemberNotFav.searchToolbarPrimary, testData.publicUserMemberNotFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.publicUserMemberNotFav.name, testData.publicUserMemberNotFav.contextMenu);
});
- it('Private library, user is a member, not favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.privateUserMemberNotFav.name, data.privateUserMemberNotFav.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.privateUserMemberNotFav.name, data.privateUserMemberNotFav.toolbarMore);
- await testUtil.checkContextMenu(data.privateUserMemberNotFav.name, data.privateUserMemberNotFav.contextMenu);
+ it('Private library, user is a member, not favorite - [C291813]', async () => {
+ await testUtil.checkToolbarActions(testData.privateUserMemberNotFav.name, testData.privateUserMemberNotFav.searchToolbarPrimary, testData.privateUserMemberNotFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.privateUserMemberNotFav.name, testData.privateUserMemberNotFav.contextMenu);
});
- it('Moderated library, user is a member, not favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.moderatedUserMemberNotFav.name, data.moderatedUserMemberNotFav.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.moderatedUserMemberNotFav.name, data.moderatedUserMemberNotFav.toolbarMore);
- await testUtil.checkContextMenu(data.moderatedUserMemberNotFav.name, data.moderatedUserMemberNotFav.contextMenu);
+ it('Moderated library, user is a member, not favorite - [C291814]', async () => {
+ await testUtil.checkToolbarActions(testData.moderatedUserMemberNotFav.name, testData.moderatedUserMemberNotFav.searchToolbarPrimary, testData.moderatedUserMemberNotFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.moderatedUserMemberNotFav.name, testData.moderatedUserMemberNotFav.contextMenu);
});
- it('Public library, user not a member, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.publicNotMemberFav.name, data.publicNotMemberFav.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.publicNotMemberFav.name, data.publicNotMemberFav.toolbarMore);
- await testUtil.checkContextMenu(data.publicNotMemberFav.name, data.publicNotMemberFav.contextMenu);
+ it('Public library, user not a member, favorite - [C326680]', async () => {
+ await testUtil.checkToolbarActions(testData.publicNotMemberFav.name, testData.publicNotMemberFav.searchToolbarPrimary, testData.publicNotMemberFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.publicNotMemberFav.name, testData.publicNotMemberFav.contextMenu);
});
- it('Moderated library, user not a member, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.moderatedNotMemberFav.name, data.moderatedNotMemberFav.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.moderatedNotMemberFav.name, data.moderatedNotMemberFav.toolbarMore);
- await testUtil.checkContextMenu(data.moderatedNotMemberFav.name, data.moderatedNotMemberFav.contextMenu);
+ it('Moderated library, user not a member, favorite - [C326681]', async () => {
+ await testUtil.checkToolbarActions(testData.moderatedNotMemberFav.name, testData.moderatedNotMemberFav.searchToolbarPrimary, testData.moderatedNotMemberFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.moderatedNotMemberFav.name, testData.moderatedNotMemberFav.contextMenu);
});
- it('Public library, user not a member, not favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.publicNotMemberNotFav.name, data.publicNotMemberNotFav.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.publicNotMemberNotFav.name, data.publicNotMemberNotFav.toolbarMore);
- await testUtil.checkContextMenu(data.publicNotMemberNotFav.name, data.publicNotMemberNotFav.contextMenu);
+ it('Public library, user not a member, not favorite - [C326682]', async () => {
+ await testUtil.checkToolbarActions(testData.publicNotMemberNotFav.name, testData.publicNotMemberNotFav.searchToolbarPrimary, testData.publicNotMemberNotFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.publicNotMemberNotFav.name, testData.publicNotMemberNotFav.contextMenu);
});
- it('Moderated library, user not a member, not favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.moderatedNotMemberNotFav.name, data.moderatedNotMemberNotFav.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.moderatedNotMemberNotFav.name, data.moderatedNotMemberNotFav.toolbarMore);
- await testUtil.checkContextMenu(data.moderatedNotMemberNotFav.name, data.moderatedNotMemberNotFav.contextMenu);
+ it('Moderated library, user not a member, not favorite - [C326683]', async () => {
+ await testUtil.checkToolbarActions(testData.moderatedNotMemberNotFav.name, testData.moderatedNotMemberNotFav.searchToolbarPrimary, testData.moderatedNotMemberNotFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.moderatedNotMemberNotFav.name, testData.moderatedNotMemberNotFav.contextMenu);
});
- it('Moderated library, user requested to join, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.moderatedRequestedJoinFav.name, data.moderatedRequestedJoinFav.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.moderatedRequestedJoinFav.name, data.moderatedRequestedJoinFav.toolbarMore);
- await testUtil.checkContextMenu(data.moderatedRequestedJoinFav.name, data.moderatedRequestedJoinFav.contextMenu);
+ it('Moderated library, user requested to join, favorite - [C326685]', async () => {
+ await testUtil.checkToolbarActions(testData.moderatedRequestedJoinFav.name, testData.moderatedRequestedJoinFav.searchToolbarPrimary, testData.moderatedRequestedJoinFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.moderatedRequestedJoinFav.name, testData.moderatedRequestedJoinFav.contextMenu);
});
- it('Moderated library, user requested to join, not favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.moderatedRequestedJoinNotFav.name, data.moderatedRequestedJoinNotFav.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.moderatedRequestedJoinNotFav.name, data.moderatedRequestedJoinNotFav.toolbarMore);
- await testUtil.checkContextMenu(data.moderatedRequestedJoinNotFav.name, data.moderatedRequestedJoinNotFav.contextMenu);
+ it('Moderated library, user requested to join, not favorite - [C326684]', async () => {
+ await testUtil.checkToolbarActions(testData.moderatedRequestedJoinNotFav.name, testData.moderatedRequestedJoinNotFav.searchToolbarPrimary, testData.moderatedRequestedJoinNotFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.moderatedRequestedJoinNotFav.name, testData.moderatedRequestedJoinNotFav.contextMenu);
});
});
describe('on Trash', () => {
- beforeEach(async (done) => {
- await page.clickTrashAndWait();
- done();
- });
-
- afterEach(async (done) => {
+ beforeAll(async () => {
await Utils.pressEscape();
- done();
+ await page.clickTrashAndWait();
});
- it('single library - []', async () => {
- await testUtil.checkToolbarPrimary(data.siteInTrash.name, data.siteInTrash.trashActions);
- await testUtil.checkContextMenu(data.siteInTrash.name, data.siteInTrash.trashActions);
+ beforeEach(async () => {
+ await Utils.pressEscape();
});
- it('multiple libraries - []', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.siteInTrash.name, data.site2InTrash.name ], data.trashActions);
- await testUtil.checkMultipleSelToolbarPrimary([ data.siteInTrash.name, data.site2InTrash.name ], data.trashActions);
+ it('single library - [C326686]', async () => {
+ await testUtil.checkToolbarPrimary(testData.siteInTrash.name, testData.siteInTrash.trashActions);
+ await testUtil.checkContextMenu(testData.siteInTrash.name, testData.siteInTrash.trashActions);
+ });
+
+ it('multiple libraries - [C326687]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.siteInTrash.name, testData.site2InTrash.name ], testData.trashActions);
+ await testUtil.checkMultipleSelToolbarPrimary([ testData.siteInTrash.name, testData.site2InTrash.name ], testData.trashActions);
});
});
});
diff --git a/e2e/suites/actions-available/libraries/test-data-libraries.ts b/e2e/suites/actions-available/libraries/test-data-libraries.ts
index bc4b3d442..258704938 100644
--- a/e2e/suites/actions-available/libraries/test-data-libraries.ts
+++ b/e2e/suites/actions-available/libraries/test-data-libraries.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/actions-available/special-permissions/favorites.ts b/e2e/suites/actions-available/special-permissions/favorites.ts
new file mode 100755
index 000000000..1e39fc052
--- /dev/null
+++ b/e2e/suites/actions-available/special-permissions/favorites.ts
@@ -0,0 +1,121 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { BrowsingPage } from '../../../pages/pages';
+import { Utils } from '../../../utilities/utils';
+import * as testData from './test-data-permissions';
+import * as testUtil from '../test-util';
+
+export function favoritesTests() {
+ const page = new BrowsingPage();
+
+ describe('available actions : ', () => {
+
+ beforeAll(async () => {
+ await page.clickFavoritesAndWait();
+ });
+
+ beforeEach(async () => {
+ await Utils.pressEscape();
+ });
+
+ afterEach(async () => {
+ await page.closeOpenDialogs();
+ });
+
+ describe('on a file', () => {
+
+ it('File Office, favorite - [C286311]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocxFav.name, testData.fileDocxFav.toolbarPrimary, testData.fileDocxFav.favoritesToolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocxFav.name, testData.fileDocxFav.favoritesContextMenu);
+ });
+
+ it('File favorite - [C306991]', async () => {
+ await testUtil.checkToolbarActions(testData.fileFav.name, testData.fileFav.toolbarPrimary, testData.fileFav.favoritesToolbarMore);
+ await testUtil.checkContextMenu(testData.fileFav.name, testData.fileFav.favoritesContextMenu);
+ });
+
+ it('File Office, shared, favorite - [C279187]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.toolbarPrimary, testData.fileDocxSharedFav.favoritesToolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.favoritesContextMenu);
+ });
+
+ it('File shared, favorite - [C280053]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.toolbarPrimary, testData.fileSharedFav.favoritesToolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.favoritesContextMenu);
+ });
+
+ it('File favorite, locked - [C280050]', async () => {
+ await testUtil.checkToolbarActions(testData.fileFavLocked.name, testData.fileFavLocked.toolbarPrimary, testData.fileFavLocked.favoritesToolbarMore);
+ await testUtil.checkContextMenu(testData.fileFavLocked.name, testData.fileFavLocked.favoritesContextMenu);
+ });
+
+ it('File shared, favorite, locked - [C325011]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.toolbarPrimary, testData.fileSharedFavLocked.favoritesToolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.favoritesContextMenu);
+ });
+
+ });
+
+ describe('on a folder', () => {
+
+ it('Folder favorite - [C325012]', async () => {
+ await testUtil.checkToolbarActions(testData.folderFav.name, testData.folderFav.toolbarPrimary, testData.folderFav.favoritesToolbarMore);
+ await testUtil.checkContextMenu(testData.folderFav.name, testData.folderFav.favoritesContextMenu);
+ });
+
+ });
+
+ describe('on multiple selection', () => {
+
+ it('multiple files - [C325046]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileDocxFav.name, testData.fileDocxSharedFav.name ], testData.multipleSelAllFav.favoritesContextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileDocxFav.name, testData.fileDocxSharedFav.name ], testData.multipleSelAllFav.toolbarPrimary, testData.multipleSelAllFav.favoritesToolbarMore);
+ });
+
+ it('multiple locked files - [C217145]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileFavLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSelAllFav.favoritesContextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileFavLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSelAllFav.toolbarPrimary, testData.multipleSelAllFav.favoritesToolbarMore);
+ });
+
+ it('multiple folders - [C213196]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.folderFav.name, testData.folderFav2.name ], testData.multipleSelAllFav.favoritesContextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.folderFav.name, testData.folderFav2.name ], testData.multipleSelAllFav.toolbarPrimary, testData.multipleSelAllFav.favoritesToolbarMore);
+ });
+
+ it('both files and folders - [C217146]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileFav.name, testData.folderFav.name ], testData.multipleSelAllFav.favoritesContextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileFav.name, testData.folderFav.name ], testData.multipleSelAllFav.toolbarPrimary, testData.multipleSelAllFav.favoritesToolbarMore);
+ });
+
+ it('multiple files with different granular permissions - [C213193]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileFav.name, testData.fileGranularPermission ], testData.multipleSelAllFav.favoritesContextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileFav.name, testData.fileGranularPermission ], testData.multipleSelAllFav.toolbarPrimary, testData.multipleSelAllFav.favoritesToolbarMore);
+ });
+
+ });
+
+ });
+}
diff --git a/e2e/suites/actions-available/special-permissions/my-libraries.ts b/e2e/suites/actions-available/special-permissions/my-libraries.ts
new file mode 100755
index 000000000..9f04dc589
--- /dev/null
+++ b/e2e/suites/actions-available/special-permissions/my-libraries.ts
@@ -0,0 +1,162 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { BrowsingPage } from '../../../pages/pages';
+import { Utils } from '../../../utilities/utils';
+import * as testData from './test-data-permissions';
+import * as testUtil from '../test-util';
+
+export function librariesTests(siteName?: string) {
+ const page = new BrowsingPage();
+ const { dataTable } = page;
+
+ describe('available actions : ', () => {
+
+ beforeAll(async () => {
+ await page.goToMyLibrariesAndWait();
+ await dataTable.doubleClickOnRowByName(siteName);
+ await dataTable.waitForHeader();
+ });
+
+ beforeEach(async () => {
+ await Utils.pressEscape();
+ });
+
+ afterEach(async () => {
+ await page.closeOpenDialogs();
+ });
+
+ describe('on a file', () => {
+
+ it('File Office - [C280476]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocx.name, testData.fileDocx.toolbarPrimary, testData.fileDocx.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocx.name, testData.fileDocx.contextMenu);
+ });
+
+ it('File Office, favorite - [C280455]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocxFav.name, testData.fileDocxFav.toolbarPrimary, testData.fileDocxFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocxFav.name, testData.fileDocxFav.contextMenu);
+ });
+
+ it('File simple - [C280444]', async () => {
+ await testUtil.checkToolbarActions(testData.file.name, testData.file.toolbarPrimary, testData.file.toolbarMore);
+ await testUtil.checkContextMenu(testData.file.name, testData.file.contextMenu);
+ });
+
+ it('File favorite - [C280464]', async () => {
+ await testUtil.checkToolbarActions(testData.fileFav.name, testData.fileFav.toolbarPrimary, testData.fileFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileFav.name, testData.fileFav.contextMenu);
+ });
+
+ it('File Office, shared - [C280465]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocxShared.name, testData.fileDocxShared.toolbarPrimary, testData.fileDocxShared.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocxShared.name, testData.fileDocxShared.contextMenu);
+ });
+
+ it('File Office, shared, favorite - [C280466]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.toolbarPrimary, testData.fileDocxSharedFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.contextMenu);
+ });
+
+ it('File shared - [C280599]', async () => {
+ await testUtil.checkToolbarActions(testData.fileShared.name, testData.fileShared.toolbarPrimary, testData.fileShared.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileShared.name, testData.fileShared.contextMenu);
+ });
+
+ it('File shared, favorite - [C280600]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.toolbarPrimary, testData.fileSharedFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.contextMenu);
+ });
+
+ it('File locked - [C280647]', async () => {
+ await testUtil.checkToolbarActions(testData.fileLocked.name, testData.fileLocked.toolbarPrimary, testData.fileLocked.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileLocked.name, testData.fileLocked.contextMenu);
+ });
+
+ it('File favorite, locked - [C280477]', async () => {
+ await testUtil.checkToolbarActions(testData.fileFavLocked.name, testData.fileFavLocked.toolbarPrimary, testData.fileFavLocked.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileFavLocked.name, testData.fileFavLocked.contextMenu);
+ });
+
+ it('File shared, locked - [C280666]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedLocked.name, testData.fileSharedLocked.toolbarPrimary, testData.fileSharedLocked.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedLocked.name, testData.fileSharedLocked.contextMenu);
+ });
+
+ it('File shared, favorite, locked - [C280669]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.toolbarPrimary, testData.fileSharedFavLocked.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.contextMenu);
+ });
+
+ });
+
+ describe('on a folder', () => {
+
+ it('Folder not favorite - [C280456]', async () => {
+ await testUtil.checkToolbarActions(testData.folder.name, testData.folder.toolbarPrimary, testData.folder.toolbarMore);
+ await testUtil.checkContextMenu(testData.folder.name, testData.folder.contextMenu);
+ });
+
+ it('Folder favorite - [C286284]', async () => {
+ await testUtil.checkToolbarActions(testData.folderFav.name, testData.folderFav.toolbarPrimary, testData.folderFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.folderFav.name, testData.folderFav.contextMenu);
+ });
+ });
+
+ describe('on multiple selection', () => {
+
+ it('multiple files - [C286264]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileDocx.name, testData.fileDocxSharedFav.name ], testData.multipleSel.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileDocx.name, testData.fileDocxSharedFav.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
+ });
+
+ it('multiple files - all favorite - [C286283]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileDocxFav.name, testData.fileDocxSharedFav.name ], testData.multipleSelAllFav.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileDocxFav.name, testData.fileDocxSharedFav.name ], testData.multipleSel.toolbarPrimary, testData.multipleSelAllFav.toolbarMore);
+ });
+
+ it('multiple locked files - [C280478]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
+ });
+
+ it('multiple folders - [C213121]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.folderFav.name, testData.folder.name ], testData.multipleSel.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.folderFav.name, testData.folder.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
+ });
+
+ it('both files and folders - [C286266]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.file.name, testData.folder.name ], testData.multipleSel.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.file.name, testData.folder.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
+ });
+
+ it('multiple files with different granular permissions - [C286285]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileDocxFav.name, testData.fileGranularPermission ], testData.multipleSelAllFav.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileDocxFav.name, testData.fileGranularPermission ], testData.multipleSel.toolbarPrimary, testData.multipleSelAllFav.toolbarMore);
+ });
+
+ });
+ });
+}
diff --git a/e2e/suites/actions-available/special-permissions/other-permissions.test.ts b/e2e/suites/actions-available/special-permissions/other-permissions.test.ts
deleted file mode 100755
index 7a7af0e99..000000000
--- a/e2e/suites/actions-available/special-permissions/other-permissions.test.ts
+++ /dev/null
@@ -1,841 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { LoginPage, BrowsingPage, SearchResultsPage } from '../../../pages/pages';
-import { SITE_VISIBILITY, SITE_ROLES, FILES } from '../../../configs';
-import { RepoClient } from '../../../utilities/repo-client/repo-client';
-import { Utils } from '../../../utilities/utils';
-import { Viewer } from '../../../components/viewer/viewer';
-
-describe('', () => {
- const userConsumer = `consumer-${Utils.random()}`;
- const userCollaborator = `collaborator-${Utils.random()}`;
- const userDemoted = `demoted-${Utils.random()}`;
-
- const siteName = `site-private-${Utils.random()}`;
- const file1 = `my-file1-${Utils.random()}.txt`;
- let file1Id;
- const file2 = `my-file2-${Utils.random()}.txt`;
- let file2Id;
- const file3 = `my-file3-${Utils.random()}.txt`;
- let file3Id;
- const fileLocked = `my-file-locked-${Utils.random()}.txt`;
- let fileLockedId;
-
- const folder1 = `my-folder1-${Utils.random()}`;
- let folder1Id;
- const folder2 = `my-folder2-${Utils.random()}`;
- let folder2Id;
-
- const docxFile = FILES.docxFile;
- let docxFileId;
-
- const apis = {
- admin: new RepoClient(),
- userConsumer: new RepoClient(userConsumer, userConsumer),
- userCollaborator: new RepoClient(userCollaborator, userCollaborator),
- userDemoted: new RepoClient(userDemoted, userDemoted)
- };
-
- const loginPage = new LoginPage();
- const page = new BrowsingPage();
- const { dataTable, toolbar } = page;
- const viewer = new Viewer();
- const viewerToolbar = viewer.toolbar;
- const searchResultsPage = new SearchResultsPage();
- const { searchInput } = searchResultsPage.header;
-
- beforeAll(async (done) => {
- await apis.admin.people.createUser({ username: userConsumer });
- await apis.admin.people.createUser({ username: userCollaborator });
- await apis.admin.people.createUser({ username: userDemoted });
-
- await apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PRIVATE);
- const docLibId = await apis.admin.sites.getDocLibId(siteName);
-
- file1Id = (await apis.admin.nodes.createFile(file1, docLibId)).entry.id;
- file2Id = (await apis.admin.nodes.createFile(file2, docLibId)).entry.id;
- file3Id = (await apis.admin.nodes.createFile(file3, docLibId)).entry.id;
- folder1Id = (await apis.admin.nodes.createFolder(folder1, docLibId)).entry.id;
- folder2Id = (await apis.admin.nodes.createFolder(folder2, docLibId)).entry.id;
-
- docxFileId = (await apis.admin.upload.uploadFile(docxFile, docLibId)).entry.id;
-
- await apis.admin.sites.addSiteMember(siteName, userConsumer, SITE_ROLES.SITE_CONSUMER.ROLE);
- await apis.admin.sites.addSiteMember(siteName, userCollaborator, SITE_ROLES.SITE_COLLABORATOR.ROLE);
- await apis.admin.sites.addSiteMember(siteName, userDemoted, SITE_ROLES.SITE_MANAGER.ROLE);
-
- fileLockedId = (await apis.admin.nodes.createFile(fileLocked, docLibId)).entry.id;
- await apis.userDemoted.nodes.lockFile(fileLockedId);
- await apis.userDemoted.favorites.addFavoriteById('file', fileLockedId);
- await apis.userDemoted.shared.shareFileById(fileLockedId);
- await apis.admin.sites.updateSiteMember(siteName, userDemoted, SITE_ROLES.SITE_CONSUMER.ROLE);
-
- await apis.admin.nodes.setGranularPermission(file3Id, false, userConsumer, SITE_ROLES.SITE_MANAGER.ROLE);
-
- await apis.userConsumer.shared.shareFileById(file1Id);
- await apis.userConsumer.shared.shareFileById(file2Id);
- await apis.userConsumer.shared.shareFileById(docxFileId);
- await apis.userConsumer.shared.shareFileById(file3Id);
- await apis.userConsumer.shared.waitForApi({ expect: 5 });
-
- await apis.userConsumer.favorites.addFavoritesByIds('file', [file1Id, file2Id, file3Id, docxFileId]);
- await apis.userConsumer.favorites.addFavoritesByIds('folder', [folder1Id, folder2Id]);
- await apis.userConsumer.favorites.waitForApi({ expect: 6 });
-
- await apis.userCollaborator.favorites.addFavoritesByIds('file', [file1Id, docxFileId]);
- await apis.userCollaborator.favorites.waitForApi({ expect: 2 });
-
- await apis.admin.favorites.addFavoriteById('file', fileLockedId);
-
- done();
- });
-
- afterAll(async (done) => {
- await apis.admin.sites.deleteSite(siteName);
- done();
- });
-
- describe('Collaborator', () => {
- beforeAll(async (done) => {
- await loginPage.loginWith(userCollaborator);
- done();
- });
-
- it('on File Libraries - [C297647]', async () => {
- await page.clickFileLibrariesAndWait();
- await dataTable.doubleClickOnRowByName(siteName);
- await dataTable.waitForHeader();
- await dataTable.selectItem(file1);
-
- expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${file1}`);
- expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${file1}`);
- expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${file1}`);
- expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`);
- expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`);
-
- await toolbar.openMoreMenu();
-
- expect(await toolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed for ${file1}`);
- expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${file1}`);
- expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${file1}`);
- expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${file1}`);
- expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${file1}`);
- expect(await toolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${file1}`);
- expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`);
- expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`);
-
- await toolbar.closeMoreMenu();
- });
-
- it('on Shared Files - [C297651]', async () => {
- await page.clickSharedFilesAndWait();
- await page.dataTable.selectItem(file1);
-
- expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${file1}`);
- expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${file1}`);
- expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${file1}`);
- expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`);
- expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`);
-
- await toolbar.openMoreMenu();
-
- // TODO: change expect to true when ACA-2173 is done
- expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${file1}`);
- expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${file1}`);
- expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${file1}`);
- expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${file1}`);
- expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${file1}`);
- expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${file1}`);
- expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`);
- expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`);
-
- await toolbar.closeMoreMenu();
- });
-
- it('on Favorites - [C297652]', async () => {
- await page.clickFavoritesAndWait();
- await dataTable.selectItem(file1);
-
- expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${file1}`);
- expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${file1}`);
- expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${file1}`);
- expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`);
- // TODO: replace with isSharedLinkSettingsPresent when ACA-2175 is done
- expect(await toolbar.isSharePresent()).toBe(true, `Share is not displayed`);
-
- await toolbar.openMoreMenu();
-
- // TODO: change expect to true when ACA-2174 is done
- expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is not displayed for ${file1}`);
- expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${file1}`);
- expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${file1}`);
- // TODO: change expect to false when ACA-1737 is done
- expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is displayed for ${file1}`);
- // TODO: change expect to false when ACA-1737 is done
- expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is displayed for ${file1}`);
- expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${file1}`);
- expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`);
- expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`);
-
- await toolbar.closeMoreMenu();
- });
-
- it('on Search Results - [C297653]', async () => {
- await searchInput.clickSearchButton();
- await searchInput.checkOnlyFiles();
- await searchInput.searchFor(file1);
- await dataTable.selectItem(file1);
-
- expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${file1}`);
- expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${file1}`);
- expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${file1}`);
- expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`);
- expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`);
-
- await toolbar.openMoreMenu();
-
- expect(await toolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed for ${file1}`);
- expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${file1}`);
- expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${file1}`);
- expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${file1}`);
- expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${file1}`);
- expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${file1}`);
- expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`);
- expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`);
-
- await toolbar.closeMoreMenu();
- });
-
- describe('in the viewer', () => {
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await dataTable.clearSelection();
- await page.clickPersonalFiles();
- done();
- });
-
- afterAll(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- it('file opened from File Libraries - [C297654]', async () => {
- await page.clickFileLibrariesAndWait();
- await dataTable.doubleClickOnRowByName(siteName);
- await dataTable.waitForHeader();
- await dataTable.doubleClickOnRowByName(docxFile);
- await viewer.waitForViewerToOpen();
-
- expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`);
- expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`);
- expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`);
- expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`);
- expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed');
- expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`);
-
- await viewerToolbar.openMoreMenu();
-
- expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed`);
- expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`);
- expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`);
- expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`);
- expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`);
- expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`);
- expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`);
- expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`);
- expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`);
-
- await viewerToolbar.closeMoreMenu();
- });
-
- it('file opened from Shared Files - [C297655]', async () => {
- await page.clickSharedFilesAndWait();
- await dataTable.doubleClickOnRowByName(docxFile);
- await viewer.waitForViewerToOpen();
-
- expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`);
- expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`);
- expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`);
- expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`);
- expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed');
- expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`);
-
- await viewerToolbar.openMoreMenu();
-
- expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed`);
- expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`);
- expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`);
- expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`);
- expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`);
- expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`);
- expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`);
- expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`);
- expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`);
-
- await viewerToolbar.closeMoreMenu();
- });
-
- it('file opened from Favorites - [C297656]', async () => {
- await page.clickFavoritesAndWait();
- await dataTable.doubleClickOnRowByName(docxFile);
- await viewer.waitForViewerToOpen();
-
- expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`);
- expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`);
- expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`);
- expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`);
- expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed');
- expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`);
-
- await viewerToolbar.openMoreMenu();
-
- expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed`);
- expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`);
- expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove Favorite is not displayed`);
- expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`);
- expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`);
- expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`);
- expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`);
- expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`);
- expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`);
-
- await viewerToolbar.closeMoreMenu();
- });
-
- it('file opened from Search Results - [C306992]', async () => {
- await searchInput.clickSearchButton();
- await searchInput.checkOnlyFiles();
- await searchInput.searchFor(docxFile);
- await dataTable.waitForBody();
- await dataTable.doubleClickOnRowByName(docxFile);
- await viewer.waitForViewerToOpen();
-
- expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`);
- expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`);
- expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`);
- expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`);
- expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed');
- expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`);
-
- await viewerToolbar.openMoreMenu();
-
- expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed`);
- expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`);
- expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`);
- expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`);
- expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`);
- expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`);
- expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`);
- expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`);
- expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`);
-
- await viewerToolbar.closeMoreMenu();
- });
- });
- });
-
- describe('File locked - lock owner : ', () => {
- beforeAll(async (done) => {
- await loginPage.loginWith(userDemoted);
- done();
- });
-
- it('on File Libraries - [C297657]', async () => {
- await page.clickFileLibrariesAndWait();
- await dataTable.doubleClickOnRowByName(siteName);
- await dataTable.waitForHeader();
- await dataTable.selectItem(fileLocked);
-
- expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`);
- expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`);
- expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`);
- expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`);
- expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`);
-
- await toolbar.openMoreMenu();
-
- expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`);
- expect(await toolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${fileLocked}`);
- expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${fileLocked}`);
- expect(await toolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed');
- expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, 'Upload new version is not displayed');
-
- await toolbar.closeMoreMenu();
- });
-
- it('on Shared Files - [C297658]', async () => {
- await page.clickSharedFilesAndWait();
- await page.dataTable.selectItem(fileLocked);
-
- expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`);
- expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`);
- expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`);
- expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`);
- expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`);
-
- await toolbar.openMoreMenu();
-
- expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`);
- // TODO: change expect to true when ACA-2173 is done
- expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${fileLocked}`);
- expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${fileLocked}`);
- expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed');
- expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, 'Upload new version is not displayed');
-
- await toolbar.closeMoreMenu();
- });
-
- it('on Favorites - [C297659]', async () => {
- await page.clickFavoritesAndWait();
- await dataTable.selectItem(fileLocked);
-
- expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`);
- expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`);
- expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`);
- expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`);
- // TODO: replace with isSharedLinkSettingsPresent when ACA-2175 is done
- expect(await toolbar.isSharePresent()).toBe(true, `Share is not displayed`);
-
- await toolbar.openMoreMenu();
-
- expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`);
- // TODO: change expect to true when ACA-2174 is fixed
- expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`);
- // TODO: change expect to false when ACA-1737 is fixed
- expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is displayed for ${fileLocked}`);
- // TODO: change expect to false when ACA-1737 is fixed
- expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is displayed for ${fileLocked}`);
- expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed');
- expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, 'Upload new version is not displayed');
-
- await toolbar.closeMoreMenu();
- });
-
- it('on Search Results - [C297660]', async () => {
- await searchInput.clickSearchButton();
- await searchInput.checkOnlyFiles();
- await searchInput.searchFor(fileLocked);
- await dataTable.selectItem(fileLocked);
-
- expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`);
- expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`);
- expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`);
- expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`);
- expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`);
-
- await toolbar.openMoreMenu();
-
- expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`);
- expect(await toolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${fileLocked}`);
- expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${fileLocked}`);
- expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed');
- expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, 'Upload new version is not displayed');
-
- await toolbar.closeMoreMenu();
- });
-
- describe('in the viewer', () => {
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await dataTable.clearSelection();
- await page.clickPersonalFiles();
- done();
- });
-
- afterAll(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- it('file opened from File Libraries - [C297661]', async () => {
- await page.clickFileLibrariesAndWait();
- await dataTable.doubleClickOnRowByName(siteName);
- await dataTable.waitForHeader();
- await dataTable.doubleClickOnRowByName(fileLocked);
- await viewer.waitForViewerToOpen();
-
- expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`);
- expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`);
- expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`);
- expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`);
- expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed');
- expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`);
-
- await viewerToolbar.openMoreMenu();
-
- expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`);
- expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`);
- expect(await viewerToolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`);
- expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`);
- expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`);
- expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`);
- expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`);
- expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`);
- expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`);
-
- await viewerToolbar.closeMoreMenu();
- });
-
- it('file opened from Shared Files - [C297662]', async () => {
- await page.clickSharedFilesAndWait();
- await dataTable.doubleClickOnRowByName(fileLocked);
- await viewer.waitForViewerToOpen();
-
- expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`);
- expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`);
- expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`);
- expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`);
- expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed');
- expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`);
-
- await viewerToolbar.openMoreMenu();
-
- expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`);
- expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`);
- expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`);
- expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`);
- expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`);
- expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`);
- expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`);
- expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`);
- expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`);
-
- await viewerToolbar.closeMoreMenu();
- });
-
- it('file opened from Favorites - [C297663]', async () => {
- await page.clickFavoritesAndWait();
- await dataTable.doubleClickOnRowByName(fileLocked);
- await viewer.waitForViewerToOpen();
-
- expect(await viewerToolbar.isEmpty()).toBe(false, `viewer toolbar is empty`);
- expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`);
- expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`);
- expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`);
- expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`);
- expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed');
- expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`);
-
- await viewerToolbar.openMoreMenu();
-
- expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`);
- expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`);
- expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`);
- expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`);
- expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`);
- expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`);
- expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`);
- expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`);
- expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`);
-
- await viewerToolbar.closeMoreMenu();
- });
-
- it('file opened from Search Results - [C306993]', async () => {
- await searchInput.clickSearchButton();
- await searchInput.checkOnlyFiles();
- await searchInput.searchFor(fileLocked);
- await dataTable.waitForBody();
- await dataTable.doubleClickOnRowByName(fileLocked);
- await viewer.waitForViewerToOpen();
-
- expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`);
- expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`);
- expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`);
- expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`);
- expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed');
- expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`);
-
- await viewerToolbar.openMoreMenu();
-
- expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`);
- expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`);
- expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`);
- expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`);
- expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`);
- expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`);
- expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`);
- expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`);
- expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`);
-
- await viewerToolbar.closeMoreMenu();
- });
- });
- });
-
- describe('File locked - manager : ', () => {
- beforeAll(async (done) => {
- await loginPage.loginWithAdmin();
- done();
- });
-
- it('on File Libraries - [C297664]', async () => {
- await page.clickFileLibrariesAndWait();
- await dataTable.doubleClickOnRowByName(siteName);
- await dataTable.waitForHeader();
- await dataTable.selectItem(fileLocked);
-
- expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`);
- expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`);
- expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`);
- expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`);
- expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`);
-
- await toolbar.openMoreMenu();
-
- expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`);
- expect(await toolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed');
- expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, 'Upload new version is displayed');
-
- await toolbar.closeMoreMenu();
- });
-
- it('on Shared Files - [C297665]', async () => {
- await page.clickSharedFilesAndWait();
- await page.dataTable.selectItem(fileLocked);
-
- expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`);
- expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`);
- expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`);
- expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`);
- expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`);
-
- await toolbar.openMoreMenu();
-
- expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`);
- // TODO: change expect to true when ACA-2173 is done
- expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed');
- // TODO: change expect to false when ACA-2173 is done
- expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, 'Upload new version is displayed');
-
- await toolbar.closeMoreMenu();
- });
-
- it('on Favorites - [C297666]', async () => {
- await page.clickFavoritesAndWait();
- await dataTable.selectItem(fileLocked);
-
- expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`);
- expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`);
- expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`);
- expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`);
- // TODO: replace with isSharedLinkSettingsPresent when ACA-2175 is done
- expect(await toolbar.isSharePresent()).toBe(true, `Share is not displayed`);
-
- await toolbar.openMoreMenu();
-
- expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`);
- // TODO: change expect to true when ACA-2174 is fixed
- expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed');
- // TODO: change expect to false when ACA-1737 is done
- expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, 'Upload new version is displayed');
-
- await toolbar.closeMoreMenu();
- });
-
- it('on Search Results - [C297667]', async () => {
- await searchInput.clickSearchButton();
- await searchInput.checkOnlyFiles();
- await searchInput.searchFor(fileLocked);
- await dataTable.selectItem(fileLocked);
-
- expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`);
- expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`);
- expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`);
- expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`);
- expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`);
-
- await toolbar.openMoreMenu();
-
- expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`);
- expect(await toolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${fileLocked} in Search Results`);
- expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${fileLocked} in Search Results`);
- expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`);
- expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed');
- expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, 'Upload new version is displayed');
-
- await toolbar.closeMoreMenu();
- });
-
- describe('in the viewer', () => {
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await dataTable.clearSelection();
- await page.clickPersonalFiles();
- done();
- });
-
- afterAll(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- it('file opened from File Libraries - [C297671]', async () => {
- await page.clickFileLibrariesAndWait();
- await dataTable.doubleClickOnRowByName(siteName);
- await dataTable.waitForHeader();
- await dataTable.doubleClickOnRowByName(fileLocked);
- await viewer.waitForViewerToOpen();
-
- expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`);
- expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`);
- expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`);
- expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`);
- expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed');
- expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`);
-
- await viewerToolbar.openMoreMenu();
-
- expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`);
- expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`);
- expect(await viewerToolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`);
- expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`);
- expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`);
- expect(await viewerToolbar.menu.isMovePresent()).toBe(true, `Move is not displayed`);
- expect(await viewerToolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed`);
- expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`);
- expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`);
-
- await viewerToolbar.closeMoreMenu();
- });
-
- it('file opened from Shared Files - [C297672]', async () => {
- await page.clickSharedFilesAndWait();
- await dataTable.doubleClickOnRowByName(fileLocked);
- await viewer.waitForViewerToOpen();
-
- expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`);
- expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`);
- expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`);
- expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`);
- expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed');
- expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`);
-
- await viewerToolbar.openMoreMenu();
-
- expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`);
- expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`);
- expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`);
- expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`);
- expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`);
- expect(await viewerToolbar.menu.isMovePresent()).toBe(true, `Move is not displayed`);
- expect(await viewerToolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed`);
- expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`);
- expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`);
-
- await viewerToolbar.closeMoreMenu();
- });
-
- it('file opened from Favorites - [C297673]', async () => {
- await page.clickFavoritesAndWait();
- await dataTable.doubleClickOnRowByName(fileLocked);
- await viewer.waitForViewerToOpen();
-
- expect(await viewerToolbar.isEmpty()).toBe(false, `viewer toolbar is empty`);
- expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`);
- expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`);
- expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`);
- expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`);
- expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed');
- expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`);
-
- await viewerToolbar.openMoreMenu();
-
- expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`);
- expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`);
- expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`);
- expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`);
- expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`);
- expect(await viewerToolbar.menu.isMovePresent()).toBe(true, `Move is not displayed`);
- expect(await viewerToolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed`);
- expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`);
- expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`);
-
- await viewerToolbar.closeMoreMenu();
- });
-
- it('file opened from Search Results - [C306994]', async () => {
- await searchInput.clickSearchButton();
- await searchInput.checkOnlyFiles();
- await searchInput.searchFor(fileLocked);
- await dataTable.waitForBody();
- await dataTable.doubleClickOnRowByName(fileLocked);
- await viewer.waitForViewerToOpen();
-
- expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`);
- expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`);
- expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`);
- expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`);
- expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed');
- expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`);
-
- await viewerToolbar.openMoreMenu();
-
- expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`);
- expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`);
- expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`);
- expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`);
- expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`);
- // TODO: change expect to true when ACA-2319 is fixed
- expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is not displayed`);
- // TODO: change expect to true when ACA-2319 is fixed
- expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is not displayed`);
- expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`);
- expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`);
-
- await viewerToolbar.closeMoreMenu();
- });
- });
- });
-});
diff --git a/e2e/suites/actions-available/special-permissions/other-permissions.ts b/e2e/suites/actions-available/special-permissions/other-permissions.ts
new file mode 100755
index 000000000..9f8ae1f76
--- /dev/null
+++ b/e2e/suites/actions-available/special-permissions/other-permissions.ts
@@ -0,0 +1,324 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { BrowsingPage, SearchResultsPage } from '../../../pages/pages';
+import { Utils } from '../../../utilities/utils';
+import * as testData from './test-data-permissions';
+import * as testUtil from '../test-util';
+
+const page = new BrowsingPage();
+const { dataTable } = page;
+const searchResultsPage = new SearchResultsPage();
+const { searchInput } = searchResultsPage.header;
+
+export function collaboratorTests(siteName?: string) {
+ describe('available actions : ', () => {
+
+ beforeEach(async () => {
+ await Utils.pressEscape();
+ });
+
+ afterEach(async () => {
+ await page.closeOpenDialogs();
+ });
+
+ it('on File Libraries - [C297647]', async () => {
+ await page.clickFileLibrariesAndWait();
+ await dataTable.doubleClickOnRowByName(siteName);
+ await dataTable.waitForHeader();
+
+ const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
+ const expectedToolbarMore = ['Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
+
+ await testUtil.checkToolbarActions(testData.fileSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
+ });
+
+ it('on Shared Files - [C297651]', async () => {
+ await page.clickSharedFilesAndWait();
+
+ const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
+ const expectedToolbarMore = ['Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
+
+ await testUtil.checkToolbarActions(testData.fileSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
+ });
+
+ it('on Favorites - [C297652]', async () => {
+ await page.clickFavoritesAndWait();
+
+ const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
+ // TODO: investigate why 'Edit Offline' is not displayed and raise issue
+ // TODO: remove 'Move' and 'Delete' when ACA-1737 is done
+ const expectedToolbarMore = ['Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
+
+ await testUtil.checkToolbarActions(testData.fileSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
+ });
+
+ it('on Search Results - [C297653]', async () => {
+ await searchInput.clickSearchButton();
+ await searchInput.searchFor(testData.fileSharedFav.name);
+
+ const expectedToolbarPrimary = ['Toggle search filter', 'Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
+ const expectedToolbarMore = ['Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
+
+ await testUtil.checkToolbarActions(testData.fileSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
+ });
+
+ describe('available actions in the viewer : ', () => {
+ it('file opened from File Libraries - [C297654]', async () => {
+ await page.clickFileLibrariesAndWait();
+ await dataTable.doubleClickOnRowByName(siteName);
+ await dataTable.waitForHeader();
+
+ const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
+ const expectedToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
+
+ await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
+ });
+
+ it('file opened from Shared Files - [C297655]', async () => {
+ await page.clickSharedFilesAndWait();
+
+ const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
+ const expectedToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
+
+ await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
+ });
+
+ it('file opened from Favorites - [C297656]', async () => {
+ await page.clickFavoritesAndWait();
+
+ const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
+ const expectedToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
+
+ await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
+ });
+
+ it('file opened from Search Results - [C306992]', async () => {
+ await searchInput.clickSearchButton();
+ await searchInput.searchFor(testData.fileDocxSharedFav.name);
+ await searchResultsPage.waitForResults();
+
+ const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
+ const expectedToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
+
+ await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
+ });
+ });
+ });
+}
+
+export function filesLockedByCurrentUser(siteName?: string) {
+ describe('available actions : ', () => {
+ beforeEach(async () => {
+ await Utils.pressEscape();
+ });
+
+ afterEach(async () => {
+ await page.closeOpenDialogs();
+ });
+
+ it('on File Libraries - [C297657]', async () => {
+ await page.clickFileLibrariesAndWait();
+ await dataTable.doubleClickOnRowByName(siteName);
+ await dataTable.waitForHeader();
+
+ const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
+ const expectedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
+
+ await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
+ });
+
+ it('on Shared Files - [C297658]', async () => {
+ await page.clickSharedFilesAndWait();
+
+ const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
+ const expectedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
+
+ await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
+ });
+
+ it('on Favorites - [C297659]', async () => {
+ await page.clickFavoritesAndWait();
+
+ const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
+ // TODO: remove 'Move' and 'Delete' when ACA-1737 is fixed
+ const expectedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
+
+ await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
+ });
+
+ it('on Search Results - [C297660]', async () => {
+ await searchInput.clickSearchButton();
+ await searchInput.searchFor(testData.fileLockedByUser);
+ await searchResultsPage.waitForResults();
+
+ const expectedToolbarPrimary = ['Toggle search filter', 'Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
+ const expectedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
+
+ await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
+ });
+
+ describe('available actions in the viewer : ', () => {
+ it('file opened from File Libraries - [C297661]', async () => {
+ await page.clickFileLibrariesAndWait();
+ await dataTable.doubleClickOnRowByName(siteName);
+ await dataTable.waitForHeader();
+
+ const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
+ const expectedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
+
+ await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
+ });
+
+ it('file opened from Shared Files - [C297662]', async () => {
+ await page.clickSharedFilesAndWait();
+
+ const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
+ const expectedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
+
+ await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
+ });
+
+ it('file opened from Favorites - [C297663]', async () => {
+ await page.clickFavoritesAndWait();
+
+ const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
+ const expectedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
+
+ await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
+ });
+
+ it('file opened from Search Results - [C306993]', async () => {
+ await searchInput.clickSearchButton();
+ await searchInput.searchFor(testData.fileLockedByUser);
+ await searchResultsPage.waitForResults();
+
+ const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
+ const expectedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
+
+ await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
+ });
+ });
+ });
+}
+
+export function filesLockedByOtherUser(siteName?: string) {
+ describe('available actions : ', () => {
+
+ beforeEach(async () => {
+ await Utils.pressEscape();
+ });
+
+ afterEach(async () => {
+ await page.closeOpenDialogs();
+ });
+
+ it('on File Libraries - [C297664]', async () => {
+ await page.clickFileLibrariesAndWait();
+ await dataTable.doubleClickOnRowByName(siteName);
+ await dataTable.waitForHeader();
+
+ const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
+ const expectedToolbarMore = ['Cancel Editing', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
+
+ await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
+ });
+
+ it('on Shared Files - [C297665]', async () => {
+ await page.clickSharedFilesAndWait();
+
+ const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
+ // TODO: investigate why 'Upload New Version' appears and raise issue
+ const expectedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
+
+ await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
+ });
+
+ it('on Favorites - [C297666]', async () => {
+ await page.clickFavoritesAndWait();
+
+ const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
+ // TODO: investigate why 'Cancel Editing' doesn't appear and raise issue
+ // TODO: remove 'Upload New Version' when ACA-1737 is done
+ const expectedToolbarMore = ['Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
+
+ await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
+ });
+
+ it('on Search Results - [C297667]', async () => {
+ await searchInput.clickSearchButton();
+ await searchInput.searchFor(testData.fileLockedByUser);
+ await searchResultsPage.waitForResults();
+
+ const expectedToolbarPrimary = ['Toggle search filter', 'Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
+ const expectedToolbarMore = ['Cancel Editing', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
+
+ await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
+ });
+
+ describe('available actions in the viewer : ', () => {
+ it('file opened from File Libraries - [C297671]', async () => {
+ await page.clickFileLibrariesAndWait();
+ await dataTable.doubleClickOnRowByName(siteName);
+ await dataTable.waitForHeader();
+
+ const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
+ const expectedToolbarMore = ['Cancel Editing', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
+
+ await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
+ });
+
+ it('file opened from Shared Files - [C297672]', async () => {
+ await page.clickSharedFilesAndWait();
+
+ const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
+ const expectedToolbarMore = ['Cancel Editing', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
+
+ await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
+ });
+
+ it('file opened from Favorites - [C297673]', async () => {
+ await page.clickFavoritesAndWait();
+
+ const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
+ const expectedToolbarMore = ['Cancel Editing', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
+
+ await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
+ });
+
+ it('file opened from Search Results - [C306994]', async () => {
+ await searchInput.clickSearchButton();
+ await searchInput.searchFor(testData.fileLockedByUser);
+ await searchResultsPage.waitForResults();
+
+ const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
+ // TODO: add 'Move' and 'Delete' when ACA-2319 is fixed
+ const expectedToolbarMore = ['Cancel Editing', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
+
+ await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
+ });
+ });
+ });
+}
diff --git a/e2e/suites/actions-available/special-permissions/permissions-favorites.test.ts b/e2e/suites/actions-available/special-permissions/permissions-favorites.test.ts
deleted file mode 100755
index a645b9c8c..000000000
--- a/e2e/suites/actions-available/special-permissions/permissions-favorites.test.ts
+++ /dev/null
@@ -1,198 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { LoginPage, BrowsingPage } from '../../../pages/pages';
-import { FILES, SITE_VISIBILITY, SITE_ROLES } from '../../../configs';
-import { RepoClient } from '../../../utilities/repo-client/repo-client';
-import { Utils } from '../../../utilities/utils';
-import * as data from './test-data-permissions';
-import * as testUtil from '../test-util';
-
-describe('Special permissions actions : on Favorites : ', () => {
-
- const site = `site-private-${Utils.random()}`;
-
- const userConsumer = `consumer-${Utils.random()}`;
-
- let fileDocxFavId, fileFavId, fileDocxSharedFavId, fileSharedFavId, fileFavLockedId, fileSharedFavLockedId;
- let folderFavId, folderFav2Id;
-
- const file3 = `file-3-${Utils.random()}.txt`;
- let file3Id;
-
- const apis = {
- admin: new RepoClient(),
- userConsumer: new RepoClient(userConsumer, userConsumer)
- };
-
- const loginPage = new LoginPage();
- const page = new BrowsingPage();
-
- beforeAll(async (done) => {
- await apis.admin.people.createUser({ username: userConsumer });
-
- await apis.admin.sites.createSite(site, SITE_VISIBILITY.PRIVATE);
- const docLibId = await apis.admin.sites.getDocLibId(site);
- await apis.admin.sites.addSiteMember(site, userConsumer, SITE_ROLES.SITE_CONSUMER.ROLE);
-
- fileDocxFavId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxFav.name)).entry.id;
- fileFavId = (await apis.admin.nodes.createFile(data.fileFav.name, docLibId)).entry.id;
- fileDocxSharedFavId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxSharedFav.name)).entry.id;
- fileSharedFavId = (await apis.admin.nodes.createFile(data.fileSharedFav.name, docLibId)).entry.id;
- fileFavLockedId = (await apis.admin.nodes.createFile(data.fileFavLocked.name, docLibId)).entry.id;
- fileSharedFavLockedId = (await apis.admin.nodes.createFile(data.fileSharedFavLocked.name, docLibId)).entry.id;
-
- file3Id = (await apis.admin.nodes.createFile(file3, docLibId)).entry.id;
-
- folderFavId = (await apis.admin.nodes.createFolder(data.folderFav.name, docLibId)).entry.id;
- folderFav2Id = (await apis.admin.nodes.createFolder(data.folderFav2.name, docLibId)).entry.id;
- await apis.userConsumer.favorites.addFavoriteById('folder', folderFavId);
- await apis.userConsumer.favorites.addFavoriteById('folder', folderFav2Id);
-
- await apis.userConsumer.favorites.addFavoritesByIds('file', [
- fileDocxFavId,
- fileFavId,
- fileDocxSharedFavId,
- fileSharedFavId,
- fileFavLockedId,
- fileSharedFavLockedId,
- file3Id
- ]);
-
- await apis.userConsumer.shared.shareFilesByIds([
- fileDocxSharedFavId,
- fileSharedFavId,
- fileSharedFavLockedId,
- file3Id
- ]);
-
- await apis.admin.nodes.lockFile(fileFavLockedId);
- await apis.admin.nodes.lockFile(fileSharedFavLockedId);
-
- await apis.admin.nodes.setGranularPermission(file3Id, false, userConsumer, SITE_ROLES.SITE_MANAGER.ROLE);
-
- await apis.userConsumer.favorites.waitForApi({ expect: 9 });
- await apis.userConsumer.shared.waitForApi({ expect: 4 });
-
- await loginPage.loginWith(userConsumer);
- done();
- });
-
- afterAll(async (done) => {
- await apis.admin.sites.deleteSite(site);
- done();
- });
-
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await page.clickFavoritesAndWait();
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- describe('on a file', () => {
-
- it('File Office, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocxFav.name, data.fileDocxFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.favoritesToolbarMore);
- await testUtil.checkContextMenu(data.fileDocxFav.name, data.fileDocxFav.favoritesContextMenu);
- });
-
- it('File favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileFav.name, data.fileFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileFav.name, data.fileFav.favoritesToolbarMore);
- await testUtil.checkContextMenu(data.fileFav.name, data.fileFav.favoritesContextMenu);
- });
-
- it('File Office, shared, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocxSharedFav.name, data.fileDocxSharedFav.favoritesToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.favoritesToolbarMore);
- await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.favoritesContextMenu);
- });
-
- it('File shared, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedFav.name, data.fileSharedFav.favoritesToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.favoritesToolbarMore);
- await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.favoritesContextMenu);
- });
-
- it('File favorite, locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileFavLocked.name, data.fileFavLocked.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.favoritesToolbarMore);
- await testUtil.checkContextMenu(data.fileFavLocked.name, data.fileFavLocked.favoritesContextMenu);
- });
-
- it('File shared, favorite, locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedFavLocked.name, data.fileSharedFavLocked.favoritesToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.favoritesToolbarMore);
- await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.favoritesContextMenu);
- });
- });
-
- describe('on a folder', () => {
- it('Folder favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.folderFav.name, data.folderFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.folderFav.name, data.folderFav.favoritesToolbarMore);
- await testUtil.checkContextMenu(data.folderFav.name, data.folderFav.favoritesContextMenu);
- });
- });
-
- describe('on multiple selection', () => {
- it('multiple files - []', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.favoritesContextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.favoritesToolbarMore);
- });
-
- it('multiple locked files - []', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileFavLocked.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.favoritesContextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileFavLocked.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileFavLocked.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.favoritesToolbarMore);
- });
-
- it('multiple folders - []', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.folderFav.name, data.folderFav2.name ], data.multipleSelAllFav.favoritesContextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.folderFav.name, data.folderFav2.name ], data.multipleSelAllFav.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.folderFav.name, data.folderFav2.name ], data.multipleSelAllFav.favoritesToolbarMore);
- });
-
- it('both files and folders - []', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileFav.name, data.folderFav.name ], data.multipleSelAllFav.favoritesContextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileFav.name, data.folderFav.name ], data.multipleSelAllFav.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileFav.name, data.folderFav.name ], data.multipleSelAllFav.favoritesToolbarMore);
- });
-
- it('multiple files with different granular permissions - []', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileFav.name, file3 ], data.multipleSelAllFav.favoritesContextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileFav.name, file3 ], data.multipleSelAllFav.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileFav.name, file3 ], data.multipleSelAllFav.favoritesToolbarMore);
- });
- });
-
-});
diff --git a/e2e/suites/actions-available/special-permissions/permissions-my-libraries.test.ts b/e2e/suites/actions-available/special-permissions/permissions-my-libraries.test.ts
deleted file mode 100755
index bc6abb7a1..000000000
--- a/e2e/suites/actions-available/special-permissions/permissions-my-libraries.test.ts
+++ /dev/null
@@ -1,266 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { LoginPage, BrowsingPage } from '../../../pages/pages';
-import { FILES, SITE_VISIBILITY, SITE_ROLES } from '../../../configs';
-import { RepoClient } from '../../../utilities/repo-client/repo-client';
-import { Utils } from '../../../utilities/utils';
-import * as data from './test-data-permissions';
-import * as testUtil from '../test-util';
-
-describe('Special permissions actions : on File Libraries : ', () => {
-
- const site = `site-private-${Utils.random()}`;
-
- const userConsumer = `consumer-${Utils.random()}`;
-
- const file3 = `file-3-${Utils.random()}.txt`;
- let file3Id;
-
- let fileDocxFavId, fileFavId, fileDocxSharedId, fileDocxSharedFavId, fileSharedId, fileSharedFavId, fileLockedId, fileFavLockedId, fileSharedLockedId, fileSharedFavLockedId;
- let folderFavId;
-
- const apis = {
- admin: new RepoClient(),
- userConsumer: new RepoClient(userConsumer, userConsumer)
- };
-
- const loginPage = new LoginPage();
- const page = new BrowsingPage();
- const { dataTable } = page;
-
- beforeAll(async (done) => {
- await apis.admin.people.createUser({ username: userConsumer });
-
- await apis.admin.sites.createSite(site, SITE_VISIBILITY.PRIVATE);
- const docLibId = await apis.admin.sites.getDocLibId(site);
- await apis.admin.sites.addSiteMember(site, userConsumer, SITE_ROLES.SITE_CONSUMER.ROLE);
-
- await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocx.name );
- fileDocxFavId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxFav.name)).entry.id;
- await apis.admin.nodes.createFile(data.file.name, docLibId);
- fileFavId = (await apis.admin.nodes.createFile(data.fileFav.name, docLibId)).entry.id;
- fileDocxSharedId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxShared.name)).entry.id;
- fileDocxSharedFavId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxSharedFav.name)).entry.id;
- fileSharedId = (await apis.admin.nodes.createFile(data.fileShared.name, docLibId)).entry.id;
- fileSharedFavId = (await apis.admin.nodes.createFile(data.fileSharedFav.name, docLibId)).entry.id;
- fileLockedId = (await apis.admin.nodes.createFile(data.fileLocked.name, docLibId)).entry.id;
- fileFavLockedId = (await apis.admin.nodes.createFile(data.fileFavLocked.name, docLibId)).entry.id;
- fileSharedLockedId = (await apis.admin.nodes.createFile(data.fileSharedLocked.name, docLibId)).entry.id;
- fileSharedFavLockedId = (await apis.admin.nodes.createFile(data.fileSharedFavLocked.name, docLibId)).entry.id;
-
- file3Id = (await apis.admin.nodes.createFile(file3, docLibId)).entry.id;
-
- await apis.admin.nodes.createFolder(data.folder.name, docLibId);
- folderFavId = (await apis.admin.nodes.createFolder(data.folderFav.name, docLibId)).entry.id;
- done();
- });
-
- beforeAll(async (done) => {
- await apis.userConsumer.favorites.addFavoriteById('folder', folderFavId);
-
- await apis.userConsumer.favorites.addFavoritesByIds('file', [
- fileDocxFavId,
- fileFavId,
- fileDocxSharedFavId,
- fileSharedFavId,
- fileFavLockedId,
- fileSharedFavLockedId,
- file3Id
- ]);
-
- await apis.userConsumer.shared.shareFilesByIds([
- fileDocxSharedId,
- fileDocxSharedFavId,
- fileSharedId,
- fileSharedFavId,
- fileSharedLockedId,
- fileSharedFavLockedId,
- file3Id
- ]);
-
- await apis.admin.nodes.lockFile(fileLockedId);
- await apis.admin.nodes.lockFile(fileFavLockedId);
- await apis.admin.nodes.lockFile(fileSharedLockedId);
- await apis.admin.nodes.lockFile(fileSharedFavLockedId);
-
- await apis.admin.nodes.setGranularPermission(file3Id, false, userConsumer, SITE_ROLES.SITE_MANAGER.ROLE);
-
- await apis.userConsumer.favorites.waitForApi({ expect: 8 });
- await apis.userConsumer.shared.waitForApi({ expect: 7 });
- done();
- });
-
- beforeAll(async (done) => {
- await loginPage.loginWith(userConsumer);
- done();
- });
-
- afterAll(async (done) => {
- await apis.admin.sites.deleteSite(site);
- done();
- });
-
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await page.goToMyLibrariesAndWait();
- await dataTable.doubleClickOnRowByName(site);
- await dataTable.waitForHeader();
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- describe('on a file', () => {
-
- it('File Office - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocx.name, data.fileDocx.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocx.name, data.fileDocx.toolbarMore);
- await testUtil.checkContextMenu(data.fileDocx.name, data.fileDocx.contextMenu);
- });
-
- it('File Office, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocxFav.name, data.fileDocxFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.toolbarMore);
- await testUtil.checkContextMenu(data.fileDocxFav.name, data.fileDocxFav.contextMenu);
- });
-
- it('File simple - []', async () => {
- await testUtil.checkToolbarPrimary(data.file.name, data.file.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.file.name, data.file.toolbarMore);
- await testUtil.checkContextMenu(data.file.name, data.file.contextMenu);
- });
-
- it('File favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileFav.name, data.fileFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileFav.name, data.fileFav.toolbarMore);
- await testUtil.checkContextMenu(data.fileFav.name, data.fileFav.contextMenu);
- });
-
- it('File Office, shared - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocxShared.name, data.fileDocxShared.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.toolbarMore);
- await testUtil.checkContextMenu(data.fileDocxShared.name, data.fileDocxShared.contextMenu);
- });
-
- it('File Office, shared, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocxSharedFav.name, data.fileDocxSharedFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.toolbarMore);
- await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.contextMenu);
- });
-
- it('File shared - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileShared.name, data.fileShared.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileShared.name, data.fileShared.toolbarMore);
- await testUtil.checkContextMenu(data.fileShared.name, data.fileShared.contextMenu);
- });
-
- it('File shared, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedFav.name, data.fileSharedFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.toolbarMore);
- await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.contextMenu);
- });
-
- it('File locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileLocked.name, data.fileLocked.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileLocked.name, data.fileLocked.toolbarMore);
- await testUtil.checkContextMenu(data.fileLocked.name, data.fileLocked.contextMenu);
- });
-
- it('File favorite, locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileFavLocked.name, data.fileFavLocked.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.toolbarMore);
- await testUtil.checkContextMenu(data.fileFavLocked.name, data.fileFavLocked.contextMenu);
- });
-
- it('File shared, locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedLocked.name, data.fileSharedLocked.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.toolbarMore);
- await testUtil.checkContextMenu(data.fileSharedLocked.name, data.fileSharedLocked.contextMenu);
- });
-
- it('File shared, favorite, locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedFavLocked.name, data.fileSharedFavLocked.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.toolbarMore);
- await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.contextMenu);
- });
- });
-
- describe('on a folder', () => {
-
- it('Folder not favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.folder.name, data.folder.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.folder.name, data.folder.toolbarMore);
- await testUtil.checkContextMenu(data.folder.name, data.folder.contextMenu);
- });
-
- it('Folder favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.folderFav.name, data.folderFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.folderFav.name, data.folderFav.toolbarMore);
- await testUtil.checkContextMenu(data.folderFav.name, data.folderFav.contextMenu);
- });
- });
-
- describe('on multiple selection', () => {
- it('multiple files - []', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileDocx.name, data.fileDocxSharedFav.name ], data.multipleSel.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocx.name, data.fileDocxSharedFav.name ], data.multipleSel.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocx.name, data.fileDocxSharedFav.name ], data.multipleSel.toolbarMore);
- });
-
- it('multiple files - all favorite - []', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSel.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.toolbarMore);
- });
-
- it('multiple locked files - []', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarMore);
- });
-
- it('multiple folders - []', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.folderFav.name, data.folder.name ], data.multipleSel.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.folderFav.name, data.folder.name ], data.multipleSel.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.folderFav.name, data.folder.name ], data.multipleSel.toolbarMore);
- });
-
- it('both files and folders - []', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.file.name, data.folder.name ], data.multipleSel.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.file.name, data.folder.name ], data.multipleSel.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.file.name, data.folder.name ], data.multipleSel.toolbarMore);
- });
-
- it('multiple files with different granular permissions - []', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, file3 ], data.multipleSelAllFav.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocxFav.name, file3 ], data.multipleSel.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocxFav.name, file3 ], data.multipleSelAllFav.toolbarMore);
- });
- });
-});
diff --git a/e2e/suites/actions-available/special-permissions/permissions-search.test.ts b/e2e/suites/actions-available/special-permissions/permissions-search.test.ts
deleted file mode 100755
index 6bcfdd7b4..000000000
--- a/e2e/suites/actions-available/special-permissions/permissions-search.test.ts
+++ /dev/null
@@ -1,310 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { LoginPage, BrowsingPage } from '../../../pages/pages';
-import { FILES, SITE_VISIBILITY, SITE_ROLES } from '../../../configs';
-import { RepoClient } from '../../../utilities/repo-client/repo-client';
-import { Utils } from '../../../utilities/utils';
-import * as data from './test-data-permissions';
-import * as testUtil from '../test-util';
-
-describe('Special permissions actions : on Search Results : ', () => {
-
- const site = `site-private-${Utils.random()}`;
-
- const userConsumer = `consumer-${Utils.random()}`;
-
- const file3 = `file-3-${Utils.random()}.txt`;
- let file3Id;
-
- let fileDocxFavId, fileFavId, fileDocxSharedId, fileDocxSharedFavId, fileSharedId, fileSharedFavId, fileLockedId, fileFavLockedId, fileSharedLockedId, fileSharedFavLockedId;
- let folderFavId;
-
- const apis = {
- admin: new RepoClient(),
- userConsumer: new RepoClient(userConsumer, userConsumer)
- };
-
- const loginPage = new LoginPage();
- const page = new BrowsingPage();
- const { searchInput } = page.header;
-
- beforeAll(async (done) => {
- await apis.admin.people.createUser({ username: userConsumer });
-
- await apis.admin.sites.createSite(site, SITE_VISIBILITY.PRIVATE);
- const docLibId = await apis.admin.sites.getDocLibId(site);
- await apis.admin.sites.addSiteMember(site, userConsumer, SITE_ROLES.SITE_CONSUMER.ROLE);
-
- await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocx.name );
- fileDocxFavId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxFav.name)).entry.id;
- await apis.admin.nodes.createFile(data.file.name, docLibId);
- fileFavId = (await apis.admin.nodes.createFile(data.fileFav.name, docLibId)).entry.id;
- fileDocxSharedId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxShared.name)).entry.id;
- fileDocxSharedFavId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxSharedFav.name)).entry.id;
- fileSharedId = (await apis.admin.nodes.createFile(data.fileShared.name, docLibId)).entry.id;
- fileSharedFavId = (await apis.admin.nodes.createFile(data.fileSharedFav.name, docLibId)).entry.id;
- fileLockedId = (await apis.admin.nodes.createFile(data.fileLocked.name, docLibId)).entry.id;
- fileFavLockedId = (await apis.admin.nodes.createFile(data.fileFavLocked.name, docLibId)).entry.id;
- fileSharedLockedId = (await apis.admin.nodes.createFile(data.fileSharedLocked.name, docLibId)).entry.id;
- fileSharedFavLockedId = (await apis.admin.nodes.createFile(data.fileSharedFavLocked.name, docLibId)).entry.id;
-
- file3Id = (await apis.admin.nodes.createFile(file3, docLibId)).entry.id;
-
- await apis.admin.nodes.createFolder(data.folder.name, docLibId);
- folderFavId = (await apis.admin.nodes.createFolder(data.folderFav.name, docLibId)).entry.id;
- await apis.userConsumer.favorites.addFavoriteById('folder', folderFavId);
-
- await apis.userConsumer.favorites.addFavoritesByIds('file', [
- fileDocxFavId,
- fileFavId,
- fileDocxSharedFavId,
- fileSharedFavId,
- fileFavLockedId,
- fileSharedFavLockedId,
- file3Id
- ]);
-
- await apis.userConsumer.shared.shareFilesByIds([
- fileDocxSharedId,
- fileDocxSharedFavId,
- fileSharedId,
- fileSharedFavId,
- fileSharedLockedId,
- fileSharedFavLockedId,
- file3Id
- ]);
-
- await apis.admin.nodes.lockFile(fileLockedId);
- await apis.admin.nodes.lockFile(fileFavLockedId);
- await apis.admin.nodes.lockFile(fileSharedLockedId);
- await apis.admin.nodes.lockFile(fileSharedFavLockedId);
-
- await apis.admin.nodes.setGranularPermission(file3Id, false, userConsumer, SITE_ROLES.SITE_MANAGER.ROLE);
-
- await apis.userConsumer.favorites.waitForApi({ expect: 8 });
- await apis.userConsumer.shared.waitForApi({ expect: 7 });
- await apis.userConsumer.search.waitForApi(userConsumer, { expect: 13 });
-
- await loginPage.loginWith(userConsumer);
- done();
- });
-
- afterAll(async (done) => {
- await apis.admin.sites.deleteSite(site);
- done();
- });
-
- describe('on a file', () => {
-
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await page.clickPersonalFiles();
- await searchInput.clickSearchButton();
- await searchInput.checkOnlyFiles();
- await searchInput.searchFor('file-');
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- it('File Office - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocx.name, data.fileDocx.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocx.name, data.fileDocx.toolbarMore);
- await testUtil.checkContextMenu(data.fileDocx.name, data.fileDocx.contextMenu);
- });
-
- it('File Office, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocxFav.name, data.fileDocxFav.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.toolbarMore);
- await testUtil.checkContextMenu(data.fileDocxFav.name, data.fileDocxFav.contextMenu);
- });
-
- it('File simple - []', async () => {
- await testUtil.checkToolbarPrimary(data.file.name, data.file.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.file.name, data.file.toolbarMore);
- await testUtil.checkContextMenu(data.file.name, data.file.contextMenu);
- });
-
- it('File favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileFav.name, data.fileFav.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileFav.name, data.fileFav.toolbarMore);
- await testUtil.checkContextMenu(data.fileFav.name, data.fileFav.contextMenu);
- });
-
- it('File Office, shared - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocxShared.name, data.fileDocxShared.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.toolbarMore);
- await testUtil.checkContextMenu(data.fileDocxShared.name, data.fileDocxShared.contextMenu);
- });
-
- it('File Office, shared, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocxSharedFav.name, data.fileDocxSharedFav.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.toolbarMore);
- await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.contextMenu);
- });
-
- it('File shared - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileShared.name, data.fileShared.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileShared.name, data.fileShared.toolbarMore);
- await testUtil.checkContextMenu(data.fileShared.name, data.fileShared.contextMenu);
- });
-
- it('File shared, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedFav.name, data.fileSharedFav.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.toolbarMore);
- await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.contextMenu);
- });
-
- it('File locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileLocked.name, data.fileLocked.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileLocked.name, data.fileLocked.toolbarMore);
- await testUtil.checkContextMenu(data.fileLocked.name, data.fileLocked.contextMenu);
- });
-
- it('File favorite, locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileFavLocked.name, data.fileFavLocked.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.toolbarMore);
- await testUtil.checkContextMenu(data.fileFavLocked.name, data.fileFavLocked.contextMenu);
- });
-
- it('File shared, locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedLocked.name, data.fileSharedLocked.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.toolbarMore);
- await testUtil.checkContextMenu(data.fileSharedLocked.name, data.fileSharedLocked.contextMenu);
- });
-
- it('File shared, favorite, locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedFavLocked.name, data.fileSharedFavLocked.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.toolbarMore);
- await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.contextMenu);
- });
- });
-
- describe('on a folder', () => {
-
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await page.clickPersonalFiles();
- await searchInput.clickSearchButton();
- await searchInput.checkOnlyFolders();
- await searchInput.searchFor('folder-');
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- it('Folder not favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.folder.name, data.folder.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.folder.name, data.folder.toolbarMore);
- await testUtil.checkContextMenu(data.folder.name, data.folder.contextMenu);
- });
-
- it('Folder favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.folderFav.name, data.folderFav.searchToolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.folderFav.name, data.folderFav.toolbarMore);
- await testUtil.checkContextMenu(data.folderFav.name, data.folderFav.contextMenu);
- });
- });
-
- describe('on multiple selection', () => {
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await page.clickPersonalFiles();
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- it('multiple files - []', async () => {
- await searchInput.clickSearchButton();
- await searchInput.checkOnlyFiles();
- await searchInput.searchFor('file-');
-
- await testUtil.checkMultipleSelContextMenu([ data.file.name, data.fileDocxShared.name ], data.multipleSel.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.file.name, data.fileDocxShared.name ], data.multipleSel.searchToolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.file.name, data.fileDocxShared.name ], data.multipleSel.toolbarMore);
- });
-
- it('multiple files - all favorite - []', async () => {
- await searchInput.clickSearchButton();
- await searchInput.checkOnlyFiles();
- await searchInput.searchFor('file-');
-
- await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileSharedFav.name ], data.multipleSelAllFav.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocxFav.name, data.fileSharedFav.name ], data.multipleSel.searchToolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocxFav.name, data.fileSharedFav.name ], data.multipleSelAllFav.toolbarMore);
- });
-
- it('multiple locked files - []', async () => {
- await searchInput.clickSearchButton();
- await searchInput.checkOnlyFiles();
- await searchInput.searchFor('file-');
-
- await testUtil.checkMultipleSelContextMenu([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.searchToolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarMore);
- });
-
- it('multiple folders - []', async () => {
- await searchInput.clickSearchButton();
- await searchInput.checkOnlyFolders();
- await searchInput.searchFor('folder-');
-
- await testUtil.checkMultipleSelContextMenu([ data.folder.name, data.folderFav.name ], data.multipleSel.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.folder.name, data.folderFav.name ], data.multipleSel.searchToolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.folder.name, data.folderFav.name ], data.multipleSel.toolbarMore);
- });
-
- it('both files and folders - []', async () => {
- await searchInput.clickSearchButton();
- await searchInput.checkFilesAndFolders();
- await searchInput.searchFor(`=${data.file.name} or =${data.folderFav.name}`);
-
- await testUtil.checkMultipleSelContextMenu([ data.file.name, data.folderFav.name ], data.multipleSel.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.file.name, data.folderFav.name ], data.multipleSel.searchToolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.file.name, data.folderFav.name ], data.multipleSel.toolbarMore);
- });
-
- it('multiple files with different granular permissions - []', async () => {
- await searchInput.clickSearchButton();
- await searchInput.checkOnlyFiles();
- await searchInput.searchFor('file-');
-
- await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, file3 ], data.multipleSelAllFav.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocxFav.name, file3 ], data.multipleSel.searchToolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocxFav.name, file3 ], data.multipleSelAllFav.toolbarMore);
- });
- });
-});
diff --git a/e2e/suites/actions-available/special-permissions/permissions-shared.test.ts b/e2e/suites/actions-available/special-permissions/permissions-shared.test.ts
deleted file mode 100755
index 6f5404bc0..000000000
--- a/e2e/suites/actions-available/special-permissions/permissions-shared.test.ts
+++ /dev/null
@@ -1,179 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { LoginPage, BrowsingPage } from '../../../pages/pages';
-import { FILES, SITE_VISIBILITY, SITE_ROLES } from '../../../configs';
-import { RepoClient } from '../../../utilities/repo-client/repo-client';
-import { Utils } from '../../../utilities/utils';
-import * as data from './test-data-permissions';
-import * as testUtil from '../test-util';
-
-describe('Special permissions actions : on Shared Files : ', () => {
-
- const site = `site-private-${Utils.random()}`;
-
- const userConsumer = `consumer-${Utils.random()}`;
-
- const file3 = `file-3-${Utils.random()}.txt`;
- let file3Id;
-
- let fileDocxSharedId, fileDocxSharedFavId, fileSharedId, fileSharedFavId, fileSharedLockedId, fileSharedFavLockedId;
-
- const apis = {
- admin: new RepoClient(),
- userConsumer: new RepoClient(userConsumer, userConsumer)
- };
-
- const loginPage = new LoginPage();
- const page = new BrowsingPage();
-
- beforeAll(async (done) => {
- await apis.admin.people.createUser({ username: userConsumer });
-
- await apis.admin.sites.createSite(site, SITE_VISIBILITY.PRIVATE);
- const docLibId = await apis.admin.sites.getDocLibId(site);
- await apis.admin.sites.addSiteMember(site, userConsumer, SITE_ROLES.SITE_CONSUMER.ROLE);
-
- fileDocxSharedId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxShared.name)).entry.id;
- fileDocxSharedFavId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxSharedFav.name)).entry.id;
- fileSharedId = (await apis.admin.nodes.createFile(data.fileShared.name, docLibId)).entry.id;
- fileSharedFavId = (await apis.admin.nodes.createFile(data.fileSharedFav.name, docLibId)).entry.id;
- fileSharedLockedId = (await apis.admin.nodes.createFile(data.fileSharedLocked.name, docLibId)).entry.id;
- fileSharedFavLockedId = (await apis.admin.nodes.createFile(data.fileSharedFavLocked.name, docLibId)).entry.id;
-
- file3Id = (await apis.admin.nodes.createFile(file3, docLibId)).entry.id;
-
- await apis.userConsumer.favorites.addFavoritesByIds('file', [
- fileDocxSharedFavId,
- fileSharedFavId,
- fileSharedFavLockedId,
- file3Id
- ]);
-
- await apis.userConsumer.shared.shareFilesByIds([
- fileDocxSharedId,
- fileDocxSharedFavId,
- fileSharedId,
- fileSharedFavId,
- fileSharedLockedId,
- fileSharedFavLockedId,
- file3Id
- ]);
-
- await apis.admin.nodes.lockFile(fileSharedLockedId);
- await apis.admin.nodes.lockFile(fileSharedFavLockedId);
-
- await apis.admin.nodes.setGranularPermission(file3Id, false, userConsumer, SITE_ROLES.SITE_MANAGER.ROLE);
-
- await apis.userConsumer.favorites.waitForApi({ expect: 7 });
- await apis.userConsumer.shared.waitForApi({ expect: 4 });
-
- await loginPage.loginWith(userConsumer);
- done();
- });
-
- afterAll(async (done) => {
- await apis
- await apis.admin.sites.deleteSite(site);
- done();
- });
-
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await page.clickSharedFilesAndWait();
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- describe('single selection', () => {
-
- it('File Office, shared - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocxShared.name, data.fileDocxShared.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.sharedToolbarMore);
- await testUtil.checkContextMenu(data.fileDocxShared.name, data.fileDocxShared.sharedContextMenu);
- });
-
- it('File Office, shared, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileDocxSharedFav.name, data.fileDocxSharedFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.sharedToolbarMore);
- await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.sharedContextMenu);
- });
-
- it('File shared - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileShared.name, data.fileShared.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileShared.name, data.fileShared.sharedToolbarMore);
- await testUtil.checkContextMenu(data.fileShared.name, data.fileShared.sharedContextMenu);
- });
-
- it('File shared, favorite - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedFav.name, data.fileSharedFav.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.sharedToolbarMore);
- await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.sharedContextMenu);
- });
-
- it('File shared, locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedLocked.name, data.fileSharedLocked.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.sharedToolbarMore);
- await testUtil.checkContextMenu(data.fileSharedLocked.name, data.fileSharedLocked.sharedContextMenu);
- });
-
- it('File shared, favorite, locked - []', async () => {
- await testUtil.checkToolbarPrimary(data.fileSharedFavLocked.name, data.fileSharedFavLocked.toolbarPrimary);
- await testUtil.checkToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.sharedToolbarMore);
- await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.sharedContextMenu);
- });
- });
-
- describe('multiple selection', () => {
- it('multiple files - []', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileShared.name, data.fileSharedFav.name ], data.multipleSel.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileShared.name, data.fileSharedFav.name ], data.multipleSel.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileShared.name, data.fileSharedFav.name ], data.multipleSel.toolbarMore);
- });
-
- it('multiple files - all favorite - []', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileSharedFav.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileSharedFav.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileSharedFav.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.toolbarMore);
- });
-
- it('multiple locked files - []', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileSharedLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileSharedLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileSharedLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarMore);
- });
-
- it('multiple files with different granular permissions - []', async () => {
- await testUtil.checkMultipleSelContextMenu([ data.fileSharedFav.name, file3 ], data.multipleSelAllFav.contextMenu);
- await testUtil.checkMultipleSelToolbarPrimary([ data.fileSharedFav.name, file3 ], data.multipleSel.toolbarPrimary);
- await testUtil.checkMultipleSelToolbarMoreActions([ data.fileSharedFav.name, file3 ], data.multipleSelAllFav.toolbarMore);
- });
- });
-
-});
diff --git a/e2e/suites/actions-available/special-permissions/permissions-viewer.test.ts b/e2e/suites/actions-available/special-permissions/permissions-viewer.test.ts
deleted file mode 100755
index 967536163..000000000
--- a/e2e/suites/actions-available/special-permissions/permissions-viewer.test.ts
+++ /dev/null
@@ -1,401 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { LoginPage, BrowsingPage } from '../../../pages/pages';
-import { FILES, SITE_VISIBILITY, SITE_ROLES } from '../../../configs';
-import { RepoClient } from '../../../utilities/repo-client/repo-client';
-import { Utils } from '../../../utilities/utils';
-import * as data from './test-data-permissions';
-import * as testUtil from '../test-util';
-
-describe('Special permissions actions : in the Viewer : ', () => {
-
- const site = `site-private-${Utils.random()}`;
-
- const userConsumer = `consumer-${Utils.random()}`;
-
- let fileDocxFavId, fileFavId, fileDocxSharedId, fileDocxSharedFavId, fileSharedId, fileSharedFavId, fileLockedId, fileFavLockedId, fileSharedLockedId, fileSharedFavLockedId;
-
- const apis = {
- admin: new RepoClient(),
- userConsumer: new RepoClient(userConsumer, userConsumer)
- };
-
- const loginPage = new LoginPage();
- const page = new BrowsingPage();
- const { dataTable } = page;
- const { searchInput } = page.header;
-
- beforeAll(async (done) => {
- await apis.admin.people.createUser({ username: userConsumer });
-
- await apis.admin.sites.createSite(site, SITE_VISIBILITY.PRIVATE);
- const docLibId = await apis.admin.sites.getDocLibId(site);
- await apis.admin.sites.addSiteMember(site, userConsumer, SITE_ROLES.SITE_CONSUMER.ROLE);
-
- await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocx.name );
- fileDocxFavId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxFav.name)).entry.id;
- await apis.admin.nodes.createFile(data.file.name, docLibId);
- fileFavId = (await apis.admin.nodes.createFile(data.fileFav.name, docLibId)).entry.id;
- fileDocxSharedId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxShared.name)).entry.id;
- fileDocxSharedFavId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxSharedFav.name)).entry.id;
- fileSharedId = (await apis.admin.nodes.createFile(data.fileShared.name, docLibId)).entry.id;
- fileSharedFavId = (await apis.admin.nodes.createFile(data.fileSharedFav.name, docLibId)).entry.id;
- fileLockedId = (await apis.admin.nodes.createFile(data.fileLocked.name, docLibId)).entry.id;
- fileFavLockedId = (await apis.admin.nodes.createFile(data.fileFavLocked.name, docLibId)).entry.id;
- fileSharedLockedId = (await apis.admin.nodes.createFile(data.fileSharedLocked.name, docLibId)).entry.id;
- fileSharedFavLockedId = (await apis.admin.nodes.createFile(data.fileSharedFavLocked.name, docLibId)).entry.id;
-
- done();
- });
-
- beforeAll(async (done) => {
- await apis.userConsumer.favorites.addFavoritesByIds('file', [
- fileDocxFavId,
- fileFavId,
- fileDocxSharedFavId,
- fileSharedFavId,
- fileFavLockedId,
- fileSharedFavLockedId
- ]);
-
- await apis.userConsumer.shared.shareFilesByIds([
- fileDocxSharedId,
- fileDocxSharedFavId,
- fileSharedId,
- fileSharedFavId,
- fileSharedLockedId,
- fileSharedFavLockedId
- ]);
-
- await apis.admin.nodes.lockFile(fileLockedId);
- await apis.admin.nodes.lockFile(fileFavLockedId);
- await apis.admin.nodes.lockFile(fileSharedLockedId);
- await apis.admin.nodes.lockFile(fileSharedFavLockedId);
-
- await apis.userConsumer.favorites.waitForApi({ expect: 6 });
- await apis.userConsumer.shared.waitForApi({ expect: 6 });
- done();
- });
-
- beforeAll(async (done) => {
- await loginPage.loginWith(userConsumer);
- done();
- });
-
- afterAll(async (done) => {
- await apis.admin.sites.deleteSite(site);
- done();
- });
-
- describe('file opened from File Libraries', () => {
-
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await page.goToMyLibrariesAndWait();
- await dataTable.doubleClickOnRowByName(site);
- await dataTable.waitForHeader();
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- it('File Office - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocx.name, data.fileDocx.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocx.name, data.fileDocx.viewerToolbarMore);
- });
-
- it('File Office, favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarMore);
- });
-
- it('File simple - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.file.name, data.file.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.file.name, data.file.viewerToolbarMore);
- });
-
- it('File favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileFav.name, data.fileFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileFav.name, data.fileFav.viewerToolbarMore);
- });
-
- it('File Office, shared - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarMore);
- });
-
- it('File Office, shared, favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarMore);
- });
-
- it('File shared - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileShared.name, data.fileShared.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileShared.name, data.fileShared.viewerToolbarMore);
- });
-
- it('File shared, favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarMore);
- });
-
- it('File locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileLocked.name, data.fileLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileLocked.name, data.fileLocked.viewerToolbarMore);
- });
-
- it('File favorite, locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarMore);
- });
-
- it('File shared, locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarMore);
- });
-
- it('File shared, favorite, locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarMore);
- });
- });
-
- describe('file opened from Favorites', () => {
-
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await page.clickFavoritesAndWait();
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- it('File Office, favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarMore);
- });
-
- it('File favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileFav.name, data.fileFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileFav.name, data.fileFav.viewerToolbarMore);
- });
-
- it('File Office, shared, favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarMore);
- });
-
- it('File shared, favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarMore);
- });
-
- it('File favorite, locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarMore);
- });
-
- it('File shared, favorite, locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarMore);
- });
- });
-
- describe('file opened from Shared Files', () => {
-
- beforeEach(async (done) => {
- await Utils.pressEscape();
- await page.clickSharedFilesAndWait();
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- it('File Office, shared - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarMore);
- });
-
- it('File Office, shared, favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarMore);
- });
-
- it('File shared - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileShared.name, data.fileShared.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileShared.name, data.fileShared.viewerToolbarMore);
- });
-
- it('File shared, favorite - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarMore);
- });
-
- it('File shared, locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarMore);
- });
-
- it('File shared, favorite, locked - []', async () => {
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarMore);
- });
- });
-
- describe('file opened from Search Results', () => {
-
- beforeAll(async (done) => {
- await Utils.pressEscape();
- await page.clickPersonalFiles();
- await searchInput.clickSearchButton();
- await searchInput.checkOnlyFiles();
- await searchInput.searchFor('file-');
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- it('File Office - []', async () => {
- // await searchInput.clickSearchButton();
- // await searchInput.checkOnlyFiles();
- // await searchInput.searchFor('file-');
-
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocx.name, data.fileDocx.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocx.name, data.fileDocx.viewerToolbarMore);
- });
-
- it('File Office, favorite - []', async () => {
- // await searchInput.clickSearchButton();
- // await searchInput.checkOnlyFiles();
- // await searchInput.searchFor('file-');
-
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarMore);
- });
-
- it('File simple - []', async () => {
- // await searchInput.clickSearchButton();
- // await searchInput.checkOnlyFiles();
- // await searchInput.searchFor('file-');
-
- await testUtil.checkViewerToolbarPrimaryActions(data.file.name, data.file.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.file.name, data.file.viewerToolbarMore);
- });
-
- it('File favorite - []', async () => {
- // await searchInput.clickSearchButton();
- // await searchInput.checkOnlyFiles();
- // await searchInput.searchFor('file-');
-
- await testUtil.checkViewerToolbarPrimaryActions(data.fileFav.name, data.fileFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileFav.name, data.fileFav.viewerToolbarMore);
- });
-
- it('File Office, shared - []', async () => {
- // await searchInput.clickSearchButton();
- // await searchInput.checkOnlyFiles();
- // await searchInput.searchFor('file-');
-
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarMore);
- });
-
- it('File Office, shared, favorite - []', async () => {
- // await searchInput.clickSearchButton();
- // await searchInput.checkOnlyFiles();
- // await searchInput.searchFor('file-');
-
- await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarMore);
- });
-
- it('File shared - []', async () => {
- // await searchInput.clickSearchButton();
- // await searchInput.checkOnlyFiles();
- // await searchInput.searchFor('file-');
-
- await testUtil.checkViewerToolbarPrimaryActions(data.fileShared.name, data.fileShared.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileShared.name, data.fileShared.viewerToolbarMore);
- });
-
- it('File shared, favorite - []', async () => {
- // await searchInput.clickSearchButton();
- // await searchInput.checkOnlyFiles();
- // await searchInput.searchFor('file-');
-
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarMore);
- });
-
- it('File locked - []', async () => {
- // await searchInput.clickSearchButton();
- // await searchInput.checkOnlyFiles();
- // await searchInput.searchFor('file-');
-
- await testUtil.checkViewerToolbarPrimaryActions(data.fileLocked.name, data.fileLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileLocked.name, data.fileLocked.viewerToolbarMore);
- });
-
- it('File favorite, locked - []', async () => {
- // await searchInput.clickSearchButton();
- // await searchInput.checkOnlyFiles();
- // await searchInput.searchFor('file-');
-
- await testUtil.checkViewerToolbarPrimaryActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarMore);
- });
-
- it('File shared, locked - []', async () => {
- // await searchInput.clickSearchButton();
- // await searchInput.checkOnlyFiles();
- // await searchInput.searchFor('file-');
-
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarMore);
- });
-
- it('File shared, favorite, locked - []', async () => {
- // await searchInput.clickSearchButton();
- // await searchInput.checkOnlyFiles();
- // await searchInput.searchFor('file-');
-
- await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary);
- await testUtil.checkViewerToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarMore);
- });
- });
-});
diff --git a/e2e/suites/actions-available/special-permissions/search-results.ts b/e2e/suites/actions-available/special-permissions/search-results.ts
new file mode 100755
index 000000000..99e601456
--- /dev/null
+++ b/e2e/suites/actions-available/special-permissions/search-results.ts
@@ -0,0 +1,190 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { BrowsingPage, SearchResultsPage } from '../../../pages/pages';
+import { Utils } from '../../../utilities/utils';
+import * as testData from './test-data-permissions';
+import * as testUtil from '../test-util';
+
+export function searchResultsTests() {
+ const page = new BrowsingPage();
+ const searchResultsPage = new SearchResultsPage();
+ const { searchInput } = page.header;
+
+ describe('available actions : ', () => {
+
+ beforeEach(async () => {
+ await Utils.pressEscape();
+ });
+
+ afterEach(async () => {
+ await page.closeOpenDialogs();
+ });
+
+ describe('on a file', () => {
+
+ beforeAll(async () => {
+ await page.clickPersonalFiles();
+ await searchInput.clickSearchButton();
+ await searchInput.searchFor('file-');
+ await searchResultsPage.waitForResults();
+ });
+
+ it('File Office - [C286286]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocx.name, testData.fileDocx.searchToolbarPrimary, testData.fileDocx.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocx.name, testData.fileDocx.contextMenu);
+ });
+
+ it('File Office, favorite - [C286287]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocxFav.name, testData.fileDocxFav.searchToolbarPrimary, testData.fileDocxFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocxFav.name, testData.fileDocxFav.contextMenu);
+ });
+
+ it('File simple - [C286262]', async () => {
+ await testUtil.checkToolbarActions(testData.file.name, testData.file.searchToolbarPrimary, testData.file.toolbarMore);
+ await testUtil.checkContextMenu(testData.file.name, testData.file.contextMenu);
+ });
+
+ it('File favorite - [C286263]', async () => {
+ await testUtil.checkToolbarActions(testData.fileFav.name, testData.fileFav.searchToolbarPrimary, testData.fileFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileFav.name, testData.fileFav.contextMenu);
+ });
+
+ it('File Office, shared - [C286280]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocxShared.name, testData.fileDocxShared.searchToolbarPrimary, testData.fileDocxShared.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocxShared.name, testData.fileDocxShared.contextMenu);
+ });
+
+ it('File Office, shared, favorite - [C286281]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.searchToolbarPrimary, testData.fileDocxSharedFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.contextMenu);
+ });
+
+ it('File shared - [C286282]', async () => {
+ await testUtil.checkToolbarActions(testData.fileShared.name, testData.fileShared.searchToolbarPrimary, testData.fileShared.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileShared.name, testData.fileShared.contextMenu);
+ });
+
+ it('File shared, favorite - [C291823]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.searchToolbarPrimary, testData.fileSharedFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.contextMenu);
+ });
+
+ it('File locked - [C291818]', async () => {
+ await testUtil.checkToolbarActions(testData.fileLocked.name, testData.fileLocked.searchToolbarPrimary, testData.fileLocked.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileLocked.name, testData.fileLocked.contextMenu);
+ });
+
+ it('File favorite, locked - [C291819]', async () => {
+ await testUtil.checkToolbarActions(testData.fileFavLocked.name, testData.fileFavLocked.searchToolbarPrimary, testData.fileFavLocked.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileFavLocked.name, testData.fileFavLocked.contextMenu);
+ });
+
+ it('File shared, locked - [C291824]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedLocked.name, testData.fileSharedLocked.searchToolbarPrimary, testData.fileSharedLocked.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedLocked.name, testData.fileSharedLocked.contextMenu);
+ });
+
+ it('File shared, favorite, locked - [C291825]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.searchToolbarPrimary, testData.fileSharedFavLocked.toolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.contextMenu);
+ });
+
+ });
+
+ describe('on a folder', () => {
+
+ beforeAll(async () => {
+ await page.clickPersonalFiles();
+ await searchInput.clickSearchButton();
+ await searchInput.searchFor('folder-');
+ await searchResultsPage.waitForResults();
+ });
+
+ it('Folder not favorite - [C291826]', async () => {
+ await testUtil.checkToolbarActions(testData.folder.name, testData.folder.searchToolbarPrimary, testData.folder.toolbarMore);
+ await testUtil.checkContextMenu(testData.folder.name, testData.folder.contextMenu);
+ });
+
+ it('Folder favorite - [C291829]', async () => {
+ await testUtil.checkToolbarActions(testData.folderFav.name, testData.folderFav.searchToolbarPrimary, testData.folderFav.toolbarMore);
+ await testUtil.checkContextMenu(testData.folderFav.name, testData.folderFav.contextMenu);
+ });
+
+ });
+
+ describe('on multiple selection', () => {
+
+ describe('of files', () => {
+
+ beforeAll(async () => {
+ await page.clickPersonalFiles();
+ await searchInput.clickSearchButton();
+ await searchInput.searchFor('file-');
+ await searchResultsPage.waitForResults();
+ });
+
+ it('multiple files - [C291830]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.file.name, testData.fileDocxShared.name ], testData.multipleSel.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.file.name, testData.fileDocxShared.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSel.toolbarMore);
+ });
+
+ it('multiple files - all favorite - [C291834]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileDocxFav.name, testData.fileSharedFav.name ], testData.multipleSelAllFav.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileDocxFav.name, testData.fileSharedFav.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSelAllFav.toolbarMore);
+ });
+
+ it('multiple locked files - [C291835]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSel.toolbarMore);
+ });
+
+ it('multiple files with different granular permissions - [C286310]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileDocxFav.name, testData.fileGranularPermission ], testData.multipleSelAllFav.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileDocxFav.name, testData.fileGranularPermission ], testData.multipleSel.searchToolbarPrimary, testData.multipleSelAllFav.toolbarMore);
+ });
+ });
+
+ it('multiple folders - [C291836]', async () => {
+ await page.clickPersonalFiles();
+ await searchInput.clickSearchButton();
+ await searchInput.searchFor('folder-');
+
+ await testUtil.checkMultipleSelContextMenu([ testData.folder.name, testData.folderFav.name ], testData.multipleSel.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.folder.name, testData.folderFav.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSel.toolbarMore);
+ });
+
+ it('both files and folders - [C268128]', async () => {
+ await page.clickPersonalFiles();
+ await searchInput.clickSearchButton();
+ await searchInput.searchFor(`=${testData.file.name} or =${testData.folderFav.name}`);
+
+ await testUtil.checkMultipleSelContextMenu([ testData.file.name, testData.folderFav.name ], testData.multipleSel.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.file.name, testData.folderFav.name ], testData.multipleSel.searchToolbarPrimary, testData.multipleSel.toolbarMore);
+ });
+
+ });
+ });
+}
diff --git a/e2e/suites/actions-available/special-permissions/shared-files.ts b/e2e/suites/actions-available/special-permissions/shared-files.ts
new file mode 100755
index 000000000..452306681
--- /dev/null
+++ b/e2e/suites/actions-available/special-permissions/shared-files.ts
@@ -0,0 +1,107 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { BrowsingPage } from '../../../pages/pages';
+import { Utils } from '../../../utilities/utils';
+import * as testData from './test-data-permissions';
+import * as testUtil from '../test-util';
+
+export function sharedFilesTests() {
+ const page = new BrowsingPage();
+
+ describe('available actions : ', () => {
+
+ beforeAll(async () => {
+ await page.clickSharedFilesAndWait();
+ });
+
+ beforeEach(async () => {
+ await Utils.pressEscape();
+ });
+
+ afterEach(async () => {
+ await page.closeOpenDialogs();
+ });
+
+ describe('single selection', () => {
+
+ it('File Office, shared - [C326626]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocxShared.name, testData.fileDocxShared.toolbarPrimary, testData.fileDocxShared.sharedToolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocxShared.name, testData.fileDocxShared.sharedContextMenu);
+ });
+
+ it('File Office, shared, favorite - [C326627]', async () => {
+ await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.toolbarPrimary, testData.fileDocxSharedFav.sharedToolbarMore);
+ await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.sharedContextMenu);
+ });
+
+ it('File shared - [C326628]', async () => {
+ await testUtil.checkToolbarActions(testData.fileShared.name, testData.fileShared.toolbarPrimary, testData.fileShared.sharedToolbarMore);
+ await testUtil.checkContextMenu(testData.fileShared.name, testData.fileShared.sharedContextMenu);
+ });
+
+ it('File shared, favorite - [C326629]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.toolbarPrimary, testData.fileSharedFav.sharedToolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.sharedContextMenu);
+ });
+
+ it('File shared, locked - [C326631]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedLocked.name, testData.fileSharedLocked.toolbarPrimary, testData.fileSharedLocked.sharedToolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedLocked.name, testData.fileSharedLocked.sharedContextMenu);
+ });
+
+ it('File shared, favorite, locked - [C326632]', async () => {
+ await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.toolbarPrimary, testData.fileSharedFavLocked.sharedToolbarMore);
+ await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.sharedContextMenu);
+ });
+
+ });
+
+ describe('multiple selection', () => {
+
+ it('multiple files - [C326634]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileShared.name, testData.fileSharedFav.name ], testData.multipleSel.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileShared.name, testData.fileSharedFav.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
+ });
+
+ it('multiple files - all favorite - [C326635]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileSharedFav.name, testData.fileSharedFavLocked.name ], testData.multipleSelAllFav.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileSharedFav.name, testData.fileSharedFavLocked.name ], testData.multipleSel.toolbarPrimary, testData.multipleSelAllFav.toolbarMore);
+ });
+
+ it('multiple locked files - [C326636]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileSharedLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileSharedLocked.name, testData.fileSharedFavLocked.name ], testData.multipleSel.toolbarPrimary, testData.multipleSel.toolbarMore);
+ });
+
+ it('multiple files with different granular permissions - [C326639]', async () => {
+ await testUtil.checkMultipleSelContextMenu([ testData.fileSharedFav.name, testData.fileGranularPermission ], testData.multipleSelAllFav.contextMenu);
+ await testUtil.checkMultipleSelToolbarActions([ testData.fileSharedFav.name, testData.fileGranularPermission ], testData.multipleSel.toolbarPrimary, testData.multipleSelAllFav.toolbarMore);
+ });
+
+ });
+
+ });
+}
diff --git a/e2e/suites/actions-available/special-permissions/special-permissions-actions.test.ts b/e2e/suites/actions-available/special-permissions/special-permissions-actions.test.ts
new file mode 100644
index 000000000..9ba463a3c
--- /dev/null
+++ b/e2e/suites/actions-available/special-permissions/special-permissions-actions.test.ts
@@ -0,0 +1,207 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { LoginPage } from '../../../pages/pages';
+import { FILES, SITE_ROLES } from '../../../configs';
+import { RepoClient } from '../../../utilities/repo-client/repo-client';
+import { Utils } from '../../../utilities/utils';
+import { AdminActions } from '../../../utilities/admin-actions';
+import * as testData from './test-data-permissions';
+import { librariesTests } from './my-libraries';
+import { favoritesTests } from './favorites';
+import { searchResultsTests } from './search-results';
+import { viewerTests } from './viewer';
+import { sharedFilesTests } from './shared-files';
+import { collaboratorTests, filesLockedByCurrentUser, filesLockedByOtherUser } from './other-permissions';
+
+describe('Special permissions : ', () => {
+ const random = Utils.random();
+
+ const sitePrivate = `site-private-${random}`;
+
+ const userManager = `manager-${random}`;
+ const userConsumer = `consumer-${random}`;
+ const userCollaborator = `collaborator-${random}`;
+ const userDemoted = `demoted-${random}`;
+
+ let fileDocxFavId: string;
+ let fileFavId: string;
+ let fileDocxSharedId: string;
+ let fileDocxSharedFavId: string;
+ let fileSharedId: string;
+ let fileSharedFavId: string;
+ let fileLockedId: string;
+ let fileFavLockedId: string;
+ let fileSharedLockedId: string;
+ let fileSharedFavLockedId: string;
+ let fileGranularPermissionId: string;
+ let fileLockedByUserId: string;
+ let folderFavId: string;
+ let folderFav2Id: string;
+
+ const adminApiActions = new AdminActions();
+
+ const userManagerApi = new RepoClient(userManager, userManager);
+ const userConsumerApi = new RepoClient(userConsumer, userConsumer);
+ const userCollaboratorApi = new RepoClient(userCollaborator, userCollaborator);
+ const userDemotedApi = new RepoClient(userDemoted, userDemoted);
+
+ const loginPage = new LoginPage();
+
+ beforeAll(async () => {
+ await adminApiActions.createUser({ username: userManager });
+ await adminApiActions.createUser({ username: userConsumer });
+ await adminApiActions.createUser({ username: userCollaborator });
+ await adminApiActions.createUser({ username: userDemoted });
+
+ await userManagerApi.sites.createSitePrivate(sitePrivate);
+ const docLibId = await userManagerApi.sites.getDocLibId(sitePrivate);
+ await userManagerApi.sites.addSiteConsumer(sitePrivate, userConsumer);
+ await userManagerApi.sites.addSiteCollaborator(sitePrivate, userCollaborator);
+ await userManagerApi.sites.addSiteManager(sitePrivate, userDemoted);
+
+ await userManagerApi.upload.uploadFileWithRename(FILES.docxFile, docLibId, testData.fileDocx.name );
+ fileDocxFavId = (await userManagerApi.upload.uploadFileWithRename(FILES.docxFile, docLibId, testData.fileDocxFav.name)).entry.id;
+ await userManagerApi.nodes.createFile(testData.file.name, docLibId);
+ fileFavId = (await userManagerApi.nodes.createFile(testData.fileFav.name, docLibId)).entry.id;
+ fileDocxSharedId = (await userManagerApi.upload.uploadFileWithRename(FILES.docxFile, docLibId, testData.fileDocxShared.name)).entry.id;
+ fileDocxSharedFavId = (await userManagerApi.upload.uploadFileWithRename(FILES.docxFile, docLibId, testData.fileDocxSharedFav.name)).entry.id;
+ fileSharedId = (await userManagerApi.nodes.createFile(testData.fileShared.name, docLibId)).entry.id;
+ fileSharedFavId = (await userManagerApi.nodes.createFile(testData.fileSharedFav.name, docLibId)).entry.id;
+ fileLockedId = (await userManagerApi.nodes.createFile(testData.fileLocked.name, docLibId)).entry.id;
+ fileFavLockedId = (await userManagerApi.nodes.createFile(testData.fileFavLocked.name, docLibId)).entry.id;
+ fileSharedLockedId = (await userManagerApi.nodes.createFile(testData.fileSharedLocked.name, docLibId)).entry.id;
+ fileSharedFavLockedId = (await userManagerApi.nodes.createFile(testData.fileSharedFavLocked.name, docLibId)).entry.id;
+ fileGranularPermissionId = (await userManagerApi.nodes.createFile(testData.fileGranularPermission, docLibId)).entry.id;
+
+ fileLockedByUserId = (await userManagerApi.nodes.createFile(testData.fileLockedByUser, docLibId)).entry.id;
+ await userDemotedApi.nodes.lockFile(fileLockedByUserId);
+ await userDemotedApi.favorites.addFavoriteById('file', fileLockedByUserId);
+ await userDemotedApi.shared.shareFileById(fileLockedByUserId);
+ await userManagerApi.sites.updateSiteMember(sitePrivate, userDemoted, SITE_ROLES.SITE_CONSUMER.ROLE);
+
+ await userManagerApi.nodes.createFolder(testData.folder.name, docLibId);
+ folderFavId = (await userManagerApi.nodes.createFolder(testData.folderFav.name, docLibId)).entry.id;
+ folderFav2Id = (await userManagerApi.nodes.createFolder(testData.folderFav2.name, docLibId)).entry.id;
+ await userConsumerApi.favorites.addFavoritesByIds('folder', [folderFavId, folderFav2Id]);
+
+ await userConsumerApi.favorites.addFavoritesByIds('file', [
+ fileDocxFavId,
+ fileFavId,
+ fileDocxSharedFavId,
+ fileSharedFavId,
+ fileFavLockedId,
+ fileSharedFavLockedId,
+ fileGranularPermissionId
+ ]);
+
+ await userConsumerApi.shared.shareFilesByIds([
+ fileDocxSharedId,
+ fileDocxSharedFavId,
+ fileSharedId,
+ fileSharedFavId,
+ fileSharedLockedId,
+ fileSharedFavLockedId,
+ fileGranularPermissionId
+ ]);
+
+ await userCollaboratorApi.favorites.addFavoritesByIds('file', [fileDocxSharedFavId, fileSharedFavId]);
+
+ await userManagerApi.nodes.lockFile(fileLockedId);
+ await userManagerApi.nodes.lockFile(fileFavLockedId);
+ await userManagerApi.nodes.lockFile(fileSharedLockedId);
+ await userManagerApi.nodes.lockFile(fileSharedFavLockedId);
+
+ await userManagerApi.nodes.setGranularPermission(fileGranularPermissionId, false, userConsumer, SITE_ROLES.SITE_MANAGER.ROLE);
+
+ await userManagerApi.favorites.addFavoriteById('file', fileLockedByUserId);
+
+ await Promise.all([
+ userConsumerApi.favorites.waitForApi({ expect: 9 }),
+ userConsumerApi.shared.waitForApi({ expect: 8 }),
+ userManagerApi.search.waitForApi(userManager, { expect: 14 }),
+ userCollaboratorApi.favorites.waitForApi({ expect: 2 })
+ ]);
+ });
+
+ afterAll(async () => {
+ await userManagerApi.sites.deleteSite(sitePrivate);
+ });
+
+ beforeEach(async () => {
+ await Utils.pressEscape();
+ });
+
+ describe('Consumer', () => {
+
+ beforeAll(async () => {
+ await loginPage.loginWith(userConsumer);
+ });
+
+ describe('on File Libraries', () => {
+ librariesTests(sitePrivate);
+ });
+
+ describe('on Favorites', () => {
+ favoritesTests();
+ });
+
+ describe('on Search Results', () => {
+ searchResultsTests();
+ });
+
+ describe('on Viewer', () => {
+ viewerTests(sitePrivate);
+ });
+
+ describe('on Shared Files', () => {
+ sharedFilesTests();
+ });
+ });
+
+ describe('Collaborator', () => {
+ beforeAll(async () => {
+ await loginPage.loginWith(userCollaborator);
+ });
+
+ collaboratorTests(sitePrivate);
+ });
+
+ describe('File locked - user is lock owner', () => {
+ beforeAll(async () => {
+ await loginPage.loginWith(userDemoted);
+ });
+
+ filesLockedByCurrentUser(sitePrivate);
+ });
+
+ describe('File locked by other user - user is manager', () => {
+ beforeAll(async () => {
+ await loginPage.loginWith(userManager);
+ });
+
+ filesLockedByOtherUser(sitePrivate);
+ });
+});
diff --git a/e2e/suites/actions-available/special-permissions/test-data-permissions.ts b/e2e/suites/actions-available/special-permissions/test-data-permissions.ts
index 58c8cb8e7..3df083069 100644
--- a/e2e/suites/actions-available/special-permissions/test-data-permissions.ts
+++ b/e2e/suites/actions-available/special-permissions/test-data-permissions.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -52,29 +52,38 @@ const consumerViewerToolbarMore = ['Favorite', 'Copy', 'Manage Versions'];
// ---- FAVORITES workarounds ----
// TODO: remove 'Move' and 'Delete' when ACA-1737 is done
-// TODO: remove 'Upload New Version' when ACA-2175 is done
+// TODO: investigate why 'Upload New Version' appears and raise issue
const favoritesConsumerToolbarMore = ['Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
// TODO: remove 'Move' and 'Delete' when ACA-1737 is done
-// TODO: remove 'Upload New Version' when ACA-2175 is done
+// TODO: investigate why 'Upload New Version' appears and raise issue
const favoritesConsumerContextMenu = ['Share', 'Download', 'View', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
// TODO: remove 'Move' and 'Delete' when ACA-1737 is done
-// TODO: remove 'Upload New Version' when ACA-2175 is done
-// TODO: change 'Share' into 'Shared Link Settings' when ACA-2175 is done
-const favoritesConsumerSharedContextMenu = ['Share', 'Download', 'View', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
-// TODO: change 'Share' into 'Shared Link Settings' when ACA-2175 is done
-const favoritesConsumerSharedToolbarPrimary = ['Share', 'Download', 'View', 'View Details', 'More Actions'];
+// TODO: investigate why 'Upload New Version' appears and raise issue
+const favoritesConsumerSharedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
// ---- SHARED FILES workaround ----
-// TODO: remove 'Upload New Version' when ACA-2173 is done
+// TODO: investigate why 'Upload New Version' appears and raise issue
const sharedConsumerToolbarMore = ['Upload New Version', 'Favorite', 'Copy', 'Manage Versions'];
-// TODO: remove 'Upload New Version' when ACA-2173 is done
+// TODO: investigate why 'Cancel Editing' appears and raise issue
+// TODO: investigate why 'Upload New Version' appears and raise issue
+const sharedConsumerLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions'];
+// TODO: investigate why 'Upload New Version' appears and raise issue
const sharedConsumerFavToolbarMore = ['Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
-// TODO: remove 'Upload New Version' when ACA-2173 is done
+// TODO: investigate why 'Cancel Editing' appears and raise issue
+// TODO: investigate why 'Upload New Version' appears and raise issue
+const sharedConsumerFavLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
+// TODO: investigate why 'Upload New Version' appears and raise issue
const sharedConsumerContextMenu = ['Shared Link Settings', 'Download', 'View', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions'];
-// TODO: remove 'Upload New Version' when ACA-2173 is done
+// TODO: investigate why 'Cancel Editing' appears and raise issue
+// TODO: investigate why 'Upload New Version' appears and raise issue
+const sharedConsumerLockedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions'];
+// TODO: investigate why 'Upload New Version' appears and raise issue
const sharedConsumerFavContextMenu = ['Shared Link Settings', 'Download', 'View', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
+// TODO: investigate why 'Cancel Editing' appears and raise issue
+// TODO: investigate why 'Upload New Version' appears and raise issue
+const sharedConsumerFavLockedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
export const fileDocx = {
@@ -163,7 +172,6 @@ export const fileDocxSharedFav = {
favoritesToolbarMore: favoritesConsumerToolbarMore,
favoritesContextMenu: favoritesConsumerSharedContextMenu,
- favoritesToolbarPrimary: favoritesConsumerSharedToolbarPrimary,
sharedToolbarMore: sharedConsumerFavToolbarMore,
sharedContextMenu: sharedConsumerFavContextMenu,
@@ -199,7 +207,6 @@ export const fileSharedFav = {
favoritesToolbarMore: favoritesConsumerToolbarMore,
favoritesContextMenu: favoritesConsumerSharedContextMenu,
- favoritesToolbarPrimary: favoritesConsumerSharedToolbarPrimary,
sharedToolbarMore: sharedConsumerFavToolbarMore,
sharedContextMenu: sharedConsumerFavContextMenu,
@@ -246,8 +253,8 @@ export const fileSharedLocked = {
viewerToolbarPrimary: consumerViewerSharedToolbarPrimary,
viewerToolbarMore: consumerViewerToolbarMore,
- sharedToolbarMore: sharedConsumerToolbarMore,
- sharedContextMenu: sharedConsumerContextMenu,
+ sharedToolbarMore: sharedConsumerLockedToolbarMore,
+ sharedContextMenu: sharedConsumerLockedContextMenu,
searchToolbarPrimary: searchConsumerSharedToolbarPrimary
};
@@ -264,14 +271,16 @@ export const fileSharedFavLocked = {
favoritesToolbarMore: favoritesConsumerToolbarMore,
favoritesContextMenu: favoritesConsumerSharedContextMenu,
- favoritesToolbarPrimary: favoritesConsumerSharedToolbarPrimary,
- sharedToolbarMore: sharedConsumerFavToolbarMore,
- sharedContextMenu: sharedConsumerFavContextMenu,
+ sharedToolbarMore: sharedConsumerFavLockedToolbarMore,
+ sharedContextMenu: sharedConsumerFavLockedContextMenu,
searchToolbarPrimary: searchConsumerSharedToolbarPrimary
};
+export const fileGranularPermission = `file-granular-${Utils.random()}.txt`;
+export const fileLockedByUser = `my-file-locked-${Utils.random()}.txt`;
+
// ---- folders ---
const consumerFolderContextMenu = ['Download', 'Favorite', 'Copy'];
diff --git a/e2e/suites/actions-available/special-permissions/viewer.ts b/e2e/suites/actions-available/special-permissions/viewer.ts
new file mode 100755
index 000000000..e6ec6b0b0
--- /dev/null
+++ b/e2e/suites/actions-available/special-permissions/viewer.ts
@@ -0,0 +1,227 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { BrowsingPage, SearchResultsPage } from '../../../pages/pages';
+import { Utils } from '../../../utilities/utils';
+import * as testData from './test-data-permissions';
+import * as testUtil from '../test-util';
+
+export function viewerTests(siteName?: string) {
+ const page = new BrowsingPage();
+ const searchResultsPage = new SearchResultsPage();
+ const { dataTable } = page;
+ const { searchInput } = page.header;
+
+ describe('available actions : ', () => {
+
+ beforeEach(async () => {
+ await Utils.pressEscape();
+ });
+
+ afterEach(async () => {
+ await page.closeOpenDialogs();
+ });
+
+ describe('file opened from File Libraries', () => {
+
+ beforeAll(async () => {
+ await page.goToMyLibrariesAndWait();
+ await dataTable.doubleClickOnRowByName(siteName);
+ await dataTable.waitForHeader();
+ });
+
+ it('File Office - [C326622]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocx.name, testData.fileDocx.viewerToolbarPrimary, testData.fileDocx.viewerToolbarMore);
+ });
+
+ it('File Office, favorite - [C326623]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocxFav.name, testData.fileDocxFav.viewerToolbarPrimary, testData.fileDocxFav.viewerToolbarMore);
+ });
+
+ it('File simple - [C326624]', async () => {
+ await testUtil.checkViewerActions(testData.file.name, testData.file.viewerToolbarPrimary, testData.file.viewerToolbarMore);
+ });
+
+ it('File favorite - [C326625]', async () => {
+ await testUtil.checkViewerActions(testData.fileFav.name, testData.fileFav.viewerToolbarPrimary, testData.fileFav.viewerToolbarMore);
+ });
+
+ it('File Office, shared - [C326637]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocxShared.name, testData.fileDocxShared.viewerToolbarPrimary, testData.fileDocxShared.viewerToolbarMore);
+ });
+
+ it('File Office, shared, favorite - [C326638]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.viewerToolbarPrimary, testData.fileDocxSharedFav.viewerToolbarMore);
+ });
+
+ it('File shared - [C326648]', async () => {
+ await testUtil.checkViewerActions(testData.fileShared.name, testData.fileShared.viewerToolbarPrimary, testData.fileShared.viewerToolbarMore);
+ });
+
+ it('File shared, favorite - [C326649]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.viewerToolbarMore);
+ });
+
+ it('File locked - [C326630]', async () => {
+ await testUtil.checkViewerActions(testData.fileLocked.name, testData.fileLocked.viewerToolbarPrimary, testData.fileLocked.viewerToolbarMore);
+ });
+
+ it('File favorite, locked - [C326633]', async () => {
+ await testUtil.checkViewerActions(testData.fileFavLocked.name, testData.fileFavLocked.viewerToolbarPrimary, testData.fileFavLocked.viewerToolbarMore);
+ });
+
+ it('File shared, locked - [C326650]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedLocked.name, testData.fileSharedLocked.viewerToolbarPrimary, testData.fileSharedLocked.viewerToolbarMore);
+ });
+
+ it('File shared, favorite, locked - [C326651]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.viewerToolbarPrimary, testData.fileSharedFavLocked.viewerToolbarMore);
+ });
+
+ });
+
+ describe('file opened from Favorites', () => {
+
+ beforeAll(async () => {
+ await page.clickFavoritesAndWait();
+ });
+
+ it('File Office, favorite - [C326652]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocxFav.name, testData.fileDocxFav.viewerToolbarPrimary, testData.fileDocxFav.viewerToolbarMore);
+ });
+
+ it('File favorite - [C326653]', async () => {
+ await testUtil.checkViewerActions(testData.fileFav.name, testData.fileFav.viewerToolbarPrimary, testData.fileFav.viewerToolbarMore);
+ });
+
+ it('File Office, shared, favorite - [C326655]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.viewerToolbarPrimary, testData.fileDocxSharedFav.viewerToolbarMore);
+ });
+
+ it('File shared, favorite - [C326656]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.viewerToolbarMore);
+ });
+
+ it('File favorite, locked - [C326654]', async () => {
+ await testUtil.checkViewerActions(testData.fileFavLocked.name, testData.fileFavLocked.viewerToolbarPrimary, testData.fileFavLocked.viewerToolbarMore);
+ });
+
+ it('File shared, favorite, locked - [C326657]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.viewerToolbarPrimary, testData.fileSharedFavLocked.viewerToolbarMore);
+ });
+
+ });
+
+ describe('file opened from Shared Files', () => {
+
+ beforeAll(async () => {
+ await page.clickSharedFilesAndWait();
+ });
+
+ it('File Office, shared - [C326658]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocxShared.name, testData.fileDocxShared.viewerToolbarPrimary, testData.fileDocxShared.viewerToolbarMore);
+ });
+
+ it('File Office, shared, favorite - [C326659]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.viewerToolbarPrimary, testData.fileDocxSharedFav.viewerToolbarMore);
+ });
+
+ it('File shared - [C326660]', async () => {
+ await testUtil.checkViewerActions(testData.fileShared.name, testData.fileShared.viewerToolbarPrimary, testData.fileShared.viewerToolbarMore);
+ });
+
+ it('File shared, favorite - [C326661]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.viewerToolbarMore);
+ });
+
+ it('File shared, locked - [C326662]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedLocked.name, testData.fileSharedLocked.viewerToolbarPrimary, testData.fileSharedLocked.viewerToolbarMore);
+ });
+
+ it('File shared, favorite, locked - [C326663]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.viewerToolbarPrimary, testData.fileSharedFavLocked.viewerToolbarMore);
+ });
+
+ });
+
+ describe('file opened from Search Results', () => {
+
+ beforeAll(async () => {
+ await searchInput.clickSearchButton();
+ await searchInput.searchFor('file-');
+ await searchResultsPage.waitForResults();
+ });
+
+ it('File Office - [C326664]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocx.name, testData.fileDocx.viewerToolbarPrimary, testData.fileDocx.viewerToolbarMore);
+ });
+
+ it('File Office, favorite - [C326665]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocxFav.name, testData.fileDocxFav.viewerToolbarPrimary, testData.fileDocxFav.viewerToolbarMore);
+ });
+
+ it('File simple - [C326666]', async () => {
+ await testUtil.checkViewerActions(testData.file.name, testData.file.viewerToolbarPrimary, testData.file.viewerToolbarMore);
+ });
+
+ it('File favorite - [C326667]', async () => {
+ await testUtil.checkViewerActions(testData.fileFav.name, testData.fileFav.viewerToolbarPrimary, testData.fileFav.viewerToolbarMore);
+ });
+
+ it('File Office, shared - [C326670]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocxShared.name, testData.fileDocxShared.viewerToolbarPrimary, testData.fileDocxShared.viewerToolbarMore);
+ });
+
+ it('File Office, shared, favorite - [C326671]', async () => {
+ await testUtil.checkViewerActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.viewerToolbarPrimary, testData.fileDocxSharedFav.viewerToolbarMore);
+ });
+
+ it('File shared - [C326672]', async () => {
+ await testUtil.checkViewerActions(testData.fileShared.name, testData.fileShared.viewerToolbarPrimary, testData.fileShared.viewerToolbarMore);
+ });
+
+ it('File shared, favorite - [C326673]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedFav.name, testData.fileSharedFav.viewerToolbarPrimary, testData.fileSharedFav.viewerToolbarMore);
+ });
+
+ it('File locked - [C326668]', async () => {
+ await testUtil.checkViewerActions(testData.fileLocked.name, testData.fileLocked.viewerToolbarPrimary, testData.fileLocked.viewerToolbarMore);
+ });
+
+ it('File favorite, locked - [C326669]', async () => {
+ await testUtil.checkViewerActions(testData.fileFavLocked.name, testData.fileFavLocked.viewerToolbarPrimary, testData.fileFavLocked.viewerToolbarMore);
+ });
+
+ it('File shared, locked - [C326674]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedLocked.name, testData.fileSharedLocked.viewerToolbarPrimary, testData.fileSharedLocked.viewerToolbarMore);
+ });
+
+ it('File shared, favorite, locked - [C326675]', async () => {
+ await testUtil.checkViewerActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.viewerToolbarPrimary, testData.fileSharedFavLocked.viewerToolbarMore);
+ });
+
+ });
+ });
+}
diff --git a/e2e/suites/actions-available/test-util.ts b/e2e/suites/actions-available/test-util.ts
index 7d440a4ef..1ede1e179 100644
--- a/e2e/suites/actions-available/test-util.ts
+++ b/e2e/suites/actions-available/test-util.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -33,101 +33,97 @@ const contextMenu = dataTable.menu;
const viewer = new Viewer();
const viewerToolbar = viewer.toolbar;
-
-export async function checkContextMenu(item: string, expectedContextMenu: string[]) {
+export async function checkContextMenu(item: string, expectedContextMenu: string[]): Promise {
await dataTable.rightClickOnItem(item);
+
const actualActions = await contextMenu.getMenuItems();
- expect(actualActions.length).toBe(expectedContextMenu.length, 'Incorrect number of context menu items');
- expect(JSON.stringify(actualActions)).toEqual(JSON.stringify(expectedContextMenu), 'Incorrect context menu actions');
+ expect(actualActions).toEqual(expectedContextMenu);
+
+ await Utils.pressEscape();
}
-export async function checkToolbarPrimary(item: string, expectedToolbarPrimary: string[]) {
+export async function checkToolbarPrimary(item: string, expectedToolbarPrimary: string[]): Promise {
await dataTable.selectItem(item);
const actualPrimaryActions = await toolbar.getButtons();
- expect(actualPrimaryActions.length).toBe(expectedToolbarPrimary.length, 'Incorrect number of toolbar primary items');
- expect(JSON.stringify(actualPrimaryActions)).toEqual(JSON.stringify(expectedToolbarPrimary), 'Incorrect toolbar primary actions');
+ expect(actualPrimaryActions).toEqual(expectedToolbarPrimary);
}
-export async function checkToolbarMoreActions(item: string, expectedToolbarMore: string[]) {
+export async function checkToolbarMoreActions(item: string, expectedToolbarMore: string[]): Promise {
await dataTable.selectItem(item);
-
await toolbar.openMoreMenu();
const actualMoreActions = await toolbar.menu.getMenuItems();
- expect(actualMoreActions.length).toBe(expectedToolbarMore.length, 'Incorrect number of toolbar More menu items');
- expect(JSON.stringify(actualMoreActions)).toEqual(JSON.stringify(expectedToolbarMore), 'Incorrect toolbar More actions');
+ expect(actualMoreActions).toEqual(expectedToolbarMore);
await toolbar.closeMoreMenu();
}
-export async function checkMultipleSelContextMenu(items: string[], expectedContextMenu: string[]) {
+export async function checkToolbarActions(item: string, expectedToolbarPrimary: string[], expectedToolbarMore: string[]): Promise {
+ await dataTable.selectItem(item);
+
+ const actualPrimaryActions = await toolbar.getButtons();
+ expect(actualPrimaryActions).toEqual(expectedToolbarPrimary);
+
+ await toolbar.openMoreMenu();
+
+ const actualMoreActions = await toolbar.menu.getMenuItems();
+ expect(actualMoreActions).toEqual(expectedToolbarMore);
+
+ await toolbar.closeMoreMenu();
+}
+
+export async function checkMultipleSelContextMenu(items: string[], expectedContextMenu: string[]): Promise {
await dataTable.selectMultipleItems(items);
await dataTable.rightClickOnMultipleSelection();
const actualActions = await contextMenu.getMenuItems();
- expect(actualActions.length).toBe(expectedContextMenu.length, 'Incorrect number of context menu items');
- expect(JSON.stringify(actualActions)).toEqual(JSON.stringify(expectedContextMenu), 'Incorrect context menu actions');
+ expect(actualActions).toEqual(expectedContextMenu);
+
+ await Utils.pressEscape();
}
-export async function checkMultipleSelToolbarPrimary(items: string[], expectedToolbarPrimary: string[]) {
+export async function checkMultipleSelToolbarPrimary(items: string[], expectedToolbarPrimary: string[]): Promise {
await dataTable.selectMultipleItems(items);
const actualPrimaryActions = await toolbar.getButtons();
- expect(actualPrimaryActions.length).toBe(expectedToolbarPrimary.length, 'Incorrect number of toolbar primary items');
- expect(JSON.stringify(actualPrimaryActions)).toEqual(JSON.stringify(expectedToolbarPrimary), 'Incorrect toolbar primary actions');
+ expect(actualPrimaryActions).toEqual(expectedToolbarPrimary);
}
-export async function checkMultipleSelToolbarMoreActions(items: string[], expectedToolbarMore: string[]) {
+export async function checkMultipleSelToolbarActions(items: string[], expectedToolbarPrimary: string[], expectedToolbarMore: string[]): Promise {
await dataTable.selectMultipleItems(items);
+ const actualPrimaryActions = await toolbar.getButtons();
+ expect(actualPrimaryActions).toEqual(expectedToolbarPrimary);
+
await toolbar.openMoreMenu();
const actualMoreActions = await toolbar.menu.getMenuItems();
- expect(actualMoreActions.length).toBe(expectedToolbarMore.length, 'Incorrect number of toolbar More menu items');
- expect(JSON.stringify(actualMoreActions)).toEqual(JSON.stringify(expectedToolbarMore), 'Incorrect toolbar More actions');
+ expect(actualMoreActions).toEqual(expectedToolbarMore);
await toolbar.closeMoreMenu();
}
-export async function checkViewerToolbarPrimaryActions(item: string, expectedToolbarPrimary: string[]) {
- // await dataTable.doubleClickOnRowByName(item);
+export async function checkViewerActions(item: string, expectedToolbarPrimary: string[], expectedToolbarMore: string[]): Promise {
await dataTable.selectItem(item);
await toolbar.clickView();
await viewer.waitForViewerToOpen();
let actualPrimaryActions = await viewerToolbar.getButtons();
-
actualPrimaryActions = removeClosePreviousNextOldInfo(actualPrimaryActions);
+ expect(actualPrimaryActions).toEqual(expectedToolbarPrimary);
- expect(actualPrimaryActions.length).toBe(expectedToolbarPrimary.length, 'Incorrect number of viewer toolbar primary items');
- expect(JSON.stringify(actualPrimaryActions)).toEqual(JSON.stringify(expectedToolbarPrimary), 'Incorrect viewer toolbar primary actions');
-
- await Utils.pressEscape();
-}
-
-export async function checkViewerToolbarMoreActions(item: string, expectedToolbarMore: string[]) {
- // await dataTable.doubleClickOnRowByName(item);
- await dataTable.selectItem(item);
- await toolbar.clickView();
- await viewer.waitForViewerToOpen();
await viewerToolbar.openMoreMenu();
const actualMoreActions = await viewerToolbar.menu.getMenuItems();
-
- expect(actualMoreActions.length).toBe(expectedToolbarMore.length, 'Incorrect number of toolbar More menu items');
- expect(JSON.stringify(actualMoreActions)).toEqual(JSON.stringify(expectedToolbarMore), 'Incorrect toolbar More actions');
+ expect(actualMoreActions).toEqual(expectedToolbarMore);
await toolbar.closeMoreMenu();
await Utils.pressEscape();
}
+const toRemove = ['Close', 'Previous File', 'Next File', 'View details'];
function removeClosePreviousNextOldInfo(actions: string[]): string[] {
- return actions.filter(elem => {
- if ( (elem !== 'Close') && (elem !== 'Previous File') && (elem !== 'Next File') && (elem !== 'View details')) {
- return elem;
- }
- return null
- }).filter((action) => action != null);
+ return actions.filter((elem) => !toRemove.includes(elem));
}
diff --git a/e2e/suites/actions/copy.test.ts b/e2e/suites/actions/copy-move/copy.test.ts
similarity index 97%
rename from e2e/suites/actions/copy.test.ts
rename to e2e/suites/actions/copy-move/copy.test.ts
index aa1b0267d..ac421b607 100755
--- a/e2e/suites/actions/copy.test.ts
+++ b/e2e/suites/actions/copy-move/copy.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -23,10 +23,10 @@
* along with Alfresco. If not, see .
*/
-import { LoginPage, BrowsingPage } from '../../pages/pages';
-import { CopyMoveDialog } from './../../components/dialog/copy-move-dialog';
-import { RepoClient } from '../../utilities/repo-client/repo-client';
-import { Utils } from '../../utilities/utils';
+import { LoginPage, BrowsingPage } from '../../../pages/pages';
+import { ContentNodeSelectorDialog } from '../../../components/dialog/content-node-selector-dialog';
+import { RepoClient } from '../../../utilities/repo-client/repo-client';
+import { Utils } from '../../../utilities/utils';
describe('Copy content', () => {
const username = `user-${Utils.random()}`;
@@ -86,7 +86,7 @@ describe('Copy content', () => {
const loginPage = new LoginPage();
const page = new BrowsingPage();
const { dataTable, toolbar } = page;
- const copyDialog = new CopyMoveDialog();
+ const copyDialog = new ContentNodeSelectorDialog();
const { searchInput } = page.header;
beforeAll(async (done) => {
@@ -539,8 +539,8 @@ describe('Copy content', () => {
await dataTable.selectMultipleItems(items, location);
await toolbar.clickMoreActionsCopy();
await copyDialog.selectLocation('File Libraries');
- await copyDialog.doubleClickOnRow(siteName);
- await copyDialog.doubleClickOnRow('documentLibrary');
+ await copyDialog.dataTable.doubleClickOnRowByName(siteName);
+ await copyDialog.dataTable.doubleClickOnRowByName('documentLibrary');
await copyDialog.selectDestination(destination);
await copyDialog.clickCopy();
const msg = await page.getSnackBarMessage();
@@ -631,7 +631,7 @@ describe('Copy content', () => {
expect(await dataTable.isItemPresent(fileName)).toBe(false, `${fileName} present in ${destination} folder`);
await page.clickTrash();
- expect(await dataTable.isEmptyList()).toBe(true, 'Trash is not empty');
+ expect(await dataTable.isEmpty()).toBe(true, 'Trash is not empty');
}
async function undoCopyFolder(folderName: string, location: string = '', destination: string, doBefore = null) {
@@ -654,7 +654,7 @@ describe('Copy content', () => {
expect(await dataTable.isItemPresent(folderName)).toBe(false, `${folderName} present in ${destination} folder`);
await page.clickTrash();
- expect(await dataTable.isEmptyList()).toBe(true, 'Trash is not empty');
+ expect(await dataTable.isEmpty()).toBe(true, 'Trash is not empty');
}
async function undoCopyFileWithExistingName(fileName: string, location: string = '', destination: string, doBefore = null) {
@@ -665,7 +665,7 @@ describe('Copy content', () => {
await dataTable.selectItem(fileName, location);
await toolbar.clickMoreActionsCopy();
await copyDialog.selectLocation('Personal Files');
- await copyDialog.doubleClickOnRow(source);
+ await copyDialog.dataTable.doubleClickOnRowByName(source);
await copyDialog.selectDestination(destination);
await copyDialog.clickCopy();
const msg = await page.getSnackBarMessage();
@@ -681,7 +681,7 @@ describe('Copy content', () => {
expect(await dataTable.isItemPresent(`${fileInFolder2}-1`)).toBe(false, `${fileInFolder2}-1 is present in ${destination} folder`);
await page.clickTrash();
- expect(await dataTable.isEmptyList()).toBe(true, 'Trash is not empty');
+ expect(await dataTable.isEmpty()).toBe(true, 'Trash is not empty');
}
async function undoCopyFolderWithExistingName(folderName: string, location: string = '', destination: string, doBefore = null) {
@@ -692,7 +692,7 @@ describe('Copy content', () => {
await dataTable.selectItem(folderName, location);
await toolbar.clickMoreActionsCopy();
await copyDialog.selectLocation('Personal Files');
- await copyDialog.doubleClickOnRow(destination);
+ await copyDialog.dataTable.doubleClickOnRowByName(destination);
await copyDialog.clickCopy();
const msg = await page.getSnackBarMessage();
expect(msg).toContain('Copied 1 item');
@@ -708,7 +708,7 @@ describe('Copy content', () => {
expect(await dataTable.isItemPresent(file1InFolderExisting)).toBe(false, `${file1InFolderExisting} present in ${folderName} in ${destination} folder`);
await page.clickTrash();
- expect(await dataTable.isEmptyList()).toBe(true, 'Trash is not empty');
+ expect(await dataTable.isEmpty()).toBe(true, 'Trash is not empty');
}
});
diff --git a/e2e/suites/actions/copy-move/destination-picker-dialog.test.ts b/e2e/suites/actions/copy-move/destination-picker-dialog.test.ts
new file mode 100755
index 000000000..02c0e372e
--- /dev/null
+++ b/e2e/suites/actions/copy-move/destination-picker-dialog.test.ts
@@ -0,0 +1,332 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { LoginPage, BrowsingPage } from '../../../pages/pages';
+import { ContentNodeSelectorDialog } from '../../../components/dialog/content-node-selector-dialog';
+import { RepoClient } from '../../../utilities/repo-client/repo-client';
+import { Utils } from '../../../utilities/utils';
+import { AdminActions } from '../../../utilities/admin-actions';
+
+describe('Destination picker dialog : ', () => {
+ const random = Utils.random();
+
+ const username = `user-${random}`;
+
+ const consumer = `consumer-${random}`;
+ const contributor = `contributor-${random}`;
+ const collaborator = `collaborator-${random}`;
+
+ const file = `file-${random}.txt`;
+ let fileId: string;
+ let fileIdConsumer: string;
+ let fileIdContributor: string;
+ let fileIdCollaborator: string;
+
+ const adminFolder = `admin-folder-${random}`;
+ let adminFolderId: string;
+
+ const destination = `destination-folder-${random}`;
+ let destinationId: string;
+ const fileInDestination = `file-in-dest-${random}.txt`;
+ const folderInDestination = `folder-in-dest-${random}`;
+ const folder2InDestination = `folder2-in-dest-${random}`;
+ let folderLink: string;
+
+ const searchFolder = `search-${random}`;
+ let searchFolderId: string;
+ let searchFolderSiteId: string;
+ const searchSubFolder1 = `sub-folder-${random}`;
+ let searchSubFolder1Id: string;
+ let searchSubFolder1SiteId: string;
+ const searchSubFolder2 = `sub-folder-${random}`;
+
+ const site = `site-${random}`;
+
+ const userApi = new RepoClient(username, username);
+ const consumerApi = new RepoClient(consumer, consumer);
+ const contributorApi = new RepoClient(contributor, contributor);
+ const collaboratorApi = new RepoClient(collaborator, collaborator);
+ const adminApiActions = new AdminActions();
+
+ const loginPage = new LoginPage();
+ const page = new BrowsingPage();
+ const { dataTable, toolbar } = page;
+ const contentNodeSelector = new ContentNodeSelectorDialog();
+
+ beforeAll(async () => {
+ await adminApiActions.createUser({ username });
+ await adminApiActions.createUser({ username: consumer });
+ await adminApiActions.createUser({ username: contributor });
+ await adminApiActions.createUser({ username: collaborator });
+
+ fileId = (await userApi.nodes.createFile(file)).entry.id;
+
+ destinationId = (await userApi.nodes.createFolder(destination)).entry.id;
+ await userApi.nodes.createFile(fileInDestination, destinationId);
+ await userApi.nodes.createFolder(folderInDestination, destinationId);
+ const folder2Id = (await userApi.nodes.createFolder(folder2InDestination, destinationId)).entry.id;
+ folderLink = (await userApi.nodes.createFolderLink(folder2Id, destinationId)).entry.name;
+ searchFolderId = (await userApi.nodes.createFolder(searchFolder, destinationId)).entry.id;
+ searchSubFolder1Id = (await userApi.nodes.createFolder(searchSubFolder1, searchFolderId)).entry.id;
+ await userApi.nodes.createFolder(searchSubFolder2, searchSubFolder1Id);
+
+ await userApi.sites.createSitePrivate(site);
+ const docLibId = await userApi.sites.getDocLibId(site);
+ searchFolderSiteId = (await userApi.nodes.createFolder(searchFolder, docLibId)).entry.id;
+ searchSubFolder1SiteId = (await userApi.nodes.createFolder(searchSubFolder1, searchFolderSiteId)).entry.id;
+ await userApi.nodes.createFolder(searchSubFolder2, searchSubFolder1SiteId);
+
+ await userApi.sites.addSiteConsumer(site, consumer);
+ await userApi.sites.addSiteContributor(site, contributor);
+ await userApi.sites.addSiteCollaborator(site, collaborator);
+
+ fileIdConsumer = (await consumerApi.nodes.createFile(file)).entry.id;
+ fileIdContributor = (await contributorApi.nodes.createFile(file)).entry.id;
+ fileIdCollaborator = (await collaboratorApi.nodes.createFile(file)).entry.id;
+
+ adminFolderId = (await adminApiActions.nodes.createFolder(adminFolder)).entry.id;
+
+ await userApi.search.waitForNodes(searchFolder, { expect: 2 });
+ });
+
+ afterAll(async () => {
+ await userApi.nodes.deleteNodeById(fileId);
+ await userApi.nodes.deleteNodeById(destinationId);
+ await userApi.sites.deleteSite(site);
+
+ await consumerApi.nodes.deleteNodeById(fileIdConsumer);
+ await contributorApi.nodes.deleteNodeById(fileIdContributor);
+ await collaboratorApi.nodes.deleteNodeById(fileIdCollaborator);
+
+ await adminApiActions.nodes.deleteNodeById(adminFolderId);
+ });
+
+ afterEach(async () => {
+ await page.closeOpenDialogs();
+ });
+
+ describe('general', () => {
+ beforeAll(async () => {
+ await loginPage.loginWith(username);
+ });
+
+ beforeEach(async () => {
+ await dataTable.selectItem(file);
+ await toolbar.clickMoreActionsCopy();
+ await contentNodeSelector.waitForDialogToOpen();
+ });
+
+ it('Dialog UI - [C263875]', async () => {
+ expect(await contentNodeSelector.getTitle()).toEqual(`Copy '${file}' to...`);
+ expect(await contentNodeSelector.isSearchInputPresent()).toBe(true, 'Search input is not displayed');
+ expect(await contentNodeSelector.isSelectLocationDropdownDisplayed()).toBe(true, 'Select Location dropdown not displayed');
+ expect(await contentNodeSelector.breadcrumb.getCurrentFolderName()).toEqual('Personal Files');
+ expect(await contentNodeSelector.dataTable.isItemPresent(destination)).toBe(true, 'Personal Files content not displayed');
+ expect(await contentNodeSelector.isCopyButtonEnabled()).toBe(true, 'Copy button is not disabled');
+ expect(await contentNodeSelector.isCancelButtonEnabled()).toBe(true, 'Cancel button is not enabled');
+ });
+
+ it('Files are not displayed - [C263880]', async () => {
+ await contentNodeSelector.selectLocation('Personal Files');
+ expect(await contentNodeSelector.dataTable.isItemPresent(destination)).toBe(true, 'destination folder not displayed');
+ await contentNodeSelector.dataTable.doubleClickOnRowByName(destination);
+ expect(await contentNodeSelector.dataTable.isItemPresent(folderInDestination)).toBe(true, 'folder is not displayed');
+ expect(await contentNodeSelector.dataTable.isItemPresent(fileInDestination)).toBe(false, 'file is displayed');
+ });
+
+ it('Folder links are not displayed - [C263881]', async() => {
+ await contentNodeSelector.selectLocation('Personal Files');
+ await contentNodeSelector.dataTable.doubleClickOnRowByName(destination);
+
+ expect(await contentNodeSelector.dataTable.isItemPresent(folderInDestination)).toBe(true, `${folderInDestination} is not displayed`);
+ expect(await contentNodeSelector.dataTable.isItemPresent(folder2InDestination)).toBe(true, `${folder2InDestination} is not displayed`);
+ expect(await contentNodeSelector.dataTable.isItemPresent(folderLink)).toBe(false, 'Link to folder is displayed');
+ });
+
+ it('User can see his Libraries - [C263885]', async () => {
+ await contentNodeSelector.selectLocation('File Libraries');
+ expect(await contentNodeSelector.dataTable.isItemPresent(site)).toBe(true, 'user site is not displayed');
+ });
+
+ it('Search - No results displayed - [C263889]', async () => {
+ await contentNodeSelector.searchFor('nonexistent-folder');
+ expect(await contentNodeSelector.dataTable.isEmpty()).toBe(true, 'datatable not empty');
+ expect(await contentNodeSelector.dataTable.getEmptyListText()).toEqual('No results found');
+ });
+
+ it('Search - results found - [C263888]', async () => {
+ await contentNodeSelector.searchFor(searchFolder);
+ expect(await contentNodeSelector.dataTable.isItemPresent(searchFolder, username)).toBe(true, 'folder from Personal Files not displayed');
+ expect(await contentNodeSelector.dataTable.isItemPresent(searchFolder, site)).toBe(true, 'folder from site not displayed');
+ });
+ });
+
+ describe('multiple selection', () => {
+ beforeAll(async () => {
+ await loginPage.loginWith(username);
+ });
+
+ beforeEach(async () => {
+ await dataTable.selectMultipleItems([file, destination]);
+ await toolbar.clickMoreActionsCopy();
+ await contentNodeSelector.waitForDialogToOpen();
+ });
+
+ it('Dialog title - multiple selection - [C263879]', async () => {
+ expect(await contentNodeSelector.getTitle()).toEqual(`Copy 2 items to...`);
+ });
+ });
+
+ describe('breadcrumb', () => {
+ beforeAll(async () => {
+ await loginPage.loginWith(username);
+ });
+
+ beforeEach(async () => {
+ await dataTable.selectItem(file);
+ await toolbar.clickMoreActionsCopy();
+ await contentNodeSelector.waitForDialogToOpen();
+ });
+
+ it('Personal Files breadcrumb - main node - [C263890]', async () => {
+ await contentNodeSelector.selectLocation('Personal Files');
+ expect(await contentNodeSelector.breadcrumb.getCurrentFolderName()).toEqual('Personal Files');
+ });
+
+ it('File Libraries breadcrumb - main node - [C263891]', async () => {
+ await contentNodeSelector.selectLocation('File Libraries');
+ expect(await contentNodeSelector.breadcrumb.getCurrentFolderName()).toEqual('File Libraries');
+ });
+
+ it('Search results breadcrumb - [C263899]', async () => {
+ await contentNodeSelector.searchFor(searchFolder);
+ expect(await contentNodeSelector.getToolbarTitle()).toEqual('Search results');
+ });
+
+ it('Search results breadcrumb when selecting a folder - [C263900]', async () => {
+ await contentNodeSelector.searchFor(searchFolder);
+ await contentNodeSelector.dataTable.selectItem(searchFolder, site);
+ expect(await contentNodeSelector.breadcrumb.getCurrentFolderName()).toEqual(searchFolder);
+ });
+
+ it('Personal Files breadcrumb - folder structure - [C263897]', async () => {
+ await contentNodeSelector.selectLocation('Personal Files');
+ await contentNodeSelector.dataTable.doubleClickOnRowByName(destination);
+ expect(await contentNodeSelector.breadcrumb.getCurrentFolderName()).toEqual(destination);
+ await contentNodeSelector.dataTable.doubleClickOnRowByName(searchFolder);
+ expect(await contentNodeSelector.breadcrumb.getCurrentFolderName()).toEqual(searchFolder);
+ await contentNodeSelector.dataTable.doubleClickOnRowByName(searchSubFolder1);
+ expect(await contentNodeSelector.breadcrumb.getCurrentFolderName()).toEqual(searchSubFolder1);
+ await contentNodeSelector.dataTable.doubleClickOnRowByName(searchSubFolder2);
+ expect(await contentNodeSelector.breadcrumb.getCurrentFolderName()).toEqual(searchSubFolder2);
+ await contentNodeSelector.breadcrumb.openPath();
+ expect(await contentNodeSelector.breadcrumb.getPathItems()).toEqual([searchSubFolder1, searchFolder, destination, 'Personal Files']);
+ });
+
+ it('File Libraries breadcrumb - folder structure - [C263898]', async () => {
+ await contentNodeSelector.selectLocation('File Libraries');
+ await contentNodeSelector.dataTable.doubleClickOnRowByName(site);
+ expect(await contentNodeSelector.breadcrumb.getCurrentFolderName()).toEqual(site);
+ await contentNodeSelector.dataTable.doubleClickOnRowByName('documentLibrary');
+ expect(await contentNodeSelector.breadcrumb.getCurrentFolderName()).toEqual(site);
+ await contentNodeSelector.dataTable.doubleClickOnRowByName(searchFolder);
+ expect(await contentNodeSelector.breadcrumb.getCurrentFolderName()).toEqual(searchFolder);
+ await contentNodeSelector.dataTable.doubleClickOnRowByName(searchSubFolder1);
+ expect(await contentNodeSelector.breadcrumb.getCurrentFolderName()).toEqual(searchSubFolder1);
+ await contentNodeSelector.dataTable.doubleClickOnRowByName(searchSubFolder2);
+ expect(await contentNodeSelector.breadcrumb.getCurrentFolderName()).toEqual(searchSubFolder2);
+ await contentNodeSelector.breadcrumb.openPath();
+ expect(await contentNodeSelector.breadcrumb.getPathItems()).toEqual([searchSubFolder1, searchFolder, site, 'File Libraries']);
+ });
+
+ it('Select a node from the breadcrumb path - [C263895]', async () => {
+ await contentNodeSelector.selectLocation('Personal Files');
+ await contentNodeSelector.dataTable.doubleClickOnRowByName(destination);
+ await contentNodeSelector.dataTable.doubleClickOnRowByName(searchFolder);
+ await contentNodeSelector.dataTable.doubleClickOnRowByName(searchSubFolder1);
+ await contentNodeSelector.dataTable.doubleClickOnRowByName(searchSubFolder2);
+ await contentNodeSelector.breadcrumb.openPath();
+
+ await contentNodeSelector.breadcrumb.clickPathItem(destination);
+ expect(await contentNodeSelector.breadcrumb.getCurrentFolderName()).toEqual(destination);
+ expect(await contentNodeSelector.dataTable.isItemPresent(searchFolder)).toBe(true, 'folder not displayed');
+ });
+ });
+
+ describe('Users with different permissions', () => {
+
+ it('Consumer user cannot select the folder as destination - [C263876]', async () => {
+ await loginPage.loginWith(consumer);
+ await dataTable.selectItem(file);
+ await toolbar.clickMoreActionsCopy();
+ await contentNodeSelector.waitForDialogToOpen();
+
+ await contentNodeSelector.selectLocation('File Libraries');
+ await contentNodeSelector.dataTable.doubleClickOnRowByName(site);
+ await contentNodeSelector.dataTable.doubleClickOnRowByName('documentLibrary');
+ await contentNodeSelector.dataTable.selectItem(searchFolder);
+
+ expect(await contentNodeSelector.isCopyButtonEnabled()).toBe(false, 'Copy should be disabled');
+ });
+
+ it('Contributor user can select the folder as destination - [C263877]', async () => {
+ await loginPage.loginWith(contributor);
+ await dataTable.selectItem(file);
+ await toolbar.clickMoreActionsCopy();
+ await contentNodeSelector.waitForDialogToOpen();
+
+ await contentNodeSelector.selectLocation('File Libraries');
+ await contentNodeSelector.dataTable.doubleClickOnRowByName(site);
+ await contentNodeSelector.dataTable.doubleClickOnRowByName('documentLibrary');
+ await contentNodeSelector.dataTable.selectItem(searchFolder);
+
+ expect(await contentNodeSelector.isCopyButtonEnabled()).toBe(true, 'Copy should be disabled');
+ });
+
+ it('Collaborator user can select the folder as destination - [C263878]', async () => {
+ await loginPage.loginWith(collaborator);
+ await dataTable.selectItem(file);
+ await toolbar.clickMoreActionsCopy();
+ await contentNodeSelector.waitForDialogToOpen();
+
+ await contentNodeSelector.selectLocation('File Libraries');
+ await contentNodeSelector.dataTable.doubleClickOnRowByName(site);
+ await contentNodeSelector.dataTable.doubleClickOnRowByName('documentLibrary');
+ await contentNodeSelector.dataTable.selectItem(searchFolder);
+
+ expect(await contentNodeSelector.isCopyButtonEnabled()).toBe(true, 'Copy should be disabled');
+ });
+
+ it('Admin user - Personal Files breadcrumb main node - [C263892]', async () => {
+ await loginPage.loginWithAdmin();
+ await dataTable.selectItem(adminFolder);
+ await toolbar.clickMoreActionsCopy();
+ await contentNodeSelector.waitForDialogToOpen();
+
+ await contentNodeSelector.selectLocation('Personal Files');
+ expect(await contentNodeSelector.breadcrumb.getCurrentFolderName()).toEqual('Company Home');
+ });
+ });
+});
diff --git a/e2e/suites/actions/move.test.ts b/e2e/suites/actions/copy-move/move.test.ts
similarity index 97%
rename from e2e/suites/actions/move.test.ts
rename to e2e/suites/actions/copy-move/move.test.ts
index 70e4538b8..a6536e352 100755
--- a/e2e/suites/actions/move.test.ts
+++ b/e2e/suites/actions/copy-move/move.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -23,10 +23,10 @@
* along with Alfresco. If not, see .
*/
-import { LoginPage, BrowsingPage } from '../../pages/pages';
-import { CopyMoveDialog } from './../../components/dialog/copy-move-dialog';
-import { RepoClient } from '../../utilities/repo-client/repo-client';
-import { Utils } from '../../utilities/utils';
+import { LoginPage, BrowsingPage } from '../../../pages/pages';
+import { ContentNodeSelectorDialog } from '../../../components/dialog/content-node-selector-dialog';
+import { RepoClient } from '../../../utilities/repo-client/repo-client';
+import { Utils } from '../../../utilities/utils';
describe('Move content', () => {
const username = `user-${Utils.random()}`;
@@ -57,7 +57,7 @@ describe('Move content', () => {
const loginPage = new LoginPage();
const page = new BrowsingPage();
const { dataTable, toolbar } = page;
- const moveDialog = new CopyMoveDialog();
+ const moveDialog = new ContentNodeSelectorDialog();
beforeAll(async (done) => {
await apis.admin.people.createUser({ username });
@@ -254,8 +254,8 @@ describe('Move content', () => {
await dataTable.selectMultipleItems([file4, folder2]);
await toolbar.clickMoreActionsMove();
await moveDialog.selectLocation('File Libraries');
- await moveDialog.doubleClickOnRow(siteName);
- await moveDialog.doubleClickOnRow('documentLibrary');
+ await moveDialog.dataTable.doubleClickOnRowByName(siteName);
+ await moveDialog.dataTable.doubleClickOnRowByName('documentLibrary');
await moveDialog.selectDestination(folderSitePF);
await moveDialog.clickMove();
const msg = await page.getSnackBarMessage();
@@ -374,8 +374,8 @@ describe('Move content', () => {
await dataTable.selectItem(file4, sourceRF);
await toolbar.clickMoreActionsMove();
await moveDialog.selectLocation('File Libraries');
- await moveDialog.doubleClickOnRow(siteName);
- await moveDialog.doubleClickOnRow('documentLibrary');
+ await moveDialog.dataTable.doubleClickOnRowByName(siteName);
+ await moveDialog.dataTable.doubleClickOnRowByName('documentLibrary');
await moveDialog.selectDestination(folderSiteRF);
await moveDialog.clickMove();
const msg = await page.getSnackBarMessage();
@@ -496,8 +496,8 @@ describe('Move content', () => {
await dataTable.selectItem(file4, sourceSF);
await toolbar.clickMoreActionsMove();
await moveDialog.selectLocation('File Libraries');
- await moveDialog.doubleClickOnRow(siteName);
- await moveDialog.doubleClickOnRow('documentLibrary');
+ await moveDialog.dataTable.doubleClickOnRowByName(siteName);
+ await moveDialog.dataTable.doubleClickOnRowByName('documentLibrary');
await moveDialog.selectDestination(folderSiteSF);
await moveDialog.clickMove();
const msg = await page.getSnackBarMessage();
@@ -686,8 +686,8 @@ describe('Move content', () => {
await dataTable.selectMultipleItems([file4, folder2], sourceFav);
await toolbar.clickMoreActionsMove();
await moveDialog.selectLocation('File Libraries');
- await moveDialog.doubleClickOnRow(siteName);
- await moveDialog.doubleClickOnRow('documentLibrary');
+ await moveDialog.dataTable.doubleClickOnRowByName(siteName);
+ await moveDialog.dataTable.doubleClickOnRowByName('documentLibrary');
await moveDialog.selectDestination(folderSiteFav);
await moveDialog.clickMove();
const msg = await page.getSnackBarMessage();
diff --git a/e2e/suites/actions/create-file-from-template.test.ts b/e2e/suites/actions/create-file-from-template.test.ts
new file mode 100755
index 000000000..21f40ef69
--- /dev/null
+++ b/e2e/suites/actions/create-file-from-template.test.ts
@@ -0,0 +1,402 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { LoginPage, BrowsingPage } from '../../pages/pages';
+import { SelectTemplateDialog } from '../../components/dialog/select-template-dialog';
+import { CreateFromTemplateDialog } from '../../components/dialog/create-from-template-dialog';
+import { Utils } from '../../utilities/utils';
+import { AdminActions } from '../../utilities/admin-actions';
+import { RepoClient, NodeContentTree } from '../../utilities/repo-client/repo-client';
+
+describe('Create file from template', () => {
+ const random = Utils.random();
+
+ const username = `user-${random}`;
+
+ const restrictedTemplateFolder = `restricted-templates-${random}`;
+ const templateInRestrictedFolder = `template-restricted-${random}.txt`;
+
+ const templatesFolder1 = `templates-folder1-${random}`;
+ const template1InFolder1 = `template1-1-${random}.txt`;
+ const template2InFolder1 = `template1-2-${random}.txt`;
+
+ const templatesFolder2 = `templates-folder2-${random}`;
+ const template1InFolder2 = `template2-1-${random}.txt`;
+ const templatesSubFolder = `template-subFolder-${random}`;
+
+ const template1InRootFolder = `template3-${random}.txt`;
+ const template2InRootFolder = `template4-${random}.txt`;
+
+ const parent = `parent-${random}`; let parentId;
+ const file1 = {
+ name: `file1-${random}.txt`
+ };
+ const file2 = {
+ name: `file2-${random}.txt`,
+ title: `file2 title`,
+ description: `file2 description`
+ };
+ const duplicateFileName = `duplicate-file-${random}.txt`;
+ const nameWithSpaces = ` file-${random}.txt `;
+
+ const siteName = `site-${random}`;
+ const fileSite = {
+ name: `file-site-${random}.txt`,
+ title: `file site title`,
+ description: `file site description`
+ };
+ const duplicateFileSite = `duplicate-file-site-${random}.txt`;
+ let docLibUserSite: string;
+
+ const userApi = new RepoClient(username, username);
+
+ const adminApiActions = new AdminActions();
+
+ const loginPage = new LoginPage();
+ const page = new BrowsingPage();
+ const selectTemplateDialog = new SelectTemplateDialog();
+ const createFromTemplateDialog = new CreateFromTemplateDialog();
+ const { sidenav } = page;
+
+ beforeAll(async () => {
+ await adminApiActions.createUser({ username });
+
+ parentId = (await userApi.nodes.createFolder(parent)).entry.id;
+ await userApi.nodes.createFile(duplicateFileName, parentId);
+
+ await userApi.sites.createSite(siteName);
+ docLibUserSite = await userApi.sites.getDocLibId(siteName);
+ await userApi.nodes.createFile(duplicateFileSite, docLibUserSite);
+
+ await loginPage.loginWith(username);
+ });
+
+ afterAll(async () => {
+ await userApi.nodes.deleteNodeById(parentId);
+ await userApi.sites.deleteSite(siteName);
+ await adminApiActions.cleanupNodeTemplatesFolder();
+ });
+
+ beforeEach(async () => {
+ await page.closeOpenDialogs();
+ });
+
+ it('Select template - dialog UI - when no templates exist in the repo - [C325049]', async () => {
+ await sidenav.openCreateFileFromTemplateDialog();
+ await selectTemplateDialog.waitForDialogToOpen();
+
+ expect(await selectTemplateDialog.getTitle()).toEqual('Select a document template');
+ expect(await selectTemplateDialog.dataTable.isEmpty()).toBe(true, 'Datatable is not empty');
+ expect(await selectTemplateDialog.dataTable.getEmptyListText()).toEqual('No results found');
+ expect(await selectTemplateDialog.breadcrumb.getCurrentFolderName()).toEqual('Node Templates');
+ expect(await selectTemplateDialog.isNextButtonEnabled()).toBe(false, 'Next button is not disabled');
+ expect(await selectTemplateDialog.isCancelButtonEnabled()).toBe(true, 'Cancel button is not enabled');
+ });
+
+ describe('with existing templates', () => {
+ const templates: NodeContentTree = {
+ folders: [
+ {
+ name: templatesFolder1,
+ files: [template1InFolder1, template2InFolder1]
+ },
+ {
+ name: templatesFolder2,
+ folders: [
+ {
+ name: templatesSubFolder
+ }
+ ],
+ files: [template1InFolder2]
+ },
+ {
+ name: restrictedTemplateFolder,
+ files: [templateInRestrictedFolder]
+ }
+ ],
+ files: [template1InRootFolder, template2InRootFolder]
+ };
+ let link: string;
+
+ beforeAll(async () => {
+ await adminApiActions.createNodeTemplatesHierarchy(templates);
+ await adminApiActions.removeUserAccessOnNodeTemplate(restrictedTemplateFolder);
+ link = (await adminApiActions.createLinkToFileName(template2InRootFolder, await adminApiActions.getNodeTemplatesFolderId())).entry.name;
+ });
+
+ describe('Select Template dialog', () => {
+ beforeEach(async () => {
+ await sidenav.openCreateFileFromTemplateDialog();
+ await selectTemplateDialog.waitForDialogToOpen();
+ });
+
+ it('Select template - dialog UI - with existing templates - [C325043]', async () => {
+ expect(await selectTemplateDialog.getTitle()).toEqual('Select a document template');
+ expect(await selectTemplateDialog.dataTable.isEmpty()).toBe(false, 'Datatable is empty');
+ expect(await selectTemplateDialog.dataTable.isItemPresent(templatesFolder1)).toBe(true, 'template folder not displayed');
+ expect(await selectTemplateDialog.dataTable.isItemPresent(templatesFolder2)).toBe(true, 'template folder not displayed');
+ expect(await selectTemplateDialog.dataTable.isItemPresent(template1InRootFolder)).toBe(true, 'template not displayed');
+ expect(await selectTemplateDialog.dataTable.isItemPresent(template2InRootFolder)).toBe(true, 'template not displayed');
+ expect(await selectTemplateDialog.breadcrumb.getCurrentFolderName()).toEqual('Node Templates');
+ expect(await selectTemplateDialog.isNextButtonEnabled()).toBe(false, 'Next button is not disabled');
+ expect(await selectTemplateDialog.isCancelButtonEnabled()).toBe(true, 'Cancel button is not enabled');
+ });
+
+ it(`Templates don't appear if user doesn't have permissions to see them - [C325044]`, async () => {
+ expect(await selectTemplateDialog.dataTable.isItemPresent(restrictedTemplateFolder)).toBe(false, 'restricted templates folder is displayed');
+ });
+
+ it('Navigate through the templates list with folder hierarchy - [C325045]', async () => {
+ expect(await selectTemplateDialog.dataTable.isItemPresent(templatesFolder2)).toBe(true, 'template folder not displayed');
+
+ await selectTemplateDialog.dataTable.doubleClickOnRowByName(templatesFolder2);
+
+ expect(await selectTemplateDialog.dataTable.isItemPresent(templatesSubFolder)).toBe(true, 'template sub-folder not displayed');
+ expect(await selectTemplateDialog.dataTable.isItemPresent(template1InFolder2)).toBe(true, 'template not displayed');
+ expect(await selectTemplateDialog.dataTable.isItemPresent(template1InRootFolder)).toBe(false, 'template is displayed');
+ expect(await selectTemplateDialog.dataTable.isItemPresent(template2InRootFolder)).toBe(false, 'template is displayed');
+ expect(await selectTemplateDialog.breadcrumb.getCurrentFolderName()).toEqual(templatesFolder2);
+
+ await selectTemplateDialog.dataTable.doubleClickOnRowByName(templatesSubFolder);
+
+ expect(await selectTemplateDialog.breadcrumb.getCurrentFolderName()).toEqual(templatesSubFolder);
+ expect(await selectTemplateDialog.dataTable.isEmpty()).toBe(true, 'datatable is not empty');
+
+ await selectTemplateDialog.breadcrumb.openPath();
+
+ expect(await selectTemplateDialog.breadcrumb.getPathItems()).toEqual([ templatesFolder2, 'Node Templates' ]);
+ });
+
+ it(`Templates list doesn't allow multiple selection - [C325047]`, async () => {
+ expect(await selectTemplateDialog.dataTable.getSelectedRowsCount()).toEqual(0, 'Incorrect number of selected rows');
+
+ await selectTemplateDialog.dataTable.selectItem(template1InRootFolder);
+ expect(await selectTemplateDialog.dataTable.getSelectedRowsCount()).toEqual(1, 'Incorrect number of selected rows');
+ expect(await selectTemplateDialog.dataTable.getSelectedRowsNames()).toEqual([ template1InRootFolder ], 'Incorrect selected item');
+
+ await Utils.pressCmd();
+ await selectTemplateDialog.dataTable.selectItem(template2InRootFolder);
+ await Utils.releaseKeyPressed();
+
+ expect(await selectTemplateDialog.dataTable.getSelectedRowsCount()).toEqual(1, 'Incorrect number of selected rows');
+ expect(await selectTemplateDialog.dataTable.getSelectedRowsNames()).toEqual([ template2InRootFolder ], 'Incorrect selected item');
+ });
+
+ it('Links to files are not displayed - [C325050]', async () => {
+ expect(await selectTemplateDialog.dataTable.isItemPresent(link)).toBe(false, 'Link to file is displayed');
+ });
+
+ it('Cancel the Select template dialog - [C325048]', async () => {
+ expect(await selectTemplateDialog.isCancelButtonEnabled()).toBe(true, 'Cancel button is not enabled');
+
+ await selectTemplateDialog.clickCancel();
+
+ expect(await selectTemplateDialog.isDialogOpen()).toBe(false, 'Select Template dialog is open');
+ });
+
+ it('Next button is disabled when selecting a folder - [C216339]', async () => {
+ expect(await selectTemplateDialog.isNextButtonEnabled()).toBe(false, 'Next button is enabled');
+
+ await selectTemplateDialog.dataTable.selectItem(templatesFolder1);
+
+ expect(await selectTemplateDialog.isNextButtonEnabled()).toBe(false, 'Next button is enabled');
+ });
+ });
+
+ describe('Create from template dialog', () => {
+ beforeEach(async () => {
+ await sidenav.openCreateFileFromTemplateDialog();
+ await selectTemplateDialog.waitForDialogToOpen();
+ await selectTemplateDialog.dataTable.selectItem(template1InRootFolder);
+ await selectTemplateDialog.clickNext();
+ await createFromTemplateDialog.waitForDialogToOpen();
+ });
+
+ it('Create file from template - dialog UI - [C325020]', async () => {
+ expect(await createFromTemplateDialog.getTitle()).toEqual(`Create new document from '${template1InRootFolder}'`);
+ expect(await createFromTemplateDialog.isNameFieldDisplayed()).toBe(true, 'Name field not displayed');
+ expect(await createFromTemplateDialog.isTitleFieldDisplayed()).toBe(true, 'Title field not displayed');
+ expect(await createFromTemplateDialog.isDescriptionFieldDisplayed()).toBe(true, 'Description field not displayed');
+ expect(await createFromTemplateDialog.isCancelButtonEnabled()).toBe(true, 'Cancel button is not enabled');
+ expect(await createFromTemplateDialog.isCreateButtonEnabled()).toBe(true, 'Create button is not enabled');
+ });
+
+ it('File name is required - [C325031]', async () => {
+ expect(await createFromTemplateDialog.getName()).toEqual(template1InRootFolder);
+ await createFromTemplateDialog.deleteNameWithBackspace();
+
+ expect(await createFromTemplateDialog.getValidationMessage()).toEqual('Name is required');
+ expect(await createFromTemplateDialog.isCreateButtonEnabled()).toBe(false, 'Create button is not disabled');
+ });
+
+ it('Special characters in file name - [C325032]', async () => {
+ const namesWithSpecialChars = [ 'a*a', 'a"a', 'aa', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];
+
+ for (const name of namesWithSpecialChars) {
+ await createFromTemplateDialog.enterName(name);
+ expect(await createFromTemplateDialog.isCreateButtonEnabled()).toBe(false, 'Create button is not disabled');
+ expect(await createFromTemplateDialog.getValidationMessage()).toContain(`Name can't contain these characters`);
+ }
+ });
+
+ it('File name ending with a dot - [C325033]', async () => {
+ await createFromTemplateDialog.enterName('file-name.');
+
+ expect(await createFromTemplateDialog.isCreateButtonEnabled()).toBe(false, 'Create button is not disabled');
+ expect(await createFromTemplateDialog.getValidationMessage()).toMatch(`Name can't end with a period .`);
+ });
+
+ it('File name containing only spaces - [C325034]', async () => {
+ await createFromTemplateDialog.enterName(' ');
+
+ expect(await createFromTemplateDialog.isCreateButtonEnabled()).toBe(false, 'Create button is not disabled');
+ expect(await createFromTemplateDialog.getValidationMessage()).toMatch(`Name can't contain only spaces`);
+ });
+
+ it('Title too long - [C290146]', async () => {
+ await createFromTemplateDialog.enterTitle(Utils.string257);
+ await Utils.pressTab();
+
+ expect(await createFromTemplateDialog.isCreateButtonEnabled()).toBe(false, 'Create button is not disabled');
+ expect(await createFromTemplateDialog.getValidationMessage()).toMatch(`Use 256 characters or less for title`);
+ });
+
+ it('Description too long - [C290142]', async () => {
+ await createFromTemplateDialog.enterDescription(Utils.string513);
+ await Utils.pressTab();
+
+ expect(await createFromTemplateDialog.isCreateButtonEnabled()).toBe(false, 'Create button is not disabled');
+ expect(await createFromTemplateDialog.getValidationMessage()).toMatch(`Use 512 characters or less for description`);
+ });
+ });
+
+ describe('On Personal Files', () => {
+ beforeEach(async () => {
+ await page.clickPersonalFilesAndWait();
+ await page.dataTable.doubleClickOnRowByName(parent);
+ await sidenav.openCreateFileFromTemplateDialog();
+ await selectTemplateDialog.waitForDialogToOpen();
+ await selectTemplateDialog.dataTable.selectItem(template1InRootFolder);
+ await selectTemplateDialog.clickNext();
+ await createFromTemplateDialog.waitForDialogToOpen();
+ });
+
+ it('Create a file from a template - with a new Name - [C325030]', async () => {
+ await createFromTemplateDialog.enterName(file1.name);
+ await createFromTemplateDialog.clickCreate();
+ await createFromTemplateDialog.waitForDialogToClose();
+ await page.dataTable.waitForHeader();
+
+ expect(await page.dataTable.isItemPresent(file1.name)).toBe(true, 'File not displayed in list view');
+ });
+
+ it('Create a file from a template - with a Name, Title and Description - [C325026]', async () => {
+ await createFromTemplateDialog.enterName(file2.name);
+ await createFromTemplateDialog.enterTitle(file2.title);
+ await createFromTemplateDialog.enterDescription(file2.description);
+ await createFromTemplateDialog.clickCreate();
+ await createFromTemplateDialog.waitForDialogToClose();
+ await page.dataTable.waitForHeader();
+
+ expect(await page.dataTable.isItemPresent(file2.name)).toBe(true, 'File not displayed in list view');
+ const desc = await userApi.nodes.getNodeDescription(file2.name, parentId);
+ expect(desc).toEqual(file2.description);
+ const title = await userApi.nodes.getNodeTitle(file2.name, parentId);
+ expect(title).toEqual(file2.title);
+ });
+
+ it('Create a file with a duplicate name - [C325028]', async () => {
+ await createFromTemplateDialog.enterName(duplicateFileName);
+ await createFromTemplateDialog.clickCreate();
+
+ expect(await page.getSnackBarMessage()).toEqual(`This name is already in use, try a different name.`);
+ expect(await createFromTemplateDialog.isDialogOpen()).toBe(true, 'dialog is not present');
+ });
+
+ it('Cancel file creation - [C325027]', async () => {
+ await createFromTemplateDialog.enterName('test');
+ await createFromTemplateDialog.clickCancel();
+
+ expect(await createFromTemplateDialog.isDialogOpen()).not.toBe(true, 'dialog is not closed');
+ expect(await page.dataTable.isItemPresent('test')).toBe(false, 'File should not appear in the list');
+ });
+
+ it('Trim spaces from file Name - [C325042]', async () => {
+ await createFromTemplateDialog.enterName(nameWithSpaces);
+ await createFromTemplateDialog.clickCreate();
+ await createFromTemplateDialog.waitForDialogToClose();
+ await page.dataTable.waitForHeader();
+
+ expect(await page.dataTable.isItemPresent(nameWithSpaces.trim())).toBe(true, 'File not displayed in list view');
+ });
+ });
+
+ describe('On File Libraries', () => {
+ const fileLibrariesPage = new BrowsingPage();
+
+ beforeEach(async () => {
+ await fileLibrariesPage.goToMyLibrariesAndWait();
+ await page.dataTable.doubleClickOnRowByName(siteName);
+ await sidenav.openCreateFileFromTemplateDialog();
+ await selectTemplateDialog.waitForDialogToOpen();
+ await selectTemplateDialog.dataTable.selectItem(template1InRootFolder);
+ await selectTemplateDialog.clickNext();
+ await createFromTemplateDialog.waitForDialogToOpen();
+ });
+
+ it('Create a file from a template - with Name, Title and Description - [C325023]', async () => {
+ await createFromTemplateDialog.enterName(fileSite.name);
+ await createFromTemplateDialog.enterTitle(fileSite.title);
+ await createFromTemplateDialog.enterDescription(fileSite.description);
+ await createFromTemplateDialog.clickCreate();
+ await createFromTemplateDialog.waitForDialogToClose();
+ await page.dataTable.waitForHeader();
+
+ expect(await page.dataTable.isItemPresent(fileSite.name)).toBe(true, 'File not displayed in list view');
+ const desc = await userApi.nodes.getNodeDescription(fileSite.name, docLibUserSite);
+ expect(desc).toEqual(fileSite.description);
+ const title = await userApi.nodes.getNodeTitle(fileSite.name, docLibUserSite);
+ expect(title).toEqual(fileSite.title);
+ });
+
+ it('Cancel file creation - [C325024]', async () => {
+ await createFromTemplateDialog.enterName('test');
+ await createFromTemplateDialog.clickCancel();
+
+ expect(await createFromTemplateDialog.isDialogOpen()).not.toBe(true, 'dialog is not closed');
+ expect(await page.dataTable.isItemPresent('test')).toBe(false, 'File should not appear in the list');
+ });
+
+ it('Create a file with a duplicate name - [C325025]', async () => {
+ await createFromTemplateDialog.enterName(duplicateFileSite);
+ await createFromTemplateDialog.clickCreate();
+
+ expect(await page.getSnackBarMessage()).toEqual(`This name is already in use, try a different name.`);
+ expect(await createFromTemplateDialog.isDialogOpen()).toBe(true, 'dialog is not present');
+ });
+ });
+ });
+
+});
diff --git a/e2e/suites/actions/create-folder-from-template.test.ts b/e2e/suites/actions/create-folder-from-template.test.ts
new file mode 100755
index 000000000..02364c15a
--- /dev/null
+++ b/e2e/suites/actions/create-folder-from-template.test.ts
@@ -0,0 +1,387 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { LoginPage, BrowsingPage } from '../../pages/pages';
+import { SelectTemplateDialog } from '../../components/dialog/select-template-dialog';
+import { CreateFromTemplateDialog } from '../../components/dialog/create-from-template-dialog';
+import { Utils } from '../../utilities/utils';
+import { AdminActions } from '../../utilities/admin-actions';
+import { RepoClient, NodeContentTree } from '../../utilities/repo-client/repo-client';
+
+describe('Create folder from template', () => {
+ const random = Utils.random();
+
+ const username = `user-${random}`;
+
+ const restrictedTemplateFolder = `restricted-folder-${random}`;
+ const fileInRestrictedFolder = `restricted-file-${random}.txt`;
+
+ const templateFolder1 = `template-folder1-${random}`;
+ const fileInFolder1 = `file-1-${random}.txt`;
+
+ const templateFolder2 = `template-folder2-${random}`;
+ const fileInFolder2 = `file-2-${random}.txt`;
+ const templateSubFolder = `template-sub-folder-${random}`;
+
+ const fileInRootFolder = `file-in-root-${random}.txt`;
+ const folderInRootFolder = `folder-in-root-${random}`;
+
+ const parent = `parent-${random}`;
+ let parentId: string;
+
+ const folder1 = {
+ name: `folder1-${random}`
+ };
+ const folder2 = {
+ name: `folder2-${random}`,
+ title: `folder2 title`,
+ description: `folder2 description`
+ };
+ const duplicateFolderName = `duplicate-folder-${random}`;
+ const nameWithSpaces = ` folder-${random} `;
+
+ const siteName = `site-${random}`;
+ const folderSite = {
+ name: `folder-site-${random}`,
+ title: `folder site title`,
+ description: `folder site description`
+ };
+ const duplicateFolderSite = `duplicate-folder-site-${random}`;
+ let docLibUserSite: string;
+
+ const templates: NodeContentTree = {
+ folders: [
+ {
+ name: folderInRootFolder
+ },
+ {
+ name: templateFolder1,
+ files: [fileInFolder1]
+ },
+ {
+ name: templateFolder2,
+ folders: [
+ {
+ name: templateSubFolder
+ }
+ ],
+ files: [fileInFolder2]
+ },
+ {
+ name: restrictedTemplateFolder,
+ files: [fileInRestrictedFolder]
+ }
+ ],
+ files: [fileInRootFolder]
+ };
+ let folderLink: string;
+
+ const userApi = new RepoClient(username, username);
+ const adminApiActions = new AdminActions();
+
+ const loginPage = new LoginPage();
+ const page = new BrowsingPage();
+ const selectTemplateDialog = new SelectTemplateDialog();
+ const createFromTemplateDialog = new CreateFromTemplateDialog();
+ const { sidenav } = page;
+
+ beforeAll(async () => {
+ await adminApiActions.createUser({ username });
+
+ parentId = (await userApi.nodes.createFolder(parent)).entry.id;
+ await userApi.nodes.createFolder(duplicateFolderName, parentId);
+
+ await userApi.sites.createSite(siteName);
+ docLibUserSite = await userApi.sites.getDocLibId(siteName);
+ await userApi.nodes.createFolder(duplicateFolderSite, docLibUserSite);
+
+ await adminApiActions.createSpaceTemplatesHierarchy(templates);
+ await adminApiActions.removeUserAccessOnSpaceTemplate(restrictedTemplateFolder);
+ folderLink = (await adminApiActions.createLinkToFolderName(folderInRootFolder, await adminApiActions.getSpaceTemplatesFolderId())).entry.name;
+
+ await loginPage.loginWith(username);
+ });
+
+ afterAll(async () => {
+ await userApi.nodes.deleteNodeById(parentId);
+ await userApi.sites.deleteSite(siteName);
+ await adminApiActions.cleanupSpaceTemplatesFolder();
+ });
+
+ beforeEach(async () => {
+ await page.closeOpenDialogs();
+ });
+
+ describe('Select Template dialog', () => {
+ beforeEach(async () => {
+ await sidenav.openCreateFolderFromTemplateDialog();
+ await selectTemplateDialog.waitForDialogToOpen();
+ });
+
+ it('Select template - dialog UI - with existing templates - [C325147]', async () => {
+ expect(await selectTemplateDialog.getTitle()).toEqual('Select a folder template');
+ expect(await selectTemplateDialog.dataTable.isEmpty()).toBe(false, 'Datatable is empty');
+ expect(await selectTemplateDialog.dataTable.isItemPresent(templateFolder1)).toBe(true, 'template folder not displayed');
+ expect(await selectTemplateDialog.dataTable.isItemPresent(templateFolder2)).toBe(true, 'template folder not displayed');
+ expect(await selectTemplateDialog.dataTable.isItemPresent(fileInRootFolder)).toBe(true, 'file not displayed');
+ expect(await selectTemplateDialog.breadcrumb.getCurrentFolderName()).toEqual('Space Templates');
+ expect(await selectTemplateDialog.isNextButtonEnabled()).toBe(false, 'Next button is not disabled');
+ expect(await selectTemplateDialog.isCancelButtonEnabled()).toBe(true, 'Cancel button is not enabled');
+ });
+
+ it(`Templates don't appear if user doesn't have permissions to see them - [C325148]`, async () => {
+ expect(await selectTemplateDialog.dataTable.isItemPresent(restrictedTemplateFolder)).toBe(false, 'restricted template folder is displayed');
+ });
+
+ it('Navigate through the templates list with folder hierarchy - [C325149]', async () => {
+ expect(await selectTemplateDialog.dataTable.isItemPresent(templateFolder2)).toBe(true, 'template folder not displayed');
+
+ await selectTemplateDialog.dataTable.doubleClickOnRowByName(templateFolder2);
+
+ expect(await selectTemplateDialog.dataTable.isItemPresent(templateSubFolder)).toBe(true, 'template sub-folder not displayed');
+ expect(await selectTemplateDialog.dataTable.isItemPresent(fileInFolder2)).toBe(true, 'template not displayed');
+ expect(await selectTemplateDialog.dataTable.isItemPresent(templateFolder1)).toBe(false, 'template folder is displayed');
+ expect(await selectTemplateDialog.breadcrumb.getCurrentFolderName()).toEqual(templateFolder2);
+
+ await selectTemplateDialog.dataTable.doubleClickOnRowByName(templateSubFolder);
+
+ expect(await selectTemplateDialog.breadcrumb.getCurrentFolderName()).toEqual(templateSubFolder);
+ expect(await selectTemplateDialog.dataTable.isEmpty()).toBe(true, 'datatable is not empty');
+
+ await selectTemplateDialog.breadcrumb.openPath();
+
+ expect(await selectTemplateDialog.breadcrumb.getPathItems()).toEqual([ templateFolder2, 'Space Templates' ]);
+ });
+
+ it(`Templates list doesn't allow multiple selection - [C325150]`, async () => {
+ expect(await selectTemplateDialog.dataTable.getSelectedRowsCount()).toEqual(0, 'Incorrect number of selected rows');
+
+ await selectTemplateDialog.dataTable.selectItem(templateFolder1);
+ expect(await selectTemplateDialog.dataTable.getSelectedRowsCount()).toEqual(1, 'Incorrect number of selected rows');
+ expect(await selectTemplateDialog.dataTable.getSelectedRowsNames()).toEqual([ templateFolder1 ], 'Incorrect selected item');
+
+ await Utils.pressCmd();
+ await selectTemplateDialog.dataTable.selectItem(templateFolder2);
+ await Utils.releaseKeyPressed();
+
+ expect(await selectTemplateDialog.dataTable.getSelectedRowsCount()).toEqual(1, 'Incorrect number of selected rows');
+ expect(await selectTemplateDialog.dataTable.getSelectedRowsNames()).toEqual([ templateFolder2 ], 'Incorrect selected item');
+ });
+
+ it('Links to folders are not displayed - [C325153]', async () => {
+ expect(await selectTemplateDialog.dataTable.isItemPresent(folderLink)).toBe(false, 'Link to folder is displayed');
+ });
+
+ it('Cancel the Select template dialog - [C325151]', async () => {
+ expect(await selectTemplateDialog.isCancelButtonEnabled()).toBe(true, 'Cancel button is not enabled');
+
+ await selectTemplateDialog.clickCancel();
+
+ expect(await selectTemplateDialog.isDialogOpen()).toBe(false, 'Select Template dialog is open');
+ });
+
+ it('Next button is disabled when selecting a file - [C325139]', async () => {
+ expect(await selectTemplateDialog.isNextButtonEnabled()).toBe(false, 'Next button is enabled');
+
+ await selectTemplateDialog.dataTable.selectItem(fileInRootFolder);
+
+ expect(await selectTemplateDialog.isNextButtonEnabled()).toBe(false, 'Next button is enabled');
+ });
+ });
+
+ describe('Create from template dialog', () => {
+ beforeEach(async () => {
+ await sidenav.openCreateFolderFromTemplateDialog();
+ await selectTemplateDialog.waitForDialogToOpen();
+ await selectTemplateDialog.dataTable.selectItem(templateFolder1);
+ await selectTemplateDialog.clickNext();
+ await createFromTemplateDialog.waitForDialogToOpen();
+ });
+
+ it('Create folder from template - dialog UI - [C325142]', async () => {
+ expect(await createFromTemplateDialog.getTitle()).toEqual(`Create new folder from '${templateFolder1}'`);
+ expect(await createFromTemplateDialog.isNameFieldDisplayed()).toBe(true, 'Name field not displayed');
+ expect(await createFromTemplateDialog.isTitleFieldDisplayed()).toBe(true, 'Title field not displayed');
+ expect(await createFromTemplateDialog.isDescriptionFieldDisplayed()).toBe(true, 'Description field not displayed');
+ expect(await createFromTemplateDialog.isCancelButtonEnabled()).toBe(true, 'Cancel button is not enabled');
+ expect(await createFromTemplateDialog.isCreateButtonEnabled()).toBe(true, 'Create button is not enabled');
+ });
+
+ it('Folder name is required - [C325143]', async () => {
+ expect(await createFromTemplateDialog.getName()).toEqual(templateFolder1);
+ await createFromTemplateDialog.deleteNameWithBackspace();
+
+ expect(await createFromTemplateDialog.getValidationMessage()).toEqual('Name is required');
+ expect(await createFromTemplateDialog.isCreateButtonEnabled()).toBe(false, 'Create button is not disabled');
+ });
+
+ it('Special characters in folder name - [C325144]', async () => {
+ const namesWithSpecialChars = [ 'a*a', 'a"a', 'aa', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];
+
+ for (const name of namesWithSpecialChars) {
+ await createFromTemplateDialog.enterName(name);
+ expect(await createFromTemplateDialog.isCreateButtonEnabled()).toBe(false, 'Create button is not disabled');
+ expect(await createFromTemplateDialog.getValidationMessage()).toContain(`Name can't contain these characters`);
+ }
+ });
+
+ it('Folder name ending with a dot - [C325145]', async () => {
+ await createFromTemplateDialog.enterName('folder-name.');
+
+ expect(await createFromTemplateDialog.isCreateButtonEnabled()).toBe(false, 'Create button is not disabled');
+ expect(await createFromTemplateDialog.getValidationMessage()).toMatch(`Name can't end with a period .`);
+ });
+
+ it('Folder name containing only spaces - [C325146]', async () => {
+ await createFromTemplateDialog.enterName(' ');
+
+ expect(await createFromTemplateDialog.isCreateButtonEnabled()).toBe(false, 'Create button is not disabled');
+ expect(await createFromTemplateDialog.getValidationMessage()).toMatch(`Name can't contain only spaces`);
+ });
+
+ it('Title too long - [C325141]', async () => {
+ await createFromTemplateDialog.enterTitle(Utils.string257);
+ await Utils.pressTab();
+
+ expect(await createFromTemplateDialog.isCreateButtonEnabled()).toBe(false, 'Create button is not disabled');
+ expect(await createFromTemplateDialog.getValidationMessage()).toMatch(`Use 256 characters or less for title`);
+ });
+
+ it('Description too long - [C325140]', async () => {
+ await createFromTemplateDialog.enterDescription(Utils.string513);
+ await Utils.pressTab();
+
+ expect(await createFromTemplateDialog.isCreateButtonEnabled()).toBe(false, 'Create button is not disabled');
+ expect(await createFromTemplateDialog.getValidationMessage()).toMatch(`Use 512 characters or less for description`);
+ });
+ });
+
+ describe('On Personal Files', () => {
+ beforeEach(async () => {
+ await page.clickPersonalFilesAndWait();
+ await page.dataTable.doubleClickOnRowByName(parent);
+ await sidenav.openCreateFolderFromTemplateDialog();
+ await selectTemplateDialog.waitForDialogToOpen();
+ await selectTemplateDialog.dataTable.selectItem(templateFolder1);
+ await selectTemplateDialog.clickNext();
+ await createFromTemplateDialog.waitForDialogToOpen();
+ });
+
+ it('Create a folder from a template - with a new Name - [C325157]', async () => {
+ await createFromTemplateDialog.enterName(folder1.name);
+ await createFromTemplateDialog.clickCreate();
+ await createFromTemplateDialog.waitForDialogToClose();
+ await page.dataTable.waitForHeader();
+
+ expect(await page.dataTable.isItemPresent(folder1.name)).toBe(true, 'Folder not displayed in list view');
+ });
+
+ it('Create a folder from a template - with a Name, Title and Description - [C325154]', async () => {
+ await createFromTemplateDialog.enterName(folder2.name);
+ await createFromTemplateDialog.enterTitle(folder2.title);
+ await createFromTemplateDialog.enterDescription(folder2.description);
+ await createFromTemplateDialog.clickCreate();
+ await createFromTemplateDialog.waitForDialogToClose();
+ await page.dataTable.waitForHeader();
+
+ expect(await page.dataTable.isItemPresent(folder2.name)).toBe(true, 'Folder not displayed in list view');
+ const desc = await userApi.nodes.getNodeDescription(folder2.name, parentId);
+ expect(desc).toEqual(folder2.description);
+ const title = await userApi.nodes.getNodeTitle(folder2.name, parentId);
+ expect(title).toEqual(folder2.title);
+ });
+
+ it('Create a folder with a duplicate name - [C325156]', async () => {
+ await createFromTemplateDialog.enterName(duplicateFolderName);
+ await createFromTemplateDialog.clickCreate();
+
+ expect(await page.getSnackBarMessage()).toEqual(`This name is already in use, try a different name.`);
+ expect(await createFromTemplateDialog.isDialogOpen()).toBe(true, 'dialog is not present');
+ });
+
+ it('Cancel folder creation - [C325155]', async () => {
+ await createFromTemplateDialog.enterName('test');
+ await createFromTemplateDialog.clickCancel();
+
+ expect(await createFromTemplateDialog.isDialogOpen()).not.toBe(true, 'dialog is not closed');
+ expect(await page.dataTable.isItemPresent('test')).toBe(false, 'Folder should not appear in the list');
+ });
+
+ it('Trim spaces from folder Name - [C325158]', async () => {
+ await createFromTemplateDialog.enterName(nameWithSpaces);
+ await createFromTemplateDialog.clickCreate();
+ await createFromTemplateDialog.waitForDialogToClose();
+ await page.dataTable.waitForHeader();
+
+ expect(await page.dataTable.isItemPresent(nameWithSpaces.trim())).toBe(true, 'Folder not displayed in list view');
+ });
+ });
+
+ describe('On File Libraries', () => {
+ const fileLibrariesPage = new BrowsingPage();
+
+ beforeEach(async () => {
+ await fileLibrariesPage.goToMyLibrariesAndWait();
+ await page.dataTable.doubleClickOnRowByName(siteName);
+ await sidenav.openCreateFolderFromTemplateDialog();
+ await selectTemplateDialog.waitForDialogToOpen();
+ await selectTemplateDialog.dataTable.selectItem(templateFolder1);
+ await selectTemplateDialog.clickNext();
+ await createFromTemplateDialog.waitForDialogToOpen();
+ });
+
+ it('Create a folder from a template - with Name, Title and Description - [C325161]', async () => {
+ await createFromTemplateDialog.enterName(folderSite.name);
+ await createFromTemplateDialog.enterTitle(folderSite.title);
+ await createFromTemplateDialog.enterDescription(folderSite.description);
+ await createFromTemplateDialog.clickCreate();
+ await createFromTemplateDialog.waitForDialogToClose();
+ await page.dataTable.waitForHeader();
+
+ expect(await page.dataTable.isItemPresent(folderSite.name)).toBe(true, 'Folder not displayed in list view');
+ const desc = await userApi.nodes.getNodeDescription(folderSite.name, docLibUserSite);
+ expect(desc).toEqual(folderSite.description);
+ const title = await userApi.nodes.getNodeTitle(folderSite.name, docLibUserSite);
+ expect(title).toEqual(folderSite.title);
+ });
+
+ it('Cancel folder creation - [C325162]', async () => {
+ await createFromTemplateDialog.enterName('test');
+ await createFromTemplateDialog.clickCancel();
+
+ expect(await createFromTemplateDialog.isDialogOpen()).not.toBe(true, 'dialog is not closed');
+ expect(await page.dataTable.isItemPresent('test')).toBe(false, 'Folder should not appear in the list');
+ });
+
+ it('Create a folder with a duplicate name - [C325163]', async () => {
+ await createFromTemplateDialog.enterName(duplicateFolderSite);
+ await createFromTemplateDialog.clickCreate();
+
+ expect(await page.getSnackBarMessage()).toEqual(`This name is already in use, try a different name.`);
+ expect(await createFromTemplateDialog.isDialogOpen()).toBe(true, 'dialog is not present');
+ });
+ });
+
+});
diff --git a/e2e/suites/actions/create-folder.test.ts b/e2e/suites/actions/create-folder.test.ts
index b42370425..a3b58accc 100755
--- a/e2e/suites/actions/create-folder.test.ts
+++ b/e2e/suites/actions/create-folder.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -23,7 +23,6 @@
* along with Alfresco. If not, see .
*/
-import { SITE_VISIBILITY, SITE_ROLES } from '../../configs';
import { LoginPage, BrowsingPage } from '../../pages/pages';
import { CreateOrEditFolderDialog } from '../../components/dialog/create-edit-folder-dialog';
import { Utils } from '../../utilities/utils';
@@ -39,7 +38,6 @@ describe('Create folder', () => {
const duplicateFolderName = `folder-${Utils.random()}`;
const nameWithSpaces = ` folder-${Utils.random()} `;
- const sitePrivate = `site-private-${Utils.random()}`;
const siteName = `site-${Utils.random()}`;
const folderSite = `folder-site-${Utils.random()}`;
@@ -59,11 +57,6 @@ describe('Create folder', () => {
beforeAll(async (done) => {
await apis.admin.people.createUser({ username });
- await apis.admin.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE);
- const docLibId = await apis.admin.sites.getDocLibId(sitePrivate);
- await apis.admin.nodes.createFolder(folderName1, docLibId);
- await apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_CONSUMER.ROLE);
-
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
await apis.user.nodes.createFolder(duplicateFolderName, parentId);
@@ -76,7 +69,6 @@ describe('Create folder', () => {
});
afterAll(async (done) => {
- await apis.admin.sites.deleteSite(sitePrivate);
await apis.user.sites.deleteSite(siteName);
await apis.user.nodes.deleteNodeById(parentId);
done();
diff --git a/e2e/suites/actions/create-library.test.ts b/e2e/suites/actions/create-library.test.ts
index 6d8c8d3ac..ca3cd25a4 100755
--- a/e2e/suites/actions/create-library.test.ts
+++ b/e2e/suites/actions/create-library.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/actions/delete-undo-delete.test.ts b/e2e/suites/actions/delete-undo-delete.test.ts
index f478e5df5..1a7b2a50e 100755
--- a/e2e/suites/actions/delete-undo-delete.test.ts
+++ b/e2e/suites/actions/delete-undo-delete.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -126,7 +126,7 @@ describe('Delete and undo delete', () => {
});
it('delete a file and check notification - [C217125]', async () => {
- let items = await page.dataTable.countRows();
+ let items = await page.dataTable.getRowsCount();
await dataTable.selectItem(file1);
await toolbar.clickMoreActionsDelete();
const message = await page.getSnackBarMessage();
@@ -140,7 +140,7 @@ describe('Delete and undo delete', () => {
});
it('delete multiple files and check notification - [C280502]', async () => {
- let items = await page.dataTable.countRows();
+ let items = await page.dataTable.getRowsCount();
await dataTable.selectMultipleItems([file2, file3]);
await toolbar.clickMoreActionsDelete();
const message = await page.getSnackBarMessage();
@@ -155,7 +155,7 @@ describe('Delete and undo delete', () => {
});
it('delete a folder with content - [C217126]', async () => {
- let items = await page.dataTable.countRows();
+ let items = await page.dataTable.getRowsCount();
await dataTable.selectItem(folder1);
await toolbar.clickMoreActionsDelete();
expect(await dataTable.isItemPresent(folder1)).toBe(false, 'Item was not removed from list');
@@ -195,7 +195,7 @@ describe('Delete and undo delete', () => {
});
it('undo delete of file - [C217132]', async () => {
- const items = await page.dataTable.countRows();
+ const items = await page.dataTable.getRowsCount();
await dataTable.selectItem(file5);
await toolbar.clickMoreActionsDelete();
@@ -206,7 +206,7 @@ describe('Delete and undo delete', () => {
});
it('undo delete of folder with content - [C280503]', async () => {
- const items = await page.dataTable.countRows();
+ const items = await page.dataTable.getRowsCount();
await dataTable.selectItem(folder6);
await toolbar.clickMoreActionsDelete();
@@ -218,7 +218,7 @@ describe('Delete and undo delete', () => {
});
it('undo delete of multiple files - [C280504]', async () => {
- const items = await page.dataTable.countRows();
+ const items = await page.dataTable.getRowsCount();
await dataTable.selectMultipleItems([file6, file7]);
await toolbar.clickMoreActionsDelete();
@@ -393,7 +393,7 @@ describe('Delete and undo delete', () => {
});
it('delete a file and check notification - [C280516]', async () => {
- let items = await page.dataTable.countRows();
+ let items = await page.dataTable.getRowsCount();
await dataTable.selectItem(favFile1);
await toolbar.clickMoreActionsDelete();
@@ -408,7 +408,7 @@ describe('Delete and undo delete', () => {
});
it('delete multiple files and check notification - [C280517]', async () => {
- let items = await page.dataTable.countRows();
+ let items = await page.dataTable.getRowsCount();
await dataTable.selectMultipleItems([favFile2, favFile3]);
await toolbar.clickMoreActionsDelete();
@@ -425,7 +425,7 @@ describe('Delete and undo delete', () => {
});
it('delete a folder with content - [C280518]', async () => {
- let items = await page.dataTable.countRows();
+ let items = await page.dataTable.getRowsCount();
await dataTable.selectItem(favFolder1);
await toolbar.clickMoreActionsDelete();
expect(await dataTable.isItemPresent(favFolder1)).toBe(false, 'Item was not removed from list');
@@ -464,7 +464,7 @@ describe('Delete and undo delete', () => {
});
it('undo delete of file - [C280524]', async () => {
- const items = await page.dataTable.countRows();
+ const items = await page.dataTable.getRowsCount();
await dataTable.selectItem(favFile5);
await toolbar.clickMoreActionsDelete();
@@ -474,7 +474,7 @@ describe('Delete and undo delete', () => {
});
it('undo delete of folder with content - [C280526]', async () => {
- const items = await page.dataTable.countRows();
+ const items = await page.dataTable.getRowsCount();
await dataTable.selectItem(favFolder6);
await toolbar.clickMoreActionsDelete();
@@ -486,7 +486,7 @@ describe('Delete and undo delete', () => {
});
it('undo delete of multiple files - [C280525]', async () => {
- const items = await page.dataTable.countRows();
+ const items = await page.dataTable.getRowsCount();
await dataTable.selectMultipleItems([favFile6, favFile7]);
await toolbar.clickMoreActionsDelete();
diff --git a/e2e/suites/actions/download.test.ts b/e2e/suites/actions/download.test.ts
index 02c694f31..5f1f31fc9 100755
--- a/e2e/suites/actions/download.test.ts
+++ b/e2e/suites/actions/download.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/actions/edit-folder.test.ts b/e2e/suites/actions/edit-folder.test.ts
index 780c6ca66..afa31c4ce 100755
--- a/e2e/suites/actions/edit-folder.test.ts
+++ b/e2e/suites/actions/edit-folder.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/actions/edit-offline.test.ts b/e2e/suites/actions/edit-offline.test.ts
index 30ee08b68..80f3dd45e 100755
--- a/e2e/suites/actions/edit-offline.test.ts
+++ b/e2e/suites/actions/edit-offline.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -55,29 +55,14 @@ describe('Edit offline', () => {
const { dataTable, toolbar } = page;
const { searchInput } = page.header;
- beforeAll(async (done) => {
+ beforeAll(async () => {
await apis.admin.people.createUser({ username });
-
- parentPFId = (await apis.user.nodes.createFolder(parentPF)).entry.id;
- parentSFId = (await apis.user.nodes.createFolder(parentSF)).entry.id;
- parentRFId = (await apis.user.nodes.createFolder(parentRF)).entry.id;
- parentFavId = (await apis.user.nodes.createFolder(parentFav)).entry.id;
- parentSearchId = (await apis.user.nodes.createFolder(parentSearch)).entry.id;
-
- done();
- });
-
- afterAll(async (done) => {
- await apis.user.nodes.deleteNodeById(parentPFId);
- await apis.user.nodes.deleteNodeById(parentSFId);
- await apis.user.nodes.deleteNodeById(parentRFId);
- await apis.user.nodes.deleteNodeById(parentFavId);
- await apis.user.nodes.deleteNodeById(parentSearchId);
- done();
});
describe('on Personal Files', () => {
- beforeAll(async (done) => {
+ beforeAll(async () => {
+ parentPFId = (await apis.user.nodes.createFolder(parentPF)).entry.id;
+
file1Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentPFId, file1)).entry.id;
fileLockedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentPFId, fileLocked)).entry.id;
fileLocked2Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentPFId, fileLocked2)).entry.id;
@@ -86,18 +71,19 @@ describe('Edit offline', () => {
await apis.user.nodes.lockFile(fileLocked2Id);
await loginPage.loginWith(username);
- done();
});
- beforeEach(async (done) => {
+ beforeEach(async () => {
await page.clickPersonalFilesAndWait();
await dataTable.doubleClickOnRowByName(parentPF);
- done();
});
- afterEach(async (done) => {
+ afterEach(async () => {
await Utils.pressEscape();
- done();
+ });
+
+ afterAll(async () => {
+ await apis.user.nodes.deleteNodeById(parentPFId);
});
it('File is locked and downloaded when clicking Edit Offline - [C297538]', async () => {
@@ -117,16 +103,17 @@ describe('Edit offline', () => {
it('Cancel Editing unlocks the file - [C297540]', async () => {
await dataTable.selectItem(fileLocked);
await toolbar.clickMoreActionsCancelEditing();
- await dataTable.clearSelection();
+ await dataTable.unselectItem(fileLocked);
expect(await apis.user.nodes.isFileLockedWrite(fileLockedId)).toBe(false, `${fileLocked} is still locked`);
expect(await dataTable.hasLockIcon(fileLocked)).toBe(false, `${fileLocked} has a lock icon`);
});
});
- // TODO: enable tests when ACA-2173 is done
- xdescribe('on Shared Files', () => {
- beforeAll(async (done) => {
+ describe('on Shared Files', () => {
+ beforeAll(async () => {
+ parentSFId = (await apis.user.nodes.createFolder(parentSF)).entry.id;
+
file1Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentSFId, file1)).entry.id;
fileLockedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentSFId, fileLocked)).entry.id;
fileLocked2Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentSFId, fileLocked2)).entry.id;
@@ -138,20 +125,21 @@ describe('Edit offline', () => {
await apis.user.shared.waitForApi({ expect: 3 });
await loginPage.loginWith(username);
- done();
});
- beforeEach(async (done) => {
+ afterAll(async () => {
+ await apis.user.nodes.deleteNodeById(parentSFId);
+ });
+
+ beforeEach(async () => {
await page.clickSharedFilesAndWait();
- done();
});
- afterEach(async (done) => {
+ afterEach(async () => {
await Utils.pressEscape();
- done();
});
- xit('File is locked and downloaded when clicking Edit Offline - [C306950]', async () => {
+ it('File is locked and downloaded when clicking Edit Offline - [C306950]', async () => {
await dataTable.selectItem(file1, parentSF);
await toolbar.clickMoreActionsEditOffline();
@@ -159,16 +147,16 @@ describe('Edit offline', () => {
expect(await apis.user.nodes.isFileLockedWrite(file1Id)).toBe(true, `${file1} is not locked`);
});
- xit('Lock information is displayed - [C306951]', async () => {
+ it('Lock information is displayed - [C306951]', async () => {
expect(await dataTable.isItemPresent(fileLocked2, parentSF)).toBe(true, `${fileLocked2} is not displayed`);
expect(await dataTable.hasLockIcon(fileLocked2, parentSF)).toBe(true, `${fileLocked2} does not have a lock icon`);
expect(await dataTable.getLockOwner(fileLocked2, parentSF)).toContain(username, `${fileLocked2} does not have correct lock owner info`);
});
- xit('Cancel Editing unlocks the file - [C306952]', async () => {
+ it('Cancel Editing unlocks the file - [C306952]', async () => {
await dataTable.selectItem(fileLocked);
await toolbar.clickMoreActionsCancelEditing();
- await dataTable.clearSelection();
+ await dataTable.unselectItem(fileLocked);
expect(await apis.user.nodes.isFileLockedWrite(fileLockedId)).toBe(false, `${fileLocked} is still locked`);
expect(await dataTable.hasLockIcon(fileLocked, parentSF)).toBe(false, `${fileLocked} has a lock icon`);
@@ -176,7 +164,11 @@ describe('Edit offline', () => {
});
describe('on Recent Files', () => {
- beforeAll(async (done) => {
+ beforeAll(async () => {
+ parentRFId = (await apis.user.nodes.createFolder(parentRF)).entry.id;
+
+ await apis.user.search.waitForApi(username, { expect: 0 });
+
file1Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentRFId, file1)).entry.id;
fileLockedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentRFId, fileLocked)).entry.id;
fileLocked2Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentRFId, fileLocked2)).entry.id;
@@ -184,20 +176,21 @@ describe('Edit offline', () => {
await apis.user.nodes.lockFile(fileLockedId);
await apis.user.nodes.lockFile(fileLocked2Id);
- await apis.user.search.waitForApi(username, { expect: 6 });
+ await apis.user.search.waitForApi(username, { expect: 3 });
await loginPage.loginWith(username);
- done();
});
- beforeEach(async (done) => {
+ afterAll(async () => {
+ await apis.user.nodes.deleteNodeById(parentRFId);
+ });
+
+ beforeEach(async () => {
await page.clickRecentFilesAndWait();
- done();
});
- afterEach(async (done) => {
+ afterEach(async () => {
await Utils.pressEscape();
- done();
});
it('File is locked and downloaded when clicking Edit Offline - [C297541]', async () => {
@@ -217,16 +210,17 @@ describe('Edit offline', () => {
it('Cancel Editing unlocks the file - [C297543]', async () => {
await dataTable.selectItem(fileLocked, parentRF);
await toolbar.clickMoreActionsCancelEditing();
- await dataTable.clearSelection();
+ await dataTable.unselectItem(fileLocked, parentRF);
expect(await apis.user.nodes.isFileLockedWrite(fileLockedId)).toBe(false, `${fileLocked} is still locked`);
expect(await dataTable.hasLockIcon(fileLocked, parentRF)).toBe(false, `${fileLocked} has a lock icon`);
});
});
- // TODO: enable tests when ACA-2174 is done
- xdescribe('on Favorite Files', () => {
- beforeAll(async (done) => {
+ describe('on Favorite Files', () => {
+ beforeAll(async () => {
+ parentFavId = (await apis.user.nodes.createFolder(parentFav)).entry.id;
+
file1Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentFavId, file1)).entry.id;
fileLockedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentFavId, fileLocked)).entry.id;
fileLocked2Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentFavId, fileLocked2)).entry.id;
@@ -238,19 +232,21 @@ describe('Edit offline', () => {
await apis.user.favorites.waitForApi({ expect: 3 });
await loginPage.loginWith(username);
- done();
});
- beforeEach(async (done) => {
+ afterAll(async () => {
+ await apis.user.nodes.deleteNodeById(parentFavId);
+ });
+
+ beforeEach(async () => {
await page.clickFavoritesAndWait();
- done();
});
- afterEach(async (done) => {
+ afterEach(async () => {
await Utils.pressEscape();
- done();
});
+ // TODO: raise REPO issue: permissions not returned in /people/${personId}/favorites api
xit('File is locked and downloaded when clicking Edit Offline - [C306956]', async () => {
await dataTable.selectItem(file1);
await toolbar.clickMoreActionsEditOffline();
@@ -259,16 +255,16 @@ describe('Edit offline', () => {
expect(await apis.user.nodes.isFileLockedWrite(file1Id)).toBe(true, `${file1} is not locked`);
});
- xit('Lock information is displayed - [C306957]', async () => {
+ it('Lock information is displayed - [C306957]', async () => {
expect(await dataTable.isItemPresent(fileLocked2)).toBe(true, `${fileLocked2} is not displayed`);
expect(await dataTable.hasLockIcon(fileLocked2)).toBe(true, `${fileLocked2} does not have a lock icon`);
expect(await dataTable.getLockOwner(fileLocked2)).toContain(username, `${fileLocked2} does not have correct lock owner info`);
});
- xit('Cancel Editing unlocks the file - [C306958]', async () => {
+ it('Cancel Editing unlocks the file - [C306958]', async () => {
await dataTable.selectItem(fileLocked);
await toolbar.clickMoreActionsCancelEditing();
- await dataTable.clearSelection();
+ await dataTable.unselectItem(fileLocked);
expect(await apis.user.nodes.isFileLockedWrite(fileLockedId)).toBe(false, `${fileLocked} is still locked`);
expect(await dataTable.hasLockIcon(fileLocked)).toBe(false, `${fileLocked} has a lock icon`);
@@ -276,7 +272,9 @@ describe('Edit offline', () => {
});
describe('on Search Results', () => {
- beforeAll(async (done) => {
+ beforeAll(async () => {
+ parentSearchId = (await apis.user.nodes.createFolder(parentSearch)).entry.id;
+
fileSearch1Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentSearchId, fileSearch1)).entry.id;
fileSearchLockedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentSearchId, fileSearchLocked)).entry.id;
fileSearchLocked2Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentSearchId, fileSearchLocked2)).entry.id;
@@ -287,21 +285,21 @@ describe('Edit offline', () => {
await apis.user.search.waitForNodes('file-search', { expect: 3 });
await loginPage.loginWith(username);
- done();
});
- beforeEach(async (done) => {
+ afterAll(async () => {
+ await apis.user.nodes.deleteNodeById(parentSearchId);
+ });
+
+ beforeEach(async () => {
await page.clickPersonalFilesAndWait();
await searchInput.clickSearchButton();
- await searchInput.checkFilesAndFolders();
await searchInput.searchFor('file-search');
await dataTable.waitForBody();
- done();
});
- afterEach(async (done) => {
+ afterEach(async () => {
await Utils.pressEscape();
- done();
});
it('File is locked and downloaded when clicking Edit Offline - [C306953]', async () => {
@@ -312,21 +310,20 @@ describe('Edit offline', () => {
expect(await apis.user.nodes.isFileLockedWrite(fileSearch1Id)).toBe(true, `${fileSearch1} is not locked`);
});
- // TODO: enable when ACA-2314 is fixed
- xit('Lock information is displayed - [C306954]', async () => {
+ it('Lock information is displayed - [C306954]', async () => {
expect(await dataTable.isItemPresent(fileSearchLocked2, parentSearch)).toBe(true, `${fileSearchLocked2} is not displayed`);
expect(await dataTable.hasLockIcon(fileSearchLocked2, parentSearch)).toBe(true, `${fileSearchLocked2} does not have a lock icon`);
- expect(await dataTable.getLockOwner(fileSearchLocked2, parentSearch)).toContain(username, `${fileSearchLocked2} does not have correct lock owner info`);
+ // TODO: enable when ACA-2314 is fixed
+ // expect(await dataTable.getLockOwner(fileSearchLocked2, parentSearch)).toContain(username, `${fileSearchLocked2} does not have correct lock owner info`);
});
it('Cancel Editing unlocks the file - [C306955]', async () => {
await dataTable.selectItem(fileSearchLocked);
await toolbar.clickMoreActionsCancelEditing();
- await dataTable.clearSelection();
+ await dataTable.unselectItem(fileSearchLocked);
expect(await apis.user.nodes.isFileLockedWrite(fileSearchLockedId)).toBe(false, `${fileSearchLocked} is still locked`);
- // TODO: enable when ACA-2314 is fixed
- // expect(await dataTable.hasLockIcon(fileSearchLocked, parentSearch)).toBe(false, `${fileSearchLocked} has a lock icon`);
+ expect(await dataTable.hasLockIcon(fileSearchLocked, parentSearch)).toBe(false, `${fileSearchLocked} has a lock icon`);
});
});
});
diff --git a/e2e/suites/actions/library-actions.test.ts b/e2e/suites/actions/library-actions.test.ts
index 0bf77ad99..f243c770f 100755
--- a/e2e/suites/actions/library-actions.test.ts
+++ b/e2e/suites/actions/library-actions.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/actions/mark-favorite.test.ts b/e2e/suites/actions/mark-favorite.test.ts
index 0130dd47b..3cf1eebcb 100644
--- a/e2e/suites/actions/mark-favorite.test.ts
+++ b/e2e/suites/actions/mark-favorite.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/actions/new-menu.test.ts b/e2e/suites/actions/new-menu.test.ts
index e5b1349cc..59627e4a0 100755
--- a/e2e/suites/actions/new-menu.test.ts
+++ b/e2e/suites/actions/new-menu.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -42,7 +42,7 @@ describe('New menu', () => {
const loginPage = new LoginPage();
const page = new BrowsingPage();
const { dataTable, sidenav } = page;
-
+ const { menu } = sidenav;
beforeAll(async (done) => {
await apis.admin.people.createUser({ username });
@@ -66,107 +66,90 @@ describe('New menu', () => {
done();
});
- it('has correct actions - [C286524]', async () => {
+ it('Actions in Personal Files - [C286524]', async () => {
await page.clickPersonalFiles();
await sidenav.openNewMenu();
- expect(await sidenav.menu.isCreateFolderPresent()).toBe(true, 'Create Folder option not present');
- expect(await sidenav.menu.isCreateLibraryPresent()).toBe(true, 'Create Library option not present');
- expect(await sidenav.menu.isUploadFilePresent()).toBe(true, 'Upload File option not present');
- expect(await sidenav.menu.isUploadFolderPresent()).toBe(true, 'Upload Folder option not present');
+ expect(await menu.isUploadFileEnabled()).toBe(true, 'Upload File option not enabled');
+ expect(await menu.isUploadFolderEnabled()).toBe(true, 'Upload Folder option not enabled');
- expect(await sidenav.menu.isCreateLibraryEnabled()).toBe(true, 'Create Library is not enabled');
+ expect(await menu.isCreateFolderEnabled()).toBe(true, 'Create Folder option not enabled');
+ expect(await menu.isCreateLibraryEnabled()).toBe(true, 'Create Library option not enabled');
+
+ expect(await menu.isCreateFileFromTemplateEnabled()).toBe(true, 'Create file from template is not enabled');
+ expect(await menu.isCreateFolderFromTemplateEnabled()).toBe(true, 'Create folder from template is not enabled');
});
- it('Create folder is enabled when having enough permissions - Personal Files - [C216339]', async () => {
- await page.clickPersonalFiles();
- await page.sidenav.openNewMenu();
-
- expect(await sidenav.menu.isCreateFolderEnabled()).toBe(true, 'Create folder is not enabled');
- });
-
- it('Create folder is enabled when having enough permissions - File Libraries - [C280393]', async () => {
- await page.goToMyLibrariesAndWait();
- await page.dataTable.doubleClickOnRowByName(siteUser);
- await page.sidenav.openNewMenu();
- expect(await sidenav.menu.isCreateFolderEnabled()).toBe(true, 'Create folder is not enabled');
- });
-
- it('Create folder is disabled when not enough permissions - [C280397]', async () => {
- await page.goToMyLibrariesAndWait();
- await dataTable.doubleClickOnRowByName(siteAdmin);
- await sidenav.openNewMenu();
- expect(await sidenav.menu.isCreateFolderEnabled()).toBe(false, 'Create folder is not disabled');
- });
-
- it('Upload File option is enabled when having enough permissions - on Personal Files - [C217145]', async () => {
- await page.clickPersonalFiles();
- await sidenav.openNewMenu();
-
- expect(await sidenav.menu.isUploadFileEnabled()).toBe(true, 'Upload file is not enabled in Personal Files');
- });
-
- it('Upload File option is enabled when having permissions - on File Libraries - [C290142]', async () => {
+ it('Actions in File Libraries - user with enough permissions - [C280393]', async () => {
await page.goToMyLibrariesAndWait();
await dataTable.doubleClickOnRowByName(siteUser);
await sidenav.openNewMenu();
- expect(await sidenav.menu.isUploadFileEnabled()).toBe(true, 'Upload file is not enabled in File Libraries');
+ expect(await menu.isUploadFileEnabled()).toBe(true, 'Upload file is not enabled in File Libraries');
+ expect(await menu.isUploadFolderEnabled()).toBe(true, 'Upload folder is not enabled in File Libraries');
+
+ expect(await menu.isCreateFolderEnabled()).toBe(true, 'Create folder is not enabled');
+ expect(await menu.isCreateLibraryEnabled()).toBe(true, 'Create Library option not enabled');
+
+ expect(await menu.isCreateFileFromTemplateEnabled()).toBe(true, 'Create file from template is not enabled');
+ expect(await menu.isCreateFolderFromTemplateEnabled()).toBe(true, 'Create folder from template is not enabled');
});
- it('Upload File option is disabled when user cannot create content in that location - [C217146]', async () => {
+ it('Actions in File Libraries - user without enough permissions - [C280397]', async () => {
await page.goToMyLibrariesAndWait();
await dataTable.doubleClickOnRowByName(siteAdmin);
await sidenav.openNewMenu();
- expect(await sidenav.menu.isUploadFileEnabled()).toBe(false, 'Upload file is not disabled');
+ expect(await menu.isUploadFileEnabled()).toBe(false, 'Upload file is not disabled');
+ expect(await menu.isUploadFolderEnabled()).toBe(false, 'Upload folder is not disabled');
+
+ expect(await menu.isCreateFolderEnabled()).toBe(false, 'Create folder is not disabled');
+ expect(await menu.isCreateLibraryEnabled()).toBe(true, 'Create Library option not enabled');
+
+ expect(await menu.isCreateFileFromTemplateEnabled()).toBe(false, 'Create file from template is not disabled');
+ expect(await menu.isCreateFolderFromTemplateEnabled()).toBe(false, 'Create folder from template is not disabled');
});
- it('Upload Folder option is enabled when having enough permissions - on Personal Files - [C213196]', async () => {
+ it('Enabled actions tooltips - [C216342]', async () => {
await page.clickPersonalFiles();
await sidenav.openNewMenu();
- expect(await sidenav.menu.isUploadFolderEnabled()).toBe(true, 'Upload folder is not enabled in Personal Files');
- });
+ let tooltip: string;
- it('Upload Folder option is enabled when having permissions - on File Libraries - [C290146]', async () => {
- await page.goToMyLibrariesAndWait();
- await dataTable.doubleClickOnRowByName(siteUser);
- await sidenav.openNewMenu();
+ tooltip = await menu.getTooltipForUploadFile();
+ expect(tooltip).toContain('Select files to upload');
- expect(await sidenav.menu.isUploadFolderEnabled()).toBe(true, 'Upload folder is not enabled in File Libraries');
- });
+ tooltip = await menu.getTooltipForUploadFolder();
+ expect(tooltip).toContain('Select folders to upload');
- it('Upload Folder option is disabled when user cannot create content in that location - [C213193]', async () => {
- await page.goToMyLibrariesAndWait();
- await dataTable.doubleClickOnRowByName(siteAdmin);
- await sidenav.openNewMenu();
-
- expect(await sidenav.menu.isUploadFolderEnabled()).toBe(false, 'Upload folder is not disabled');
- });
-
- it('Create folder enabled button tooltip - [C216342]', async () => {
- await page.clickPersonalFiles();
- await sidenav.openNewMenu();
-
- const tooltip = await sidenav.menu.getItemTooltip('Create Folder');
+ tooltip = await menu.getTooltipForCreateFolder();
expect(tooltip).toContain('Create new folder');
+
+ tooltip = await menu.getTooltipForCreateLibrary();
+ expect(tooltip).toContain('Create a new File Library');
+
+ tooltip = await menu.getTooltipForCreateFileFromTemplate();
+ expect(tooltip).toContain('Create file from template');
});
- it('Create folder disabled button tooltip - [C280398]', async () => {
+ it('Disabled actions tooltips - [C280398]', async () => {
await page.goToMyLibrariesAndWait();
await dataTable.doubleClickOnRowByName(siteAdmin);
await sidenav.openNewMenu();
- const tooltip = await sidenav.menu.getItemTooltip('Create Folder');
- expect(tooltip).toContain(`Folders cannot be created whilst viewing the current items`);
- });
+ let tooltip: string;
- it('Create Library button tooltip - [C286526]', async () => {
- await sidenav.openNewMenu();
+ tooltip = await menu.getTooltipForUploadFile();
+ expect(tooltip).toContain('Files cannot be uploaded whilst viewing the current items');
- const tooltip = await sidenav.menu.getItemTooltip('Create Library');
- expect(tooltip).toContain('Create a new File Library');
+ tooltip = await menu.getTooltipForUploadFolder();
+ expect(tooltip).toContain('Folders cannot be uploaded whilst viewing the current items');
+
+ tooltip = await menu.getTooltipForCreateFolder();
+ expect(tooltip).toContain('Folders cannot be created whilst viewing the current items');
+
+ tooltip = await menu.getTooltipForCreateFileFromTemplate();
+ expect(tooltip).toContain('Files cannot be created whilst viewing the current items');
});
});
diff --git a/e2e/suites/actions/permanently-delete.test.ts b/e2e/suites/actions/permanently-delete.test.ts
index d028fc2ad..fdc212437 100755
--- a/e2e/suites/actions/permanently-delete.test.ts
+++ b/e2e/suites/actions/permanently-delete.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/actions/restore.test.ts b/e2e/suites/actions/restore.test.ts
index d5783f769..29cdb4b9e 100755
--- a/e2e/suites/actions/restore.test.ts
+++ b/e2e/suites/actions/restore.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/actions/share-file.test.ts b/e2e/suites/actions/share-file.test.ts
index 4f3522d55..8ff0db5da 100755
--- a/e2e/suites/actions/share-file.test.ts
+++ b/e2e/suites/actions/share-file.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -48,7 +48,7 @@ describe('Share a file', () => {
const viewer = new Viewer();
const page = new BrowsingPage();
const { dataTable, toolbar } = page;
- const shareLinkPreUrl = "/#/preview/s/";
+ const shareLinkPreUrl = `${browser.baseUrl}/#/preview/s/`;
const apis = {
admin: new RepoClient(),
@@ -924,7 +924,7 @@ describe('Share a file', () => {
it('Expire date is displayed correctly - [C286671]', async () => {
await dataTable.selectItem(file6);
- await toolbar.clickShare();
+ await toolbar.clickSharedLinkSettings();
await shareDialog.waitForDialogToOpen();
const expireProperty = await apis.user.nodes.getSharedExpiryDate(file6Id);
@@ -935,7 +935,7 @@ describe('Share a file', () => {
it('Disable the share link expiration - [C286672]', async () => {
await dataTable.selectItem(file7);
- await toolbar.clickShare();
+ await toolbar.clickSharedLinkSettings();
await shareDialog.waitForDialogToOpen();
expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked');
@@ -959,7 +959,7 @@ describe('Share a file', () => {
await page.dataTable.clearSelection();
await dataTable.selectItem(file8);
- await toolbar.clickShare();
+ await toolbar.clickSharedLinkSettings();
await shareDialog.waitForDialogToOpen();
const url2 = await shareDialog.getLinkUrl();
diff --git a/e2e/suites/actions/unshare-file-search-results.test.ts b/e2e/suites/actions/unshare-file-search-results.test.ts
index 5b494b835..acf2ea55f 100755
--- a/e2e/suites/actions/unshare-file-search-results.test.ts
+++ b/e2e/suites/actions/unshare-file-search-results.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/actions/unshare-file.test.ts b/e2e/suites/actions/unshare-file.test.ts
index e3b802962..aee35f584 100755
--- a/e2e/suites/actions/unshare-file.test.ts
+++ b/e2e/suites/actions/unshare-file.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -479,9 +479,6 @@ describe('Unshare a file', () => {
expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog open');
expect(await apis.user.nodes.isFileShared(file2Id)).toBe(false, `${file2} is shared`);
- // TODO: disable check cause api is slow to update
- // expect(await dataTable.isItemPresent(file2)).toBe(false, `${file2} is in the Shared files list`);
-
await browser.get(url);
expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open');
expect(await viewer.getFileTitle()).not.toEqual(file2);
@@ -519,9 +516,6 @@ describe('Unshare a file', () => {
expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog open');
expect(await apis.user.nodes.isFileShared(file4Id)).toBe(false, `${file4} is shared`);
- // TODO: disable check cause api is slow to update
- // expect(await dataTable.isItemPresent(file4)).toBe(false, `${file4} is in the Shared files list`);
-
await browser.get(url);
expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open');
expect(await viewer.getFileTitle()).not.toEqual(file4);
@@ -579,9 +573,7 @@ describe('Unshare a file', () => {
it('Unshare dialog UI - [C286694]', async () => {
await dataTable.selectItem(file1);
- // TODO: remove workaround for favorites
- // await toolbar.clickSharedLinkSettings();
- await toolbar.clickShare();
+ await toolbar.clickSharedLinkSettings();
await shareDialog.waitForDialogToOpen();
expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle not checked');
@@ -596,9 +588,7 @@ describe('Unshare a file', () => {
it('Unshare a file - [C286695]', async () => {
await dataTable.selectItem(file2);
- // TODO: remove workaround for favorites
- // await toolbar.clickSharedLinkSettings();
- await toolbar.clickShare();
+ await toolbar.clickSharedLinkSettings();
await shareDialog.waitForDialogToOpen();
const url = await shareDialog.getLinkUrl();
await shareDialog.clickShareToggle();
@@ -618,9 +608,7 @@ describe('Unshare a file', () => {
it('Cancel the Unshare action - [C286696]', async () => {
await dataTable.selectItem(file3);
- // TODO: remove workaround for favorites
- // await toolbar.clickSharedLinkSettings();
- await toolbar.clickShare();
+ await toolbar.clickSharedLinkSettings();
await shareDialog.waitForDialogToOpen();
const urlBefore = await shareDialog.getLinkUrl();
@@ -637,9 +625,7 @@ describe('Unshare a file', () => {
it('Unshare a file from the context menu - [C286698]', async () => {
await dataTable.rightClickOnItem(file4);
- // TODO: remove workaround for favorites
- // await toolbar.clickSharedLinkSettings();
- await contextMenu.clickShare();
+ await contextMenu.clickSharedLinkSettings();
await shareDialog.waitForDialogToOpen();
const url = await shareDialog.getLinkUrl();
await shareDialog.clickShareToggle();
@@ -780,9 +766,7 @@ describe('Unshare a file', () => {
it('on Favorites - file shared by other user - [C286697]', async () => {
await page.clickFavoritesAndWait();
await dataTable.selectItem(file1Fav);
- // TODO: remove workaround for favorites
- // await toolbar.clickSharedLinkSettings();
- await toolbar.clickShare();
+ await toolbar.clickSharedLinkSettings();
await shareDialog.waitForDialogToOpen();
expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle disabled for consumer');
@@ -797,9 +781,7 @@ describe('Unshare a file', () => {
it('on Favorites - file shared by the user - [C286703]', async () => {
await page.clickFavoritesAndWait();
await dataTable.selectItem(file2Fav);
- // TODO: remove workaround for favorites
- // await toolbar.clickSharedLinkSettings();
- await toolbar.clickShare();
+ await toolbar.clickSharedLinkSettings();
await shareDialog.waitForDialogToOpen();
expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle disabled for consumer');
diff --git a/e2e/suites/actions/upload-file.test.ts b/e2e/suites/actions/upload-file.test.ts
index b99a54c43..b9eb37dfb 100755
--- a/e2e/suites/actions/upload-file.test.ts
+++ b/e2e/suites/actions/upload-file.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -63,5 +63,7 @@ describe('Upload files', () => {
await dataTable.doubleClickOnRowByName(folder1);
await page.sidenav.openNewMenu();
await page.sidenav.menu.uploadFile().sendKeys(`${__dirname}/create-folder.test.ts`);
+
+ expect(await dataTable.isItemPresent('create-folder.test.ts')).toBe(true, 'file not uploaded');
});
});
diff --git a/e2e/suites/actions/upload-new-version.test.ts b/e2e/suites/actions/upload-new-version.test.ts
index 3a3594679..715a388e0 100755
--- a/e2e/suites/actions/upload-new-version.test.ts
+++ b/e2e/suites/actions/upload-new-version.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/application/general.test.ts b/e2e/suites/application/general.test.ts
index 393a88aab..891f5d4b3 100644
--- a/e2e/suites/application/general.test.ts
+++ b/e2e/suites/application/general.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/application/page-titles.test.ts b/e2e/suites/application/page-titles.test.ts
index dbcb51f52..26f48694c 100755
--- a/e2e/suites/application/page-titles.test.ts
+++ b/e2e/suites/application/page-titles.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/authentication/login.test.ts b/e2e/suites/authentication/login.test.ts
index ae7123ebb..551427407 100755
--- a/e2e/suites/authentication/login.test.ts
+++ b/e2e/suites/authentication/login.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/authentication/logout.test.ts b/e2e/suites/authentication/logout.test.ts
index b6926ea49..ed7f2158f 100755
--- a/e2e/suites/authentication/logout.test.ts
+++ b/e2e/suites/authentication/logout.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/extensions/ext-context-submenus.test.ts b/e2e/suites/extensions/ext-context-submenus.test.ts
index e7a38a41e..9f3f8582e 100644
--- a/e2e/suites/extensions/ext-context-submenus.test.ts
+++ b/e2e/suites/extensions/ext-context-submenus.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/extensions/ext-document-list.test.ts b/e2e/suites/extensions/ext-document-list.test.ts
index 554c5c19f..adeaa446b 100644
--- a/e2e/suites/extensions/ext-document-list.test.ts
+++ b/e2e/suites/extensions/ext-document-list.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -38,10 +38,6 @@ describe('Extensions - DocumentList presets', () => {
id: 'app.files.name',
label: 'Name'
},
- {
- id: 'app.files.thumbnail',
- label: 'Thumbnail'
- },
{
id: 'app.files.size',
label: 'Size',
diff --git a/e2e/suites/extensions/ext-header.test.ts b/e2e/suites/extensions/ext-header.test.ts
index 8e9b5b76d..7b3179071 100755
--- a/e2e/suites/extensions/ext-header.test.ts
+++ b/e2e/suites/extensions/ext-header.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/extensions/ext-info-drawer.test.ts b/e2e/suites/extensions/ext-info-drawer.test.ts
index a6a24b7d5..6b51e37ff 100755
--- a/e2e/suites/extensions/ext-info-drawer.test.ts
+++ b/e2e/suites/extensions/ext-info-drawer.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/extensions/ext-metadata.test.ts b/e2e/suites/extensions/ext-metadata.test.ts
index f292b1b43..5bcee0151 100644
--- a/e2e/suites/extensions/ext-metadata.test.ts
+++ b/e2e/suites/extensions/ext-metadata.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/extensions/ext-viewer.test.ts b/e2e/suites/extensions/ext-viewer.test.ts
index 80d7275a4..97d66e580 100755
--- a/e2e/suites/extensions/ext-viewer.test.ts
+++ b/e2e/suites/extensions/ext-viewer.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/info-drawer/comments.test.ts b/e2e/suites/info-drawer/comments.test.ts
index b7a76fe6d..936c4d2d7 100755
--- a/e2e/suites/info-drawer/comments.test.ts
+++ b/e2e/suites/info-drawer/comments.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -75,8 +75,6 @@ describe('Comments', () => {
fileWith1CommentId = (await apis.user.nodes.createFile(fileWith1Comment, parentId)).entry.id;
fileWith2CommentsId = (await apis.user.nodes.createFile(fileWith2Comments, parentId)).entry.id;
- commentFile1Entry = (await apis.user.comments.addComment(fileWith1CommentId, 'this is my comment')).entry;
-
comment1File2Entry = (await apis.user.comments.addComment(fileWith2CommentsId, 'first comment')).entry;
comment2File2Entry = (await apis.user.comments.addComment(fileWith2CommentsId, 'second comment')).entry;
@@ -96,6 +94,11 @@ describe('Comments', () => {
done();
});
+ afterEach(async (done) => {
+ await page.clickPersonalFiles();
+ done();
+ });
+
describe('from Personal Files', () => {
beforeEach(async (done) => {
await page.clickPersonalFilesAndWait();
@@ -115,23 +118,6 @@ describe('Comments', () => {
expect(await commentsTab.isAddCommentButtonEnabled()).toBe(false, 'Add comment button not disabled');
});
- it('Comment info display - [C280582]', async () => {
- await dataTable.selectItem(fileWith1Comment);
- await page.toolbar.clickViewDetails();
- await infoDrawer.waitForInfoDrawerToOpen();
- await infoDrawer.clickCommentsTab();
-
- expect(await commentsTab.getCommentsTabHeaderText()).toBe('Comments (1)');
- expect(await commentsTab.isCommentTextAreaDisplayed()).toBe(true, 'Comment field not present');
- expect(await commentsTab.isAddCommentButtonEnabled()).toBe(false, 'Add comment button not disabled');
-
- expect(await commentsTab.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`);
- expect(await commentsTab.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text');
- expect(await commentsTab.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user');
- expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time');
- expect(await commentsTab.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed');
- });
-
it('Comments are displayed ordered by created date in descending order - [C280583]', async () => {
await dataTable.selectItem(fileWith2Comments);
await page.toolbar.clickViewDetails();
@@ -219,29 +205,6 @@ describe('Comments', () => {
done();
});
- afterEach(async (done) => {
- await page.clickPersonalFiles();
- done();
- });
-
- it('Comment info display - [C299196]', async () => {
- await dataTable.selectItem(fileWith1Comment);
- await page.toolbar.clickViewDetails();
- await infoDrawer.waitForInfoDrawerToOpen();
- await infoDrawer.clickCommentsTab();
-
- expect(await commentsTab.getCommentsTabHeaderText()).toBe('Comments (1)');
- expect(await commentsTab.isCommentTextAreaDisplayed()).toBe(true, 'Comment field not present');
- expect(await commentsTab.isAddCommentButtonEnabled()).toBe(false, 'Add comment button not disabled');
-
- expect(await commentsTab.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`);
- expect(await commentsTab.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text');
- expect(await commentsTab.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user');
- // ACA-2348 expect broken because of parallel test suites
- // expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time');
- expect(await commentsTab.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed');
- });
-
it('Comments are displayed ordered by created date in descending order - [C299197]', async () => {
await dataTable.selectItem(fileWith2Comments);
await page.toolbar.clickViewDetails();
@@ -303,28 +266,6 @@ describe('Comments', () => {
done();
});
- afterEach(async (done) => {
- await page.clickPersonalFiles();
- done();
- });
-
- it('Comment info display - [C299188]', async () => {
- await dataTable.selectItem(fileWith1Comment);
- await page.toolbar.clickViewDetails();
- await infoDrawer.waitForInfoDrawerToOpen();
- await infoDrawer.clickCommentsTab();
-
- expect(await commentsTab.getCommentsTabHeaderText()).toBe('Comments (1)');
- expect(await commentsTab.isCommentTextAreaDisplayed()).toBe(true, 'Comment field not present');
- expect(await commentsTab.isAddCommentButtonEnabled()).toBe(false, 'Add comment button not disabled');
-
- expect(await commentsTab.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`);
- expect(await commentsTab.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text');
- expect(await commentsTab.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user');
- expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time');
- expect(await commentsTab.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed');
- });
-
it('Comments are displayed ordered by created date in descending order - [C299189]', async () => {
await dataTable.selectItem(fileWith2Comments);
await page.toolbar.clickViewDetails();
@@ -371,28 +312,6 @@ describe('Comments', () => {
done();
});
- afterEach(async (done) => {
- await page.clickPersonalFiles();
- done();
- });
-
- it('Comment info display - [C299192]', async () => {
- await dataTable.selectItem(fileWith1Comment);
- await page.toolbar.clickViewDetails();
- await infoDrawer.waitForInfoDrawerToOpen();
- await infoDrawer.clickCommentsTab();
-
- expect(await commentsTab.getCommentsTabHeaderText()).toBe('Comments (1)');
- expect(await commentsTab.isCommentTextAreaDisplayed()).toBe(true, 'Comment field not present');
- expect(await commentsTab.isAddCommentButtonEnabled()).toBe(false, 'Add comment button not disabled');
-
- expect(await commentsTab.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`);
- expect(await commentsTab.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text');
- expect(await commentsTab.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user');
- expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time');
- expect(await commentsTab.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed');
- });
-
it('Comments are displayed ordered by created date in descending order - [C299193]', async () => {
await dataTable.selectItem(fileWith2Comments);
await page.toolbar.clickViewDetails();
@@ -428,4 +347,94 @@ describe('Comments', () => {
});
});
+ describe('Comment info display', () => {
+ beforeAll(async (done) => {
+ commentFile1Entry = (await apis.user.comments.addComment(fileWith1CommentId, 'this is my comment')).entry;
+
+ await apis.user.favorites.waitForApi({ expect: 4 });
+ await apis.user.shared.waitForApi({ expect: 3 });
+ await apis.user.search.waitForApi(username, { expect: 7 });
+
+ done();
+ });
+
+ it('File from Personal files - [C280582]', async () => {
+ await page.clickPersonalFilesAndWait();
+ await dataTable.doubleClickOnRowByName(parent);
+
+ await dataTable.selectItem(fileWith1Comment);
+ await page.toolbar.clickViewDetails();
+ await infoDrawer.waitForInfoDrawerToOpen();
+ await infoDrawer.clickCommentsTab();
+
+ expect(await commentsTab.getCommentsTabHeaderText()).toBe('Comments (1)');
+ expect(await commentsTab.isCommentTextAreaDisplayed()).toBe(true, 'Comment field not present');
+ expect(await commentsTab.isAddCommentButtonEnabled()).toBe(false, 'Add comment button not disabled');
+
+ expect(await commentsTab.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`);
+ expect(await commentsTab.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text');
+ expect(await commentsTab.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user');
+ expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time');
+ expect(await commentsTab.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed');
+ });
+
+ it('File from Favorites - [C299196]', async () => {
+ await page.clickFavoritesAndWait();
+
+ await dataTable.selectItem(fileWith1Comment);
+ await page.toolbar.clickViewDetails();
+ await infoDrawer.waitForInfoDrawerToOpen();
+ await infoDrawer.clickCommentsTab();
+
+ expect(await commentsTab.getCommentsTabHeaderText()).toBe('Comments (1)');
+ expect(await commentsTab.isCommentTextAreaDisplayed()).toBe(true, 'Comment field not present');
+ expect(await commentsTab.isAddCommentButtonEnabled()).toBe(false, 'Add comment button not disabled');
+
+ expect(await commentsTab.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`);
+ expect(await commentsTab.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text');
+ expect(await commentsTab.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user');
+ expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time');
+ expect(await commentsTab.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed');
+ });
+
+ it('File from Shared Files - [C299188]', async () => {
+ await page.clickSharedFilesAndWait();
+
+ await dataTable.selectItem(fileWith1Comment);
+ await page.toolbar.clickViewDetails();
+ await infoDrawer.waitForInfoDrawerToOpen();
+ await infoDrawer.clickCommentsTab();
+
+ expect(await commentsTab.getCommentsTabHeaderText()).toBe('Comments (1)');
+ expect(await commentsTab.isCommentTextAreaDisplayed()).toBe(true, 'Comment field not present');
+ expect(await commentsTab.isAddCommentButtonEnabled()).toBe(false, 'Add comment button not disabled');
+
+ expect(await commentsTab.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`);
+ expect(await commentsTab.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text');
+ expect(await commentsTab.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user');
+ expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time');
+ expect(await commentsTab.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed');
+ });
+
+ it('File from Recent Files - [C299192]', async () => {
+ await page.clickRecentFilesAndWait();
+
+ await dataTable.selectItem(fileWith1Comment);
+ await page.toolbar.clickViewDetails();
+ await infoDrawer.waitForInfoDrawerToOpen();
+ await infoDrawer.clickCommentsTab();
+
+ expect(await commentsTab.getCommentsTabHeaderText()).toBe('Comments (1)');
+ expect(await commentsTab.isCommentTextAreaDisplayed()).toBe(true, 'Comment field not present');
+ expect(await commentsTab.isAddCommentButtonEnabled()).toBe(false, 'Add comment button not disabled');
+
+ expect(await commentsTab.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`);
+ expect(await commentsTab.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text');
+ expect(await commentsTab.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user');
+ expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time');
+ expect(await commentsTab.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed');
+ });
+
+ });
+
});
diff --git a/e2e/suites/info-drawer/file-folder-properties.test.ts b/e2e/suites/info-drawer/file-folder-properties.test.ts
index d26ad95b1..161ccdea8 100755
--- a/e2e/suites/info-drawer/file-folder-properties.test.ts
+++ b/e2e/suites/info-drawer/file-folder-properties.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -140,7 +140,7 @@ describe('File / Folder properties', () => {
expect(await propertiesTab.getVisiblePropertiesLabels()).toEqual(expectedPropLabels, 'Incorrect properties displayed');
expect(await propertiesTab.getVisiblePropertiesValues()).toEqual(expectedPropValues, 'Incorrect properties values');
expect(await propertiesTab.isEditPropertiesButtonEnabled()).toBe(true, 'Edit button not enabled');
- expect(await propertiesTab.isLessInfoButtonEnabled()).toBe(true, 'Less information button not enabled');
+ expect(await propertiesTab.isMoreInfoButtonEnabled()).toBe(true, 'More information button not enabled');
});
it('Folder properties - [C307106]', async () => {
@@ -174,7 +174,7 @@ describe('File / Folder properties', () => {
expect(await propertiesTab.getVisiblePropertiesLabels()).toEqual(expectedPropLabels, 'Incorrect properties displayed');
expect(await propertiesTab.getVisiblePropertiesValues()).toEqual(expectedPropValues, 'Incorrect properties values');
expect(await propertiesTab.isEditPropertiesButtonEnabled()).toBe(true, 'Edit button not enabled');
- expect(await propertiesTab.isLessInfoButtonEnabled()).toBe(true, 'Less information button not enabled');
+ expect(await propertiesTab.isMoreInfoButtonEnabled()).toBe(true, 'More information button not enabled');
});
it('Less / More information buttons - [C269004]', async () => {
@@ -182,19 +182,19 @@ describe('File / Folder properties', () => {
await page.toolbar.clickViewDetails();
await infoDrawer.waitForInfoDrawerToOpen();
- expect(await propertiesTab.isLessInfoButtonEnabled()).toBe(true, 'Less information button not enabled');
- expect(await propertiesTab.isPropertiesListExpanded()).toBe(true, 'Properties list not expanded');
-
- await propertiesTab.clickLessInformationButton();
-
- expect(await propertiesTab.isLessInfoButtonDisplayed()).toBe(false, 'Less information button displayed');
expect(await propertiesTab.isMoreInfoButtonEnabled()).toBe(true, 'More information button not enabled');
- expect(await propertiesTab.isPropertiesListExpanded()).toBe(false, 'Properties list expanded');
+ expect(await propertiesTab.isPropertiesListExpanded()).toBe(true, 'Properties list not expanded');
await propertiesTab.clickMoreInformationButton();
expect(await propertiesTab.isMoreInfoButtonDisplayed()).toBe(false, 'More information button displayed');
expect(await propertiesTab.isLessInfoButtonEnabled()).toBe(true, 'Less information button not enabled');
+ expect(await propertiesTab.isPropertiesListExpanded()).toBe(false, 'Properties list expanded');
+
+ await propertiesTab.clickLessInformationButton();
+
+ expect(await propertiesTab.isMoreInfoButtonDisplayed()).toBe(true, 'More information button not displayed');
+ expect(await propertiesTab.isLessInfoButtonEnabled()).toBe(false, 'Less information button enabled');
expect(await propertiesTab.isPropertiesListExpanded()).toBe(true, 'Properties list not expanded');
});
@@ -234,7 +234,7 @@ describe('File / Folder properties', () => {
await page.toolbar.clickViewDetails();
await infoDrawer.waitForInfoDrawerToOpen();
- await propertiesTab.clickLessInformationButton();
+ await propertiesTab.clickMoreInformationButton();
await propertiesTab.clickImagePropertiesPanel();
await propertiesTab.waitForImagePropertiesPanelToExpand();
@@ -242,7 +242,7 @@ describe('File / Folder properties', () => {
expect(await propertiesTab.getVisiblePropertiesLabels()).toEqual(expectedPropLabels, 'Incorrect properties displayed');
expect(await propertiesTab.getVisiblePropertiesValues()).toEqual(expectedPropValues, 'Incorrect properties values');
expect(await propertiesTab.isEditPropertiesButtonEnabled()).toBe(true, 'Edit button not enabled');
- expect(await propertiesTab.isMoreInfoButtonEnabled()).toBe(true, 'More information button not enabled');
+ expect(await propertiesTab.isLessInfoButtonEnabled()).toBe(true, 'Less information button not enabled');
});
});
diff --git a/e2e/suites/info-drawer/general.test.ts b/e2e/suites/info-drawer/general.test.ts
index 4465e5f55..872bc4125 100755
--- a/e2e/suites/info-drawer/general.test.ts
+++ b/e2e/suites/info-drawer/general.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/info-drawer/library-properties.test.ts b/e2e/suites/info-drawer/library-properties.test.ts
index 29518cc14..c798d96ba 100755
--- a/e2e/suites/info-drawer/library-properties.test.ts
+++ b/e2e/suites/info-drawer/library-properties.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/list-views/empty-list.test.ts b/e2e/suites/list-views/empty-list.test.ts
index 93ecafd09..e17e24134 100755
--- a/e2e/suites/list-views/empty-list.test.ts
+++ b/e2e/suites/list-views/empty-list.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -23,7 +23,7 @@
* along with Alfresco. If not, see .
*/
-import { LoginPage, BrowsingPage } from '../../pages/pages';
+import { LoginPage, BrowsingPage, SearchResultsPage } from '../../pages/pages';
import { Utils } from '../../utilities/utils';
import { RepoClient } from '../../utilities/repo-client/repo-client';
@@ -38,6 +38,7 @@ describe('Empty list views', () => {
const loginPage = new LoginPage();
const page = new BrowsingPage();
+ const searchResultsPage = new SearchResultsPage();
const { dataTable, pagination } = page;
const { searchInput } = page.header;
@@ -49,51 +50,51 @@ describe('Empty list views', () => {
it('empty Personal Files - [C280131]', async () => {
await page.clickPersonalFiles();
- expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
+ expect(await dataTable.isEmpty()).toBe(true, 'list is not empty');
expect(await dataTable.getEmptyDragAndDropText()).toContain('Drag and drop');
});
it('empty My Libraries - [C217099]', async () => {
await page.goToMyLibraries();
- expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
+ expect(await dataTable.isEmpty()).toBe(true, 'list is not empty');
expect(await dataTable.getEmptyStateTitle()).toContain(`You aren't a member of any File Libraries yet`);
expect(await dataTable.getEmptyStateSubtitle()).toContain('Join libraries to upload, view, and share files.');
});
it('empty Favorite Libraries - [C289911]', async () => {
await page.goToFavoriteLibraries();
- expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
+ expect(await dataTable.isEmpty()).toBe(true, 'list is not empty');
expect(await dataTable.getEmptyStateTitle()).toContain(`No Favorite Libraries`);
expect(await dataTable.getEmptyStateSubtitle()).toContain('Favorite a library that you want to find easily later.');
});
it('empty Shared Files - [C280132]', async () => {
await page.clickSharedFiles();
- expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
+ expect(await dataTable.isEmpty()).toBe(true, 'list is not empty');
expect(await dataTable.getEmptyStateTitle()).toContain('No shared files or folders');
expect(await dataTable.getEmptyStateSubtitle()).toContain('Items you share using the Share option are shown here.');
});
it('empty Recent Files - [C213169]', async () => {
await page.clickRecentFiles();
- expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
+ expect(await dataTable.isEmpty()).toBe(true, 'list is not empty');
expect(await dataTable.getEmptyStateTitle()).toContain('No recent files');
expect(await dataTable.getEmptyStateSubtitle()).toContain('Items you uploaded or edited in the last 30 days are shown here.');
});
it('empty Favorites - [C280133]', async () => {
await page.clickFavorites();
- expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
+ expect(await dataTable.isEmpty()).toBe(true, 'list is not empty');
expect(await dataTable.getEmptyStateTitle()).toContain('No favorite files or folders');
expect(await dataTable.getEmptyStateSubtitle()).toContain('Favorite items that you want to easily find later.');
});
it('empty Trash - [C280134]', async () => {
await page.clickTrash();
- expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
+ expect(await dataTable.isEmpty()).toBe(true, 'list is not empty');
expect(await dataTable.getEmptyStateTitle()).toContain('Trash is empty');
- expect(await dataTable.getEmptyStateText()).toContain('Items you delete are moved to the Trash.');
- expect(await dataTable.getEmptyStateText()).toContain('Empty Trash to permanently delete items.');
+ expect(await dataTable.getEmptyListText()).toContain('Items you delete are moved to the Trash.');
+ expect(await dataTable.getEmptyListText()).toContain('Empty Trash to permanently delete items.');
});
it('Favorites - pagination controls not displayed - [C280111]', async () => {
@@ -168,7 +169,6 @@ describe('Empty list views', () => {
it('Search results - pagination controls not displayed - [C290123]', async () => {
await searchInput.clickSearchButton();
- await searchInput.checkOnlyFiles();
/* cspell:disable-next-line */
await searchInput.searchFor('qwertyuiop');
await dataTable.waitForBody();
@@ -181,6 +181,15 @@ describe('Empty list views', () => {
expect(await pagination.isNextButtonPresent()).toBe(false, 'Next button is present');
});
+ it('Search filters panel is not displayed on empty Search Results page - [C279189]', async () => {
+ await searchInput.clickSearchButton();
+ /* cspell:disable-next-line */
+ await searchInput.searchFor('qwertyuiop');
+ await dataTable.waitForBody();
+
+ expect(await searchResultsPage.filters.isSearchFiltersPanelDisplayed()).toBe(false, 'Search filters panel is present');
+ });
+
it('Empty Search results - Libraries - [C290020]', async () => {
await searchInput.clickSearchButton();
await searchInput.checkLibraries();
@@ -188,7 +197,7 @@ describe('Empty list views', () => {
await searchInput.searchFor('qwertyuiop');
await dataTable.waitForBody();
- expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
+ expect(await dataTable.isEmpty()).toBe(true, 'list is not empty');
expect(await dataTable.getEmptySearchResultsText()).toContain('Your search returned 0 results');
});
@@ -199,7 +208,7 @@ describe('Empty list views', () => {
await searchInput.searchFor('qwertyuiop');
await dataTable.waitForBody();
- expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
+ expect(await dataTable.isEmpty()).toBe(true, 'list is not empty');
expect(await dataTable.getEmptySearchResultsText()).toContain('Your search returned 0 results');
});
});
diff --git a/e2e/suites/list-views/favorites.test.ts b/e2e/suites/list-views/favorites.test.ts
index dbef1d15e..f071eb3eb 100755
--- a/e2e/suites/list-views/favorites.test.ts
+++ b/e2e/suites/list-views/favorites.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -88,14 +88,14 @@ describe('Favorites', () => {
});
it('has the correct columns - [C280482]', async () => {
- const expectedColumns = [ 'Thumbnail', 'Name', 'Location', 'Size', 'Modified', 'Modified by' ];
+ const expectedColumns = [ 'Name', 'Location', 'Size', 'Modified', 'Modified by' ];
const actualColumns = await dataTable.getColumnHeadersText();
expect(actualColumns).toEqual(expectedColumns);
});
it('displays the favorite files and folders - [C213226]', async () => {
- expect(await dataTable.countRows()).toEqual(4, 'Incorrect number of items displayed');
+ expect(await dataTable.getRowsCount()).toEqual(4, 'Incorrect number of items displayed');
expect(await dataTable.isItemPresent(fileName1)).toBe(true, `${fileName1} not displayed`);
expect(await dataTable.isItemPresent(fileName2)).toBe(true, `${fileName2} not displayed`);
expect(await dataTable.isItemPresent(favFolderName)).toBe(true, `${favFolderName} not displayed`);
diff --git a/e2e/suites/list-views/file-libraries.test.ts b/e2e/suites/list-views/file-libraries.test.ts
index 7ff6e3847..3c5713ed4 100755
--- a/e2e/suites/list-views/file-libraries.test.ts
+++ b/e2e/suites/list-views/file-libraries.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -103,14 +103,14 @@ describe('File Libraries', () => {
});
it('has the correct columns - [C217095]', async () => {
- const expectedColumns = [ 'Thumbnail', 'Name', 'My Role', 'Visibility' ];
+ const expectedColumns = [ 'Name', 'My Role', 'Visibility' ];
const actualColumns = await dataTable.getColumnHeadersText();
expect(actualColumns).toEqual(expectedColumns);
});
it('User can see only the sites he is a member of - [C280501]', async () => {
- const sitesCount = await dataTable.countRows();
+ const sitesCount = await dataTable.getRowsCount();
expect(sitesCount).toEqual(10, 'Incorrect number of sites displayed');
expect(await dataTable.isItemPresent(adminSite5)).toBe(false, `${adminSite5} should not appear in the list`);
@@ -150,10 +150,8 @@ describe('File Libraries', () => {
`${siteName} (${siteId1})`,
`${siteName} (${siteId2})`
];
- const cells = await dataTable.getCellsContainingName(siteName);
- const expectedJSON = JSON.stringify(expectedSites.sort());
- const actualJSON = JSON.stringify(cells.sort());
- expect(actualJSON).toEqual(expectedJSON);
+ const actualSites = await dataTable.getCellsContainingName(siteName);
+ expect(actualSites.sort()).toEqual(expectedSites.sort());
});
it('Tooltip for sites without description - [C217096]', async () => {
@@ -174,14 +172,14 @@ describe('File Libraries', () => {
});
it('has the correct columns - [C289893]', async () => {
- const expectedColumns = [ 'Thumbnail', 'Name', 'My Role', 'Visibility' ];
+ const expectedColumns = [ 'Name', 'My Role', 'Visibility' ];
const actualColumns = await dataTable.getColumnHeadersText();
expect(actualColumns).toEqual(expectedColumns);
});
it('User can see only his favorite sites - [C289897]', async () => {
- const sitesCount = await dataTable.countRows();
+ const sitesCount = await dataTable.getRowsCount();
expect(sitesCount).toEqual(9, 'Incorrect number of sites displayed');
expect(await dataTable.isItemPresent(adminSite6)).toBe(false, `${adminSite6} should not appear`);
@@ -221,10 +219,8 @@ describe('File Libraries', () => {
`${siteName} (${siteId1})`,
`${siteName} (${siteId2})`
];
- const cells = await dataTable.getCellsContainingName(siteName);
- const expectedJSON = JSON.stringify(expectedSites.sort());
- const actualJSON = JSON.stringify(cells.sort());
- expect(actualJSON).toEqual(expectedJSON);
+ const actualSites = await dataTable.getCellsContainingName(siteName);
+ expect(actualSites.sort()).toEqual(expectedSites.sort());
});
it('Tooltip for sites without description - [C289894]', async () => {
diff --git a/e2e/suites/list-views/generic-errors.test.ts b/e2e/suites/list-views/generic-errors.test.ts
index 92422f035..50122996e 100755
--- a/e2e/suites/list-views/generic-errors.test.ts
+++ b/e2e/suites/list-views/generic-errors.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/list-views/permissions.test.ts b/e2e/suites/list-views/permissions.test.ts
index 0e42c6efd..f2598bea6 100755
--- a/e2e/suites/list-views/permissions.test.ts
+++ b/e2e/suites/list-views/permissions.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -80,26 +80,26 @@ describe('Special permissions', () => {
it('on Recent Files - [C213173]', async () => {
await page.clickRecentFilesAndWait();
- expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
+ expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items');
await apis.admin.sites.deleteSiteMember(sitePrivate, username);
await page.refresh();
- expect(await dataTable.isEmptyList()).toBe(true, 'Items are still displayed');
+ expect(await dataTable.isEmpty()).toBe(true, 'Items are still displayed');
});
it('on Favorites - [C213227]', async () => {
await page.clickFavoritesAndWait();
- expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
+ expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items');
await apis.admin.sites.deleteSiteMember(sitePrivate, username);
await page.refresh();
- expect(await dataTable.isEmptyList()).toBe(true, 'Items are still displayed');
+ expect(await dataTable.isEmpty()).toBe(true, 'Items are still displayed');
});
it('on Shared Files - [C213116]', async () => {
await page.clickSharedFilesAndWait();
- expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
+ expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items');
await apis.admin.sites.deleteSiteMember(sitePrivate, username);
await page.refresh();
- expect(await dataTable.isEmptyList()).toBe(true, 'Items are still displayed');
+ expect(await dataTable.isEmpty()).toBe(true, 'Items are still displayed');
});
it('on Search Results - [C290122]', async () => {
@@ -147,19 +147,19 @@ describe('Special permissions', () => {
it(`on Recent Files - [C213178]`, async () => {
await page.clickRecentFilesAndWait();
- expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
+ expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items');
expect(await dataTable.getItemLocation(fileName)).toEqual('Unknown');
});
it(`on Favorites - [C213672]`, async () => {
await page.clickFavoritesAndWait();
- expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
+ expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items');
expect(await dataTable.getItemLocation(fileName)).toEqual('Unknown');
});
it(`on Shared Files - [C213668]`, async () => {
await page.clickSharedFilesAndWait();
- expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
+ expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items');
expect(await dataTable.getItemLocation(fileName)).toEqual('Unknown');
});
diff --git a/e2e/suites/list-views/personal-files.test.ts b/e2e/suites/list-views/personal-files.test.ts
index 3f72219c2..5f8072e45 100755
--- a/e2e/suites/list-views/personal-files.test.ts
+++ b/e2e/suites/list-views/personal-files.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -94,7 +94,7 @@ describe('Personal Files', () => {
});
it('has the correct columns - [C217142]', async () => {
- const expectedColumns = [ 'Thumbnail', 'Name', 'Size', 'Modified', 'Modified by' ];
+ const expectedColumns = [ 'Name', 'Size', 'Modified', 'Modified by' ];
const actualColumns = await dataTable.getColumnHeadersText();
expect(actualColumns).toEqual(expectedColumns);
diff --git a/e2e/suites/list-views/recent-files.test.ts b/e2e/suites/list-views/recent-files.test.ts
index c9ee41353..37a1ffc69 100755
--- a/e2e/suites/list-views/recent-files.test.ts
+++ b/e2e/suites/list-views/recent-files.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -81,7 +81,7 @@ describe('Recent Files', () => {
});
it('has the correct columns - [C213168]', async () => {
- const expectedColumns = [ 'Thumbnail', 'Name', 'Location', 'Size', 'Modified' ];
+ const expectedColumns = [ 'Name', 'Location', 'Size', 'Modified' ];
const actualColumns = await dataTable.getColumnHeadersText();
expect(actualColumns).toEqual(expectedColumns);
@@ -93,7 +93,7 @@ describe('Recent Files', () => {
});
it('displays the files added by the current user in the last 30 days - [C213170]', async () => {
- expect(await dataTable.countRows()).toEqual(3, 'Incorrect number of files displayed');
+ expect(await dataTable.getRowsCount()).toEqual(3, 'Incorrect number of files displayed');
expect(await dataTable.isItemPresent(fileName1)).toBe(true, `${fileName1} not displayed`);
expect(await dataTable.isItemPresent(fileName2)).toBe(true, `${fileName2} not displayed`);
expect(await dataTable.isItemPresent(fileSite)).toBe(true, `${fileSite} not displayed`);
diff --git a/e2e/suites/list-views/shared-files.test.ts b/e2e/suites/list-views/shared-files.test.ts
index c0c0a447f..909a45fa5 100755
--- a/e2e/suites/list-views/shared-files.test.ts
+++ b/e2e/suites/list-views/shared-files.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -87,7 +87,7 @@ describe('Shared Files', () => {
});
it('has the correct columns - [C213113]', async () => {
- const expectedColumns = [ 'Thumbnail', 'Name', 'Location', 'Size', 'Modified', 'Modified by', 'Shared by' ];
+ const expectedColumns = [ 'Name', 'Location', 'Size', 'Modified', 'Modified by', 'Shared by' ];
const actualColumns = await dataTable.getColumnHeadersText();
expect(actualColumns).toEqual(expectedColumns);
diff --git a/e2e/suites/list-views/tooltips.test.ts b/e2e/suites/list-views/tooltips.test.ts
index 53499c659..a54861138 100755
--- a/e2e/suites/list-views/tooltips.test.ts
+++ b/e2e/suites/list-views/tooltips.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/list-views/trash.test.ts b/e2e/suites/list-views/trash.test.ts
index 63216feb6..890afd8a9 100755
--- a/e2e/suites/list-views/trash.test.ts
+++ b/e2e/suites/list-views/trash.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -99,14 +99,14 @@ describe('Trash', () => {
});
it('has the correct columns - [C213217]', async () => {
- const expectedColumns = [ 'Thumbnail', 'Name', 'Location', 'Size', 'Deleted', 'Deleted by' ];
+ const expectedColumns = [ 'Name', 'Location', 'Size', 'Deleted', 'Deleted by' ];
const actualColumns = await dataTable.getColumnHeadersText();
expect(actualColumns).toEqual(expectedColumns);
});
it('displays the files and folders deleted by everyone - [C280493]', async () => {
- expect(await dataTable.countRows()).toEqual(8, 'Incorrect number of deleted items displayed');
+ expect(await dataTable.getRowsCount()).toEqual(8, 'Incorrect number of deleted items displayed');
expect(await dataTable.isItemPresent(fileAdmin)).toBe(true, `${fileAdmin} not displayed`);
expect(await dataTable.isItemPresent(folderAdmin)).toBe(true, `${folderAdmin} not displayed`);
@@ -128,14 +128,14 @@ describe('Trash', () => {
});
it('has the correct columns - [C280494]', async () => {
- const expectedColumns = [ 'Thumbnail', 'Name', 'Location', 'Size', 'Deleted'];
+ const expectedColumns = [ 'Name', 'Location', 'Size', 'Deleted'];
const actualColumns = await dataTable.getColumnHeadersText();
expect(actualColumns).toEqual(expectedColumns);
});
it('displays the files and folders deleted by the user - [C213218]', async () => {
- expect(await dataTable.countRows()).toEqual(6, 'Incorrect number of deleted items displayed');
+ expect(await dataTable.getRowsCount()).toEqual(6, 'Incorrect number of deleted items displayed');
expect(await dataTable.isItemPresent(fileSite)).toBe(true, `${fileSite} not displayed`);
expect(await dataTable.isItemPresent(fileUser)).toBe(true, `${fileUser} not displayed`);
diff --git a/e2e/suites/navigation/breadcrumb.test.ts b/e2e/suites/navigation/breadcrumb.test.ts
index 198870a5a..449c9973f 100755
--- a/e2e/suites/navigation/breadcrumb.test.ts
+++ b/e2e/suites/navigation/breadcrumb.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/navigation/sidebar.test.ts b/e2e/suites/navigation/sidebar.test.ts
index 773acbdaf..66ea8ccb0 100755
--- a/e2e/suites/navigation/sidebar.test.ts
+++ b/e2e/suites/navigation/sidebar.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/navigation/single-click.test.ts b/e2e/suites/navigation/single-click.test.ts
index d37251789..e27a4a18c 100755
--- a/e2e/suites/navigation/single-click.test.ts
+++ b/e2e/suites/navigation/single-click.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/pagination/favorites.ts b/e2e/suites/pagination/favorites.ts
new file mode 100755
index 000000000..1b7f282ac
--- /dev/null
+++ b/e2e/suites/pagination/favorites.ts
@@ -0,0 +1,131 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { BrowsingPage } from '../../pages/pages';
+import { Utils } from '../../utilities/utils';
+
+export function favoritesTests() {
+ const page = new BrowsingPage();
+ const { dataTable, pagination } = page;
+
+ describe('Pagination controls : ', () => {
+
+ beforeAll(async () => {
+ await page.clickFavoritesAndWait();
+ });
+
+ afterEach(async () => {
+ await Utils.pressEscape();
+ });
+
+ it('Pagination control default values - [C280113]', async () => {
+ expect(await pagination.getRange()).toContain('1-25 of 101');
+ expect(await pagination.getMaxItems()).toContain('25');
+ expect(await pagination.getCurrentPage()).toContain('Page 1');
+ expect(await pagination.getTotalPages()).toContain('of 5');
+ expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled');
+ expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
+ });
+
+ it('Items per page values - [C280114]', async () => {
+ await pagination.openMaxItemsMenu();
+ expect(await pagination.menu.getNthItem(1).getText()).toBe('25');
+ expect(await pagination.menu.getNthItem(2).getText()).toBe('50');
+ expect(await pagination.menu.getNthItem(3).getText()).toBe('100');
+ await pagination.menu.closeMenu();
+ });
+
+ it('current page menu items - [C280115]', async () => {
+ await pagination.openMaxItemsMenu()
+ await pagination.menu.clickMenuItem('25');
+ expect(await pagination.getMaxItems()).toContain('25');
+ expect(await pagination.getTotalPages()).toContain('of 5');
+ await pagination.openCurrentPageMenu();
+ expect(await pagination.menu.getItemsCount()).toBe(5);
+ await pagination.menu.closeMenu();
+
+ await pagination.openMaxItemsMenu();
+ await pagination.menu.clickMenuItem('50');
+ expect(await pagination.getMaxItems()).toContain('50');
+ expect(await pagination.getTotalPages()).toContain('of 3');
+ await pagination.openCurrentPageMenu();
+ expect(await pagination.menu.getItemsCount()).toBe(3);
+ await pagination.menu.closeMenu();
+
+ await pagination.openMaxItemsMenu();
+ await pagination.menu.clickMenuItem('100');
+ expect(await pagination.getMaxItems()).toContain('100');
+ expect(await pagination.getTotalPages()).toContain('of 2');
+ await pagination.openCurrentPageMenu();
+ expect(await pagination.menu.getItemsCount()).toBe(2);
+ await pagination.menu.closeMenu();
+
+ await pagination.resetToDefaultPageSize();
+ });
+
+ it('change the current page from menu - [C280116]', async () => {
+ await pagination.openCurrentPageMenu();
+ await pagination.menu.clickNthItem(3);
+ expect(await pagination.getRange()).toContain('51-75 of 101');
+ expect(await pagination.getCurrentPage()).toContain('Page 3');
+ expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled');
+ expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
+ expect(await dataTable.isItemPresent('my-file-40')).toBe(true, 'File not found on page');
+
+ await pagination.resetToDefaultPageNumber();
+ });
+
+ it('navigate to next and previous pages - [C280119]', async () => {
+ await pagination.clickNext();
+ await dataTable.waitForHeader();
+ expect(await pagination.getRange()).toContain('26-50 of 101');
+ expect(await dataTable.isItemPresent('my-file-70')).toBe(true, 'File not found on page');
+ await pagination.resetToDefaultPageNumber();
+
+ await pagination.openCurrentPageMenu();
+ await pagination.menu.clickNthItem(2);
+ await dataTable.waitForHeader();
+ await pagination.clickPrevious();
+ await dataTable.waitForHeader();
+ expect(await pagination.getRange()).toContain('1-25 of 101');
+ expect(await dataTable.isItemPresent('my-file-88')).toBe(true, 'File not found on page');
+
+ await pagination.resetToDefaultPageNumber();
+ });
+
+ it('Previous button is disabled on first page - [C280117]', async () => {
+ expect(await pagination.getCurrentPage()).toContain('Page 1');
+ expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled on first page');
+ });
+
+ it('Next button is disabled on last page - [C280118]', async () => {
+ await pagination.openCurrentPageMenu();
+ await pagination.menu.clickNthItem(5);
+ expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page');
+ expect(await pagination.getCurrentPage()).toContain('Page 5');
+ expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
+ });
+ });
+}
diff --git a/e2e/suites/pagination/multiple-pages-files.test.ts b/e2e/suites/pagination/multiple-pages-files.test.ts
new file mode 100644
index 000000000..37f40a402
--- /dev/null
+++ b/e2e/suites/pagination/multiple-pages-files.test.ts
@@ -0,0 +1,94 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { LoginPage } from '../../pages/pages';
+import { Utils } from '../../utilities/utils';
+import { AdminActions } from '../../utilities/admin-actions';
+import { RepoClient } from '../../utilities/repo-client/repo-client';
+import { personalFilesTests } from './personal-files';
+import { recentFilesTests } from './recent-files';
+import { searchResultsTests } from './search-results';
+import { sharedFilesTests } from './shared-files';
+import { favoritesTests } from './favorites';
+
+describe('Pagination on multiple pages : ', () => {
+ const random = Utils.random();
+ const username = `user-${random}`;
+
+ const parent = `parent-${random}`;
+ let parentId: string;
+
+ const files = Array(101)
+ .fill('my-file')
+ .map((name, index): string => `${name}-${index + 1}-${random}.txt`);
+ let filesIds: string[];
+
+ const userApi = new RepoClient(username, username);
+ const adminApiActions = new AdminActions();
+
+ const loginPage = new LoginPage();
+
+ beforeAll(async () => {
+ await adminApiActions.createUser({ username });
+ parentId = (await userApi.nodes.createFolder(parent)).entry.id;
+ filesIds = (await userApi.nodes.createFiles(files, parent)).list.entries.map(entries => entries.entry.id);
+
+ await userApi.shared.shareFilesByIds(filesIds);
+ await userApi.favorites.addFavoritesByIds('file', filesIds);
+
+ await Promise.all([
+ userApi.favorites.waitForApi({ expect: 101 }),
+ userApi.shared.waitForApi({ expect: 101 }),
+ userApi.search.waitForApi(username, { expect: 101 }),
+ ]);
+
+ await loginPage.loginWith(username);
+ });
+
+ afterAll(async () => {
+ await userApi.nodes.deleteNodeById(parentId);
+ });
+
+ describe('on Personal Files', () => {
+ personalFilesTests(parent);
+ });
+
+ describe('on Recent Files', () => {
+ recentFilesTests();
+ });
+
+ describe('on Search Results', () => {
+ searchResultsTests();
+ });
+
+ describe('on Shared Files', () => {
+ sharedFilesTests();
+ });
+
+ describe('on Favorites', () => {
+ favoritesTests();
+ });
+
+});
diff --git a/e2e/suites/pagination/pag-file-libraries.test.ts b/e2e/suites/pagination/multiple-pages-libraries.test.ts
similarity index 90%
rename from e2e/suites/pagination/pag-file-libraries.test.ts
rename to e2e/suites/pagination/multiple-pages-libraries.test.ts
index 91edddffc..dd601b5ea 100755
--- a/e2e/suites/pagination/pag-file-libraries.test.ts
+++ b/e2e/suites/pagination/multiple-pages-libraries.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -23,48 +23,45 @@
* along with Alfresco. If not, see .
*/
-import { SITE_VISIBILITY } from '../../configs';
import { LoginPage, BrowsingPage } from '../../pages/pages';
import { Utils } from '../../utilities/utils';
+import { AdminActions } from '../../utilities/admin-actions';
import { RepoClient } from '../../utilities/repo-client/repo-client';
describe('Pagination on multiple pages', () => {
- const username = `user-${Utils.random()}`;
+ const random = Utils.random();
+
+ const username = `user-${random}`;
+
+ const userApi = new RepoClient(username, username);
+ const adminApiActions = new AdminActions();
- const apis = {
- admin: new RepoClient(),
- user: new RepoClient(username, username)
- };
const loginPage = new LoginPage();
const page = new BrowsingPage();
const { dataTable, pagination } = page;
const sites = Array(101)
.fill('site')
- .map((name, index): string => `${name}-${index + 1}-${Utils.random()}`);
+ .map((name, index): string => `${name}-${index + 1}-${random}`);
- beforeAll(async (done) => {
- await apis.admin.people.createUser({ username });
- await apis.user.sites.createSites(sites, SITE_VISIBILITY.PRIVATE);
- await apis.user.sites.waitForApi({ expect: 101 });
+ beforeAll(async () => {
+ await adminApiActions.createUser({ username });
+ await userApi.sites.createSitesPrivate(sites);
+ await userApi.sites.waitForApi({ expect: 101 });
await loginPage.loginWith(username);
- done();
});
- afterAll(async (done) => {
- await apis.user.sites.deleteSites(sites);
- done();
+ afterAll(async () => {
+ await userApi.sites.deleteSites(sites);
})
describe('on My Libraries', () => {
- beforeEach(async (done) => {
+ beforeAll(async () => {
await page.goToMyLibrariesAndWait();
- done();
});
- afterEach(async (done) => {
+ afterEach(async () => {
await Utils.pressEscape();
- done();
});
it('Pagination control default values - [C280086]', async () => {
@@ -151,21 +148,19 @@ describe('Pagination on multiple pages', () => {
it('Next button is disabled on last page - [C280091]', async () => {
await pagination.openCurrentPageMenu();
await pagination.menu.clickNthItem(5);
- expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items on the last page');
+ expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page');
expect(await pagination.getCurrentPage()).toContain('Page 5');
expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
});
});
describe('on Favorite Libraries', () => {
- beforeEach(async (done) => {
+ beforeAll(async () => {
await page.goToFavoriteLibrariesAndWait();
- done();
});
- afterEach(async (done) => {
+ afterEach(async () => {
await Utils.pressEscape();
- done();
});
it('Pagination control default values - [C291875]', async () => {
@@ -252,7 +247,7 @@ describe('Pagination on multiple pages', () => {
it('Next button is disabled on last page - [C291880]', async () => {
await pagination.openCurrentPageMenu();
await pagination.menu.clickNthItem(5);
- expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items on the last page');
+ expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page');
expect(await pagination.getCurrentPage()).toContain('Page 5');
expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
});
diff --git a/e2e/suites/pagination/pag-trash.test.ts b/e2e/suites/pagination/multiple-pages-trash.test.ts
similarity index 86%
rename from e2e/suites/pagination/pag-trash.test.ts
rename to e2e/suites/pagination/multiple-pages-trash.test.ts
index bebb729d7..f8c9c03aa 100755
--- a/e2e/suites/pagination/pag-trash.test.ts
+++ b/e2e/suites/pagination/multiple-pages-trash.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -25,46 +25,42 @@
import { LoginPage, BrowsingPage } from '../../pages/pages';
import { Utils } from '../../utilities/utils';
+import { AdminActions } from '../../utilities/admin-actions';
import { RepoClient } from '../../utilities/repo-client/repo-client';
describe('Pagination on multiple pages on Trash', () => {
- const username = `user-${Utils.random()}`;
+ const random = Utils.random();
+
+ const username = `user-${random}`;
const filesForDelete = Array(101)
.fill('file')
- .map((name, index): string => `${name}-${index + 1}.txt`);
- let filesDeletedIds;
+ .map((name, index): string => `${name}-${index + 1}-${random}.txt`);
+ let filesDeletedIds: string[];
- const apis = {
- admin: new RepoClient(),
- user: new RepoClient(username, username)
- };
+ const userApi = new RepoClient(username, username);
+ const adminApiActions = new AdminActions();
const loginPage = new LoginPage();
const page = new BrowsingPage();
const { dataTable, pagination } = page;
- beforeAll(async (done) => {
- await apis.admin.people.createUser({ username });
- filesDeletedIds = (await apis.user.nodes.createFiles(filesForDelete)).list.entries.map(entries => entries.entry.id);
- await apis.user.nodes.deleteNodesById(filesDeletedIds, false);
- await apis.user.trashcan.waitForApi({expect: 101});
+ beforeAll(async () => {
+ await adminApiActions.createUser({ username });
+ filesDeletedIds = (await userApi.nodes.createFiles(filesForDelete)).list.entries.map(entries => entries.entry.id);
+
+ await userApi.nodes.deleteNodesById(filesDeletedIds, false);
+ await userApi.trashcan.waitForApi({expect: 101});
+
await loginPage.loginWith(username);
- done();
- });
-
- beforeEach(async (done) => {
await page.clickTrashAndWait();
- done();
});
- afterEach(async (done) => {
+ afterEach(async () => {
await Utils.pressEscape();
- done();
});
- afterAll(async (done) => {
- await apis.user.trashcan.emptyTrash();
- done();
+ afterAll(async () => {
+ await userApi.trashcan.emptyTrash();
});
it('Pagination control default values - [C280122]', async () => {
@@ -151,7 +147,7 @@ describe('Pagination on multiple pages on Trash', () => {
it('Next button is disabled on last page - [C280127]', async () => {
await pagination.openCurrentPageMenu();
await pagination.menu.clickNthItem(5);
- expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items on the last page');
+ expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page');
expect(await pagination.getCurrentPage()).toContain('Page 5');
expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
});
diff --git a/e2e/suites/pagination/pag-favorites.test.ts b/e2e/suites/pagination/pag-favorites.test.ts
deleted file mode 100755
index 0a94f9ab9..000000000
--- a/e2e/suites/pagination/pag-favorites.test.ts
+++ /dev/null
@@ -1,162 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { LoginPage, BrowsingPage } from '../../pages/pages';
-import { Utils } from '../../utilities/utils';
-import { RepoClient } from '../../utilities/repo-client/repo-client';
-
-describe('Pagination on multiple pages on Favorites', () => {
- const username = `user-${Utils.random()}`;
-
- const apis = {
- admin: new RepoClient(),
- user: new RepoClient(username, username)
- };
-
- const parent = `parent-${Utils.random()}`; let parentId;
-
- const files = Array(101)
- .fill('file')
- .map((name, index): string => `${name}-${index + 1}-${Utils.random()}.txt`);
- let filesIds;
-
- const loginPage = new LoginPage();
- const page = new BrowsingPage();
- const { dataTable, pagination } = page;
-
- beforeAll(async (done) => {
- await apis.admin.people.createUser({ username });
- parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
- filesIds = (await apis.user.nodes.createFiles(files, parent)).list.entries.map(entries => entries.entry.id);
- await apis.user.favorites.addFavoritesByIds('file', filesIds);
- await apis.user.favorites.waitForApi({ expect: 101 });
- await loginPage.loginWith(username);
- done();
- });
-
- beforeEach(async (done) => {
- await page.clickFavoritesAndWait();
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- afterAll(async (done) => {
- await apis.user.nodes.deleteNodeById(parentId);
- await apis.user.favorites.waitForApi({ expect: 0 });
- done();
- });
-
- it('Pagination control default values - [C280113]', async () => {
- expect(await pagination.getRange()).toContain('1-25 of 101');
- expect(await pagination.getMaxItems()).toContain('25');
- expect(await pagination.getCurrentPage()).toContain('Page 1');
- expect(await pagination.getTotalPages()).toContain('of 5');
- expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled');
- expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
- });
-
- it('Items per page values - [C280114]', async () => {
- await pagination.openMaxItemsMenu();
- expect(await pagination.menu.getNthItem(1).getText()).toBe('25');
- expect(await pagination.menu.getNthItem(2).getText()).toBe('50');
- expect(await pagination.menu.getNthItem(3).getText()).toBe('100');
- await pagination.menu.closeMenu();
- });
-
- it('current page menu items - [C280115]', async () => {
- await pagination.openMaxItemsMenu()
- await pagination.menu.clickMenuItem('25');
- expect(await pagination.getMaxItems()).toContain('25');
- expect(await pagination.getTotalPages()).toContain('of 5');
- await pagination.openCurrentPageMenu();
- expect(await pagination.menu.getItemsCount()).toBe(5);
- await pagination.menu.closeMenu();
-
- await pagination.openMaxItemsMenu();
- await pagination.menu.clickMenuItem('50');
- expect(await pagination.getMaxItems()).toContain('50');
- expect(await pagination.getTotalPages()).toContain('of 3');
- await pagination.openCurrentPageMenu();
- expect(await pagination.menu.getItemsCount()).toBe(3);
- await pagination.menu.closeMenu();
-
- await pagination.openMaxItemsMenu();
- await pagination.menu.clickMenuItem('100');
- expect(await pagination.getMaxItems()).toContain('100');
- expect(await pagination.getTotalPages()).toContain('of 2');
- await pagination.openCurrentPageMenu();
- expect(await pagination.menu.getItemsCount()).toBe(2);
- await pagination.menu.closeMenu();
-
- await pagination.resetToDefaultPageSize();
- });
-
- it('change the current page from menu - [C280116]', async () => {
- await pagination.openCurrentPageMenu();
- await pagination.menu.clickNthItem(3);
- expect(await pagination.getRange()).toContain('51-75 of 101');
- expect(await pagination.getCurrentPage()).toContain('Page 3');
- expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled');
- expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
- expect(await dataTable.isItemPresent('file-40')).toBe(true, 'File not found on page');
-
- await pagination.resetToDefaultPageNumber();
- });
-
- it('navigate to next and previous pages - [C280119]', async () => {
- await pagination.clickNext();
- await dataTable.waitForHeader();
- expect(await pagination.getRange()).toContain('26-50 of 101');
- expect(await dataTable.isItemPresent('file-70')).toBe(true, 'File not found on page');
- await pagination.resetToDefaultPageNumber();
-
- await pagination.openCurrentPageMenu();
- await pagination.menu.clickNthItem(2);
- await dataTable.waitForHeader();
- await pagination.clickPrevious();
- await dataTable.waitForHeader();
- expect(await pagination.getRange()).toContain('1-25 of 101');
- expect(await dataTable.isItemPresent('file-88')).toBe(true, 'File not found on page');
-
- await pagination.resetToDefaultPageNumber();
- });
-
- it('Previous button is disabled on first page - [C280117]', async () => {
- expect(await pagination.getCurrentPage()).toContain('Page 1');
- expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled on first page');
- });
-
- it('Next button is disabled on last page - [C280118]', async () => {
- await pagination.openCurrentPageMenu();
- await pagination.menu.clickNthItem(5);
- expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items on the last page');
- expect(await pagination.getCurrentPage()).toContain('Page 5');
- expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
- });
-});
diff --git a/e2e/suites/pagination/pag-personal-files.test.ts b/e2e/suites/pagination/pag-personal-files.test.ts
deleted file mode 100755
index 18a0a948b..000000000
--- a/e2e/suites/pagination/pag-personal-files.test.ts
+++ /dev/null
@@ -1,160 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { LoginPage, BrowsingPage } from '../../pages/pages';
-import { Utils } from '../../utilities/utils';
-import { RepoClient } from '../../utilities/repo-client/repo-client';
-
-describe('Pagination on multiple pages on Personal Files', () => {
- const username = `user-${Utils.random()}`;
-
- const apis = {
- admin: new RepoClient(),
- user: new RepoClient(username, username)
- };
-
- const parent = `parent-${Utils.random()}`; let parentId;
- const files = Array(101)
- .fill('file')
- .map((name, index): string => `${name}-${index + 1}.txt`);
-
- const loginPage = new LoginPage();
- const page = new BrowsingPage();
- const { dataTable, pagination } = page;
-
- beforeAll(async (done) => {
- await apis.admin.people.createUser({ username });
- parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
- await apis.user.nodes.createFiles(files, parent);
- await loginPage.loginWith(username);
- done();
- });
-
- beforeEach(async (done) => {
- await page.clickPersonalFilesAndWait();
- await dataTable.doubleClickOnRowByName(parent);
- await dataTable.waitForHeader();
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- afterAll(async (done) => {
- await apis.user.nodes.deleteNodeById(parentId);
- done();
- });
-
- it('Pagination control default values - [C280077]', async () => {
- expect(await pagination.getRange()).toContain('1-25 of 101');
- expect(await pagination.getMaxItems()).toContain('25');
- expect(await pagination.getCurrentPage()).toContain('Page 1');
- expect(await pagination.getTotalPages()).toContain('of 5');
- expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled');
- expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
- });
-
- it('Items per page values - [C280078]', async () => {
- await pagination.openMaxItemsMenu();
- expect(await pagination.menu.getNthItem(1).getText()).toBe('25');
- expect(await pagination.menu.getNthItem(2).getText()).toBe('50');
- expect(await pagination.menu.getNthItem(3).getText()).toBe('100');
- await pagination.menu.closeMenu();
- });
-
- it('current page menu items - [C280079]', async () => {
- await pagination.openMaxItemsMenu();
- await pagination.menu.clickMenuItem('25');
- expect(await pagination.getMaxItems()).toContain('25');
- expect(await pagination.getTotalPages()).toContain('of 5');
- await pagination.openCurrentPageMenu();
- expect(await pagination.menu.getItemsCount()).toBe(5);
- await pagination.menu.closeMenu();
-
- await pagination.openMaxItemsMenu();
- await pagination.menu.clickMenuItem('50');
- expect(await pagination.getMaxItems()).toContain('50');
- expect(await pagination.getTotalPages()).toContain('of 3');
- await pagination.openCurrentPageMenu();
- expect(await pagination.menu.getItemsCount()).toBe(3);
- await pagination.menu.closeMenu();
-
- await pagination.openMaxItemsMenu();
- await pagination.menu.clickMenuItem('100');
- expect(await pagination.getMaxItems()).toContain('100');
- expect(await pagination.getTotalPages()).toContain('of 2');
- await pagination.openCurrentPageMenu();
- expect(await pagination.menu.getItemsCount()).toBe(2);
- await pagination.menu.closeMenu();
-
- await pagination.resetToDefaultPageSize();
- });
-
- it('change the current page from menu - [C280080]', async () => {
- await pagination.openCurrentPageMenu();
- await pagination.menu.clickNthItem(3);
- await dataTable.waitForHeader();
- expect(await pagination.getRange()).toContain('51-75 of 101');
- expect(await pagination.getCurrentPage()).toContain('Page 3');
- expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled');
- expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
- expect(await dataTable.isItemPresent('file-60')).toBe(true, 'File not found on page');
-
- await pagination.resetToDefaultPageNumber();
- });
-
- it('navigate to next and previous pages - [C280083]', async () => {
- await pagination.clickNext();
- await dataTable.waitForHeader();
- expect(await pagination.getRange()).toContain('26-50 of 101');
- expect(await dataTable.isItemPresent('file-31')).toBe(true, 'file-31 not found on page');
- await pagination.resetToDefaultPageNumber();
-
- await pagination.openCurrentPageMenu();
- await pagination.menu.clickNthItem(2);
- await dataTable.waitForHeader();
- await pagination.clickPrevious();
- await dataTable.waitForHeader();
- expect(await pagination.getRange()).toContain('1-25 of 101');
- expect(await dataTable.isItemPresent('file-12')).toBe(true, 'file-12 not found on page');
-
- await pagination.resetToDefaultPageNumber();
- });
-
- it('Previous button is disabled on first page - [C280081]', async () => {
- expect(await pagination.getCurrentPage()).toContain('Page 1');
- expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled on first page');
- });
-
- it('Next button is disabled on last page - [C280082]', async () => {
- await pagination.openCurrentPageMenu();
- await pagination.menu.clickNthItem(5);
- expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items on the last page');
- expect(await pagination.getCurrentPage()).toContain('Page 5');
- expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
- });
-});
diff --git a/e2e/suites/pagination/pag-recent-files.test.ts b/e2e/suites/pagination/pag-recent-files.test.ts
deleted file mode 100755
index 32e377dcf..000000000
--- a/e2e/suites/pagination/pag-recent-files.test.ts
+++ /dev/null
@@ -1,159 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { LoginPage, BrowsingPage } from '../../pages/pages';
-import { Utils } from '../../utilities/utils';
-import { RepoClient } from '../../utilities/repo-client/repo-client';
-
-describe('Pagination on multiple pages on Recent Files', () => {
- const username = `user-${Utils.random()}`;
-
- const parent = `parent-${Utils.random()}`; let parentId;
- const files = Array(101)
- .fill('file')
- .map((name, index): string => `${name}-${index + 1}.txt`);
-
- const apis = {
- admin: new RepoClient(),
- user: new RepoClient(username, username)
- };
-
- const loginPage = new LoginPage();
- const page = new BrowsingPage();
- const { dataTable, pagination } = page;
-
- beforeAll(async (done) => {
- await apis.admin.people.createUser({ username });
- parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
- await apis.user.nodes.createFiles(files, parent);
- await apis.user.search.waitForApi(username, { expect: 101 });
- await loginPage.loginWith(username);
- done();
- });
-
- beforeEach(async (done) => {
- await page.clickRecentFilesAndWait();
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- afterAll(async (done) => {
- await apis.user.nodes.deleteNodeById(parentId);
- done();
- });
-
- it('Pagination control default values - [C280104]', async () => {
- expect(await pagination.getRange()).toContain('1-25 of 101');
- expect(await pagination.getMaxItems()).toContain('25');
- expect(await pagination.getCurrentPage()).toContain('Page 1');
- expect(await pagination.getTotalPages()).toContain('of 5');
- expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled');
- expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
- });
-
- it('Items per page values - [C280105]', async () => {
- await pagination.openMaxItemsMenu();
- expect(await pagination.menu.getNthItem(1).getText()).toBe('25');
- expect(await pagination.menu.getNthItem(2).getText()).toBe('50');
- expect(await pagination.menu.getNthItem(3).getText()).toBe('100');
- await pagination.menu.closeMenu();
- });
-
- it('current page menu items - [C280106]', async () => {
- await pagination.openMaxItemsMenu();
- await pagination.menu.clickMenuItem('25');
- expect(await pagination.getMaxItems()).toContain('25');
- expect(await pagination.getTotalPages()).toContain('of 5');
- await pagination.openCurrentPageMenu();
- expect(await pagination.menu.getItemsCount()).toBe(5);
- await pagination.menu.closeMenu();
-
- await pagination.openMaxItemsMenu();
- await pagination.menu.clickMenuItem('50');
- expect(await pagination.getMaxItems()).toContain('50');
- expect(await pagination.getTotalPages()).toContain('of 3');
- await pagination.openCurrentPageMenu();
- expect(await pagination.menu.getItemsCount()).toBe(3);
- await pagination.menu.closeMenu();
-
- await pagination.openMaxItemsMenu();
- await pagination.menu.clickMenuItem('100');
- expect(await pagination.getMaxItems()).toContain('100');
- expect(await pagination.getTotalPages()).toContain('of 2');
- await pagination.openCurrentPageMenu();
- expect(await pagination.menu.getItemsCount()).toBe(2);
- await pagination.menu.closeMenu();
-
- await pagination.resetToDefaultPageSize();
- });
-
- it('change the current page from menu - [C280107]', async () => {
- await pagination.openCurrentPageMenu();
- await pagination.menu.clickNthItem(3);
- await dataTable.waitForHeader();
- expect(await pagination.getRange()).toContain('51-75 of 101');
- expect(await pagination.getCurrentPage()).toContain('Page 3');
- expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled');
- expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
- expect(await dataTable.isItemPresent('file-40')).toBe(true, 'File not found on page');
-
- await pagination.resetToDefaultPageNumber();
- });
-
- it('navigate to next and previous pages - [C280110]', async () => {
- await pagination.clickNext();
- await dataTable.waitForHeader();
- expect(await pagination.getRange()).toContain('26-50 of 101');
- expect(await dataTable.isItemPresent('file-70')).toBe(true, 'File not found on page');
- await pagination.resetToDefaultPageNumber();
-
- await pagination.openCurrentPageMenu();
- await pagination.menu.clickNthItem(2);
- await dataTable.waitForHeader();
- await pagination.clickPrevious();
- await dataTable.waitForHeader();
- expect(await pagination.getRange()).toContain('1-25 of 101');
- expect(await dataTable.isItemPresent('file-88')).toBe(true, 'File not found on page');
-
- await pagination.resetToDefaultPageNumber();
- });
-
- it('Previous button is disabled on first page - [C280108]', async () => {
- expect(await pagination.getCurrentPage()).toContain('Page 1');
- expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled on first page');
- });
-
- it('Next button is disabled on last page - [C280109]', async () => {
- await pagination.openCurrentPageMenu();
- await pagination.menu.clickNthItem(5);
- expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items on the last page');
- expect(await pagination.getCurrentPage()).toContain('Page 5');
- expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
- });
-});
diff --git a/e2e/suites/pagination/pag-search-results.test.ts b/e2e/suites/pagination/pag-search-results.test.ts
deleted file mode 100755
index dd9fa015b..000000000
--- a/e2e/suites/pagination/pag-search-results.test.ts
+++ /dev/null
@@ -1,158 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { LoginPage, BrowsingPage } from '../../pages/pages';
-import { Utils } from '../../utilities/utils';
-import { RepoClient } from '../../utilities/repo-client/repo-client';
-
-describe('Pagination on multiple pages on Search Results', () => {
- const username = `user-${Utils.random()}`;
-
- const parent = `parent-${Utils.random()}`; let parentId;
- const files = Array(101)
- .fill('myFile')
- .map((name, index): string => `${name}-${index + 1}.txt`);
-
- const apis = {
- admin: new RepoClient(),
- user: new RepoClient(username, username)
- };
-
- const loginPage = new LoginPage();
- const page = new BrowsingPage();
- const { dataTable, pagination } = page;
- const { searchInput } = page.header;
-
- beforeAll(async (done) => {
- await apis.admin.people.createUser({ username });
- parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
- await apis.user.nodes.createFiles(files, parent);
- await apis.user.search.waitForApi(username, { expect: 101 });
- await loginPage.loginWith(username);
-
- await searchInput.clickSearchButton();
- await searchInput.checkOnlyFiles();
- await searchInput.searchFor('myFile-');
- await dataTable.waitForBody();
-
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- afterAll(async (done) => {
- await apis.user.nodes.deleteNodeById(parentId);
- done();
- });
-
- it('Pagination control default values - [C290125]', async () => {
- expect(await pagination.getRange()).toContain('1-25 of 101');
- expect(await pagination.getMaxItems()).toContain('25');
- expect(await pagination.getCurrentPage()).toContain('Page 1');
- expect(await pagination.getTotalPages()).toContain('of 5');
- expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled');
- expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
- });
-
- it('Items per page values - [C290126]', async () => {
- await pagination.openMaxItemsMenu();
- expect(await pagination.menu.getNthItem(1).getText()).toBe('25');
- expect(await pagination.menu.getNthItem(2).getText()).toBe('50');
- expect(await pagination.menu.getNthItem(3).getText()).toBe('100');
- await pagination.menu.closeMenu();
- });
-
- it('current page menu items - [C290127]', async () => {
- await pagination.openMaxItemsMenu();
- await pagination.menu.clickMenuItem('25');
- expect(await pagination.getMaxItems()).toContain('25');
- expect(await pagination.getTotalPages()).toContain('of 5');
- await pagination.openCurrentPageMenu();
- expect(await pagination.menu.getItemsCount()).toBe(5);
- await pagination.menu.closeMenu();
-
- await pagination.openMaxItemsMenu();
- await pagination.menu.clickMenuItem('50');
- expect(await pagination.getMaxItems()).toContain('50');
- expect(await pagination.getTotalPages()).toContain('of 3');
- await pagination.openCurrentPageMenu();
- expect(await pagination.menu.getItemsCount()).toBe(3);
- await pagination.menu.closeMenu();
-
- await pagination.openMaxItemsMenu();
- await pagination.menu.clickMenuItem('100');
- expect(await pagination.getMaxItems()).toContain('100');
- expect(await pagination.getTotalPages()).toContain('of 2');
- await pagination.openCurrentPageMenu();
- expect(await pagination.menu.getItemsCount()).toBe(2);
- await pagination.menu.closeMenu();
-
- await pagination.resetToDefaultPageSize();
- });
-
- it('change the current page from menu - [C290128]', async () => {
- await pagination.openCurrentPageMenu();
- await pagination.menu.clickNthItem(3);
- await dataTable.waitForBody();
- expect(await pagination.getRange()).toContain('51-75 of 101');
- expect(await pagination.getCurrentPage()).toContain('Page 3');
- expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled');
- expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
-
- await pagination.resetToDefaultPageNumber();
- });
-
- it('navigate to next and previous pages - [C290131]', async () => {
- await pagination.clickNext();
- await dataTable.waitForBody();
- expect(await pagination.getRange()).toContain('26-50 of 101');
- await pagination.resetToDefaultPageNumber();
-
- await pagination.openCurrentPageMenu();
- await pagination.menu.clickNthItem(2);
- await dataTable.waitForBody();
- await pagination.clickPrevious();
- await dataTable.waitForBody();
- expect(await pagination.getRange()).toContain('1-25 of 101');
-
- await pagination.resetToDefaultPageNumber();
- });
-
- it('Previous button is disabled on first page - [C290129]', async () => {
- expect(await pagination.getCurrentPage()).toContain('Page 1');
- expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled on first page');
- });
-
- it('Next button is disabled on last page - [C290130]', async () => {
- await pagination.openCurrentPageMenu();
- await pagination.menu.clickNthItem(5);
- expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items on the last page');
- expect(await pagination.getCurrentPage()).toContain('Page 5');
- expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
- });
-});
diff --git a/e2e/suites/pagination/pag-shared-files.test.ts b/e2e/suites/pagination/pag-shared-files.test.ts
deleted file mode 100755
index 4a2695cc3..000000000
--- a/e2e/suites/pagination/pag-shared-files.test.ts
+++ /dev/null
@@ -1,162 +0,0 @@
-/*!
- * @license
- * Alfresco Example Content Application
- *
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
- *
- * This file is part of the Alfresco Example Content Application.
- * If the software was purchased under a paid Alfresco license, the terms of
- * the paid license agreement will prevail. Otherwise, the software is
- * provided under the following open source license terms:
- *
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-
-import { LoginPage, BrowsingPage } from '../../pages/pages';
-import { Utils } from '../../utilities/utils';
-import { RepoClient } from '../../utilities/repo-client/repo-client';
-
-describe('Pagination on multiple pages on Shared Files', () => {
- const username = `user-${Utils.random()}`;
-
- const parent = `parent-${Utils.random()}`; let parentId;
- const files = Array(101)
- .fill('file')
- .map((name, index): string => `${name}-${index + 1}.txt`);
- let filesIds;
-
- const apis = {
- admin: new RepoClient(),
- user: new RepoClient(username, username)
- };
-
- const loginPage = new LoginPage();
- const page = new BrowsingPage();
- const { dataTable, pagination } = page;
-
- beforeAll(async (done) => {
- await apis.admin.people.createUser({ username });
- parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
- filesIds = (await apis.user.nodes.createFiles(files, parent)).list.entries.map(entries => entries.entry.id);
-
- await apis.user.shared.shareFilesByIds(filesIds);
- await apis.user.shared.waitForApi({ expect: 101 });
- await loginPage.loginWith(username);
- done();
- });
-
- beforeEach(async (done) => {
- await page.clickSharedFilesAndWait();
- done();
- });
-
- afterEach(async (done) => {
- await Utils.pressEscape();
- done();
- });
-
- afterAll(async (done) => {
- await apis.user.nodes.deleteNodeById(parentId);
- done();
- });
-
- it('Pagination control default values - [C280095]', async () => {
- expect(await pagination.getRange()).toContain('1-25 of 101');
- expect(await pagination.getMaxItems()).toContain('25');
- expect(await pagination.getCurrentPage()).toContain('Page 1');
- expect(await pagination.getTotalPages()).toContain('of 5');
- expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled');
- expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
- });
-
- it('Items per page values - [C280096]', async () => {
- await pagination.openMaxItemsMenu();
- expect(await pagination.menu.getNthItem(1).getText()).toBe('25');
- expect(await pagination.menu.getNthItem(2).getText()).toBe('50');
- expect(await pagination.menu.getNthItem(3).getText()).toBe('100');
- await pagination.menu.closeMenu();
- });
-
- it('current page menu items - [C280097]', async () => {
- await pagination.openMaxItemsMenu();
- await pagination.menu.clickMenuItem('25');
- expect(await pagination.getMaxItems()).toContain('25');
- expect(await pagination.getTotalPages()).toContain('of 5');
- await pagination.openCurrentPageMenu();
- expect(await pagination.menu.getItemsCount()).toBe(5);
- await pagination.menu.closeMenu();
-
- await pagination.openMaxItemsMenu();
- await pagination.menu.clickMenuItem('50');
- expect(await pagination.getMaxItems()).toContain('50');
- expect(await pagination.getTotalPages()).toContain('of 3');
- await pagination.openCurrentPageMenu();
- expect(await pagination.menu.getItemsCount()).toBe(3);
- await pagination.menu.closeMenu();
-
- await pagination.openMaxItemsMenu();
- await pagination.menu.clickMenuItem('100');
- expect(await pagination.getMaxItems()).toContain('100');
- expect(await pagination.getTotalPages()).toContain('of 2');
- await pagination.openCurrentPageMenu();
- expect(await pagination.menu.getItemsCount()).toBe(2);
- await pagination.menu.closeMenu();
-
- await pagination.resetToDefaultPageSize();
- });
-
- it('change the current page from menu - [C280098]', async () => {
- await pagination.openCurrentPageMenu();
- await pagination.menu.clickNthItem(3);
- await dataTable.waitForHeader();
- expect(await pagination.getRange()).toContain('51-75 of 101');
- expect(await pagination.getCurrentPage()).toContain('Page 3');
- expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled');
- expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
- expect(await dataTable.isItemPresent('file-40')).toBe(true, 'File not found on page');
-
- await pagination.resetToDefaultPageNumber();
- });
-
- it('navigate to next and previous pages - [C280101]', async () => {
- await pagination.clickNext();
- await dataTable.waitForHeader();
- expect(await pagination.getRange()).toContain('26-50 of 101');
- expect(await dataTable.isItemPresent('file-70')).toBe(true, 'File not found on page');
- await pagination.resetToDefaultPageNumber();
-
- await pagination.openCurrentPageMenu();
- await pagination.menu.clickNthItem(2);
- await dataTable.waitForHeader();
- await pagination.clickPrevious();
- await dataTable.waitForHeader();
- expect(await pagination.getRange()).toContain('1-25 of 101');
- expect(await dataTable.isItemPresent('file-88')).toBe(true, 'File not found on page');
-
- await pagination.resetToDefaultPageNumber();
- });
-
- it('Previous button is disabled on first page - [C280099]', async () => {
- expect(await pagination.getCurrentPage()).toContain('Page 1');
- expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled on first page');
- });
-
- it('Next button is disabled on last page - [C280100]', async () => {
- await pagination.openCurrentPageMenu();
- await pagination.menu.clickNthItem(5);
- expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items on the last page');
- expect(await pagination.getCurrentPage()).toContain('Page 5');
- expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
- });
-});
diff --git a/e2e/suites/pagination/personal-files.ts b/e2e/suites/pagination/personal-files.ts
new file mode 100755
index 000000000..b36ee7727
--- /dev/null
+++ b/e2e/suites/pagination/personal-files.ts
@@ -0,0 +1,134 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { BrowsingPage } from '../../pages/pages';
+import { Utils } from '../../utilities/utils';
+
+export function personalFilesTests(parentName: string) {
+ const page = new BrowsingPage();
+ const { dataTable, pagination } = page;
+
+ describe('Pagination controls : ', () => {
+
+ beforeAll(async () => {
+ await page.clickPersonalFilesAndWait();
+ await dataTable.doubleClickOnRowByName(parentName);
+ await dataTable.waitForHeader();
+ });
+
+ afterEach(async () => {
+ await Utils.pressEscape();
+ });
+
+ it('Pagination control default values - [C280077]', async () => {
+ expect(await pagination.getRange()).toContain('1-25 of 101');
+ expect(await pagination.getMaxItems()).toContain('25');
+ expect(await pagination.getCurrentPage()).toContain('Page 1');
+ expect(await pagination.getTotalPages()).toContain('of 5');
+ expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled');
+ expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
+ });
+
+ it('Items per page values - [C280078]', async () => {
+ await pagination.openMaxItemsMenu();
+ expect(await pagination.menu.getNthItem(1).getText()).toBe('25');
+ expect(await pagination.menu.getNthItem(2).getText()).toBe('50');
+ expect(await pagination.menu.getNthItem(3).getText()).toBe('100');
+ await pagination.menu.closeMenu();
+ });
+
+ it('current page menu items - [C280079]', async () => {
+ await pagination.openMaxItemsMenu();
+ await pagination.menu.clickMenuItem('25');
+ expect(await pagination.getMaxItems()).toContain('25');
+ expect(await pagination.getTotalPages()).toContain('of 5');
+ await pagination.openCurrentPageMenu();
+ expect(await pagination.menu.getItemsCount()).toBe(5);
+ await pagination.menu.closeMenu();
+
+ await pagination.openMaxItemsMenu();
+ await pagination.menu.clickMenuItem('50');
+ expect(await pagination.getMaxItems()).toContain('50');
+ expect(await pagination.getTotalPages()).toContain('of 3');
+ await pagination.openCurrentPageMenu();
+ expect(await pagination.menu.getItemsCount()).toBe(3);
+ await pagination.menu.closeMenu();
+
+ await pagination.openMaxItemsMenu();
+ await pagination.menu.clickMenuItem('100');
+ expect(await pagination.getMaxItems()).toContain('100');
+ expect(await pagination.getTotalPages()).toContain('of 2');
+ await pagination.openCurrentPageMenu();
+ expect(await pagination.menu.getItemsCount()).toBe(2);
+ await pagination.menu.closeMenu();
+
+ await pagination.resetToDefaultPageSize();
+ });
+
+ it('change the current page from menu - [C280080]', async () => {
+ await pagination.openCurrentPageMenu();
+ await pagination.menu.clickNthItem(3);
+ await dataTable.waitForHeader();
+ expect(await pagination.getRange()).toContain('51-75 of 101');
+ expect(await pagination.getCurrentPage()).toContain('Page 3');
+ expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled');
+ expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
+ expect(await dataTable.isItemPresent('my-file-60')).toBe(true, 'File not found on page');
+
+ await pagination.resetToDefaultPageNumber();
+ });
+
+ it('navigate to next and previous pages - [C280083]', async () => {
+ await pagination.clickNext();
+ await dataTable.waitForHeader();
+ expect(await pagination.getRange()).toContain('26-50 of 101');
+ expect(await dataTable.isItemPresent('my-file-31')).toBe(true, 'file-31 not found on page');
+ await pagination.resetToDefaultPageNumber();
+
+ await pagination.openCurrentPageMenu();
+ await pagination.menu.clickNthItem(2);
+ await dataTable.waitForHeader();
+ await pagination.clickPrevious();
+ await dataTable.waitForHeader();
+ expect(await pagination.getRange()).toContain('1-25 of 101');
+ expect(await dataTable.isItemPresent('my-file-12')).toBe(true, 'my-file-12 not found on page');
+
+ await pagination.resetToDefaultPageNumber();
+ });
+
+ it('Previous button is disabled on first page - [C280081]', async () => {
+ expect(await pagination.getCurrentPage()).toContain('Page 1');
+ expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled on first page');
+ });
+
+ it('Next button is disabled on last page - [C280082]', async () => {
+ await pagination.openCurrentPageMenu();
+ await pagination.menu.clickNthItem(5);
+ expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page');
+ expect(await pagination.getCurrentPage()).toContain('Page 5');
+ expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
+ });
+ });
+}
diff --git a/e2e/suites/pagination/recent-files.ts b/e2e/suites/pagination/recent-files.ts
new file mode 100755
index 000000000..866e46585
--- /dev/null
+++ b/e2e/suites/pagination/recent-files.ts
@@ -0,0 +1,132 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { BrowsingPage } from '../../pages/pages';
+import { Utils } from '../../utilities/utils';
+
+export function recentFilesTests() {
+ const page = new BrowsingPage();
+ const { dataTable, pagination } = page;
+
+ describe('Pagination controls : ', () => {
+
+ beforeAll(async () => {
+ await page.clickRecentFilesAndWait();
+ });
+
+ afterEach(async () => {
+ await Utils.pressEscape();
+ });
+
+ it('Pagination control default values - [C280104]', async () => {
+ expect(await pagination.getRange()).toContain('1-25 of 101');
+ expect(await pagination.getMaxItems()).toContain('25');
+ expect(await pagination.getCurrentPage()).toContain('Page 1');
+ expect(await pagination.getTotalPages()).toContain('of 5');
+ expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled');
+ expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
+ });
+
+ it('Items per page values - [C280105]', async () => {
+ await pagination.openMaxItemsMenu();
+ expect(await pagination.menu.getNthItem(1).getText()).toBe('25');
+ expect(await pagination.menu.getNthItem(2).getText()).toBe('50');
+ expect(await pagination.menu.getNthItem(3).getText()).toBe('100');
+ await pagination.menu.closeMenu();
+ });
+
+ it('current page menu items - [C280106]', async () => {
+ await pagination.openMaxItemsMenu();
+ await pagination.menu.clickMenuItem('25');
+ expect(await pagination.getMaxItems()).toContain('25');
+ expect(await pagination.getTotalPages()).toContain('of 5');
+ await pagination.openCurrentPageMenu();
+ expect(await pagination.menu.getItemsCount()).toBe(5);
+ await pagination.menu.closeMenu();
+
+ await pagination.openMaxItemsMenu();
+ await pagination.menu.clickMenuItem('50');
+ expect(await pagination.getMaxItems()).toContain('50');
+ expect(await pagination.getTotalPages()).toContain('of 3');
+ await pagination.openCurrentPageMenu();
+ expect(await pagination.menu.getItemsCount()).toBe(3);
+ await pagination.menu.closeMenu();
+
+ await pagination.openMaxItemsMenu();
+ await pagination.menu.clickMenuItem('100');
+ expect(await pagination.getMaxItems()).toContain('100');
+ expect(await pagination.getTotalPages()).toContain('of 2');
+ await pagination.openCurrentPageMenu();
+ expect(await pagination.menu.getItemsCount()).toBe(2);
+ await pagination.menu.closeMenu();
+
+ await pagination.resetToDefaultPageSize();
+ });
+
+ it('change the current page from menu - [C280107]', async () => {
+ await pagination.openCurrentPageMenu();
+ await pagination.menu.clickNthItem(3);
+ await dataTable.waitForHeader();
+ expect(await pagination.getRange()).toContain('51-75 of 101');
+ expect(await pagination.getCurrentPage()).toContain('Page 3');
+ expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled');
+ expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
+ expect(await dataTable.isItemPresent('my-file-40')).toBe(true, 'File not found on page');
+
+ await pagination.resetToDefaultPageNumber();
+ });
+
+ it('navigate to next and previous pages - [C280110]', async () => {
+ await pagination.clickNext();
+ await dataTable.waitForHeader();
+ expect(await pagination.getRange()).toContain('26-50 of 101');
+ expect(await dataTable.isItemPresent('my-file-70')).toBe(true, 'File not found on page');
+ await pagination.resetToDefaultPageNumber();
+
+ await pagination.openCurrentPageMenu();
+ await pagination.menu.clickNthItem(2);
+ await dataTable.waitForHeader();
+ await pagination.clickPrevious();
+ await dataTable.waitForHeader();
+ expect(await pagination.getRange()).toContain('1-25 of 101');
+ expect(await dataTable.isItemPresent('my-file-88')).toBe(true, 'File not found on page');
+
+ await pagination.resetToDefaultPageNumber();
+ });
+
+ it('Previous button is disabled on first page - [C280108]', async () => {
+ expect(await pagination.getCurrentPage()).toContain('Page 1');
+ expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled on first page');
+ });
+
+ it('Next button is disabled on last page - [C280109]', async () => {
+ await pagination.openCurrentPageMenu();
+ await pagination.menu.clickNthItem(5);
+ expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page');
+ expect(await pagination.getCurrentPage()).toContain('Page 5');
+ expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
+ });
+ });
+}
diff --git a/e2e/suites/pagination/search-results.ts b/e2e/suites/pagination/search-results.ts
new file mode 100755
index 000000000..8ed3ef219
--- /dev/null
+++ b/e2e/suites/pagination/search-results.ts
@@ -0,0 +1,132 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { BrowsingPage } from '../../pages/pages';
+import { Utils } from '../../utilities/utils';
+
+export function searchResultsTests() {
+ const page = new BrowsingPage();
+ const { dataTable, pagination } = page;
+ const { searchInput } = page.header;
+
+ describe('Pagination controls : ', () => {
+
+ beforeAll(async () => {
+ await searchInput.clickSearchButton();
+ await searchInput.searchFor('my-file-');
+ await dataTable.waitForBody();
+ });
+
+ afterEach(async () => {
+ await Utils.pressEscape();
+ });
+
+ it('Pagination control default values - [C290125]', async () => {
+ expect(await pagination.getRange()).toContain('1-25 of 101');
+ expect(await pagination.getMaxItems()).toContain('25');
+ expect(await pagination.getCurrentPage()).toContain('Page 1');
+ expect(await pagination.getTotalPages()).toContain('of 5');
+ expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled');
+ expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
+ });
+
+ it('Items per page values - [C290126]', async () => {
+ await pagination.openMaxItemsMenu();
+ expect(await pagination.menu.getNthItem(1).getText()).toBe('25');
+ expect(await pagination.menu.getNthItem(2).getText()).toBe('50');
+ expect(await pagination.menu.getNthItem(3).getText()).toBe('100');
+ await pagination.menu.closeMenu();
+ });
+
+ it('current page menu items - [C290127]', async () => {
+ await pagination.openMaxItemsMenu();
+ await pagination.menu.clickMenuItem('25');
+ expect(await pagination.getMaxItems()).toContain('25');
+ expect(await pagination.getTotalPages()).toContain('of 5');
+ await pagination.openCurrentPageMenu();
+ expect(await pagination.menu.getItemsCount()).toBe(5);
+ await pagination.menu.closeMenu();
+
+ await pagination.openMaxItemsMenu();
+ await pagination.menu.clickMenuItem('50');
+ expect(await pagination.getMaxItems()).toContain('50');
+ expect(await pagination.getTotalPages()).toContain('of 3');
+ await pagination.openCurrentPageMenu();
+ expect(await pagination.menu.getItemsCount()).toBe(3);
+ await pagination.menu.closeMenu();
+
+ await pagination.openMaxItemsMenu();
+ await pagination.menu.clickMenuItem('100');
+ expect(await pagination.getMaxItems()).toContain('100');
+ expect(await pagination.getTotalPages()).toContain('of 2');
+ await pagination.openCurrentPageMenu();
+ expect(await pagination.menu.getItemsCount()).toBe(2);
+ await pagination.menu.closeMenu();
+
+ await pagination.resetToDefaultPageSize();
+ });
+
+ it('change the current page from menu - [C290128]', async () => {
+ await pagination.openCurrentPageMenu();
+ await pagination.menu.clickNthItem(3);
+ await dataTable.waitForBody();
+ expect(await pagination.getRange()).toContain('51-75 of 101');
+ expect(await pagination.getCurrentPage()).toContain('Page 3');
+ expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled');
+ expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
+
+ await pagination.resetToDefaultPageNumber();
+ });
+
+ it('navigate to next and previous pages - [C290131]', async () => {
+ await pagination.clickNext();
+ await dataTable.waitForBody();
+ expect(await pagination.getRange()).toContain('26-50 of 101');
+ await pagination.resetToDefaultPageNumber();
+
+ await pagination.openCurrentPageMenu();
+ await pagination.menu.clickNthItem(2);
+ await dataTable.waitForBody();
+ await pagination.clickPrevious();
+ await dataTable.waitForBody();
+ expect(await pagination.getRange()).toContain('1-25 of 101');
+
+ await pagination.resetToDefaultPageNumber();
+ });
+
+ it('Previous button is disabled on first page - [C290129]', async () => {
+ expect(await pagination.getCurrentPage()).toContain('Page 1');
+ expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled on first page');
+ });
+
+ it('Next button is disabled on last page - [C290130]', async () => {
+ await pagination.openCurrentPageMenu();
+ await pagination.menu.clickNthItem(5);
+ expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page');
+ expect(await pagination.getCurrentPage()).toContain('Page 5');
+ expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
+ });
+ });
+}
diff --git a/e2e/suites/pagination/shared-files.ts b/e2e/suites/pagination/shared-files.ts
new file mode 100755
index 000000000..c52ded324
--- /dev/null
+++ b/e2e/suites/pagination/shared-files.ts
@@ -0,0 +1,132 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { BrowsingPage } from '../../pages/pages';
+import { Utils } from '../../utilities/utils';
+
+export function sharedFilesTests() {
+ const page = new BrowsingPage();
+ const { dataTable, pagination } = page;
+
+ describe('Pagination controls : ', () => {
+
+ beforeAll(async () => {
+ await page.clickSharedFilesAndWait();
+ });
+
+ afterEach(async () => {
+ await Utils.pressEscape();
+ });
+
+ it('Pagination control default values - [C280095]', async () => {
+ expect(await pagination.getRange()).toContain('1-25 of 101');
+ expect(await pagination.getMaxItems()).toContain('25');
+ expect(await pagination.getCurrentPage()).toContain('Page 1');
+ expect(await pagination.getTotalPages()).toContain('of 5');
+ expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled');
+ expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
+ });
+
+ it('Items per page values - [C280096]', async () => {
+ await pagination.openMaxItemsMenu();
+ expect(await pagination.menu.getNthItem(1).getText()).toBe('25');
+ expect(await pagination.menu.getNthItem(2).getText()).toBe('50');
+ expect(await pagination.menu.getNthItem(3).getText()).toBe('100');
+ await pagination.menu.closeMenu();
+ });
+
+ it('current page menu items - [C280097]', async () => {
+ await pagination.openMaxItemsMenu();
+ await pagination.menu.clickMenuItem('25');
+ expect(await pagination.getMaxItems()).toContain('25');
+ expect(await pagination.getTotalPages()).toContain('of 5');
+ await pagination.openCurrentPageMenu();
+ expect(await pagination.menu.getItemsCount()).toBe(5);
+ await pagination.menu.closeMenu();
+
+ await pagination.openMaxItemsMenu();
+ await pagination.menu.clickMenuItem('50');
+ expect(await pagination.getMaxItems()).toContain('50');
+ expect(await pagination.getTotalPages()).toContain('of 3');
+ await pagination.openCurrentPageMenu();
+ expect(await pagination.menu.getItemsCount()).toBe(3);
+ await pagination.menu.closeMenu();
+
+ await pagination.openMaxItemsMenu();
+ await pagination.menu.clickMenuItem('100');
+ expect(await pagination.getMaxItems()).toContain('100');
+ expect(await pagination.getTotalPages()).toContain('of 2');
+ await pagination.openCurrentPageMenu();
+ expect(await pagination.menu.getItemsCount()).toBe(2);
+ await pagination.menu.closeMenu();
+
+ await pagination.resetToDefaultPageSize();
+ });
+
+ it('change the current page from menu - [C280098]', async () => {
+ await pagination.openCurrentPageMenu();
+ await pagination.menu.clickNthItem(3);
+ await dataTable.waitForHeader();
+ expect(await pagination.getRange()).toContain('51-75 of 101');
+ expect(await pagination.getCurrentPage()).toContain('Page 3');
+ expect(await pagination.isPreviousEnabled()).toBe(true, 'Previous button is not enabled');
+ expect(await pagination.isNextEnabled()).toBe(true, 'Next button is not enabled');
+ expect(await dataTable.isItemPresent('my-file-40')).toBe(true, 'File not found on page');
+
+ await pagination.resetToDefaultPageNumber();
+ });
+
+ it('navigate to next and previous pages - [C280101]', async () => {
+ await pagination.clickNext();
+ await dataTable.waitForHeader();
+ expect(await pagination.getRange()).toContain('26-50 of 101');
+ expect(await dataTable.isItemPresent('my-file-70')).toBe(true, 'File not found on page');
+ await pagination.resetToDefaultPageNumber();
+
+ await pagination.openCurrentPageMenu();
+ await pagination.menu.clickNthItem(2);
+ await dataTable.waitForHeader();
+ await pagination.clickPrevious();
+ await dataTable.waitForHeader();
+ expect(await pagination.getRange()).toContain('1-25 of 101');
+ expect(await dataTable.isItemPresent('my-file-88')).toBe(true, 'File not found on page');
+
+ await pagination.resetToDefaultPageNumber();
+ });
+
+ it('Previous button is disabled on first page - [C280099]', async () => {
+ expect(await pagination.getCurrentPage()).toContain('Page 1');
+ expect(await pagination.isPreviousEnabled()).toBe(false, 'Previous button is enabled on first page');
+ });
+
+ it('Next button is disabled on last page - [C280100]', async () => {
+ await pagination.openCurrentPageMenu();
+ await pagination.menu.clickNthItem(5);
+ expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items on the last page');
+ expect(await pagination.getCurrentPage()).toContain('Page 5');
+ expect(await pagination.isNextEnabled()).toBe(false, 'Next button is enabled on last page');
+ });
+ });
+}
diff --git a/e2e/suites/pagination/pag-single-page.test.ts b/e2e/suites/pagination/single-page.test.ts
similarity index 67%
rename from e2e/suites/pagination/pag-single-page.test.ts
rename to e2e/suites/pagination/single-page.test.ts
index 6c9560549..9689c3f52 100755
--- a/e2e/suites/pagination/pag-single-page.test.ts
+++ b/e2e/suites/pagination/single-page.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -23,60 +23,60 @@
* along with Alfresco. If not, see .
*/
-import { LoginPage, BrowsingPage } from '../../pages/pages';
+import { LoginPage, BrowsingPage, SearchResultsPage } from '../../pages/pages';
import { Utils } from '../../utilities/utils';
+import { AdminActions } from '../../utilities/admin-actions';
import { RepoClient } from '../../utilities/repo-client/repo-client';
describe('Pagination on single page', () => {
- const username = `user-${Utils.random()}`;
+ const random = Utils.random();
- const siteName = `site-${Utils.random()}`; let siteId;
+ const username = `user-${random}`;
- const file = `file-${Utils.random()}.txt`; let fileId;
- const fileInTrash = `fileInTrash-${Utils.random()}.txt`; let fileInTrashId;
+ const siteName = `site-${random}`;
+ let siteId: string;
- const apis = {
- admin: new RepoClient(),
- user: new RepoClient(username, username)
- };
+ const file = `file-${random}.txt`;
+ let fileId: string;
+ const fileInTrash = `fileInTrash-${random}.txt`;
+ let fileInTrashId: string;
+
+ const userApi = new RepoClient(username, username);
+ const adminApiActions = new AdminActions();
const loginPage = new LoginPage();
const page = new BrowsingPage();
- const { pagination, dataTable } = page;
+ const { pagination } = page;
const { searchInput } = page.header;
+ const searchResultsPage = new SearchResultsPage();
- beforeAll(async (done) => {
- await apis.admin.people.createUser({ username });
- const [fileP, fileInTrashP, siteP] = await Promise.all([
- apis.user.nodes.createFile(file),
- apis.user.nodes.createFile(fileInTrash),
- apis.user.sites.createSite(siteName)
+ beforeAll(async () => {
+ await adminApiActions.createUser({ username });
+
+ fileId = (await userApi.nodes.createFile(file)).entry.id;
+ fileInTrashId = (await userApi.nodes.createFile(fileInTrash)).entry.id;
+ siteId = (await userApi.sites.createSite(siteName)).entry.id;
+
+ await userApi.nodes.deleteNodeById(fileInTrashId, false);
+ await userApi.favorites.addFavoriteById('file', fileId);
+ await userApi.shared.shareFileById(fileId);
+
+ await Promise.all([
+ userApi.favorites.waitForApi({ expect: 2 }),
+ userApi.search.waitForApi(username, { expect: 1 }),
+ userApi.shared.waitForApi({ expect: 1 }),
+ userApi.trashcan.waitForApi({ expect: 1 })
]);
- fileId = fileP.entry.id;
- fileInTrashId = fileInTrashP.entry.id;
- siteId = siteP.entry.id;
-
- await apis.user.nodes.deleteNodeById(fileInTrashId, false);
- await apis.user.favorites.addFavoriteById('file', fileId);
- await apis.user.shared.shareFileById(fileId);
-
- await apis.user.favorites.waitForApi({ expect: 2 });
- await apis.user.search.waitForApi(username, { expect: 1 });
- await apis.user.shared.waitForApi({ expect: 1 });
- await apis.user.trashcan.waitForApi({ expect: 1 });
-
await loginPage.loginWith(username);
- done();
});
- afterAll(async (done) => {
+ afterAll(async () => {
await Promise.all([
- apis.user.nodes.deleteNodeById(fileId),
- apis.user.sites.deleteSite(siteId),
- apis.user.trashcan.emptyTrash()
+ userApi.nodes.deleteNodeById(fileId),
+ userApi.sites.deleteSite(siteId),
+ userApi.trashcan.emptyTrash()
]);
- done();
});
it('page selector not displayed on Favorites - [C280112]', async () => {
@@ -116,9 +116,8 @@ describe('Pagination on single page', () => {
it('page selector not displayed on Search results - [C290124]', async () => {
await searchInput.clickSearchButton();
- await searchInput.checkOnlyFiles();
await searchInput.searchFor(file);
- await dataTable.waitForBody();
+ await searchResultsPage.waitForResults();
expect(await pagination.isPagesButtonPresent()).toBe(false, 'page selector displayed');
});
diff --git a/e2e/suites/search/search-filters.test.ts b/e2e/suites/search/search-filters.test.ts
new file mode 100644
index 000000000..66df49fac
--- /dev/null
+++ b/e2e/suites/search/search-filters.test.ts
@@ -0,0 +1,635 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { LoginPage, SearchResultsPage } from '../../pages/pages';
+import { RepoClient } from '../../utilities/repo-client/repo-client';
+import { Utils } from '../../utilities/utils';
+import { FILES, SITE_VISIBILITY, SITE_ROLES } from '../../configs';
+import * as moment from 'moment';
+
+describe('Search filters', () => {
+ const random = Utils.random();
+
+ const user1 = `user1-${random}`;
+ const user2 = `user2-${random}`;
+
+ const parent = `parent-${random}`;
+ let parentId: string;
+
+ const site = `site-${Utils.random()}`; let docLibId;
+
+ const fileJpgUser1 = {
+ name: `search-filters-file-1-${random}.jpg`,
+ source: FILES.jpgFile
+ };
+
+ const filePdfUser2 = {
+ name: `search-filters-file-2-${random}.pdf`,
+ title: 'search filters title',
+ description: 'search filters',
+ source: FILES.pdfFile
+ };
+
+ const expectedFileTypes = ['Adobe PDF Document (1)', 'JPEG Image (1)'];
+ const expectedCreators = [`${user1} ${user1} (1)`, `${user2} ${user2} (1)`];
+ const expectedModifiers = [`${user1} ${user1} (1)`, `${user2} ${user2} (1)`];
+ const expectedLocations = ['_REPOSITORY_ (1)', `${site} (1)`];
+
+ const apis = {
+ admin: new RepoClient(),
+ user1: new RepoClient(user1, user1),
+ user2: new RepoClient(user2, user2)
+ };
+
+ const loginPage = new LoginPage();
+ const page = new SearchResultsPage();
+ const { searchInput } = page.header;
+ const { dataTable, filters } = page;
+
+ const sizeFilter = filters.size;
+ const fileTypeFilter = filters.fileType;
+ const createdDateFilter = filters.createdDate;
+ const creatorFilter = filters.creator;
+ const locationFilter = filters.location;
+ const modifierFilter = filters.modifier;
+ const modifiedDateFilter = filters.modifiedDate;
+
+ beforeAll(async (done) => {
+ await apis.admin.people.createUser({ username: user1 });
+ await apis.admin.people.createUser({ username: user2 });
+ parentId = (await apis.user1.nodes.createFolder(parent)).entry.id;
+ await apis.user1.sites.createSite(site, SITE_VISIBILITY.PUBLIC);
+ await apis.user1.sites.addSiteMember(site, user2, SITE_ROLES.SITE_MANAGER.ROLE);
+ docLibId = await apis.admin.sites.getDocLibId(site);
+
+ await apis.user1.nodes.setGranularPermission(parentId, true, user2, 'Collaborator');
+
+ await apis.user1.upload.uploadFileWithRename(fileJpgUser1.source, docLibId, fileJpgUser1.name);
+ await apis.user2.upload.uploadFileWithRename(filePdfUser2.source, parentId, filePdfUser2.name, filePdfUser2.title, filePdfUser2.description);
+
+ await apis.user1.search.waitForNodes('search-filters', { expect: 2 });
+
+ await loginPage.loginWith(user1);
+ done();
+ });
+
+ beforeEach(async (done) => {
+ await Utils.pressEscape();
+ await page.clickPersonalFilesAndWait();
+
+ await searchInput.clickSearchButton();
+ await searchInput.searchFor('search filters');
+ await dataTable.waitForBody();
+ done();
+ });
+
+ afterAll(async (done) => {
+ await Promise.all([
+ apis.user1.nodes.deleteNodeById(parentId),
+ apis.user1.sites.deleteSite(site)
+ ]);
+ done();
+ });
+
+ it('Filters are displayed - [C279186]', async () => {
+ expect(await sizeFilter.isPanelDisplayed()).toBe(true, 'Size filter panel not displayed');
+ expect(await createdDateFilter.isPanelDisplayed()).toBe(true, 'Created date filter panel not displayed');
+ expect(await fileTypeFilter.isPanelDisplayed()).toBe(true, 'File type filter panel not displayed');
+ expect(await creatorFilter.isPanelDisplayed()).toBe(true, 'Creator filter panel not displayed');
+ expect(await modifierFilter.isPanelDisplayed()).toBe(true, 'Modifier filter panel not displayed');
+ expect(await locationFilter.isPanelDisplayed()).toBe(true, 'Location filter panel not displayed');
+ expect(await modifiedDateFilter.isPanelDisplayed()).toBe(true, 'Modified date filter panel not displayed');
+ });
+
+ describe('Filter by Size', () => {
+ afterEach(async (done) => {
+ await sizeFilter.resetPanel();
+ done();
+ });
+
+ it('Expand / Collapse the Size filter panel - [C279197]', async () => {
+ expect(await sizeFilter.isPanelExpanded()).toBe(false, 'Size filter panel is expanded');
+
+ await sizeFilter.expandPanel();
+ expect(await sizeFilter.isPanelExpanded()).toBe(true, 'Size filter panel not expanded');
+
+ const expectedSizes = ['Small', 'Medium', 'Large', 'Huge'];
+ expect(await sizeFilter.getFiltersValues()).toEqual(expectedSizes, 'Incorrect Size filters facets');
+ expect(await sizeFilter.isClearButtonEnabled()).toBe(true, 'Size filter Clear button not enabled');
+
+ await sizeFilter.collapsePanel();
+ expect(await sizeFilter.isPanelExpanded()).toBe(false, 'Size filter panel is expanded');
+ });
+
+ it('Filter by Small - [C279199]', async () => {
+ await sizeFilter.expandPanel();
+ await sizeFilter.checkSizeSmall();
+
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, `${fileJpgUser1.name} not in the list`);
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, `${filePdfUser2.name} not in the list`);
+ });
+
+ it('Filter by Huge - [C279202]', async () => {
+ await sizeFilter.expandPanel();
+ await sizeFilter.checkSizeHuge();
+
+ expect(await dataTable.isEmpty()).toBe(true, 'list is not empty');
+ });
+
+ it('Filter by multiple size categories - [C279203]', async () => {
+ await sizeFilter.expandPanel();
+ await sizeFilter.checkSizeSmall();
+ await sizeFilter.checkSizeMedium();
+ await sizeFilter.checkSizeLarge();
+
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, `${fileJpgUser1.name} not in the list`);
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, `${filePdfUser2.name} not in the list`);
+ });
+
+ it('Clear the Size filter options - [C279198]', async () => {
+ await sizeFilter.expandPanel();
+ await sizeFilter.checkSizeSmall();
+ await sizeFilter.checkSizeMedium();
+ expect(await sizeFilter.getFiltersCheckedValues()).toEqual(['Small', 'Medium'], 'Incorrect checked Size filters');
+
+ await sizeFilter.clickClearButton();
+ expect(await sizeFilter.getFiltersCheckedValues()).toEqual([], 'Size filters not cleared');
+ });
+ });
+
+ describe('Filter by Created date', () => {
+ const yesterday = moment().subtract(1, 'day').format('DD-MMM-YY');
+ const today = moment().format('DD-MMM-YY');
+ const future = moment().add(1, 'month').format('DD-MMM-YY');
+
+ afterEach(async (done) => {
+ await createdDateFilter.resetPanel();
+ done();
+ });
+
+ it('Expand / Collapse the Created date filter panel - [C279211]', async () => {
+ expect(await createdDateFilter.isPanelExpanded()).toBe(false, 'Created date filter panel is expanded');
+
+ await createdDateFilter.expandPanel();
+ expect(await createdDateFilter.isPanelExpanded()).toBe(true, 'Created date filter panel not expanded');
+
+ expect(await createdDateFilter.isClearButtonEnabled()).toBe(true, 'Created date CLEAR button not enabled');
+ expect(await createdDateFilter.isApplyButtonEnabled()).toBe(false, 'Created date APPLY button not disabled');
+
+ await createdDateFilter.collapsePanel();
+ expect(await createdDateFilter.isPanelExpanded()).toBe(false, 'Created date filter panel is expanded');
+ });
+
+ it('Results are filtered by Created date - [C279217]', async () => {
+ await createdDateFilter.expandPanel();
+ await createdDateFilter.enterFromDate(yesterday);
+ await createdDateFilter.enterToDate(yesterday);
+
+ expect(await createdDateFilter.isApplyButtonEnabled()).toBe(true, 'Created date filter Apply button not enabled');
+
+ await createdDateFilter.clickApplyButton();
+
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(false, 'PDF file is displayed');
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(false, 'JPG file is displayed');
+
+ await createdDateFilter.enterFromDate(yesterday);
+ await createdDateFilter.enterToDate(today);
+
+ expect(await createdDateFilter.isApplyButtonEnabled()).toBe(true, 'Created date filter Apply button not enabled');
+
+ await createdDateFilter.clickApplyButton();
+
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
+ });
+
+ it('Clear the Created date filter options - [C279216]', async () => {
+ await createdDateFilter.expandPanel();
+ await createdDateFilter.enterFromDate(yesterday);
+ await createdDateFilter.enterToDate(yesterday);
+ await createdDateFilter.clickApplyButton();
+
+ expect(await createdDateFilter.getFromValue()).toContain(yesterday);
+ expect(await createdDateFilter.getToValue()).toContain(yesterday);
+
+ await createdDateFilter.clickClearButton();
+
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file is displayed');
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file is displayed');
+ expect(await createdDateFilter.getFromValue()).toEqual('', 'From field not empty');
+ expect(await createdDateFilter.getToValue()).toEqual('', 'To field not empty');
+ });
+
+ it('From and To values are required - [C279212]', async () => {
+ await createdDateFilter.expandPanel();
+ await createdDateFilter.enterFromDate('');
+ await createdDateFilter.enterToDate('');
+
+ expect(await createdDateFilter.isFromErrorDisplayed()).toBe(true, 'Error missing for From field');
+ expect(await createdDateFilter.isToErrorDisplayed()).toBe(true, 'Error missing for To field');
+ expect(await createdDateFilter.getFromError()).toEqual('Required value');
+ expect(await createdDateFilter.getToError()).toEqual('Required value');
+ });
+
+ it('Error message is displayed when entering an incorrect date format - [C279213]', async () => {
+ await createdDateFilter.expandPanel();
+ await createdDateFilter.enterFromDate('03.31.2019');
+ await createdDateFilter.enterToDate('invalid text');
+
+ expect(await createdDateFilter.isFromErrorDisplayed()).toBe(true, 'Error missing for From field');
+ expect(await createdDateFilter.isToErrorDisplayed()).toBe(true, 'Error missing for To field');
+ expect(await createdDateFilter.getFromError()).toEqual(`Invalid date. The date must be in the format 'DD-MMM-YY'`);
+ expect(await createdDateFilter.getToError()).toEqual(`Invalid date. The date must be in the format 'DD-MMM-YY'`);
+ });
+
+ it('Error message is displayed when entering a date from the future - [C279214]', async () => {
+ await createdDateFilter.expandPanel();
+ await createdDateFilter.enterFromDate(future);
+ await createdDateFilter.enterToDate(future);
+
+ expect(await createdDateFilter.isFromErrorDisplayed()).toBe(true, 'Error missing for From field');
+ expect(await createdDateFilter.isToErrorDisplayed()).toBe(true, 'Error missing for To field');
+ expect(await createdDateFilter.getFromError()).toEqual('The date is beyond the maximum date.');
+ expect(await createdDateFilter.getToError()).toEqual('The date is beyond the maximum date.');
+ });
+
+ it('Error message is displayed when From value is bigger than To value - [C279215]', async () => {
+ await createdDateFilter.expandPanel();
+ await createdDateFilter.enterFromDate(today);
+ await createdDateFilter.enterToDate(yesterday);
+
+ expect(await createdDateFilter.isToErrorDisplayed()).toBe(true, 'Error missing for To field');
+ expect(await createdDateFilter.getToError()).toEqual('No days selected.');
+ });
+ });
+
+ describe('Filter by File type', () => {
+ afterEach(async (done) => {
+ await filters.clickResetAllButton();
+ done();
+ });
+
+ it('Expand / Collapse the File type filter panel - [C279191]', async () => {
+ expect(await fileTypeFilter.isPanelExpanded()).toBe(true, 'File type filter panel not expanded');
+ expect(await fileTypeFilter.getFiltersValues()).toEqual(expectedFileTypes, 'Incorrect File type filters facets');
+ expect(await fileTypeFilter.isFilterCategoryInputDisplayed()).toBe(true, 'File type filter categories not displayed');
+
+ await fileTypeFilter.collapsePanel();
+ expect(await fileTypeFilter.isPanelExpanded()).toBe(false, 'File type filter panel is expanded');
+ });
+
+ it('Results are filtered by File type - [C279192]', async () => {
+ await fileTypeFilter.expandPanel();
+ await fileTypeFilter.checkCategory('Adobe PDF Document');
+
+ expect(await fileTypeFilter.isClearButtonEnabled()).toBe(true, 'File type filter Clear button not enabled');
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(false, 'JPG file is displayed');
+ expect(await page.getResultsChipsValues()).toEqual(['Adobe PDF Document']);
+
+ await fileTypeFilter.checkCategory('JPEG Image');
+
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
+ expect(await page.getResultsChipsValues()).toEqual(['Adobe PDF Document', 'JPEG Image']);
+ });
+
+ it('Clear the File type filter options - [C279193]', async () => {
+ await fileTypeFilter.expandPanel();
+ await fileTypeFilter.checkCategory('Adobe PDF Document');
+
+ expect(await fileTypeFilter.getFiltersCheckedValues()).toEqual(['Adobe PDF Document (1)']);
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(false, 'JPG file is displayed');
+
+ await fileTypeFilter.clickClearButton();
+
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
+ expect(await fileTypeFilter.getFiltersCheckedValues()).toEqual([], 'File types selection not cleared');
+ });
+
+ it('Search for a specific file type - [C279195]', async () => {
+ await fileTypeFilter.expandPanel();
+ expect(await fileTypeFilter.getFiltersValues()).toEqual(expectedFileTypes, 'Incorrect File type filters facets');
+ await fileTypeFilter.filterCategoriesBy('PDF');
+ expect(await fileTypeFilter.getFiltersValues()).toEqual(['Adobe PDF Document (1)'], 'Incorrect File type filters facets');
+ });
+ });
+
+ describe('Filter by Creator', () => {
+ afterEach(async (done) => {
+ await filters.clickResetAllButton();
+ done();
+ });
+
+ it('Expand / Collapse the Creator filter panel - [C279205]', async () => {
+ expect(await creatorFilter.isPanelExpanded()).toBe(true, 'Creator filter panel not expanded');
+
+ expect(await creatorFilter.getFiltersValues()).toEqual(expectedCreators, 'Incorrect Creator filters facets');
+ expect(await creatorFilter.isFilterCategoryInputDisplayed()).toBe(true, 'Creator filter categories not displayed');
+
+ await creatorFilter.collapsePanel();
+ expect(await creatorFilter.isPanelExpanded()).toBe(false, 'Creator filter panel is expanded');
+ });
+
+ it('Results are filtered by Creator - [C279206]', async () => {
+ await creatorFilter.expandPanel();
+ await creatorFilter.checkCategory(user1);
+
+ expect(await creatorFilter.isClearButtonEnabled()).toBe(true, 'Creator filter Clear button not enabled');
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(false, 'PDF file is displayed');
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
+ expect(await page.getResultsChipsValues()).toEqual([`${user1} ${user1}`]);
+
+ await creatorFilter.checkCategory(user2);
+
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
+ expect(await page.getResultsChipsValues()).toEqual([`${user1} ${user1}`, `${user2} ${user2}`]);
+ });
+
+ it('Clear the Creator filter options - [C279207]', async () => {
+ await creatorFilter.expandPanel();
+ await creatorFilter.checkCategory(user1);
+
+ expect(await creatorFilter.getFiltersCheckedValues()).toEqual([`${user1} ${user1} (1)`]);
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(false, 'PDF file is displayed');
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
+
+ await creatorFilter.clickClearButton();
+
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
+ expect(await creatorFilter.getFiltersCheckedValues()).toEqual([], 'Creator selection not cleared');
+ });
+
+ it('Search for a specific creator - [C279208]', async () => {
+ await creatorFilter.expandPanel();
+ expect(await creatorFilter.getFiltersValues()).toEqual(expectedCreators, 'Incorrect Creator filters facets');
+ await creatorFilter.filterCategoriesBy(user1);
+ expect(await creatorFilter.getFiltersValues()).toEqual([`${user1} ${user1} (1)`], 'Incorrect Creator filters facets');
+ });
+ });
+
+ describe('Filter by Modifier', () => {
+ afterEach(async (done) => {
+ await filters.clickResetAllButton();
+ done();
+ });
+
+ it('Expand / Collapse the Modifier filter panel - [C279224]', async () => {
+ expect(await modifierFilter.isPanelExpanded()).toBe(true, 'Modifier filter panel not expanded');
+
+ expect(await modifierFilter.getFiltersValues()).toEqual(expectedModifiers, 'Incorrect Modifier filters facets');
+ expect(await modifierFilter.isFilterCategoryInputDisplayed()).toBe(true, 'Modifier filter categories not displayed');
+
+ await modifierFilter.collapsePanel();
+ expect(await modifierFilter.isPanelExpanded()).toBe(false, 'Modifier filter panel is expanded');
+ });
+
+ it('Results are filtered by Modifier - [C279225]', async () => {
+ await modifierFilter.expandPanel();
+ await modifierFilter.checkCategory(user1);
+
+ expect(await modifierFilter.isClearButtonEnabled()).toBe(true, 'Modifier filter Clear button not enabled');
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(false, 'PDF file is displayed');
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
+ expect(await page.getResultsChipsValues()).toEqual([`${user1} ${user1}`]);
+
+ await modifierFilter.checkCategory(user2);
+
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
+ expect(await page.getResultsChipsValues()).toEqual([`${user1} ${user1}`, `${user2} ${user2}`]);
+ });
+
+ it('Clear the Modifier filter options - [C279226]', async () => {
+ await modifierFilter.expandPanel();
+ await modifierFilter.checkCategory(user1);
+
+ expect(await modifierFilter.getFiltersCheckedValues()).toEqual([`${user1} ${user1} (1)`]);
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(false, 'PDF file is displayed');
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
+
+ await modifierFilter.clickClearButton();
+
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
+ expect(await modifierFilter.getFiltersCheckedValues()).toEqual([], 'Modifier selection not cleared');
+ });
+
+ it('Search for a specific modifier - [C279227]', async () => {
+ await modifierFilter.expandPanel();
+ expect(await modifierFilter.getFiltersValues()).toEqual(expectedModifiers, 'Incorrect Modifier filters facets');
+ await modifierFilter.filterCategoriesBy(user1);
+ expect(await modifierFilter.getFiltersValues()).toEqual([`${user1} ${user1} (1)`], 'Incorrect Modifier filters facets');
+ });
+ });
+
+ describe('Filter by Location', () => {
+ afterEach(async (done) => {
+ await filters.clickResetAllButton();
+ done();
+ });
+
+ it('Expand / Collapse the Location filter panel - [C279230]', async () => {
+ expect(await locationFilter.isPanelExpanded()).toBe(true, 'Location filter panel not expanded');
+
+ expect(await locationFilter.getFiltersValues()).toEqual(expectedLocations, 'Incorrect Location filters facets');
+ expect(await locationFilter.isFilterCategoryInputDisplayed()).toBe(true, 'Location filter categories not displayed');
+
+ await locationFilter.collapsePanel();
+ expect(await locationFilter.isPanelExpanded()).toBe(false, 'Location filter panel is expanded');
+ });
+
+ it('Results are filtered by Location - [C279231]', async () => {
+ await locationFilter.expandPanel();
+ await locationFilter.checkCategory(site);
+
+ expect(await locationFilter.isClearButtonEnabled()).toBe(true, 'Location filter Clear button not enabled');
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(false, 'PDF file is displayed');
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
+ expect(await page.getResultsChipsValues()).toEqual([site]);
+
+ await locationFilter.checkCategory('_REPOSITORY_');
+
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
+ expect(await page.getResultsChipsValues()).toEqual([site, '_REPOSITORY_']);
+ });
+
+ it('Clear the Location filter options - [C279232]', async () => {
+ await locationFilter.expandPanel();
+ await locationFilter.checkCategory(site);
+
+ expect(await locationFilter.getFiltersCheckedValues()).toEqual([`${site} (1)`]);
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(false, 'PDF file is displayed');
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
+
+ await locationFilter.clickClearButton();
+
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
+ expect(await locationFilter.getFiltersCheckedValues()).toEqual([], 'Location selection not cleared');
+ });
+
+ it('Search for a specific location - [C279233]', async () => {
+ await locationFilter.expandPanel();
+ expect(await locationFilter.getFiltersValues()).toEqual(expectedLocations, 'Incorrect Location filters facets');
+ await locationFilter.filterCategoriesBy(site);
+ expect(await locationFilter.getFiltersValues()).toEqual([`${site} (1)`], 'Incorrect Location filters facets');
+ });
+ });
+
+ describe('Filter by Modified date', () => {
+ const expectedDateFilters = ['Today (2)', 'This week (2)', 'This month (2)', 'In the last 6 months (2)', 'This year (2)'];
+
+ afterEach(async (done) => {
+ await filters.clickResetAllButton();
+ done();
+ });
+
+ it('Expand / Collapse the Modified date filter panel - [C279219]', async () => {
+ expect(await modifiedDateFilter.isPanelExpanded()).toBe(true, 'Modified Date filter panel not expanded');
+
+ expect(await modifiedDateFilter.getFiltersValues()).toEqual(expectedDateFilters, 'Incorrect Modified Date filters facets');
+ expect(await modifiedDateFilter.isFilterCategoryInputDisplayed()).toBe(true, 'Modified Date filter categories not displayed');
+
+ await modifiedDateFilter.collapsePanel();
+ expect(await modifiedDateFilter.isPanelExpanded()).toBe(false, 'Modified Date filter panel is expanded');
+ });
+
+ it('Results are filtered by Modified date - [C279221]', async () => {
+ await modifiedDateFilter.expandPanel();
+ await modifiedDateFilter.checkCategory('Today');
+
+ expect(await modifiedDateFilter.isClearButtonEnabled()).toBe(true, 'Modified date filter Clear button not enabled');
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
+ expect(await page.getResultsChipsValues()).toEqual(['Today']);
+
+ await modifiedDateFilter.checkCategory('This week');
+
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
+ expect(await page.getResultsChipsValues()).toEqual(['Today', 'This week']);
+ });
+
+ it('Clear the Modified date filter options - [C279220]', async () => {
+ await modifiedDateFilter.expandPanel();
+ await modifiedDateFilter.checkCategory('Today');
+ await modifiedDateFilter.checkCategory('This week');
+ await modifiedDateFilter.checkCategory('This month');
+ await modifiedDateFilter.checkCategory('In the last 6 months');
+ await modifiedDateFilter.checkCategory('This year');
+
+ expect(await modifiedDateFilter.getFiltersCheckedValues()).toEqual(expectedDateFilters, 'Incorrect checked Modified date filters');
+
+ await modifiedDateFilter.clickClearButton();
+ expect(await modifiedDateFilter.getFiltersCheckedValues()).toEqual([], 'Modified date selection not cleared');
+ });
+
+ it('Search for a specific modified date option - [C325006]', async () => {
+ await modifiedDateFilter.expandPanel();
+ expect(await modifiedDateFilter.getFiltersValues()).toEqual(expectedDateFilters, 'Incorrect Modified date filters facets');
+ await modifiedDateFilter.filterCategoriesBy('This');
+ expect(await modifiedDateFilter.getFiltersValues()).toEqual(['This week (2)', 'This month (2)', 'This year (2)'], 'Incorrect Modified date filters facets');
+ });
+ });
+
+ describe('Multiple filters', () => {
+ afterEach(async (done) => {
+ await filters.clickResetAllButton();
+ await sizeFilter.resetPanel();
+ await createdDateFilter.resetPanel();
+ done();
+ });
+
+ it('Multiple filters can be applied - [C280051]', async () => {
+ await sizeFilter.expandPanel();
+ await sizeFilter.checkSizeSmall();
+
+ await fileTypeFilter.expandPanel();
+ await fileTypeFilter.checkCategory('JPEG Image');
+ await creatorFilter.checkCategory(user1);
+ await locationFilter.checkCategory(site);
+
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(false, 'PDF file is displayed');
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
+ expect(await page.getResultsChipsValues()).toEqual(['JPEG Image', `${user1} ${user1}`, site]);
+
+ await page.removeChip('JPEG Image');
+ await page.removeChip(`${user1} ${user1}`);
+ await page.removeChip(site);
+
+ expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
+ expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
+ expect(await page.getResultsChipsValues()).toEqual([]);
+ });
+
+ it('Total results is updated correctly - [C280052]', async () => {
+ await fileTypeFilter.expandPanel();
+ await fileTypeFilter.checkCategory('JPEG Image');
+ await creatorFilter.checkCategory(user1);
+
+ expect(await page.getResultsFoundText()).toEqual('1 result found');
+
+ await page.removeChip('JPEG Image');
+ await page.removeChip(`${user1} ${user1}`);
+
+ expect(await page.getResultsFoundText()).toEqual('2 results found');
+ });
+
+ it('Pagination is correct when search results are filtered - [C279188]', async () => {
+ await fileTypeFilter.expandPanel();
+ await fileTypeFilter.checkCategory('JPEG Image');
+ await creatorFilter.checkCategory(user1);
+
+ expect(await page.pagination.getRange()).toEqual('Showing 1-1 of 1');
+
+ await page.removeChip('JPEG Image');
+ await page.removeChip(`${user1} ${user1}`);
+
+ expect(await page.pagination.getRange()).toEqual('Showing 1-2 of 2');
+ });
+
+ it('The filter facets display is updated when making a new query - [C308042]', async () => {
+ expect(await fileTypeFilter.getFiltersValues()).toEqual(expectedFileTypes);
+ expect(await creatorFilter.getFiltersValues()).toEqual(expectedCreators);
+ expect(await modifierFilter.getFiltersValues()).toEqual(expectedModifiers);
+ expect(await locationFilter.getFiltersValues()).toEqual(expectedLocations);
+
+ await searchInput.clickSearchButton();
+ await searchInput.searchFor(fileJpgUser1.name);
+ await dataTable.waitForBody();
+
+ expect(await fileTypeFilter.getFiltersValues()).toEqual(['JPEG Image (1)']);
+ expect(await creatorFilter.getFiltersValues()).toEqual([`${user1} ${user1} (1)`]);
+ expect(await modifierFilter.getFiltersValues()).toEqual([`${user1} ${user1} (1)`]);
+ expect(await locationFilter.getFiltersValues()).toEqual([`${site} (1)`]);
+ });
+ });
+});
diff --git a/e2e/suites/search/search-input.test.ts b/e2e/suites/search/search-input.test.ts
index ac57d4d98..0c41ce2c4 100644
--- a/e2e/suites/search/search-input.test.ts
+++ b/e2e/suites/search/search-input.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -48,13 +48,13 @@ describe('Search input', () => {
it('Search options are displayed when clicking in the search input - [C289848]', async () => {
await searchInput.clickSearchButton();
- expect(await searchInput.isOptionsAreaDisplayed()).toBe(true, '1. Search options not displayed');
- expect(await searchInput.isFilesOptionEnabled()).toBe(true, '2. Files option not enabled');
- expect(await searchInput.isFoldersOptionEnabled()).toBe(true, '3. Folders option not enabled');
- expect(await searchInput.isLibrariesOptionEnabled()).toBe(true, '4. Libraries option not enabled');
- expect(await searchInput.isFilesOptionChecked()).toBe(false, '5. Files option is checked');
- expect(await searchInput.isFoldersOptionChecked()).toBe(false, '6. Folders option is checked');
- expect(await searchInput.isLibrariesOptionChecked()).toBe(false, '7. Libraries option is checked');
+ expect(await searchInput.isOptionsAreaDisplayed()).toBe(true, 'Search options not displayed');
+ expect(await searchInput.isFilesOptionEnabled()).toBe(true, 'Files option not enabled');
+ expect(await searchInput.isFoldersOptionEnabled()).toBe(true, 'Folders option not enabled');
+ expect(await searchInput.isLibrariesOptionEnabled()).toBe(true, 'Libraries option not enabled');
+ expect(await searchInput.isFilesOptionChecked()).toBe(false, 'Files option is checked');
+ expect(await searchInput.isFoldersOptionChecked()).toBe(false, 'Folders option is checked');
+ expect(await searchInput.isLibrariesOptionChecked()).toBe(false, 'Libraries option is checked');
});
it('Search options are correctly enabled / disabled - [C289849]', async () => {
diff --git a/e2e/suites/search/search-results-files-folders.test.ts b/e2e/suites/search/search-results-files-folders.test.ts
index db589b197..6f9cf33e2 100644
--- a/e2e/suites/search/search-results-files-folders.test.ts
+++ b/e2e/suites/search/search-results-files-folders.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -60,19 +60,9 @@ describe('Search results - files and folders', () => {
beforeAll(async done => {
await apis.admin.people.createUser({ username });
- fileId = (await apis.user.nodes.createFile(
- file,
- '-my-',
- fileTitle,
- fileDescription
- )).entry.id;
+ fileId = (await apis.user.nodes.createFile(file, '-my-', fileTitle, fileDescription)).entry.id;
await apis.user.nodes.editNodeContent(fileId, 'edited by user');
- folderId = (await apis.user.nodes.createFolder(
- folder,
- '-my-',
- folderTitle,
- folderDescription
- )).entry.id;
+ folderId = (await apis.user.nodes.createFolder(folder, '-my-', folderTitle, folderDescription)).entry.id;
fileRussianId = (await apis.user.nodes.createFile(fileRussian)).entry.id;
await apis.user.sites.createSite(site);
@@ -83,6 +73,11 @@ describe('Search results - files and folders', () => {
done();
});
+ beforeEach(async done => {
+ await page.refresh();
+ done();
+ });
+
afterAll(async done => {
await Promise.all([
apis.user.nodes.deleteNodeById(fileId),
@@ -93,20 +88,13 @@ describe('Search results - files and folders', () => {
done();
});
- beforeEach(async done => {
- await page.refresh();
- done();
- });
-
it('Results page title - [C307002]', async () => {
await searchInput.clickSearchButton();
await searchInput.checkFilesAndFolders();
await searchInput.searchFor('test-');
await dataTable.waitForBody();
- expect(await page.breadcrumb.getCurrentItemName()).toEqual(
- 'Search Results'
- );
+ expect(await page.breadcrumb.getCurrentItemName()).toEqual('Search Results');
});
it('File information - [C279183]', async () => {
@@ -116,38 +104,17 @@ describe('Search results - files and folders', () => {
await dataTable.waitForBody();
const fileEntry = await apis.user.nodes.getNodeById(fileId);
- const modifiedDate = moment(fileEntry.entry.modifiedAt).format(
- 'MMM D, YYYY, h:mm:ss A'
- );
+ const modifiedDate = moment(fileEntry.entry.modifiedAt).format('MMM D, YYYY, h:mm:ss A');
const modifiedBy = fileEntry.entry.modifiedByUser.displayName;
const size = fileEntry.entry.content.sizeInBytes;
- expect(await dataTable.isItemPresent(file)).toBe(
- true,
- `${file} is not displayed`
- );
-
- expect(await dataTable.getRowCellsCount(file)).toEqual(
- 2,
- 'incorrect number of columns'
- );
-
- expect(await dataTable.getSearchResultLinesCount(file)).toEqual(
- 4,
- 'incorrect number of lines for search result'
- );
- expect(await dataTable.getSearchResultNameAndTitle(file)).toBe(
- `${file} ( ${fileTitle} )`
- );
- expect(await dataTable.getSearchResultDescription(file)).toBe(
- fileDescription
- );
- expect(await dataTable.getSearchResultModified(file)).toBe(
- `Modified: ${modifiedDate} by ${modifiedBy} | Size: ${size} Bytes`
- );
- expect(await dataTable.getSearchResultLocation(file)).toMatch(
- /Location:\s+Personal Files/
- );
+ expect(await dataTable.isItemPresent(file)).toBe(true, `${file} is not displayed`);
+ expect(await dataTable.getRowCellsCount(file)).toEqual(2, 'incorrect number of columns');
+ expect(await dataTable.getSearchResultLinesCount(file)).toEqual(4, 'incorrect number of lines for search result');
+ expect(await dataTable.getSearchResultNameAndTitle(file)).toBe(`${file} ( ${fileTitle} )`);
+ expect(await dataTable.getSearchResultDescription(file)).toBe(fileDescription);
+ expect(await dataTable.getSearchResultModified(file)).toBe(`Modified: ${modifiedDate} by ${modifiedBy} | Size: ${size} Bytes`);
+ expect(await dataTable.getSearchResultLocation(file)).toMatch(/Location:\s+Personal Files/);
});
it('Folder information - [C306867]', async () => {
@@ -157,37 +124,16 @@ describe('Search results - files and folders', () => {
await dataTable.waitForBody();
const folderEntry = await apis.user.nodes.getNodeById(folderId);
- const modifiedDate = moment(folderEntry.entry.modifiedAt).format(
- 'MMM D, YYYY, h:mm:ss A'
- );
+ const modifiedDate = moment(folderEntry.entry.modifiedAt).format('MMM D, YYYY, h:mm:ss A');
const modifiedBy = folderEntry.entry.modifiedByUser.displayName;
- expect(await dataTable.isItemPresent(folder)).toBe(
- true,
- `${folder} is not displayed`
- );
-
- expect(await dataTable.getRowCellsCount(folder)).toEqual(
- 2,
- 'incorrect number of columns'
- );
-
- expect(await dataTable.getSearchResultLinesCount(folder)).toEqual(
- 4,
- 'incorrect number of lines for search result'
- );
- expect(await dataTable.getSearchResultNameAndTitle(folder)).toBe(
- `${folder} ( ${folderTitle} )`
- );
- expect(await dataTable.getSearchResultDescription(folder)).toBe(
- folderDescription
- );
- expect(await dataTable.getSearchResultModified(folder)).toBe(
- `Modified: ${modifiedDate} by ${modifiedBy}`
- );
- expect(await dataTable.getSearchResultLocation(folder)).toMatch(
- /Location:\s+Personal Files/
- );
+ expect(await dataTable.isItemPresent(folder)).toBe(true, `${folder} is not displayed`);
+ expect(await dataTable.getRowCellsCount(folder)).toEqual(2, 'incorrect number of columns');
+ expect(await dataTable.getSearchResultLinesCount(folder)).toEqual(4, 'incorrect number of lines for search result');
+ expect(await dataTable.getSearchResultNameAndTitle(folder)).toBe(`${folder} ( ${folderTitle} )`);
+ expect(await dataTable.getSearchResultDescription(folder)).toBe(folderDescription);
+ expect(await dataTable.getSearchResultModified(folder)).toBe(`Modified: ${modifiedDate} by ${modifiedBy}`);
+ expect(await dataTable.getSearchResultLocation(folder)).toMatch(/Location:\s+Personal Files/);
});
it('Search file with special characters - [C290029]', async () => {
@@ -196,10 +142,7 @@ describe('Search results - files and folders', () => {
await searchInput.searchFor(fileRussian);
await dataTable.waitForBody();
- expect(await dataTable.isItemPresent(fileRussian)).toBe(
- true,
- `${fileRussian} is not displayed`
- );
+ expect(await dataTable.isItemPresent(fileRussian)).toBe(true, `${fileRussian} is not displayed`);
});
it('Location column redirect - file in user Home - [C279177]', async () => {
diff --git a/e2e/suites/search/search-results-general.test.ts b/e2e/suites/search/search-results-general.test.ts
index cc21b4ef5..6876f525c 100644
--- a/e2e/suites/search/search-results-general.test.ts
+++ b/e2e/suites/search/search-results-general.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/search/search-results-libraries.test.ts b/e2e/suites/search/search-results-libraries.test.ts
index a40ed84f7..6316009b2 100644
--- a/e2e/suites/search/search-results-libraries.test.ts
+++ b/e2e/suites/search/search-results-libraries.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -63,7 +63,6 @@ describe('Search results - libraries', () => {
const adminSite2 = `admin-site-${Utils.random()}`;
const adminSite3 = `admin-site-${Utils.random()}`;
const adminSite4 = `admin-site-${Utils.random()}`;
-
const adminPrivate = `admin-site-${Utils.random()}`;
const apis = {
@@ -173,7 +172,7 @@ describe('Search results - libraries', () => {
await searchInput.searchFor(site1.name);
await dataTable.waitForBody();
- const expectedColumns = [ 'Thumbnail', 'Name', 'My Role', 'Visibility' ];
+ const expectedColumns = [ 'Name', 'My Role', 'Visibility' ];
const actualColumns = await dataTable.getColumnHeadersText();
expect(actualColumns).toEqual(expectedColumns);
diff --git a/e2e/suites/search/search-sorting.test.ts b/e2e/suites/search/search-sorting.test.ts
new file mode 100644
index 000000000..6b824f854
--- /dev/null
+++ b/e2e/suites/search/search-sorting.test.ts
@@ -0,0 +1,202 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { LoginPage, SearchResultsPage } from '../../pages/pages';
+import { RepoClient } from '../../utilities/repo-client/repo-client';
+import { Utils } from '../../utilities/utils';
+import { FILES } from '../../configs';
+
+describe('Search sorting', () => {
+ const random = Utils.random();
+
+ const user1 = `user1-${random}`;
+ const user2 = `user2-${random}`;
+
+ const parent = `parent-${random}`;
+ let parentId: string;
+
+ const fileJpg = {
+ name: `search-sort-file-1-${random}.jpg`,
+ source: FILES.jpgFile
+ };
+
+ const filePdf = {
+ name: `search-sort-file-2-${random}.pdf`,
+ title: 'search sort title',
+ description: 'search sort',
+ source: FILES.pdfFile
+ };
+
+ const apis = {
+ admin: new RepoClient(),
+ user1: new RepoClient(user1, user1),
+ user2: new RepoClient(user2, user2)
+ };
+
+ const loginPage = new LoginPage();
+ const page = new SearchResultsPage();
+ const { searchInput } = page.header;
+ const { dataTable } = page;
+
+ beforeAll(async (done) => {
+ await apis.admin.people.createUser({ username: user1 });
+ await apis.admin.people.createUser({ username: user2 });
+ parentId = (await apis.user1.nodes.createFolder(parent)).entry.id;
+
+ await apis.user1.nodes.setGranularPermission(parentId, true, user2, 'Collaborator');
+
+ await apis.user1.upload.uploadFileWithRename(fileJpg.source, parentId, fileJpg.name);
+ await apis.user2.upload.uploadFileWithRename(filePdf.source, parentId, filePdf.name, filePdf.title, filePdf.description);
+
+ await apis.user1.search.waitForNodes('search-sort', { expect: 2 });
+
+ await loginPage.loginWith(user1);
+ done();
+ });
+
+ beforeEach(async (done) => {
+ await Utils.pressEscape();
+ await page.clickPersonalFilesAndWait();
+
+ await searchInput.clickSearchButton();
+ await searchInput.searchFor('search sort');
+ await dataTable.waitForBody();
+ done();
+ });
+
+ afterAll(async () => {
+ await apis.user1.nodes.deleteNodeById(parentId);
+ });
+
+ it('Sorting options are displayed - [C277722]', async () => {
+ expect(await page.sortingPicker.isSortOrderButtonDisplayed()).toBe(true, 'Sort order button not displayed');
+ expect(await page.sortingPicker.isSortByOptionDisplayed()).toBe(true, 'Sort options not displayed');
+ expect(await page.sortingPicker.getSortOrder()).toBe('DESC', 'Incorrect default sort order');
+ expect(await page.sortingPicker.getSelectedSortByOption()).toBe('Relevance', 'Incorrect selected sort option');
+
+ await page.sortingPicker.clickSortByDropdown();
+
+ const expectedOptions = [ 'Relevance', 'Filename', 'Title', 'Modified date', 'Modifier', 'Created date', 'Size', 'Type' ];
+ expect(await page.sortingPicker.getSortByOptionsList()).toEqual(expectedOptions, 'Incorrect sort options list');
+ });
+
+ it('Sort by Name - [C277728]', async () => {
+ await page.sortingPicker.sortByName();
+ await page.sortingPicker.setSortOrderASC();
+
+ expect(await dataTable.getNthSearchResultsRow(1).getText()).toContain(fileJpg.name);
+ expect(await dataTable.getNthSearchResultsRow(2).getText()).toContain(filePdf.name);
+
+ await page.sortingPicker.sortByName();
+ await page.sortingPicker.setSortOrderDESC();
+
+ expect(await dataTable.getNthSearchResultsRow(1).getText()).toContain(filePdf.name);
+ expect(await dataTable.getNthSearchResultsRow(2).getText()).toContain(fileJpg.name);
+ });
+
+ it('Sort by Type - [C277740]', async () => {
+ await page.sortingPicker.sortByType();
+ await page.sortingPicker.setSortOrderASC();
+
+ expect(await dataTable.getNthSearchResultsRow(1).getText()).toContain(filePdf.name);
+ expect(await dataTable.getNthSearchResultsRow(2).getText()).toContain(fileJpg.name);
+
+ await page.sortingPicker.sortByType();
+ await page.sortingPicker.setSortOrderDESC();
+
+ expect(await dataTable.getNthSearchResultsRow(1).getText()).toContain(fileJpg.name);
+ expect(await dataTable.getNthSearchResultsRow(2).getText()).toContain(filePdf.name);
+ });
+
+ it('Sort by Size - [C277738]', async () => {
+ await page.sortingPicker.sortBySize();
+ await page.sortingPicker.setSortOrderASC();
+
+ expect(await dataTable.getNthSearchResultsRow(1).getText()).toContain(filePdf.name);
+ expect(await dataTable.getNthSearchResultsRow(2).getText()).toContain(fileJpg.name);
+
+ await page.sortingPicker.sortBySize();
+ await page.sortingPicker.setSortOrderDESC();
+
+ expect(await dataTable.getNthSearchResultsRow(1).getText()).toContain(fileJpg.name);
+ expect(await dataTable.getNthSearchResultsRow(2).getText()).toContain(filePdf.name);
+ });
+
+ it('Sort by Created date - [C277734]', async () => {
+ await page.sortingPicker.sortByCreatedDate();
+ await page.sortingPicker.setSortOrderASC();
+
+ expect(await dataTable.getNthSearchResultsRow(1).getText()).toContain(fileJpg.name);
+ expect(await dataTable.getNthSearchResultsRow(2).getText()).toContain(filePdf.name);
+
+ await page.sortingPicker.sortByCreatedDate();
+ await page.sortingPicker.setSortOrderDESC();
+
+ expect(await dataTable.getNthSearchResultsRow(1).getText()).toContain(filePdf.name);
+ expect(await dataTable.getNthSearchResultsRow(2).getText()).toContain(fileJpg.name);
+ });
+
+ it('Sort by Modified date - [C277736]', async () => {
+ await page.sortingPicker.sortByModifiedDate();
+ await page.sortingPicker.setSortOrderASC();
+
+ expect(await dataTable.getNthSearchResultsRow(1).getText()).toContain(fileJpg.name);
+ expect(await dataTable.getNthSearchResultsRow(2).getText()).toContain(filePdf.name);
+
+ await page.sortingPicker.sortByModifiedDate();
+ await page.sortingPicker.setSortOrderDESC();
+
+ expect(await dataTable.getNthSearchResultsRow(1).getText()).toContain(filePdf.name);
+ expect(await dataTable.getNthSearchResultsRow(2).getText()).toContain(fileJpg.name);
+ });
+
+ it('Sort by Relevance - [C277727]', async () => {
+ await page.sortingPicker.sortByRelevance();
+ await page.sortingPicker.setSortOrderASC();
+
+ expect(await dataTable.getNthSearchResultsRow(1).getText()).toContain(fileJpg.name);
+ expect(await dataTable.getNthSearchResultsRow(2).getText()).toContain(filePdf.name);
+
+ await page.sortingPicker.sortByRelevance();
+ await page.sortingPicker.setSortOrderDESC();
+
+ expect(await dataTable.getNthSearchResultsRow(1).getText()).toContain(filePdf.name);
+ expect(await dataTable.getNthSearchResultsRow(2).getText()).toContain(fileJpg.name);
+ });
+
+ it('Sort by Modifier - [C277732]', async () => {
+ await page.sortingPicker.sortByModifier();
+ await page.sortingPicker.setSortOrderASC();
+
+ expect(await dataTable.getNthSearchResultsRow(1).getText()).toContain(fileJpg.name);
+ expect(await dataTable.getNthSearchResultsRow(2).getText()).toContain(filePdf.name);
+
+ await page.sortingPicker.sortByModifier();
+ await page.sortingPicker.setSortOrderDESC();
+
+ expect(await dataTable.getNthSearchResultsRow(1).getText()).toContain(filePdf.name);
+ expect(await dataTable.getNthSearchResultsRow(2).getText()).toContain(fileJpg.name);
+ });
+});
diff --git a/e2e/suites/viewer/viewer-actions.test.ts b/e2e/suites/viewer/viewer-actions.test.ts
index f295917a1..0c9801403 100755
--- a/e2e/suites/viewer/viewer-actions.test.ts
+++ b/e2e/suites/viewer/viewer-actions.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -28,7 +28,7 @@ import { FILES } from '../../configs';
import { RepoClient } from '../../utilities/repo-client/repo-client';
import { Utils } from '../../utilities/utils';
import { Viewer } from '../../components/viewer/viewer';
-import { CopyMoveDialog } from './../../components/dialog/copy-move-dialog';
+import { ContentNodeSelectorDialog } from './../../components/dialog/content-node-selector-dialog';
import { ShareDialog } from './../../components/dialog/share-dialog';
import { ManageVersionsDialog } from './../../components/dialog/manage-versions-dialog';
import { UploadNewVersionDialog } from './../../components/dialog/upload-new-version-dialog';
@@ -51,7 +51,7 @@ describe('Viewer actions', () => {
const dataTable = page.dataTable;
const viewer = new Viewer();
const { toolbar } = viewer;
- const copyMoveDialog = new CopyMoveDialog();
+ const copyMoveDialog = new ContentNodeSelectorDialog();
const shareDialog = new ShareDialog();
const manageVersionsDialog = new ManageVersionsDialog();
const uploadNewVersionDialog = new UploadNewVersionDialog();
@@ -74,6 +74,7 @@ describe('Viewer actions', () => {
const fileForEditOffline = `file1-${Utils.random()}.docx`; let fileForEditOfflineId;
const fileForCancelEditing = `file2-${Utils.random()}.docx`; let fileForCancelEditingId;
const fileForUploadNewVersion = `file3-${Utils.random()}.docx`; let fileForUploadNewVersionId;
+ const fileForUploadNewVersion2 = `file4-${Utils.random()}.docx`; let fileForUploadNewVersionId2;
beforeAll(async (done) => {
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
@@ -88,9 +89,11 @@ describe('Viewer actions', () => {
fileForEditOfflineId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, fileForEditOffline)).entry.id;
fileForCancelEditingId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, fileForCancelEditing)).entry.id;
fileForUploadNewVersionId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, fileForUploadNewVersion)).entry.id;
+ fileForUploadNewVersionId2 = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, fileForUploadNewVersion2)).entry.id;
await apis.user.nodes.lockFile(fileForCancelEditingId);
await apis.user.nodes.lockFile(fileForUploadNewVersionId);
+ await apis.user.nodes.lockFile(fileForUploadNewVersionId2);
await loginPage.loginWith(username);
@@ -221,6 +224,25 @@ describe('Viewer actions', () => {
expect(await apis.user.nodes.getFileVersionLabel(filePersonalFilesId)).toEqual('2.0', 'File has incorrect version label');
});
+ it('Upload new version action when node is locked - [MNT-21058]', async () => {
+ await dataTable.doubleClickOnRowByName(fileForUploadNewVersion2);
+ await viewer.waitForViewerToOpen();
+
+ await toolbar.openMoreMenu();
+ expect(await toolbar.menu.isCancelEditingPresent()).toBe(true, `'Cancel Editing' button should be shown`);
+ expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `'Edit Offline' shouldn't be shown`);
+
+ await toolbar.menu.clickMenuItem('Upload New Version');
+ await Utils.uploadFileNewVersion(docxFile);
+ await page.waitForDialog();
+
+ await uploadNewVersionDialog.clickUpload();
+
+ await toolbar.openMoreMenu();
+ expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `'Cancel Editing' button shouldn't be shown`);
+ expect(await toolbar.menu.isEditOfflinePresent()).toBe(true, `'Edit Offline' should be shown`);
+ });
+
it('Full screen action - [C279282]', async () => {
await dataTable.doubleClickOnRowByName(docxPersonalFiles);
await viewer.waitForViewerToOpen();
diff --git a/e2e/suites/viewer/viewer-general.test.ts b/e2e/suites/viewer/viewer-general.test.ts
index 15bcb6f2f..77da91905 100755
--- a/e2e/suites/viewer/viewer-general.test.ts
+++ b/e2e/suites/viewer/viewer-general.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
diff --git a/e2e/suites/viewer/viewer-protected-file.test.ts b/e2e/suites/viewer/viewer-protected-file.test.ts
index b6ecebd46..a7e1863ac 100755
--- a/e2e/suites/viewer/viewer-protected-file.test.ts
+++ b/e2e/suites/viewer/viewer-protected-file.test.ts
@@ -2,7 +2,7 @@
* @license
* Alfresco Example Content Application
*
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -48,16 +48,15 @@ describe('Viewer - password protected file', () => {
const viewer = new Viewer();
const passwordDialog = new PasswordDialog();
- beforeAll(async (done) => {
+ beforeAll(async () => {
await apis.admin.people.createUser({ username });
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
await apis.user.upload.uploadFile(protectedFile.name, parentId);
await loginPage.loginWith(username);
- done();
});
- beforeEach(async (done) => {
+ beforeEach(async () => {
await page.header.expandSideNav();
await page.clickPersonalFilesAndWait();
await dataTable.doubleClickOnRowByName(parent);
@@ -65,20 +64,15 @@ describe('Viewer - password protected file', () => {
await dataTable.doubleClickOnRowByName(protectedFile.name);
await viewer.waitForViewerToOpen();
await page.waitForDialog();
- done();
});
- afterEach(async (done) => {
- if (await passwordDialog.isDialogOpen()) {
- await passwordDialog.clickClose();
- }
+ afterEach(async () => {
+ await page.closeOpenDialogs();
await Utils.pressEscape();
- done();
});
- afterAll(async (done) => {
+ afterAll(async () => {
await apis.user.nodes.deleteNodeById(parentId);
- done();
});
it('Password dialog appears when opening a protected file - [C268958]', async () => {
diff --git a/e2e/utilities/admin-actions.ts b/e2e/utilities/admin-actions.ts
new file mode 100755
index 000000000..980c59825
--- /dev/null
+++ b/e2e/utilities/admin-actions.ts
@@ -0,0 +1,142 @@
+/*!
+ * @license
+ * Alfresco Example Content Application
+ *
+ * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ *
+ * This file is part of the Alfresco Example Content Application.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+
+import { RepoClient, NodeContentTree } from './repo-client/repo-client';
+import { PersonEntry, NodeEntry } from '@alfresco/js-api';
+import { PersonModel } from './repo-client/apis/people/people-api-models';
+
+import { SitesApi } from './repo-client/apis/sites/sites-api';
+import { UploadApi } from './repo-client/apis/upload/upload-api';
+import { NodesApi } from './repo-client/apis/nodes/nodes-api';
+import { FavoritesApi } from './repo-client/apis/favorites/favorites-api';
+import { SearchApi } from './repo-client/apis/search/search-api';
+
+export class AdminActions {
+ private adminApi: RepoClient;
+
+ constructor() {
+ this.adminApi = new RepoClient();
+ }
+
+ sites: SitesApi = new SitesApi();
+ upload: UploadApi = new UploadApi();
+ nodes: NodesApi = new NodesApi();
+ favorites: FavoritesApi = new FavoritesApi();
+ search: SearchApi = new SearchApi();
+
+ async getDataDictionaryId(): Promise {
+ return await this.adminApi.nodes.getNodeIdFromParent('Data Dictionary', '-root-');
+ }
+
+ async getNodeTemplatesFolderId(): Promise {
+ return await this.adminApi.nodes.getNodeIdFromParent('Node Templates', await this.getDataDictionaryId());
+ }
+
+ async getSpaceTemplatesFolderId(): Promise {
+ return await this.adminApi.nodes.getNodeIdFromParent('Space Templates', await this.getDataDictionaryId());
+ }
+
+ async createUser(user: PersonModel): Promise {
+ return await this.adminApi.people.createUser(user);
+ }
+
+ async createNodeTemplate(name: string, title: string = '', description: string = '', author: string = ''): Promise {
+ const templatesRootFolderId: string = await this.getNodeTemplatesFolderId();
+
+ return await this.adminApi.nodes.createFile(name, templatesRootFolderId, title, description, author);
+ }
+
+ async createNodeTemplatesHierarchy(hierarchy: NodeContentTree): Promise {
+ return await this.adminApi.nodes.createContent(hierarchy, `Data Dictionary/Node Templates`);
+ }
+
+ async createSpaceTemplate(name: string, title: string = '', description: string = ''): Promise {
+ const templatesRootFolderId: string = await this.getSpaceTemplatesFolderId();
+
+ return await this.adminApi.nodes.createFolder(name, templatesRootFolderId, title, description);
+ }
+
+ async createSpaceTemplatesHierarchy(hierarchy: NodeContentTree): Promise {
+ return await this.adminApi.nodes.createContent(hierarchy, `Data Dictionary/Space Templates`);
+ }
+
+ async removeUserAccessOnNodeTemplate(nodeName: string): Promise {
+ const templatesRootFolderId = await this.getNodeTemplatesFolderId();
+ const nodeId: string = await this.adminApi.nodes.getNodeIdFromParent(nodeName, templatesRootFolderId);
+
+ return await this.adminApi.nodes.setInheritPermissions(nodeId, false);
+ }
+
+ async removeUserAccessOnSpaceTemplate(nodeName: string): Promise {
+ const templatesRootFolderId = await this.getSpaceTemplatesFolderId();
+ const nodeId: string = await this.adminApi.nodes.getNodeIdFromParent(nodeName, templatesRootFolderId);
+
+ return await this.adminApi.nodes.setInheritPermissions(nodeId, false);
+ }
+
+ async cleanupNodeTemplatesFolder(): Promise {
+ return await this.adminApi.nodes.deleteNodeChildren(await this.getNodeTemplatesFolderId());
+ }
+
+ async cleanupSpaceTemplatesFolder(): Promise {
+ const spaceTemplatesNodeId = await this.getSpaceTemplatesFolderId();
+
+ // folder links are deleted automatically when original folder is deleted
+ // Software Engineering Project is the default folder template coming from ACS, should not be deleted
+ const nodesToDelete = (await this.adminApi.nodes.getNodeChildren(spaceTemplatesNodeId)).list.entries
+ .filter(node => (node.entry.nodeType !== 'app:folderlink') && (node.entry.name !== 'Software Engineering Project'))
+ .map(node => node.entry.id);
+ return await this.adminApi.nodes.deleteNodesById(nodesToDelete);
+ }
+
+ async createLinkToFileId(originalFileId: string, destinationParentId: string): Promise