Merge pull request #1348 from Alfresco/development

1.10.0
This commit is contained in:
Cilibiu Bogdan
2020-02-19 09:51:10 +02:00
committed by GitHub
507 changed files with 12089 additions and 7009 deletions
+1
View File
@@ -40,6 +40,7 @@ testem.log
/e2e/*.js
/e2e/*.map
/e2e-output
/e2e-downloads
# System Files
.DS_Store
+6
View File
@@ -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
+4 -2
View File
@@ -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
+1
Submodule alfresco-js-api added at a7e88e5526
-210
View File
@@ -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:
+31
View File
@@ -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
+5 -1
View File
@@ -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/ {
+3
View File
@@ -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) |
+2
View File
@@ -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
+1
View File
@@ -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 |
+2 -2
View File
@@ -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);
}
+77
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
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<void> {
await browser.wait(EC.presenceOf(this.pathItemsContainer), BROWSER_WAIT_TIMEOUT, 'Timeout waiting for breadcrumb dropdown to open');
}
async waitForPathListDropdownToClose(): Promise<void> {
await browser.wait(EC.stalenessOf(browser.$(DropDownBreadcrumb.selectors.pathOption)), BROWSER_WAIT_TIMEOUT, 'Timeout waiting for breadcrumb dropdown to close');
}
async getCurrentFolderName(): Promise<string> {
return this.currentFolder.getText();
}
async openPath(): Promise<void> {
await this.trigger.click();
await this.waitForPathListDropdownToOpen();
}
async clickPathItem(name: string): Promise<void> {
const elem = browser.element(by.cssContainingText(DropDownBreadcrumb.selectors.pathOption, name));
await elem.click();
}
async getPathItems(): Promise<string[]> {
const items: string[] = await this.pathItems.map(async elem => {
return elem.getText();
});
return items;
}
}
+3 -3
View File
@@ -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();
}
+1 -1
View File
@@ -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
+121 -90
View File
@@ -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<void> {
await browser.wait(EC.presenceOf(this.head), BROWSER_WAIT_TIMEOUT, '--- timeout waitForHeader ---');
}
async waitForBody() {
async waitForBody(): Promise<void> {
await browser.wait(EC.presenceOf(this.body), BROWSER_WAIT_TIMEOUT, '--- timeout waitForBody ---');
}
async waitForEmptyState() {
async waitForEmptyState(): Promise<void> {
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<string> {
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<string> {
return this.getSortedColumnHeader().getText();
}
async getSortingOrder(): Promise<string> {
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<void> {
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<number> {
return this.getRows().count();
}
getSelectedRows() {
async waitForRowToBeSelected(): Promise<void> {
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<string[]> {
const rowsText: string[] = await this.getSelectedRows().map((row) => {
return row.element(by.css('.adf-datatable-cell[title="Name"]')).getText();
});
return rowsText;
}
async getSelectedRowsCount(): Promise<number> {
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<number> {
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<string> {
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<boolean> {
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<boolean> {
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<boolean> {
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<string> {
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<boolean> {
return this.getNameLink(itemName).isPresent();
}
// Navigation/selection methods
async doubleClickOnRowByName(name: string, location: string = '') {
async doubleClickOnRowByName(name: string, location: string = ''): Promise<void> {
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<void> {
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<void> {
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<void> {
const item = this.getRowFirstCell(name, location);
await item.click();
}
async clickNameLink(itemName: string) {
async clickNameLink(itemName: string): Promise<void> {
await this.getNameLink(itemName).click();
}
async selectMultipleItems(names: string[], location: string = '') {
async selectMultipleItems(names: string[], location: string = ''): Promise<void> {
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<void> {
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<void> {
const item = this.getRowFirstCell(itemName);
await browser.actions().mouseMove(item).perform();
await browser.actions().click(protractor.Button.RIGHT).perform();
}
async rightClickOnMultipleSelection() {
async rightClickOnMultipleSelection(): Promise<void> {
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<string> {
return this.getItemLocationEl(name).getText();
}
async getItemLocationTooltip(name: string) {
async getItemLocationTooltip(name: string): Promise<string> {
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<void> {
await this.getItemLocationEl(name).click();
}
// empty state methods
async isEmptyList() {
async isEmpty(): Promise<boolean> {
return this.emptyList.isPresent();
}
async isEmptyWithDragAndDrop() {
async isEmptyWithDragAndDrop(): Promise<boolean> {
return this.emptyFolderDragAndDrop.isDisplayed();
}
@@ -334,66 +355,68 @@ export class DataTable extends Component {
if (isEmpty) {
return this.emptyFolderDragAndDrop.getText();
}
return '';
}
async getEmptyStateTitle(): Promise<string> {
const isEmpty = await this.isEmptyList();
const isEmpty = await this.isEmpty();
if (isEmpty) {
return this.emptyListTitle.getText();
}
return '';
}
async getEmptyStateSubtitle(): Promise<string> {
const isEmpty = await this.isEmptyList();
const isEmpty = await this.isEmpty();
if (isEmpty) {
return this.emptyListSubtitle.getText();
}
return '';
}
async getEmptyStateText(): Promise<string> {
const isEmpty = await this.isEmptyList();
async getEmptyListText(): Promise<string> {
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<string> {
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<string[]> {
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<boolean> {
const count = await this.menu.getItemsCount();
return count > 0;
}
async getLibraryRole(name: string) {
async getLibraryRole(name: string): Promise<string> {
return this.getRowByName(name).element(by.css(DataTable.selectors.libraryRole)).getText();
}
async isItemPresent(name: string, location? : string) {
async isItemPresent(name: string, location? : string): Promise<boolean> {
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<string[]> {
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<number> {
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<string> {
return this.getSearchResultNthLine(name, location, 0).getText();
}
async getSearchResultDescription(name: string, location: string = '') {
async getSearchResultDescription(name: string, location: string = ''): Promise<string> {
return this.getSearchResultNthLine(name, location, 1).getText();
}
async getSearchResultModified(name: string, location: string = '') {
async getSearchResultModified(name: string, location: string = ''): Promise<string> {
return this.getSearchResultNthLine(name, location, 2).getText();
}
async getSearchResultLocation(name: string, location: string = '') {
async getSearchResultLocation(name: string, location: string = ''): Promise<string> {
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<boolean> {
return this.getSearchResultNameLink(itemName, location).isPresent();
}
async clickSearchResultNameLink(itemName: string, location: string = '') {
async clickSearchResultNameLink(itemName: string, location: string = ''): Promise<void> {
await this.getSearchResultNameLink(itemName, location).click();
}
@@ -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);
}
+2 -2
View File
@@ -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);
}
+157
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
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<void> {
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<void> {
await browser.wait(EC.stalenessOf(this.title), BROWSER_WAIT_TIMEOUT);
}
async waitForDropDownToOpen(): Promise<void> {
await browser.wait(EC.presenceOf(this.locationPersonalFiles), BROWSER_WAIT_TIMEOUT);
}
async waitForDropDownToClose(): Promise<void> {
await browser.wait(EC.stalenessOf(browser.$(ContentNodeSelectorDialog.selectors.locationOption)), BROWSER_WAIT_TIMEOUT);
}
async waitForRowToBeSelected(): Promise<void> {
await browser.wait(EC.presenceOf(this.component.element(by.css(ContentNodeSelectorDialog.selectors.selectedRow))), BROWSER_WAIT_TIMEOUT);
}
async isDialogOpen(): Promise<boolean> {
return browser.$(ContentNodeSelectorDialog.selectors.root).isDisplayed();
}
async getTitle(): Promise<string> {
return this.title.getText();
}
async clickCancel(): Promise<void> {
await this.cancelButton.click();
await this.waitForDialogToClose();
}
async clickCopy(): Promise<void> {
await this.copyButton.click();
}
async clickMove(): Promise<void> {
await this.moveButton.click();
}
async selectLocation(location: 'Personal Files' | 'File Libraries'): Promise<void> {
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<void> {
const row = this.dataTable.getRowByName(folderName);
await Utils.waitUntilElementClickable(row);
await row.click();
await this.waitForRowToBeSelected();
}
async isSearchInputPresent(): Promise<boolean> {
return await this.searchInput.isPresent();
}
async isSelectLocationDropdownDisplayed(): Promise<boolean> {
return (await this.locationDropDown.isPresent()) && (await this.locationDropDown.isDisplayed());
}
async isCopyButtonEnabled(): Promise<boolean> {
return (await this.copyButton.isPresent()) && (await this.copyButton.isEnabled());
}
async isCancelButtonEnabled(): Promise<boolean> {
return (await this.cancelButton.isPresent()) && (await this.cancelButton.isEnabled());
}
async searchFor(text: string): Promise<void> {
await Utils.clearFieldWithBackspace(this.searchInput);
await this.searchInput.sendKeys(text);
await this.searchInput.sendKeys(protractor.Key.ENTER);
}
async getToolbarTitle(): Promise<string> {
return await this.toolbarTitle.getText();
}
}
-131
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
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();
}
}
@@ -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<boolean> {
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<string> {
if (await this.isValidationMessageDisplayed()) {
return this.validationMessage.getText();
} else {
return '';
}
}
async getName() {
+140
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
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<void> {
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<void> {
await browser.wait(EC.stalenessOf(this.title), BROWSER_WAIT_TIMEOUT, '---- timeout waiting for dialog to close ----');
}
async isDialogOpen(): Promise<boolean> {
return browser.isElementPresent(by.css(CreateFromTemplateDialog.selectors.root));
}
async getTitle(): Promise<string> {
return this.title.getText();
}
async isValidationMessageDisplayed(): Promise<boolean> {
return (await this.validationMessage.isPresent()) && (await this.validationMessage.isDisplayed());
}
async isCreateButtonEnabled(): Promise<boolean> {
return this.createButton.isEnabled();
}
async isCancelButtonEnabled(): Promise<boolean> {
return this.cancelButton.isEnabled();
}
async isNameFieldDisplayed(): Promise<boolean> {
return this.nameInput.isDisplayed();
}
async isTitleFieldDisplayed(): Promise<boolean> {
return this.titleInput.isDisplayed();
}
async isDescriptionFieldDisplayed(): Promise<boolean> {
return this.descriptionTextArea.isDisplayed();
}
async getValidationMessage(): Promise<string> {
if (await this.isValidationMessageDisplayed()) {
return this.validationMessage.getText();
} else {
return '';
}
}
async getName(): Promise<string> {
return this.nameInput.getAttribute('value');
}
async getDescription(): Promise<string> {
return this.descriptionTextArea.getAttribute('value');
}
async enterName(name: string): Promise<void> {
await this.nameInput.clear();
await this.nameInput.sendKeys(name);
}
async enterTitle(title: string): Promise<void> {
await this.titleInput.clear();
await this.titleInput.sendKeys(title);
}
async enterDescription(description: string): Promise<void> {
await this.descriptionTextArea.clear();
await this.descriptionTextArea.sendKeys(description);
}
async deleteNameWithBackspace(): Promise<void> {
await this.nameInput.clear();
await this.nameInput.sendKeys(' ', protractor.Key.CONTROL, 'a', protractor.Key.NULL, protractor.Key.BACK_SPACE);
}
async clickCreate(): Promise<void> {
await this.createButton.click();
}
async clickCancel(): Promise<void> {
await this.cancelButton.click();
await this.waitForDialogToClose();
}
}
@@ -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);
}
@@ -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);
}
+9 -3
View File
@@ -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() {
+86
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
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<void> {
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<void> {
await browser.wait(EC.stalenessOf(this.title), BROWSER_WAIT_TIMEOUT, '---- timeout waiting for dialog to close ----');
}
async isDialogOpen(): Promise<boolean> {
return browser.isElementPresent(by.css(SelectTemplateDialog.selectors.root));
}
async getTitle(): Promise<string> {
return this.title.getText();
}
// action buttons
async isCancelButtonEnabled(): Promise<boolean> {
return this.cancelButton.isEnabled();
}
async isNextButtonEnabled(): Promise<boolean> {
return this.nextButton.isEnabled();
}
async clickCancel(): Promise<void> {
await this.cancelButton.click();
await this.waitForDialogToClose();
}
async clickNext(): Promise<void> {
await this.nextButton.click();
await this.waitForDialogToClose();
}
}
+2 -2
View File
@@ -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);
}
@@ -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);
}
+3 -3
View File
@@ -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);
}
+2 -2
View File
@@ -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);
}
@@ -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);
}
@@ -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);
}
@@ -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);
}
+6 -6
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
+2 -2
View File
@@ -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);
}
+111 -85
View File
@@ -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<void> {
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<void> {
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<void> {
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<string> {
return this.getItemByLabel(menuItem).getAttribute('title');
}
async getItemIconText(menuItem: string) {
async getTooltipForUploadFile(): Promise<string> {
return this.getItemTooltip('Upload File');
}
async getTooltipForUploadFolder(): Promise<string> {
return this.getItemTooltip('Upload Folder');
}
async getTooltipForCreateFolder(): Promise<string> {
return this.getItemTooltip('Create Folder');
}
async getTooltipForCreateLibrary(): Promise<string> {
return this.getItemTooltip('Create Library');
}
async getTooltipForCreateFileFromTemplate(): Promise<string> {
return this.getItemTooltip('Create file from template');
}
async getItemIconText(menuItem: string): Promise<string> {
return this.getItemByLabel(menuItem).element(by.css(Menu.selectors.icon)).getText();
}
async getItemIdAttribute(menuItem: string) {
async getItemIdAttribute(menuItem: string): Promise<string> {
return this.getItemByLabel(menuItem).getAttribute('id');
}
async getItemsCount() {
async getItemsCount(): Promise<number> {
return this.items.count();
}
async getMenuItems(): Promise<string[]> {
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<void> {
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<void> {
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<void> {
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<void> {
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<boolean> {
return browser.element(by.cssContainingText(Menu.selectors.item, title)).isPresent();
}
async isSubMenuItemPresent(title: string) {
async isSubMenuItemPresent(title: string): Promise<boolean> {
return browser.element(by.cssContainingText(Menu.selectors.submenu, title)).isPresent();
}
async getSubmenuItemsCount() {
async getSubmenuItemsCount(): Promise<number> {
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<void> {
await this.editFolderAction.click();
}
async clickShare() {
async clickShare(): Promise<void> {
const action = this.shareAction;
await action.click();
}
async clickSharedLinkSettings() {
async clickSharedLinkSettings(): Promise<void> {
const action = this.shareEditAction;
await action.click();
}
async isViewPresent() {
async isViewPresent(): Promise<boolean> {
return this.viewAction.isPresent();
}
async isDownloadPresent() {
async isDownloadPresent(): Promise<boolean> {
return this.downloadAction.isPresent();
}
async isEditFolderPresent() {
async isEditFolderPresent(): Promise<boolean> {
return this.editFolderAction.isPresent();
}
async isEditOfflinePresent() {
async isEditOfflinePresent(): Promise<boolean> {
return this.editOfflineAction.isPresent();
}
async isCancelEditingPresent() {
async isCancelEditingPresent(): Promise<boolean> {
return this.cancelEditingAction.isPresent();
}
async isCopyPresent() {
async isCopyPresent(): Promise<boolean> {
return this.copyAction.isPresent();
}
async isMovePresent() {
async isMovePresent(): Promise<boolean> {
return this.moveAction.isPresent();
}
async isDeletePresent() {
async isDeletePresent(): Promise<boolean> {
return this.deleteAction.isPresent();
}
async isManagePermissionsPresent() {
async isManagePermissionsPresent(): Promise<boolean> {
return this.managePermissionsAction.isPresent();
}
async isManageVersionsPresent() {
async isManageVersionsPresent(): Promise<boolean> {
return this.manageVersionsAction.isPresent();
}
async isUploadNewVersionPresent() {
async isUploadNewVersionPresent(): Promise<boolean> {
return this.uploadNewVersionAction.isPresent();
}
async isFavoritePresent() {
async isFavoritePresent(): Promise<boolean> {
return this.favoriteAction.isPresent();
}
async isRemoveFavoritePresent() {
async isRemoveFavoritePresent(): Promise<boolean> {
return this.removeFavoriteAction.isPresent();
}
async isToggleFavoritePresent() {
async isToggleFavoritePresent(): Promise<boolean> {
return this.toggleFavoriteAction.isPresent();
}
async isToggleRemoveFavoritePresent() {
async isToggleRemoveFavoritePresent(): Promise<boolean> {
return this.toggleRemoveFavoriteAction.isPresent();
}
async isJoinLibraryPresent() {
async isJoinLibraryPresent(): Promise<boolean> {
return this.joinAction.isPresent();
}
async isCancelJoinPresent() {
async isCancelJoinPresent(): Promise<boolean> {
return this.cancelJoinAction.isPresent();
}
async isLeaveLibraryPresent() {
async isLeaveLibraryPresent(): Promise<boolean> {
return this.leaveAction.isPresent();
}
async isPermanentDeletePresent() {
async isPermanentDeletePresent(): Promise<boolean> {
return this.permanentDeleteAction.isPresent();
}
async isRestorePresent() {
async isRestorePresent(): Promise<boolean> {
return this.restoreAction.isPresent();
}
async isSharePresent() {
async isSharePresent(): Promise<boolean> {
return this.shareAction.isPresent();
}
async isSharedLinkSettingsPresent() {
async isSharedLinkSettingsPresent(): Promise<boolean> {
return this.shareEditAction.isPresent();
}
async isViewDetailsPresent() {
async isViewDetailsPresent(): Promise<boolean> {
return this.viewDetailsAction.isPresent();
}
async isCreateFolderPresent() {
return this.createFolderAction.isPresent();
}
async isCreateFolderEnabled() {
return this.createFolderAction.isEnabled();
async isCreateFolderEnabled(): Promise<boolean> {
return (await this.createFolderAction.isPresent()) && (await this.createFolderAction.isEnabled());
}
async isCreateLibraryPresent() {
return this.createLibraryAction.isPresent();
}
async isCreateLibraryEnabled() {
return this.createLibraryAction.isEnabled();
async isCreateLibraryEnabled(): Promise<boolean> {
return (await this.createLibraryAction.isPresent()) && (await this.createLibraryAction.isEnabled());
}
async isUploadFilePresent() {
return this.uploadFileAction.isPresent();
}
async isUploadFileEnabled() {
return this.uploadFileAction.isEnabled();
async isUploadFileEnabled(): Promise<boolean> {
return (await this.uploadFileAction.isPresent()) && (await this.uploadFileAction.isEnabled());
}
async isUploadFolderPresent() {
return this.uploadFolderAction.isPresent();
}
async isUploadFolderEnabled() {
return this.uploadFolderAction.isEnabled();
async isUploadFolderEnabled(): Promise<boolean> {
return (await this.uploadFolderAction.isPresent()) && (await this.uploadFolderAction.isEnabled());
}
async isCreateFileFromTemplateEnabled(): Promise<boolean> {
return (await this.createFileFromTemplateAction.isPresent()) && (await this.createFileFromTemplateAction.isEnabled());
}
async clickCreateFolder() {
async isCreateFolderFromTemplateEnabled(): Promise<boolean> {
return (await this.createFolderFromTemplateAction.isPresent()) && (await this.createFolderFromTemplateAction.isEnabled());
}
async clickCreateFolder(): Promise<void> {
const action = this.createFolderAction;
await action.click();
}
async clickCreateLibrary() {
async clickCreateLibrary(): Promise<void> {
const action = this.createLibraryAction;
await action.click();
}
async clickUploadFile() {
const action = this.uploadFileAction;
async clickCreateFileFromTemplate(): Promise<void> {
const action = this.createFileFromTemplateAction;
await action.click();
}
async clickUploadFolder() {
const action = this.uploadFolderAction;
async clickCreateFolderFromTemplate(): Promise<void> {
const action = this.createFolderFromTemplateAction;
await action.click();
}
}
@@ -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);
}
+2 -2
View File
@@ -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);
}
+137
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
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<boolean> {
return (await this.fromField.isPresent()) && (await this.fromField.isDisplayed());
}
async isFromErrorDisplayed(): Promise<boolean> {
return (await this.fromFieldError.isPresent()) && (await this.fromFieldError.isDisplayed());
}
async isToFieldDisplayed(): Promise<boolean> {
return (await this.toField.isPresent()) && (await this.toField.isDisplayed());
}
async isToErrorDisplayed(): Promise<boolean> {
return (await this.toFieldError.isPresent()) && (await this.toFieldError.isDisplayed());
}
async isClearButtonEnabled(): Promise<boolean> {
return await this.clearButton.isEnabled();
}
async isApplyButtonEnabled(): Promise<boolean> {
return await this.applyButton.isEnabled();
}
async clickClearButton(): Promise<void> {
if ( await this.isClearButtonEnabled() ) {
await this.clearButton.click();
}
}
async clickApplyButton(): Promise<void> {
if ( await this.isApplyButtonEnabled() ) {
await this.applyButton.click();
}
}
async getFromValue(): Promise<string> {
try {
const value = await this.fromInput.getAttribute('value');
return value;
} catch (error) {
return '';
}
}
async getFromError(): Promise<string> {
try {
const error = await this.fromFieldError.getText();
return error;
} catch (err) {
return '';
}
}
async getToValue(): Promise<string> {
try {
const value = await this.toInput.getAttribute('value');
return value;
} catch (err) {
return '';
}
}
async getToError(): Promise<string> {
try {
const error = await this.toFieldError.getText();
return error;
} catch (err) {
return '';
}
}
async resetPanel(): Promise<void> {
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<void> {
await this.expandPanel();
await Utils.clearFieldWithBackspace(this.fromInput);
await this.fromInput.sendKeys(date, protractor.Key.TAB);
}
async enterToDate(date: string): Promise<void> {
await this.expandPanel();
await Utils.clearFieldWithBackspace(this.toInput);
await this.toInput.sendKeys(date, protractor.Key.TAB);
}
}
+96
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
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<string[]> {
const list: string[] = await this.facets.map(option => {
return option.getText();
});
return list;
}
async getFiltersCheckedValues(): Promise<string[]> {
const list: string[] = await this.selectedFacets.map(option => {
return option.getText();
});
return list;
}
async resetPanel(): Promise<void> {
if ( (await this.selectedFacets.count()) > 0 ) {
await this.expandPanel();
await this.selectedFacets.each(async elem => {
await elem.click();
});
}
await this.expandPanel();
}
async isFilterFacetsDisplayed(): Promise<boolean> {
return await this.facetsFilter.isDisplayed();
}
async isClearButtonEnabled(): Promise<boolean> {
return await this.clearButton.isEnabled();
}
async clickClearButton(): Promise<void> {
if ( await this.isClearButtonEnabled() ) {
await this.clearButton.click();
}
}
async isFilterCategoryInputDisplayed(): Promise<boolean> {
return await this.filterCategoryInput.isDisplayed();
}
async checkCategory(name: string): Promise<void> {
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<void> {
await this.filterCategoryInput.sendKeys(name);
}
}
+71
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
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<void> {
await this.panelHeader.click();
}
async isPanelDisplayed(): Promise<boolean> {
return (await browser.isElementPresent(this.panel)) && (await this.panel.isDisplayed());
}
async isPanelExpanded(): Promise<boolean> {
return (await this.panelExpanded.isPresent()) && (await this.panelExpanded.isDisplayed());
}
async expandPanel(): Promise<void> {
if ( !(await this.isPanelExpanded()) ) {
await this.clickPanelHeader();
}
}
async collapsePanel(): Promise<void> {
if ( await this.isPanelExpanded() ) {
await this.clickPanelHeader();
}
}
}
+92
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
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<string[]> {
const list: string[] = await this.facets.map(option => {
return option.getText();
});
return list;
}
async getFiltersCheckedValues(): Promise<string[]> {
const list: string[] = await this.selectedFacets.map(option => {
return option.getText();
});
return list;
}
async resetPanel(): Promise<void> {
if ( (await this.selectedFacets.count()) > 0 ) {
await this.expandPanel();
await this.selectedFacets.each(async elem => {
await elem.click();
});
}
await this.collapsePanel();
}
async isClearButtonEnabled(): Promise<boolean> {
return await this.clearButton.isEnabled();
}
async clickClearButton(): Promise<void> {
if ( await this.isClearButtonEnabled() ) {
await this.clearButton.click();
}
}
async checkSizeSmall(): Promise<void> {
const small = this.facets.filter(async (elem) => await elem.getText() === 'Small').first();
await small.click();
}
async checkSizeMedium(): Promise<void> {
const medium = this.facets.filter(async (elem) => await elem.getText() === 'Medium').first();
await medium.click();
}
async checkSizeLarge(): Promise<void> {
const large = this.facets.filter(async (elem) => await elem.getText() === 'Large').first();
await large.click();
}
async checkSizeHuge(): Promise<void> {
const huge = this.facets.filter(async (elem) => await elem.getText() === 'Huge').first();
await huge.click();
}
}
+60
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
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<boolean> {
return (await this.mainPanel.isPresent()) && (await this.mainPanel.isDisplayed());
}
async clickResetAllButton(): Promise<void> {
await this.resetAllButton.click();
}
}
+12 -8
View File
@@ -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);
}
}
+141
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
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<void> {
await browser.wait(EC.visibilityOf(this.sortByDropdownExpanded), BROWSER_WAIT_TIMEOUT, 'Timeout waiting for sortBy dropdown to expand');
}
async isSortOrderButtonDisplayed(): Promise<boolean> {
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<boolean> {
return (await this.sortByDropdownCollapsed.isPresent()) && (await this.sortByDropdownCollapsed.isDisplayed());
}
async isSortByDropdownExpanded(): Promise<boolean> {
return (await this.sortByDropdownExpanded.isPresent()) && (await this.sortByDropdownExpanded.isDisplayed());
}
async getSelectedSortByOption(): Promise<string> {
return await this.sortByDropdownCollapsed.getText();
}
async clickSortByDropdown(): Promise<void> {
await this.sortByDropdownCollapsed.click();
await this.waitForSortByDropdownToExpand();
}
async getSortByOptionsList(): Promise<string[]> {
const list: string[] = await this.sortByList.map(async option => {
return option.getText();
});
return list;
}
async sortByOption(option: string): Promise<void> {
if ( !(await this.isSortByDropdownExpanded()) ) {
await this.clickSortByDropdown();
}
const elem = browser.element(by.cssContainingText(SearchSortingPicker.selectors.sortByOption, option));
await elem.click();
}
async sortByName(): Promise<void> {
await this.sortByOption('Filename');
}
async sortByRelevance(): Promise<void> {
await this.sortByOption('Relevance');
}
async sortByTitle(): Promise<void> {
await this.sortByOption('Title');
}
async sortByModifiedDate(): Promise<void> {
await this.sortByOption('Modified date');
}
async sortByModifier(): Promise<void> {
await this.sortByOption('Modifier');
}
async sortByCreatedDate(): Promise<void> {
await this.sortByOption('Created date');
}
async sortBySize(): Promise<void> {
await this.sortByOption('Size');
}
async sortByType(): Promise<void> {
await this.sortByOption('Type');
}
async setSortOrderASC(): Promise<void> {
if ( (await this.getSortOrder()) !== 'ASC' ) {
await this.sortOrderButton.click();
}
}
async setSortOrderDESC(): Promise<void> {
if ( (await this.getSortOrder()) !== 'DESC' ) {
await this.sortOrderButton.click();
}
}
}
+31 -24
View File
@@ -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<void> {
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<void> {
await this.newButton.click();
await this.menu.waitForMenuToOpen();
}
async openCreateFolderDialog() {
async openCreateFolderDialog(): Promise<void> {
await this.openNewMenu();
await this.menu.clickMenuItem('Create Folder');
await this.menu.clickCreateFolder();
}
async openCreateLibraryDialog() {
async openCreateLibraryDialog(): Promise<void> {
await this.openNewMenu();
await this.menu.clickMenuItem('Create Library');
await this.menu.clickCreateLibrary();
}
async isActive(name: string) {
async openCreateFileFromTemplateDialog(): Promise<void> {
await this.openNewMenu();
await this.menu.clickCreateFileFromTemplate();
}
async openCreateFolderFromTemplateDialog(): Promise<void> {
await this.openNewMenu();
await this.menu.clickCreateFolderFromTemplate();
}
async isActive(name: string): Promise<boolean> {
return (await this.getLinkLabel(name).getAttribute('class')).includes(Sidenav.selectors.activeClassName);
}
async childIsActive(name: string) {
async childIsActive(name: string): Promise<boolean> {
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<string> {
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<void> {
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<boolean> {
return element(by.cssContainingText('.mat-expanded', SIDEBAR_LABELS.FILE_LIBRARIES)).isPresent();
}
async expandFileLibraries() {
async expandFileLibraries(): Promise<void> {
await this.expandMenu(SIDEBAR_LABELS.FILE_LIBRARIES);
}
+2 -2
View File
@@ -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);
}
+3 -3
View File
@@ -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);
}
+1 -1
View File
@@ -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
+7 -7
View File
@@ -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();
+2 -2
View File
@@ -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() {
+4 -3
View File
@@ -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));
+1 -1
View File
@@ -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 -20
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
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<void> {
await this.dataTable.waitForBody();
}
async getResultsHeader() {
return browser.element(by.css(SearchResultsPage.selectors.resultsContentHeader)).getText();
async getResultsHeader(): Promise<string> {
return await browser.element(by.css(SearchResultsPage.selectors.resultsContentHeader)).getText();
}
async getResultsFoundText(): Promise<string> {
return await this.infoText.getText();
}
async getResultsChipsValues(): Promise<string[]> {
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<void> {
const chip: ElementFinder = browser.element(By.cssContainingText(SearchResultsPage.selectors.chip, chipName));
const closeChip: ElementFinder = chip.element(by.css(SearchResultsPage.selectors.chipCloseIcon));
await closeChip.click();
}
}
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
});
+106
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
});
}
@@ -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 <http://www.gnu.org/licenses/>.
*/
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();
});
});
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
});
}
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
});
+124
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
});
}
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
});
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
});
}
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
});
+94
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
});
}
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
});
@@ -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 = {
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
+70
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
}
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
});
+283
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
});
}
+100 -108
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
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');
});
});
});
@@ -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);
});
});
});
@@ -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
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
});
}
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
});
}
@@ -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 <http://www.gnu.org/licenses/>.
*/
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();
});
});
});
});
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
});
}
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
});
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
});
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
});
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
});
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
});
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
});
}
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
});
}
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
@@ -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'];
+227
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
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);
});
});
});
}
+40 -44
View File
@@ -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<void> {
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<void> {
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<void> {
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<void> {
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<void> {
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<void> {
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<void> {
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<void> {
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));
}
@@ -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 <http://www.gnu.org/licenses/>.
*/
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');
}
});
@@ -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 <http://www.gnu.org/licenses/>.
*/
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');
});
});
});
@@ -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 <http://www.gnu.org/licenses/>.
*/
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();
+402
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
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', 'a<a', 'a>a', `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');
});
});
});
});
+387
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
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', 'a<a', 'a>a', `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');
});
});
});
+1 -9
View File
@@ -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 <http://www.gnu.org/licenses/>.
*/
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();
+1 -1
View File
@@ -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
+13 -13
View File
@@ -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();
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+67 -70
View File
@@ -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`);
});
});
});
+1 -1
View File
@@ -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

Some files were not shown because too many files have changed in this diff Show More