mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-09 18:02:54 +00:00
+1
-1
@@ -4,7 +4,7 @@ root = true
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
indent_size = 2
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
node_modules
|
||||
src/assets/i18n
|
||||
e2e
|
||||
/angular.json
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"singleQuote": true
|
||||
}
|
||||
+17
-10
@@ -1,33 +1,40 @@
|
||||
dist: trusty
|
||||
sudo: required
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
addons:
|
||||
chrome: stable
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- e2e-output
|
||||
target_paths:
|
||||
- /${TRAVIS_BUILD_NUMBER}
|
||||
language: node_js
|
||||
node_js:
|
||||
- "8"
|
||||
|
||||
- '8'
|
||||
before_script:
|
||||
# Disable services enabled by default
|
||||
- sudo /etc/init.d/postgresql stop
|
||||
|
||||
before_install:
|
||||
- npm install -g npm@latest
|
||||
- export DISPLAY=:99.0
|
||||
- sh -e /etc/init.d/xvfb start
|
||||
- sleep 3 # give xvfb some time to start
|
||||
|
||||
- sleep 3
|
||||
jobs:
|
||||
include:
|
||||
- stage: test
|
||||
script: npm run lint && npm run spellcheck
|
||||
name: 'Code quality checks'
|
||||
script:
|
||||
- npm run lint
|
||||
- npm run spellcheck
|
||||
- npm run format:check
|
||||
- stage: test
|
||||
name: 'Unit tests'
|
||||
script:
|
||||
- npm run test:ci
|
||||
- bash <(curl -s https://codecov.io/bash) -X gcov
|
||||
- stage: e2e
|
||||
name: 'Nginx'
|
||||
script: npm run build && npm run e2e:docker
|
||||
- stage: e2e
|
||||
name: 'Tomcat'
|
||||
script: npm run build.tomcat.e2e && npm run docker.tomcat.e2e
|
||||
|
||||
Vendored
+11
-2
@@ -1,4 +1,13 @@
|
||||
{
|
||||
"javascript.preferences.quoteStyle": "single",
|
||||
"typescript.preferences.quoteStyle": "single"
|
||||
"javascript.preferences.quoteStyle": "single",
|
||||
"javascript.preferences.importModuleSpecifier": "relative",
|
||||
"typescript.preferences.quoteStyle": "single",
|
||||
"typescript.preferences.importModuleSpecifier": "relative",
|
||||
"editor.formatOnSave": true,
|
||||
"[html]": {
|
||||
"editor.formatOnSave": false
|
||||
},
|
||||
"[json]": {
|
||||
"editor.formatOnSave": false
|
||||
}
|
||||
}
|
||||
|
||||
+5
-1
@@ -1,9 +1,13 @@
|
||||
FROM nginx:stable-alpine
|
||||
LABEL version="1.3"
|
||||
LABEL version="1.4"
|
||||
LABEL maintainer="Denys Vuika <denys.vuika@alfresco.com>"
|
||||
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
COPY ./docker-entrypoint.sh /
|
||||
RUN chmod +x /docker-entrypoint.sh
|
||||
|
||||
WORKDIR /usr/share/nginx/html
|
||||
COPY dist/app/ .
|
||||
|
||||
ENTRYPOINT [ "/docker-entrypoint.sh" ]
|
||||
|
||||
@@ -28,19 +28,24 @@ Isuses can be raised in GitHub or in the Alfresco JIRA project.
|
||||
Please include a clear description, steps to reproduce and screenshots where appropriate.All issues will be reviewed; bugs will be categorized if reproducible and enhancement/feature suggestions will be considered against existing priorities if the use case serves a general-purpose need.
|
||||
|
||||
#### Features added in the latest release
|
||||
* Application Extensibility - first phase of extensibilty, see [Documentation](https://alfresco.github.io/alfresco-content-app/#/extending) for details.
|
||||
* Sharing Files - activate and deactivate shared file links.
|
||||
* Commenting - View and add comments to files and folders.
|
||||
* Permissions - update file and folder permissions.
|
||||
* Print - print action from the file viewer
|
||||
* Improved UX - single click to open folders and files, and right click actions menu
|
||||
* Application Extensibility - Phase 2
|
||||
* Document list presets
|
||||
* File viewer actions
|
||||
* Create menu button
|
||||
* Application header
|
||||
* Metadata card configuration
|
||||
* see [Documentation](https://alfresco.github.io/alfresco-content-app/#/extending) for details.
|
||||
* Sharing Files
|
||||
* Set expiry date for shared links
|
||||
* Right click action to access shared link settings
|
||||
* Automatic disable of sharing based on respository configuration
|
||||
|
||||
Please refer to the [release notes](https://github.com/Alfresco/alfresco-content-app/releases) for details of all changes.
|
||||
|
||||
#### High level features planned for H2 2018 (July - December)
|
||||
* Library Management - create, find, join and manage file libraries.
|
||||
* Sharing Files - add an expiry date to a sharable link.
|
||||
* Application Extensibility - Extension framework to provide simple ways to extend the application.
|
||||
* Library Management
|
||||
* For end users: Find, join and favorite libraries
|
||||
* For managers: Create libraries, manage users and requests to join
|
||||
|
||||
### Want to help?
|
||||
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for [contributing](https://github.com/Alfresco/alfresco-content-app/blob/master/CONTRIBUTING.md) and then check out one of our issues in the [Jira](https://issues.alfresco.com/jira/projects/ACA) or [GitHub](https://github.com/Alfresco/alfresco-content-app/issues)
|
||||
@@ -60,42 +65,6 @@ Want to file a bug, contribute some code, or improve documentation? Excellent! R
|
||||
| Metadata | The information drawer can be configured in the app.config.json to display metadata information, by default file the Properties Aspect is shown and images will also include EXIF information.|
|
||||
| Versioning | The version manager provides access and management of previous file versions, and the ability to upload new versions.|
|
||||
|
||||
|
||||
## Development server
|
||||
|
||||
Run `npm start` for a dev server. Navigate to `http://localhost:4200/` (opens by default).
|
||||
The app will automatically reload if you change any of the source files.
|
||||
|
||||
## Build
|
||||
|
||||
Run `npm run build` to build the project in the production mode. The build artifacts will be stored in the `dist/` directory.
|
||||
|
||||
## Running unit tests
|
||||
|
||||
Run `npm test` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
||||
|
||||
## Running end-to-end tests
|
||||
|
||||
Run the local instance of the application packaged into the docker image together with the ACS images:
|
||||
|
||||
```sh
|
||||
npm run build
|
||||
npm run start:docker
|
||||
```
|
||||
|
||||
The ACA runs on port 4000 inside the docker container.
|
||||
Run `npm run e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
|
||||
|
||||
```sh
|
||||
npm run e2e
|
||||
```
|
||||
|
||||
When testing is over you can stop all corresponding containers:
|
||||
|
||||
```sh
|
||||
npm run stop:docker
|
||||
```
|
||||
|
||||
## Further help
|
||||
|
||||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
||||
|
||||
+10
-92
@@ -47,14 +47,14 @@
|
||||
"output": "/"
|
||||
},
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "node_modules/monaco-editor/min",
|
||||
"output": "./assets/monaco"
|
||||
"glob": "**/*.json",
|
||||
"input": "node_modules/@denysvuika/aca-dev-tools/assets",
|
||||
"output": "./assets/plugins"
|
||||
},
|
||||
{
|
||||
"glob": "**/*.js",
|
||||
"input": "node_modules/@ngstack/code-editor/workers",
|
||||
"output": "./assets/workers"
|
||||
"glob": "extension.schema.json",
|
||||
"input": ".",
|
||||
"output": "./assets"
|
||||
}
|
||||
],
|
||||
"styles": [
|
||||
@@ -63,10 +63,9 @@
|
||||
"src/styles.scss"
|
||||
],
|
||||
"scripts": [
|
||||
"node_modules/pdfjs-dist/build/pdf.js",
|
||||
"node_modules/pdfjs-dist/lib/shared/compatibility.js",
|
||||
"node_modules/pdfjs-dist/web/pdf_viewer.js",
|
||||
"node_modules/moment/min/moment.min.js"
|
||||
"node_modules/pdfjs-dist/build/pdf.js",
|
||||
"node_modules/pdfjs-dist/web/pdf_viewer.js",
|
||||
"node_modules/moment/min/moment.min.js"
|
||||
]
|
||||
},
|
||||
"configurations": {
|
||||
@@ -124,7 +123,6 @@
|
||||
"tsConfig": "src/tsconfig.spec.json",
|
||||
"scripts": [
|
||||
"node_modules/pdfjs-dist/build/pdf.js",
|
||||
"node_modules/pdfjs-dist/lib/shared/compatibility.js",
|
||||
"node_modules/pdfjs-dist/web/pdf_viewer.js",
|
||||
"node_modules/moment/min/moment.min.js"
|
||||
],
|
||||
@@ -154,7 +152,7 @@
|
||||
"output": "/assets"
|
||||
},
|
||||
{
|
||||
"glob": "pdf.worker.js",
|
||||
"glob": "pdf.worker.min.js",
|
||||
"input": "node_modules/pdfjs-dist/build",
|
||||
"output": "/"
|
||||
}
|
||||
@@ -204,86 +202,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"aca-dev-tools": {
|
||||
"root": "projects/aca-dev-tools",
|
||||
"sourceRoot": "projects/aca-dev-tools/src",
|
||||
"projectType": "library",
|
||||
"prefix": "lib",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-ng-packagr:build",
|
||||
"options": {
|
||||
"tsConfig": "projects/aca-dev-tools/tsconfig.lib.json",
|
||||
"project": "projects/aca-dev-tools/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"project": "projects/aca-dev-tools/ng-package.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "projects/aca-dev-tools/src/test.ts",
|
||||
"tsConfig": "projects/aca-dev-tools/tsconfig.spec.json",
|
||||
"karmaConfig": "projects/aca-dev-tools/karma.conf.js"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"projects/aca-dev-tools/tsconfig.lib.json",
|
||||
"projects/aca-dev-tools/tsconfig.spec.json"
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"adf-extensions": {
|
||||
"root": "projects/adf-extensions",
|
||||
"sourceRoot": "projects/adf-extensions/src",
|
||||
"projectType": "library",
|
||||
"prefix": "lib",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-ng-packagr:build",
|
||||
"options": {
|
||||
"tsConfig": "projects/adf-extensions/tsconfig.lib.json",
|
||||
"project": "projects/adf-extensions/ng-package.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"project": "projects/adf-extensions/ng-package.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "projects/adf-extensions/src/test.ts",
|
||||
"tsConfig": "projects/adf-extensions/tsconfig.spec.json",
|
||||
"karmaConfig": "projects/adf-extensions/karma.conf.js"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"projects/adf-extensions/tsconfig.lib.json",
|
||||
"projects/adf-extensions/tsconfig.spec.json"
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"defaultProject": "app",
|
||||
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
npm run build -- --base-href ./
|
||||
|
||||
node -e "
|
||||
const fs = require('fs');
|
||||
const config = require('./dist/app/app.config.json');
|
||||
config.baseShareUrl = 'http://localhost:4000/content-app';
|
||||
fs.writeFileSync(
|
||||
'./dist/app/app.config.json',
|
||||
JSON.stringify(config, null, 2)
|
||||
);
|
||||
"
|
||||
|
||||
jar -cvf docker/tomcat/artifacts/content-app.war -C dist/app/ .
|
||||
+56
-52
@@ -1,56 +1,60 @@
|
||||
{
|
||||
"version": "0.1",
|
||||
"language": "en",
|
||||
"words": [
|
||||
"succes",
|
||||
"sharedlinks",
|
||||
"version": "0.1",
|
||||
"language": "en",
|
||||
"words": [
|
||||
"succes",
|
||||
"sharedlinks",
|
||||
"Redistributable",
|
||||
"fullscreen",
|
||||
|
||||
"ngrx",
|
||||
"ngstack",
|
||||
"sidenav",
|
||||
"injectable",
|
||||
"truthy",
|
||||
"cryptodoc",
|
||||
"mysites",
|
||||
"afts",
|
||||
"classlist",
|
||||
"folderlink",
|
||||
"filelink",
|
||||
"datatable",
|
||||
"repo",
|
||||
"snackbar",
|
||||
"promisify",
|
||||
"xdescribe",
|
||||
"unfavorite",
|
||||
"devtools",
|
||||
"gitter",
|
||||
"jira",
|
||||
"markdownlint",
|
||||
"uploader",
|
||||
"nginx",
|
||||
"docx",
|
||||
"SOLR",
|
||||
"ngrx",
|
||||
"ngstack",
|
||||
"sidenav",
|
||||
"injectable",
|
||||
"truthy",
|
||||
"cryptodoc",
|
||||
"mysites",
|
||||
"afts",
|
||||
"classlist",
|
||||
"folderlink",
|
||||
"filelink",
|
||||
"formcontrolname",
|
||||
"datetimepicker",
|
||||
"datatable",
|
||||
"repo",
|
||||
"snackbar",
|
||||
"promisify",
|
||||
"xdescribe",
|
||||
"unfavorite",
|
||||
"devtools",
|
||||
"gitter",
|
||||
"jira",
|
||||
"markdownlint",
|
||||
"uploader",
|
||||
"nginx",
|
||||
"docx",
|
||||
"SOLR",
|
||||
|
||||
"unshare",
|
||||
"validators",
|
||||
"guid",
|
||||
"polyfill",
|
||||
"polyfills",
|
||||
"jsonp",
|
||||
"hammerjs",
|
||||
"pdfjs",
|
||||
"xpath",
|
||||
"tooltip",
|
||||
"tooltips",
|
||||
"unindent",
|
||||
"exif",
|
||||
"cardview",
|
||||
"webm",
|
||||
"keycodes"
|
||||
],
|
||||
"dictionaries": [
|
||||
"html",
|
||||
"en-gb",
|
||||
"en_US"
|
||||
]
|
||||
"unshare",
|
||||
"qshare",
|
||||
"validators",
|
||||
"guid",
|
||||
"polyfill",
|
||||
"polyfills",
|
||||
"jsonp",
|
||||
"hammerjs",
|
||||
"pdfjs",
|
||||
"xpath",
|
||||
"tooltip",
|
||||
"tooltips",
|
||||
"unindent",
|
||||
"exif",
|
||||
"cardview",
|
||||
"webm",
|
||||
"keycodes",
|
||||
"denysvuika",
|
||||
"submenu",
|
||||
"submenus"
|
||||
],
|
||||
"dictionaries": ["html", "en-gb", "en_US"]
|
||||
}
|
||||
|
||||
+96
-86
@@ -1,95 +1,105 @@
|
||||
version: "3"
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
alfresco:
|
||||
image: alfresco/alfresco-content-repository-community:6.0.7-ga
|
||||
depends_on:
|
||||
- postgres
|
||||
environment:
|
||||
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
|
||||
-Ddeployment.method=DOCKER_COMPOSE
|
||||
-Dcsrf.filter.enabled=false
|
||||
"
|
||||
networks:
|
||||
- internal
|
||||
ports:
|
||||
- 8080:8080 #Browser port
|
||||
alfresco:
|
||||
image: alfresco/alfresco-content-repository-community:6.1.0-ea
|
||||
depends_on:
|
||||
- postgres
|
||||
environment:
|
||||
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
|
||||
-Ddeployment.method=DOCKER_COMPOSE
|
||||
-Dcsrf.filter.enabled=false
|
||||
'
|
||||
networks:
|
||||
- internal
|
||||
ports:
|
||||
- 8080:8080 #Browser port
|
||||
|
||||
share:
|
||||
image: alfresco/alfresco-share:6.0.b
|
||||
depends_on:
|
||||
- alfresco
|
||||
environment:
|
||||
- REPO_HOST=alfresco
|
||||
- REPO_PORT=8080
|
||||
networks:
|
||||
- internal
|
||||
ports:
|
||||
- 8083:8080
|
||||
share:
|
||||
image: alfresco/alfresco-share:6.0.c
|
||||
depends_on:
|
||||
- alfresco
|
||||
environment:
|
||||
- REPO_HOST=alfresco
|
||||
- REPO_PORT=8080
|
||||
networks:
|
||||
- internal
|
||||
ports:
|
||||
- 8083:8080
|
||||
|
||||
postgres:
|
||||
image: postgres:10.1
|
||||
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
|
||||
postgres:
|
||||
image: postgres:10.1
|
||||
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.1.1
|
||||
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
|
||||
networks:
|
||||
- internal
|
||||
ports:
|
||||
- 8983:8983 #Browser port
|
||||
solr6:
|
||||
image: alfresco/alfresco-search-services:1.2.0
|
||||
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
|
||||
networks:
|
||||
- internal
|
||||
ports:
|
||||
- 8983:8983 #Browser port
|
||||
|
||||
content-app:
|
||||
image: alfresco/alfresco-content-app:latest
|
||||
build: .
|
||||
depends_on:
|
||||
- alfresco
|
||||
networks:
|
||||
- internal
|
||||
ports:
|
||||
- 4001:80
|
||||
# volumes:
|
||||
# - ./app.config.json:/usr/share/nginx/html/app.config.json
|
||||
# - ./nginx.conf:/etc/nginx/conf.d/default.conf
|
||||
activemq:
|
||||
image: alfresco/alfresco-activemq:5.15.6
|
||||
networks:
|
||||
- internal
|
||||
ports:
|
||||
- 8161:8161 # Web Console
|
||||
- 5672:5672 # AMQP
|
||||
- 61616:61616 # OpenWire
|
||||
- 61613:61613 # STOMP
|
||||
|
||||
proxy:
|
||||
image: nginx:stable-alpine
|
||||
depends_on:
|
||||
- content-app
|
||||
volumes:
|
||||
- ./docker-compose/nginx.conf:/etc/nginx/conf.d/default.conf
|
||||
networks:
|
||||
- internal
|
||||
ports:
|
||||
- 4000:80
|
||||
content-app:
|
||||
image: alfresco/alfresco-content-app:latest
|
||||
build: .
|
||||
depends_on:
|
||||
- alfresco
|
||||
networks:
|
||||
- internal
|
||||
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
|
||||
volumes:
|
||||
- ./docker-compose/nginx.conf:/etc/nginx/conf.d/default.conf
|
||||
networks:
|
||||
- internal
|
||||
ports:
|
||||
- 4000:80
|
||||
|
||||
networks:
|
||||
internal:
|
||||
? internal
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -n "${APP_CONFIG_AUTH_TYPE}" ];then
|
||||
sed -e "s/\"authType\": \".*\"/\"authType\": \"${APP_CONFIG_AUTH_TYPE}\"/g" \
|
||||
-i ./app.config.json
|
||||
fi
|
||||
|
||||
if [ -n "${APP_CONFIG_OAUTH2_HOST}" ];then
|
||||
replace="\/"
|
||||
encoded=${APP_CONFIG_OAUTH2_HOST//\//$replace}
|
||||
sed -e "s/\"host\": \".*\"/\"host\": \"${encoded}\"/g" \
|
||||
-i ./app.config.json
|
||||
fi
|
||||
|
||||
if [ -n "${APP_CONFIG_OAUTH2_CLIENTID}" ];then
|
||||
sed -e "s/\"clientId\": \".*\"/\"clientId\": \"${APP_CONFIG_OAUTH2_CLIENTID}\"/g" \
|
||||
-i ./app.config.json
|
||||
fi
|
||||
|
||||
if [ -n "${APP_CONFIG_OAUTH2_IMPLICIT_FLOW}" ];then
|
||||
sed "/implicitFlow/s/true/${APP_CONFIG_OAUTH2_IMPLICIT_FLOW}/" \
|
||||
-i ./app.config.json
|
||||
fi
|
||||
|
||||
if [ -n "${APP_CONFIG_OAUTH2_SILENT_LOGIN}" ];then
|
||||
sed "/silentLogin/s/true/${APP_CONFIG_OAUTH2_SILENT_LOGIN}/" \
|
||||
-i ./app.config.json
|
||||
fi
|
||||
|
||||
if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI}" ];then
|
||||
replace="\/"
|
||||
encoded=${APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI//\//$replace}
|
||||
sed -e "s/\"redirectSilentIframeUri\": \".*\"/\"redirectSilentIframeUri\": \"${encoded}\"/g" \
|
||||
-i ./app.config.json
|
||||
fi
|
||||
|
||||
if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_LOGIN}" ];then
|
||||
replace="\/"
|
||||
encoded=${APP_CONFIG_OAUTH2_REDIRECT_LOGIN//\//$replace}
|
||||
sed -e "s/\"redirectUri\": \".*\"/\"redirectUri\": \"${encoded}\"/g" \
|
||||
-i ./app.config.json
|
||||
fi
|
||||
|
||||
if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_LOGOUT}" ];then
|
||||
replace="\/"
|
||||
encoded=${APP_CONFIG_OAUTH2_REDIRECT_LOGOUT//\//$replace}
|
||||
sed -e "s/\"redirectUriLogout\": \".*\"/\"redirectUriLogout\": \"${encoded}\"/g" \
|
||||
-i ./app.config.json
|
||||
fi
|
||||
|
||||
if [[ $ACSURL ]]; then
|
||||
sed -i s%{protocol}//{hostname}{:port}%"$ACSURL"%g /usr/share/nginx/html/app.config.json
|
||||
fi
|
||||
|
||||
if [[ $BASEPATH ]]; then
|
||||
sed -i s%href=\"/\"%href=\""$BASEPATH"\"%g /usr/share/nginx/html/index.html
|
||||
fi
|
||||
|
||||
if [ -n "${APP_BASE_SHARE_URL}" ];then
|
||||
sed -e "s/\"baseShareUrl\": \".*\"/\"baseShareUrl\": \"${APP_BASE_SHARE_URL}\"/g" \
|
||||
-i ./app.config.json
|
||||
fi
|
||||
|
||||
nginx -g "daemon off;"
|
||||
@@ -0,0 +1,5 @@
|
||||
FROM tomcat:8.5-alpine
|
||||
LABEL version="1.3"
|
||||
LABEL maintainer="Denys Vuika <denys.vuika@alfresco.com>"
|
||||
|
||||
COPY ./artifacts/content-app.war /usr/local/tomcat/webapps/content-app.war
|
||||
@@ -0,0 +1 @@
|
||||
*.war
|
||||
@@ -0,0 +1,97 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
alfresco:
|
||||
image: alfresco/alfresco-content-repository-community:6.1.0-ea
|
||||
depends_on:
|
||||
- postgres
|
||||
environment:
|
||||
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
|
||||
-Ddeployment.method=DOCKER_COMPOSE
|
||||
-Dcsrf.filter.enabled=false
|
||||
'
|
||||
networks:
|
||||
- internal
|
||||
ports:
|
||||
- 8080:8080 #Browser port
|
||||
|
||||
share:
|
||||
image: alfresco/alfresco-share:6.0.c
|
||||
depends_on:
|
||||
- alfresco
|
||||
environment:
|
||||
- REPO_HOST=alfresco
|
||||
- REPO_PORT=8080
|
||||
networks:
|
||||
- internal
|
||||
ports:
|
||||
- 8083:8080
|
||||
|
||||
postgres:
|
||||
image: postgres:10.1
|
||||
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.2.0
|
||||
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
|
||||
networks:
|
||||
- internal
|
||||
ports:
|
||||
- 8983:8983 #Browser port
|
||||
|
||||
content-app:
|
||||
image: alfresco/alfresco-content-app:development-latest-tomcat8
|
||||
build: .
|
||||
environment:
|
||||
- APP_BASE_SHARE_URL={protocol}//{hostname}{:port}/content-app/
|
||||
depends_on:
|
||||
- alfresco
|
||||
networks:
|
||||
- internal
|
||||
ports:
|
||||
- 4001:8080
|
||||
# volumes:
|
||||
# - ./app.config.json:/usr/share/nginx/html/app.config.json
|
||||
# - ./nginx.conf:/etc/nginx/conf.d/default.conf
|
||||
|
||||
proxy:
|
||||
image: nginx
|
||||
depends_on:
|
||||
- content-app
|
||||
volumes:
|
||||
- ./nginx.conf:/etc/nginx/conf.d/default.conf
|
||||
networks:
|
||||
- internal
|
||||
ports:
|
||||
- 4000:80
|
||||
|
||||
networks:
|
||||
? internal
|
||||
@@ -0,0 +1,43 @@
|
||||
server {
|
||||
listen *:80;
|
||||
|
||||
set $allowOriginSite *;
|
||||
proxy_pass_request_headers on;
|
||||
proxy_pass_header Set-Cookie;
|
||||
|
||||
location / {
|
||||
proxy_pass http://content-app:8080;
|
||||
|
||||
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
|
||||
proxy_redirect off;
|
||||
proxy_buffering off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass_header Set-Cookie;
|
||||
}
|
||||
|
||||
location /alfresco/ {
|
||||
proxy_pass http://alfresco:8080;
|
||||
|
||||
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
|
||||
proxy_redirect off;
|
||||
proxy_buffering off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass_header Set-Cookie;
|
||||
}
|
||||
|
||||
location /share/ {
|
||||
proxy_pass http://share:8080;
|
||||
|
||||
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
|
||||
proxy_redirect off;
|
||||
proxy_buffering off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass_header Set-Cookie;
|
||||
}
|
||||
}
|
||||
+15
-18
@@ -7,7 +7,7 @@
|
||||
The Alfresco Content Application is an example application built using
|
||||
[Alfresco Application Development Framework (ADF)](https://github.com/Alfresco/alfresco-ng2-components) components.
|
||||
|
||||
### Who is this example application for
|
||||
### Who is this example application for?
|
||||
|
||||
This example application demonstrates to Angular software engineers
|
||||
how to construct a content application using the Alfresco ADF.
|
||||
@@ -19,7 +19,7 @@ with a simple and easy to use interface for working with files stored in the Alf
|
||||
|
||||
This application was created based on the latest releases from Alfresco:
|
||||
|
||||
- [Alfresco ADF (2.5.0)](https://community.alfresco.com/community/application-development-framework/pages/get-started)
|
||||
- [Alfresco ADF (2.6.0)](https://community.alfresco.com/community/application-development-framework/pages/get-started)
|
||||
- [Alfresco Content Services (6.0.0)](https://www.alfresco.com/platform/content-services-ecm)
|
||||
or [Alfresco Community Edition (6.0 - General Release: 201806)](https://www.alfresco.com/products/community/download)
|
||||
|
||||
@@ -27,8 +27,7 @@ This application was created based on the latest releases from Alfresco:
|
||||
You also need <a href="https://nodejs.org/en/" target="_blank">node.js</a> (LTS) installed to build it locally from source code.
|
||||
</p>
|
||||
|
||||
The latest version of the Alfresco Content platform is required
|
||||
due to the application using the latest [REST APIs](https://docs.alfresco.com/5.2/pra/1/topics/pra-welcome.html) developments.
|
||||
**Note:** The latest version of the Alfresco Content platform is required due to the application using the latest [REST APIs](https://docs.alfresco.com/5.2/pra/1/topics/pra-welcome.html) developments.
|
||||
|
||||
## Features
|
||||
|
||||
@@ -46,9 +45,9 @@ using the Alfresco Application Development Framework to easily and quickly creat
|
||||
|
||||
There are three main areas of the application controlled by the [Layout component](https://github.com/Alfresco/alfresco-content-app/tree/master/src/app/components/layout):
|
||||
|
||||
- [(1) Application Header](#header)
|
||||
- [(2) Side Navigation](#side-navigation)
|
||||
- [(3) Document List](#document-list-layout)
|
||||
1. [Application Header](#header)
|
||||
2. [Side Navigation](#side-navigation)
|
||||
3. [Document List](#document-list-layout)
|
||||
|
||||

|
||||
|
||||
@@ -66,13 +65,13 @@ The application [header](https://github.com/Alfresco/alfresco-content-app/tree/m
|
||||
|
||||
Logo & app primary color - logo and color are configurable by updating the
|
||||
[app.config.json](https://github.com/Alfresco/alfresco-content-app/blob/master/src/app.config.json) file in the root folder of the project.
|
||||
Please refer to the [Application Configuration](/getting-started#application-logo) documentation for more information on how to change the logo and color.
|
||||
Please refer to the [Application Configuration](/getting-started/configuration) documentation for more information on how to change the logo and color.
|
||||
|
||||
#### Search
|
||||
|
||||
The application [Search](https://github.com/Alfresco/alfresco-content-app/tree/master/src/app/components/search) -
|
||||
uses the [ADF Search Component](https://github.com/Alfresco/alfresco-ng2-components/tree/master/lib/content-services/search)
|
||||
the app provides a 'live' search feature, where users can open files and folders directly from the Search API results.
|
||||
uses the [ADF Search Component](https://github.com/Alfresco/alfresco-ng2-components/tree/master/lib/content-services/search).
|
||||
The app provides a 'live' search feature, where users can open files and folders directly from the Search API results.
|
||||
|
||||

|
||||
|
||||
@@ -114,16 +113,16 @@ and uploads can be canceled which will stop uploads in progress or permanently d
|
||||
|
||||
The navigation links are configurable via the [app.config.json](https://github.com/Alfresco/alfresco-content-app/blob/master/src/app.config.json).
|
||||
Default configuration creates two sections.
|
||||
See [Navigation](/getting-started#navigation) for more information about configuring the side navigation.
|
||||
See [Navigation](/getting-started/navigation) for more information about configuring the side navigation.
|
||||
|
||||
### Document List Layout
|
||||
|
||||
The main area of the application is composed of several individual ADF components:
|
||||
|
||||
- (1) [Breadcrumb](https://alfresco.github.io/adf-component-catalog/components/BreadcrumbComponent.html)
|
||||
- (2) [Toolbar](https://alfresco.github.io/adf-component-catalog/components/ToolbarComponent.html)
|
||||
- (3) [Document List](https://alfresco.github.io/adf-component-catalog/components/DocumentListComponent.html)
|
||||
- (4) [Pagination](https://alfresco.github.io/adf-component-catalog/components/PaginationComponent.html)
|
||||
1. [Breadcrumb](https://alfresco.github.io/adf-component-catalog/components/BreadcrumbComponent.html)
|
||||
2. [Toolbar](https://alfresco.github.io/adf-component-catalog/components/ToolbarComponent.html)
|
||||
3. [Document List](https://alfresco.github.io/adf-component-catalog/components/DocumentListComponent.html)
|
||||
4. [Pagination](https://alfresco.github.io/adf-component-catalog/components/PaginationComponent.html)
|
||||
|
||||

|
||||
|
||||
@@ -155,8 +154,6 @@ and includes extra columns to display where the file is
|
||||
[located](https://github.com/Alfresco/alfresco-content-app/tree/master/src/app/components/location-link)
|
||||
in the content repository and who created the shared link.
|
||||
|
||||
A feature for creating and removing Shared Links will be added in the future.
|
||||
|
||||
#### Recent Files
|
||||
|
||||
The Recent Files view shows all the files that have been created or modified within the last 30 days by the current user.
|
||||
@@ -248,7 +245,7 @@ actions are automatically hidden when the user does not have permission.
|
||||
<tr>
|
||||
<td>Share</td>
|
||||
<td>
|
||||
Create and copy a link to a file that can be shared, the links are accessible without granting permissions to the file, and do not require users to login to the application.
|
||||
Create and copy a link to a file that can be shared, the links are accessible without granting permissions to the file, and do not require users to login to the application. Share links can automatically expire based on a date, the minimum expiry date is controlled by the Content Services repository, which is 1 day from the date of creation.
|
||||
</td>
|
||||
<td>
|
||||
Not applicable.
|
||||
|
||||
+1259
-742
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
|
||||
@@ -1,560 +0,0 @@
|
||||
---
|
||||
title: Getting Started
|
||||
---
|
||||
|
||||
# Getting Started
|
||||
|
||||
## Prerequisites
|
||||
|
||||
This application uses the latest releases from Alfresco:
|
||||
|
||||
- [Alfresco ADF (2.4.0)](https://community.alfresco.com/community/application-development-framework/pages/get-started)
|
||||
- [Alfresco Content Services (5.2.3)](https://www.alfresco.com/platform/content-services-ecm)
|
||||
or [Alfresco Community Edition (201802 EA)](https://www.alfresco.com/products/community/download)
|
||||
|
||||
<p class="warning">
|
||||
You also need <a href="https://nodejs.org/en/" target="_blank">node.js</a> (LTS) installed to build it locally from source code.
|
||||
</p>
|
||||
|
||||
The latest version of the Alfresco Content platform is required
|
||||
due to the application using the latest [REST APIs](https://docs.alfresco.com/5.2/pra/1/topics/pra-welcome.html) developments.
|
||||
|
||||
## Building from source
|
||||
|
||||
The Content App is based on [Angular CLI](https://cli.angular.io), and you can use all the commands, generators and blueprints supported by the CLI.
|
||||
|
||||
### Prerequisites for building
|
||||
|
||||
- [Node.js](https://nodejs.org/en/) LTS
|
||||
- [Angular CLI](https://cli.angular.io/) 1.7.3
|
||||
|
||||
### Cloning and running
|
||||
|
||||
Use the following commands to clone the project, install dependencies and run it.
|
||||
|
||||
```sh
|
||||
git clone https://github.com/Alfresco/alfresco-content-app.git
|
||||
cd alfresco-content-app
|
||||
npm install
|
||||
npm start
|
||||
```
|
||||
|
||||
The application runs at port `4200` by default, and should automatically open in the default browser once project compilation finishes.
|
||||
|
||||
### Proxy settings
|
||||
|
||||
The Content App provides a proxy configuration for local development server
|
||||
that allows you to address specific scenarios with CORS and native authentication dialog.
|
||||
|
||||
You can find settings in the "proxy.conf.js" file in the project root directory.
|
||||
|
||||
<p class="warning">
|
||||
The proxy settings get automatically applied every time you run the application with "npm start" script.
|
||||
You must restart the application every time you change the settings values.
|
||||
</p>
|
||||
|
||||
### Running unit tests
|
||||
|
||||
Run `npm test` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
||||
|
||||
## Internationalization (i18n)
|
||||
|
||||
The Content Application provides support for the following languages:
|
||||
|
||||
- German (`de`)
|
||||
- English (`en`)
|
||||
- Spanish (`es`)
|
||||
- French (`fr`)
|
||||
- Italian (`it`)
|
||||
- Japanese (`ja`)
|
||||
- Norwegian (`nb`)
|
||||
- Dutch (`nl`)
|
||||
- Brazilian Portuguese (`pt-BR`)
|
||||
- Russian (`ru`)
|
||||
- Simplified Chinese (`zh-CN`)
|
||||
|
||||
The fallback locale is the English one, however current browser language is taken as the default one automatically when the application starts.
|
||||
|
||||
### User-defined language
|
||||
|
||||
You can allow users to set custom language that gets saved to user preferences.
|
||||
The main application menu already has the [ADF Language Menu](https://github.com/Alfresco/alfresco-ng2-components/blob/master/docs/core/language-menu.component.md) component integrated and pre-filled with the supported items.
|
||||
|
||||
To change the default language set edit the `app.config.json` file and add or remove items:
|
||||
|
||||
```json
|
||||
{
|
||||
...,
|
||||
"languages": [
|
||||
{
|
||||
"key": "de",
|
||||
"label": "German"
|
||||
},
|
||||
{
|
||||
"key": "en",
|
||||
"label": "English"
|
||||
},
|
||||
{
|
||||
"key": "es",
|
||||
"label": "Spanish"
|
||||
},
|
||||
...
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
The file is located at the following path: `/src/app.config.json`.
|
||||
|
||||
### Custom languages
|
||||
|
||||
To add a custom language, add a new "JSON" file to the "/src/assets/i18n" folder
|
||||
with the name of the target locale, for instance, a "de.json" for the "German".
|
||||
|
||||
Translate the resource strings based on the default "en.json" file.
|
||||
You can copy the content over to your newly created file and replace English values with translated text.
|
||||
|
||||
```json
|
||||
{
|
||||
"APP": {
|
||||
"SIGN_IN": "Anmelden",
|
||||
"SIGN_OUT": "Abmelden",
|
||||
"NEW_MENU": {
|
||||
"LABEL": "Neu",
|
||||
"MENU_ITEMS": {
|
||||
"CREATE_FOLDER": "Ordner erstellen",
|
||||
"UPLOAD_FILE": "Datei hochladen",
|
||||
"UPLOAD_FOLDER": "Ordner hochladen"
|
||||
},
|
||||
...
|
||||
}
|
||||
},
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
The Content Application automatically bundles your file upon project build.
|
||||
You can test your locale by changing the browser language settings and reloading the page.
|
||||
|
||||
Optionally, you can extend the [ADF Language Menu](https://github.com/Alfresco/alfresco-ng2-components/blob/master/docs/core/language-menu.component.md) component with the newly added language by updating the `app.config.json` file.
|
||||
|
||||
### Customizing ADF translations
|
||||
|
||||
In addition to creating a custom language file for the Content Application,
|
||||
you can also provide translations for the ADF resources.
|
||||
|
||||
Your `/src/assets/i18n/<lang>.json` file can reflect the structure of one of the ADF language files:
|
||||
|
||||
- ADF Core ([en.json](https://github.com/Alfresco/alfresco-ng2-components/blob/master/lib/core/i18n/en.json))
|
||||
- ADF Content Services ([en.json](https://github.com/Alfresco/alfresco-ng2-components/blob/master/lib/content-services/i18n/en.json))
|
||||
- ADF Process Services ([en.json](https://github.com/Alfresco/alfresco-ng2-components/blob/master/lib/process-services/i18n/en.json))
|
||||
- ADF Insights ([en.json](https://github.com/Alfresco/alfresco-ng2-components/blob/master/lib/insights/i18n/en.json))
|
||||
|
||||
At runtime, the application-level strings have the highest priority.
|
||||
That means you can replace the value of any ADF resource string if needed.
|
||||
|
||||
For example, let's change the title of the "Create Folder" dialog shipped with the ADF.
|
||||
Modify the `/src/assets/i18n/en.json` file and append the "CORE" section like in the example below:
|
||||
|
||||
```json
|
||||
{
|
||||
"APP": {
|
||||
...
|
||||
},
|
||||
"CORE": {
|
||||
"FOLDER_DIALOG": {
|
||||
"CREATE_FOLDER_TITLE": "Custom title"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Now, if you run the application and click the "New → Create Folder" menu,
|
||||
the title of the dialog should look like the following:
|
||||
|
||||

|
||||
|
||||
### Language picker
|
||||
|
||||
You can enable internal language picker in the `app.config.json` file:
|
||||
|
||||
```json
|
||||
{
|
||||
...,
|
||||
|
||||
"languagePicker": true,
|
||||
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
## CORS
|
||||
|
||||
The ACA already comes with the proxy configuration for Angular CLI to address CORS-related issues for development.
|
||||
Also, the docker images contain Nginx settings needed for CORS when developing and debugging application locally.
|
||||
|
||||
### Chrome Workaround
|
||||
|
||||
For the Chrome browser, you can use the following plugin that allows you to toggle CORS:
|
||||
[Allow-Control-Allow-Origin](https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi)
|
||||
|
||||
### Firefox Workaround
|
||||
|
||||
Firefox users can try the following plugin: [CORS Everywhere](https://addons.mozilla.org/en-Gb/firefox/addon/cors-everywhere/)
|
||||
|
||||
### Safari Workaround
|
||||
|
||||
If you are developing or testing with Safari then you can use the "Develop" menu to toggle the CORS mode.
|
||||
Please note that the page must be reloaded every time you change CORS settings.
|
||||
|
||||

|
||||
|
||||
### See also
|
||||
|
||||
- [Using CORS](https://www.html5rocks.com/en/tutorials/cors/)
|
||||
|
||||
## Configuration
|
||||
|
||||
The Content Application provides support for a global settings file `app.config.json` that you can use to customize the behavior of ACA and ADF components.
|
||||
|
||||
### Server settings
|
||||
|
||||
Once the Content Application starts, it needs to know where the Alfresco Content Services (either Community or Enterprise) server is.
|
||||
The "ecmHost" property allows you to set the address of the server using the dynamic or static format.
|
||||
|
||||
#### Dynamic address
|
||||
|
||||
The example below demonstrates the most common dynamic format for development environment:
|
||||
|
||||
```json
|
||||
{
|
||||
"ecmHost": "http://{hostname}{:port}",
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
The configuration above assumes you are running ACS and Content App on the same server and port
|
||||
and allows deploying to different servers having the same unified configuration file.
|
||||
|
||||
For example, a proxy server at `localhost:4200` hosting the Content App as the root application,
|
||||
and `localhost:4200/alfresco` for the ACS repository.
|
||||
|
||||
At runtime, the application is going to automatically substitute the "{hostname}" value with the original hostname.
|
||||
Optionally it can also use the value of the original port if present, for example, "4200" at local machines, or skip the value for port 80.
|
||||
|
||||
#### Static address
|
||||
|
||||
Alternatively, you can provide a static address for the ACS server if necessary:
|
||||
|
||||
```json
|
||||
{
|
||||
"ecmHost": "http://localhost:4200",
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
### Application settings
|
||||
|
||||
There are many settings you can change to alter the default behavior of the application.
|
||||
|
||||
#### Application Name
|
||||
|
||||
The following block allows you to change the name of the application.
|
||||
|
||||
```json
|
||||
{
|
||||
...,
|
||||
"application": {
|
||||
"name": "Alfresco Example Content Application"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The value of the `application.name` key gets appended to every browser tab title at runtime
|
||||
with the format `[page title] - [application name]`,
|
||||
for example: "Personal Files - Alfresco Example Content Application".
|
||||
|
||||
#### Application Logo
|
||||
|
||||
The default logo displayed in the top left corner of the Alfresco Content Application can be easily changed:
|
||||
|
||||
1. Place your custom logo image file in the [app-name]/src/assets/images folder. The displayed image will resize automatically, an image with extreme width/height might not retain its dimensions.
|
||||
|
||||
2. In the app.config.json file, set the value of the application.logo to contain the name of the custom logo image: "logo": "/assets/images/[image-name].[extension]"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
...,
|
||||
"application": {
|
||||
"logo": "/assets/images/alfresco-logo-white.svg"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Header Background color
|
||||
|
||||
You can change the header background color by specifying color code for the "headerColor" key:
|
||||
|
||||
```json
|
||||
{
|
||||
...,
|
||||
"headerColor": "#2196F3"
|
||||
}
|
||||
```
|
||||
|
||||
#### Restricted content
|
||||
|
||||
You can restrict users from uploading certain types of files and folders by setting or extending the list of rules at the "files.excluded" path.
|
||||
|
||||
By default, the application ships with the following rules already predefined:
|
||||
|
||||
```json
|
||||
{
|
||||
...,
|
||||
"files": {
|
||||
"excluded": [
|
||||
".DS_Store",
|
||||
"desktop.ini",
|
||||
"thumbs.db",
|
||||
".git"
|
||||
]
|
||||
},
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
<p class="tip">
|
||||
You can get more details on the supported rules in the following article: <a href="https://github.com/Alfresco/alfresco-ng2-components/blob/master/docs/core/upload.service.md" target="_blank">Upload Service</a>.
|
||||
</p>
|
||||
|
||||
#### Pagination settings
|
||||
|
||||
You can change the default settings of the pagination that gets applied to all the document lists in the application.
|
||||
|
||||
```json
|
||||
{
|
||||
...,
|
||||
"pagination": {
|
||||
"supportedPageSizes": [
|
||||
25,
|
||||
50,
|
||||
100
|
||||
]
|
||||
},
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
### Your custom settings
|
||||
|
||||
You can store any information in the application configuration file, and access it at runtime by using the `AppConfigService` service provided by ADF.
|
||||
|
||||
<p class="tip">
|
||||
Please refer to the <a href="https://github.com/Alfresco/alfresco-ng2-components/blob/master/docs/core/app-config.service.md" target="_blank">AppConfigService</a> documentation to get more details on Application Configuration features and API available.
|
||||
</p>
|
||||
|
||||
## Navigation
|
||||
|
||||
The Alfresco Content Application provides the following navigation links:
|
||||
|
||||
- Personal Files
|
||||
- File Libraries
|
||||
- Shared
|
||||
- Recent Files
|
||||
- Favorites
|
||||
- Trash
|
||||
|
||||
The side navigation provides support to customize the appearance of the links by editing the `app.config.json`.
|
||||
|
||||
### Customization
|
||||
|
||||
Navigation configuration supports array and object like schema. Defining an object helps navigation to render visual delimiters between different groups of links.
|
||||
|
||||
```json
|
||||
{
|
||||
"navigation": {
|
||||
"main": [
|
||||
...
|
||||
],
|
||||
"secondary": [
|
||||
...
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
```json
|
||||
{
|
||||
"navigation": [
|
||||
{ ... },
|
||||
{ ... },
|
||||
...
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
#### Customize icons and text
|
||||
|
||||
`icon` - supported value can be anything from [Material Design](https://material.io/icons) icons library. If not defined, the link will render just the label value.
|
||||
|
||||
`title` - instructs the link to render a native browser tooltip with the given value. It can be a string or a i18n defined reference. If not defined, the link will not show a tooltip.
|
||||
|
||||
`label` - represents the visual name of the link. It can be a string or a i18n defined reference.
|
||||
|
||||
<p class="danger">
|
||||
Changing ` "route": { "url": "/..." } ` value will affect the navigation since these are mapped to application routing system.
|
||||
</p>
|
||||
|
||||
#### Custom text (i18n)
|
||||
|
||||
To change the `title` and `label` of navigation links edit the values under `BROWSE` entry found at `/src/assets/i18n/en.json`
|
||||
|
||||
```json
|
||||
"APP" : {
|
||||
...
|
||||
"BROWSE": {
|
||||
"PERSONAL": {
|
||||
"TITLE": "Personal Files",
|
||||
"SIDENAV_LINK": {
|
||||
"LABEL": "Personal Files",
|
||||
"TOOLTIP": "View your Personal Files"
|
||||
}
|
||||
},
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
For more information about internationalization see [Internationalization (i18n)](#internationalization-i18n) section.
|
||||
|
||||
### User-defined navigation
|
||||
|
||||
To add custom navigation link for the application, first we need to create a component.
|
||||
|
||||
`src/app/components/custom-page/custom-page.component.ts`
|
||||
|
||||
```js
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
<h4>{{ title }}</h4>
|
||||
`
|
||||
})
|
||||
export class CustomPage {
|
||||
title = 'My Custom Page'
|
||||
}
|
||||
```
|
||||
|
||||
Register the component in ```app.module.ts```
|
||||
|
||||
```javascript
|
||||
|
||||
...
|
||||
import { CustomPage } from './components/custom-page/custom-page.component';
|
||||
|
||||
@NgModule({
|
||||
...
|
||||
declarations: [
|
||||
...,
|
||||
CustomPage
|
||||
],
|
||||
...
|
||||
})
|
||||
|
||||
```
|
||||
|
||||
In the `app.config.json` define a link entry which will point to the custom page
|
||||
|
||||
```json
|
||||
{
|
||||
...,
|
||||
"navigation": [
|
||||
"main": [ ... ],
|
||||
"secondary": [ ... ],
|
||||
"custom": [
|
||||
{
|
||||
"icon": "work",
|
||||
"label": "Link",
|
||||
"title": "My custom link",
|
||||
"route": {
|
||||
"url": "/custom-route"
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
Map the `/custom-route` in `app.routes.ts` as a child of `LayoutComponent` definition.
|
||||
|
||||
```js
|
||||
|
||||
import { CustomPage } from './components/custom-page/custom-page.component.ts';
|
||||
|
||||
...
|
||||
{
|
||||
path: '',
|
||||
component: LayoutComponent,
|
||||
children: [
|
||||
...,
|
||||
{
|
||||
path: 'custom-route',
|
||||
component: CustomPage
|
||||
}
|
||||
]
|
||||
}
|
||||
...,
|
||||
|
||||
```
|
||||
|
||||

|
||||
|
||||
For more information about the content of a custom page see [Document List Layout](/#document-list-layout) section.
|
||||
|
||||
## Docker
|
||||
|
||||
The ACA comes with the ACS 6.0 Community Edition preconfigured.
|
||||
The application runs in to modes:
|
||||
|
||||
- Development (runs latest source code, requires building application)
|
||||
- Preview (runs with latest published containers, master branch)
|
||||
|
||||
### Development Mode
|
||||
|
||||
Run the local instance of the application packaged into the docker image together with the ACS images:
|
||||
|
||||
```sh
|
||||
npm run build
|
||||
npm run start:docker
|
||||
```
|
||||
|
||||
The ACA runs on port `4000` when served from within container.
|
||||
|
||||
Use the following command to stop all the containers:
|
||||
|
||||
```sh
|
||||
npm run stop:docker
|
||||
```
|
||||
|
||||
### Preview Mode
|
||||
|
||||
<p class="tip">
|
||||
With this mode, you do not need building application from source code or installing dependencies.
|
||||
</p>
|
||||
|
||||
To run the latest published container go to the `docker-compose` folder and start docker compose from there:
|
||||
|
||||
```sh
|
||||
cd docker-compose
|
||||
docker-compose up
|
||||
```
|
||||
|
||||
The application is available at the `http://localhost:3000` address.
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
---
|
||||
|
||||
# Getting started
|
||||
|
||||
Learn how to start developing with the Alfresco Content Application.
|
||||
|
||||
## Contents
|
||||
|
||||
- [Prerequisites](/getting-started/prerequisites)
|
||||
- [Building from source](/getting-started/building-from-source)
|
||||
- [Internationalization (i18n)](/getting-started/internationalization)
|
||||
- [CORS](/getting-started/cors)
|
||||
- [Configuration](/getting-started/configuration)
|
||||
- [Navigation](/getting-started/navigation)
|
||||
- [Docker](/getting-started/docker)
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
---
|
||||
|
||||
# Building from source
|
||||
|
||||
The Content App is based on [Angular CLI](https://cli.angular.io), and you can use all the commands, generators, and blueprints supported by the CLI.
|
||||
|
||||
## Prerequisites for building
|
||||
|
||||
- [Node.js](https://nodejs.org/en/) LTS
|
||||
- [Angular CLI](https://cli.angular.io/) 1.7.3
|
||||
|
||||
## Cloning and running
|
||||
|
||||
Use the following commands to clone the project, install dependencies and run it.
|
||||
|
||||
```sh
|
||||
git clone https://github.com/Alfresco/alfresco-content-app.git
|
||||
cd alfresco-content-app
|
||||
npm install
|
||||
npm start
|
||||
```
|
||||
|
||||
The application runs at port `4200` by default, and should automatically open in the default browser once the project has compiled.
|
||||
|
||||
## Proxy settings
|
||||
|
||||
The Content App provides a proxy configuration for a local development server that allows you to address specific scenarios with CORS and a native authentication dialog.
|
||||
|
||||
You can find settings in the "proxy.conf.js" file in the project root directory.
|
||||
|
||||
<p class="warning">
|
||||
The proxy settings get automatically applied every time you run the application with the "npm start" script.
|
||||
You must restart the application every time you change its settings.
|
||||
</p>
|
||||
|
||||
## Running unit tests
|
||||
|
||||
Run `npm test` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
||||
@@ -0,0 +1,179 @@
|
||||
---
|
||||
---
|
||||
|
||||
# Configuration
|
||||
|
||||
The Alfresco Content Application provides support for the global settings file `app.config.json` that you can use to customize the behavior of the Content Application and ADF components.
|
||||
|
||||
## Server settings
|
||||
|
||||
Once the Content Application starts, it needs to know where the Alfresco Content Services server is, and what the file sharing URL will be.
|
||||
|
||||
### Content Services Address
|
||||
|
||||
The "ecmHost" property allows you to set the address of the server using the dynamic or static format.
|
||||
|
||||
#### Dynamic address
|
||||
|
||||
The example below demonstrates the most common dynamic format for a development environment:
|
||||
|
||||
```json
|
||||
{
|
||||
"ecmHost": "http://{hostname}{:port}",
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
The configuration above assumes you are running ACS and the Alfresco Content Application on the same server and port
|
||||
and allows deploying to different servers having the same unified configuration file.
|
||||
|
||||
For example, a proxy server at `localhost:4200` hosting the Alfresco Content Application as the root application,
|
||||
and `localhost:4200/alfresco` for the ACS repository.
|
||||
|
||||
At runtime, the application is going to automatically substitute the "{hostname}" value with the original hostname.
|
||||
Optionally it can also use the value of the original port if present, for example, "4200" at local machines, or skip the value for port 80.
|
||||
|
||||
#### Static address
|
||||
|
||||
Alternatively, you can provide a static address for the ACS server if necessary:
|
||||
|
||||
```json
|
||||
{
|
||||
"ecmHost": "http://localhost:4200",
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
### Shared Files Address
|
||||
|
||||
The "baseShareUrl" property tells the application how to construct the address where users will access shared files.
|
||||
|
||||
#### Default
|
||||
|
||||
When the default value is set the application will construct the File Share URL from the "ecmHost" property:
|
||||
|
||||
```json
|
||||
{
|
||||
...
|
||||
"baseShareUrl": null,
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
#### Configuration
|
||||
|
||||
If you run the application from a different server than the Content Services server the "baseShareUrl" property should must be configured correctly, for example:
|
||||
|
||||
```json
|
||||
{
|
||||
...
|
||||
"baseShareUrl": "http://{serveraddress}{:port}",
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
<p class="warning">
|
||||
If you run the application as part of Tomcat and not in the root (subfolder), then "baseShareUrl" value should contain full address to the app, for example: "baseShareUrl": "http://{serveraddress}{:port}/{folder}".
|
||||
</p>
|
||||
|
||||
|
||||
## Application settings
|
||||
|
||||
There are many settings you can change to alter the default behavior of the application.
|
||||
|
||||
### Application Name
|
||||
|
||||
The following block allows you to change the name of the application.
|
||||
|
||||
```json
|
||||
{
|
||||
...,
|
||||
"application": {
|
||||
"name": "Alfresco Example Content Application"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The value of the `application.name` key gets appended to every browser tab title at runtime
|
||||
with the format `[page title] - [application name]`,
|
||||
for example: "Personal Files - Alfresco Example Content Application".
|
||||
|
||||
### Application Logo
|
||||
|
||||
The default logo displayed in the top left corner of the Alfresco Content Application can be changed:
|
||||
|
||||
1. Place your custom logo image file in the [app-name]/src/assets/images folder. The displayed image will resize automatically, an image with extreme width/height might not retain its dimensions.
|
||||
|
||||
2. In the app.config.json file, set the value of the application.logo to contain the name of the custom logo image: "logo": "/assets/images/[image-name].[extension]"
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
...,
|
||||
"application": {
|
||||
"logo": "/assets/images/alfresco-logo-white.svg"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Header Background color
|
||||
|
||||
You can change the header background color by specifying the color code for the "headerColor" key:
|
||||
|
||||
```json
|
||||
{
|
||||
...,
|
||||
"headerColor": "#2196F3"
|
||||
}
|
||||
```
|
||||
|
||||
### Restricted content
|
||||
|
||||
You can restrict users from uploading certain types of files and folders by setting or extending the list of rules at the "files.excluded" path.
|
||||
|
||||
By default, the application ships with the following rules already predefined:
|
||||
|
||||
```json
|
||||
{
|
||||
...,
|
||||
"files": {
|
||||
"excluded": [
|
||||
".DS_Store",
|
||||
"desktop.ini",
|
||||
"thumbs.db",
|
||||
".git"
|
||||
]
|
||||
},
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
<p class="tip">
|
||||
You can get more details on the supported rules in the following article: <a href="https://github.com/Alfresco/alfresco-ng2-components/blob/master/docs/core/upload.service.md" target="_blank">Upload Service</a>.
|
||||
</p>
|
||||
|
||||
### Pagination settings
|
||||
|
||||
You can change the default settings of the pagination that gets applied to all the document lists in the application.
|
||||
|
||||
```json
|
||||
{
|
||||
...,
|
||||
"pagination": {
|
||||
"supportedPageSizes": [
|
||||
25,
|
||||
50,
|
||||
100
|
||||
]
|
||||
},
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
## Your custom settings
|
||||
|
||||
You can store any information in the application configuration file, and access it at runtime by using the `AppConfigService` service provided by ADF.
|
||||
|
||||
<p class="tip">
|
||||
Please refer to the <a href="https://github.com/Alfresco/alfresco-ng2-components/blob/master/docs/core/app-config.service.md" target="_blank">AppConfigService</a> documentation to get more details on Application Configuration features and API's available.
|
||||
</p>
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
---
|
||||
|
||||
# CORS
|
||||
|
||||
The Alfresco Content Application comes with the proxy configuration for Angular CLI to address CORS-related issues for development.
|
||||
Also, the docker images contain Nginx settings needed for CORS when developing and debugging an application locally.
|
||||
|
||||
## Chrome Workaround
|
||||
|
||||
For the Chrome browser, you can use the following plugin that allows you to toggle CORS:
|
||||
[Allow-Control-Allow-Origin](https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi)
|
||||
|
||||
## Firefox Workaround
|
||||
|
||||
For the Chrome browser, you can use the following plugin: [CORS Everywhere](https://addons.mozilla.org/en-Gb/firefox/addon/cors-everywhere/)
|
||||
|
||||
## Safari Workaround
|
||||
|
||||
If you are developing or testing with Safari then you can use the "Develop" menu to toggle the CORS mode.
|
||||
Note, the page must be reloaded every time you change the CORS settings.
|
||||
|
||||

|
||||
|
||||
## See also
|
||||
|
||||
- [Using CORS](https://www.html5rocks.com/en/tutorials/cors/)
|
||||
@@ -0,0 +1,42 @@
|
||||
---
|
||||
---
|
||||
|
||||
# Docker
|
||||
|
||||
The ACA comes with the ACS 6.0 Community Edition preconfigured.
|
||||
The application runs in two modes:
|
||||
|
||||
- Development (runs latest source code, requires building application)
|
||||
- Preview (runs with latest published containers, master branch)
|
||||
|
||||
## Development Mode
|
||||
|
||||
Run the local instance of the application packaged into the docker image together with the ACS images:
|
||||
|
||||
```sh
|
||||
npm run build
|
||||
npm run start:docker
|
||||
```
|
||||
|
||||
The ACA runs on port `4000` when served from within container.
|
||||
|
||||
Use the following command to stop all the containers:
|
||||
|
||||
```sh
|
||||
npm run stop:docker
|
||||
```
|
||||
|
||||
## Preview Mode
|
||||
|
||||
<p class="tip">
|
||||
With this mode, you do not need building application from source code or installing dependencies.
|
||||
</p>
|
||||
|
||||
To run the latest published container go to the `docker-compose` folder and start docker compose from there:
|
||||
|
||||
```sh
|
||||
cd docker-compose
|
||||
docker-compose up
|
||||
```
|
||||
|
||||
The application is available at the `http://localhost:3000` address.
|
||||
@@ -0,0 +1,134 @@
|
||||
---
|
||||
---
|
||||
|
||||
# Internationalization (i18n)
|
||||
|
||||
The Content Application provides support for the following languages:
|
||||
|
||||
- German (`de`)
|
||||
- English (`en`)
|
||||
- Spanish (`es`)
|
||||
- French (`fr`)
|
||||
- Italian (`it`)
|
||||
- Japanese (`ja`)
|
||||
- Norwegian (`nb`)
|
||||
- Dutch (`nl`)
|
||||
- Brazilian Portuguese (`pt-BR`)
|
||||
- Russian (`ru`)
|
||||
- Simplified Chinese (`zh-CN`)
|
||||
|
||||
The default language is English, however the current browser language is taken as the default one automatically when the application starts.
|
||||
|
||||
## User-defined language
|
||||
|
||||
You can allow users to set custom languages that are saved to their preferences.
|
||||
The main application menu already has the [ADF Language Menu](https://github.com/Alfresco/alfresco-ng2-components/blob/master/docs/core/language-menu.component.md) component integrated and pre-filled with the supported items.
|
||||
|
||||
To change the default language set edit the `app.config.json` file and add or remove items:
|
||||
|
||||
```json
|
||||
{
|
||||
...,
|
||||
"languages": [
|
||||
{
|
||||
"key": "de",
|
||||
"label": "German"
|
||||
},
|
||||
{
|
||||
"key": "en",
|
||||
"label": "English"
|
||||
},
|
||||
{
|
||||
"key": "es",
|
||||
"label": "Spanish"
|
||||
},
|
||||
...
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
The file is located here: `/src/app.config.json`.
|
||||
|
||||
## Custom languages
|
||||
|
||||
To add a custom language, add a new "JSON" file to the "/src/assets/i18n" folder
|
||||
with the name of the target language, for instance, a "de.json" for "German".
|
||||
|
||||
Translate the resource strings based on the default "en.json" file.
|
||||
You can copy the content over to your newly created file and replace the English values with translated text.
|
||||
|
||||
```json
|
||||
{
|
||||
"APP": {
|
||||
"SIGN_IN": "Anmelden",
|
||||
"SIGN_OUT": "Abmelden",
|
||||
"NEW_MENU": {
|
||||
"LABEL": "Neu",
|
||||
"MENU_ITEMS": {
|
||||
"CREATE_FOLDER": "Ordner erstellen",
|
||||
"UPLOAD_FILE": "Datei hochladen",
|
||||
"UPLOAD_FOLDER": "Ordner hochladen"
|
||||
},
|
||||
...
|
||||
}
|
||||
},
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
The Content Application automatically bundles your file when the project builds.
|
||||
You can test your locale by changing the browser language settings and reloading the page.
|
||||
|
||||
Optionally, you can extend the [ADF Language Menu](https://github.com/Alfresco/alfresco-ng2-components/blob/master/docs/core/language-menu.component.md) component with the newly added language by updating the `app.config.json` file.
|
||||
|
||||
## Customizing ADF translations
|
||||
|
||||
In addition to creating a custom language file for the Content Application,
|
||||
you can also provide translations for the ADF resources.
|
||||
|
||||
Your `/src/assets/i18n/<lang>.json` file can reflect the structure of one of the ADF language files:
|
||||
|
||||
- ADF Core ([en.json](https://github.com/Alfresco/alfresco-ng2-components/blob/master/lib/core/i18n/en.json))
|
||||
- ADF Content Services ([en.json](https://github.com/Alfresco/alfresco-ng2-components/blob/master/lib/content-services/i18n/en.json))
|
||||
- ADF Process Services ([en.json](https://github.com/Alfresco/alfresco-ng2-components/blob/master/lib/process-services/i18n/en.json))
|
||||
- ADF Insights ([en.json](https://github.com/Alfresco/alfresco-ng2-components/blob/master/lib/insights/i18n/en.json))
|
||||
|
||||
At runtime, the application-level strings have the highest priority.
|
||||
That means you can replace the value of any ADF resource string if needed.
|
||||
|
||||
For example, let's change the title of the "Create Folder" dialog that was shipped with ADF.
|
||||
Modify the `/src/assets/i18n/en.json` file and append the "CORE" section like in the example below:
|
||||
|
||||
```json
|
||||
{
|
||||
"APP": {
|
||||
...
|
||||
},
|
||||
"CORE": {
|
||||
"FOLDER_DIALOG": {
|
||||
"CREATE_FOLDER_TITLE": "Custom title"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Now, if you run the application and click the "New > Create Folder" menu,
|
||||
the title of the dialog should look like the following:
|
||||
|
||||

|
||||
|
||||
## Language picker
|
||||
|
||||
You can enable internal language picker in the `app.config.json` file:
|
||||
|
||||
```json
|
||||
{
|
||||
...,
|
||||
|
||||
"languagePicker": true,
|
||||
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
@@ -0,0 +1,166 @@
|
||||
---
|
||||
---
|
||||
|
||||
# Navigation
|
||||
|
||||
The Alfresco Content Application provides the following navigation links:
|
||||
|
||||
- Personal Files
|
||||
- File Libraries
|
||||
- Shared
|
||||
- Recent Files
|
||||
- Favorites
|
||||
- Trash
|
||||
|
||||
The side navigation provides support to customize the appearance of the links by editing the `app.config.json`.
|
||||
|
||||
## Customization
|
||||
|
||||
Navigation configuration supports array and object like schema. Defining an object helps navigation to render visual delimiters between different groups of links.
|
||||
|
||||
```json
|
||||
{
|
||||
"navigation": {
|
||||
"main": [
|
||||
...
|
||||
],
|
||||
"secondary": [
|
||||
...
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
```json
|
||||
{
|
||||
"navigation": [
|
||||
{ ... },
|
||||
{ ... },
|
||||
...
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
### Customize icons and text
|
||||
|
||||
`icon` - supported value can be anything from [Material Design](https://material.io/icons) icons library. If not defined, the link will render just the label value.
|
||||
|
||||
`title` - instructs the link to render a native browser tooltip with the given value. It can be a string or a i18n defined reference. If not defined, the link will not show a tooltip.
|
||||
|
||||
`label` - represents the visual name of the link. It can be a string or a i18n defined reference.
|
||||
|
||||
<p class="danger">
|
||||
Changing ` "route": { "url": "/..." } ` value will affect the navigation since these are mapped to application routing system.
|
||||
</p>
|
||||
|
||||
### Custom text (i18n)
|
||||
|
||||
To change the `title` and `label` of navigation links edit the values under `BROWSE` entry found at `/src/assets/i18n/en.json`
|
||||
|
||||
```json
|
||||
"APP" : {
|
||||
...
|
||||
"BROWSE": {
|
||||
"PERSONAL": {
|
||||
"TITLE": "Personal Files",
|
||||
"SIDENAV_LINK": {
|
||||
"LABEL": "Personal Files",
|
||||
"TOOLTIP": "View your Personal Files"
|
||||
}
|
||||
},
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
For more information about internationalization see [Internationalization (i18n)](/getting-started/internationalization) section.
|
||||
|
||||
## User-defined navigation
|
||||
|
||||
To add custom navigation link for the application, first we need to create a component.
|
||||
|
||||
`src/app/components/custom-page/custom-page.component.ts`
|
||||
|
||||
```js
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
<h4>{{ title }}</h4>
|
||||
`
|
||||
})
|
||||
export class CustomPage {
|
||||
title = 'My Custom Page'
|
||||
}
|
||||
```
|
||||
|
||||
Register the component in ```app.module.ts```
|
||||
|
||||
```javascript
|
||||
|
||||
...
|
||||
import { CustomPage } from './components/custom-page/custom-page.component';
|
||||
|
||||
@NgModule({
|
||||
...
|
||||
declarations: [
|
||||
...,
|
||||
CustomPage
|
||||
],
|
||||
...
|
||||
})
|
||||
|
||||
```
|
||||
|
||||
In the `app.config.json` define a link entry which will point to the custom page
|
||||
|
||||
```json
|
||||
{
|
||||
...,
|
||||
"navigation": [
|
||||
"main": [ ... ],
|
||||
"secondary": [ ... ],
|
||||
"custom": [
|
||||
{
|
||||
"icon": "work",
|
||||
"label": "Link",
|
||||
"title": "My custom link",
|
||||
"route": {
|
||||
"url": "/custom-route"
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
Map the `/custom-route` in `app.routes.ts` as a child of `LayoutComponent` definition.
|
||||
|
||||
```js
|
||||
|
||||
import { CustomPage } from './components/custom-page/custom-page.component.ts';
|
||||
|
||||
...
|
||||
{
|
||||
path: '',
|
||||
component: LayoutComponent,
|
||||
children: [
|
||||
...,
|
||||
{
|
||||
path: 'custom-route',
|
||||
component: CustomPage
|
||||
}
|
||||
]
|
||||
}
|
||||
...,
|
||||
|
||||
```
|
||||
|
||||

|
||||
|
||||
For more information about the content of a custom page see [Document List Layout](/#document-list-layout) section.
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
---
|
||||
|
||||
# Prerequisites
|
||||
|
||||
This application uses the latest releases from Alfresco:
|
||||
|
||||
- [Alfresco ADF (2.6.0)](https://community.alfresco.com/community/application-development-framework/pages/get-started)
|
||||
- [Alfresco Content Services (6.0)](https://www.alfresco.com/platform/content-services-ecm)
|
||||
or [Alfresco Community Edition (6.0 - General Release: 201806)](https://www.alfresco.com/products/community/download)
|
||||
|
||||
<p class="warning">
|
||||
You also need <a href="https://nodejs.org/en/" target="_blank">node.js</a> (LTS) installed to build it locally from source code.
|
||||
</p>
|
||||
|
||||
The latest version of the Alfresco Content platform is required
|
||||
due to the application using the latest [REST APIs](https://docs.alfresco.com/5.2/pra/1/topics/pra-welcome.html) developments.
|
||||
+4
-4
@@ -4,11 +4,11 @@ title: Get Help
|
||||
|
||||
# Where to get help
|
||||
|
||||
There are several ways to get help with building applications using the Alfresco Application Development Framework:
|
||||
See below for the different ways you can get help when building applications using the Alfresco Application Development Framework.
|
||||
|
||||
## Alfresco Community
|
||||
|
||||
Visit the Alfresco Community space where you can find many resources to help you get started building your application,
|
||||
Visit Alfresco Community for resources that will help you find information to get started building your application,
|
||||
along with blog posts from the Alfresco developers and much more:
|
||||
https://community.alfresco.com/community/application-development-framework
|
||||
|
||||
@@ -20,8 +20,8 @@ https://gitter.im/Alfresco/alfresco-ng2-components
|
||||
|
||||
## Alfresco Developer Support
|
||||
|
||||
Developer Support is a subscription-based support offering delivered remotely
|
||||
by a dedicated team of development-focused, senior Support Engineers.
|
||||
Developer Support is a remote subscription-based support team that offers
|
||||
development-focused, senior Support Engineers to help you with your installation.
|
||||
This support offering is best for customers and partners that require on-going support
|
||||
for their development teams and customized code.
|
||||
|
||||
|
||||
+4
-3
@@ -14,6 +14,7 @@
|
||||
<script src="https://unpkg.com/prismjs/components/prism-typescript.js"></script>
|
||||
<script>
|
||||
docute.init({
|
||||
toc: "toc.md",
|
||||
nav: [
|
||||
{
|
||||
title: 'Home',
|
||||
@@ -21,15 +22,15 @@
|
||||
},
|
||||
{
|
||||
title: 'Getting Started',
|
||||
path: 'getting-started'
|
||||
path: '/getting-started/'
|
||||
},
|
||||
{
|
||||
title: 'Extending',
|
||||
path: 'extending'
|
||||
path: '/extending'
|
||||
},
|
||||
{
|
||||
title: 'Get Help',
|
||||
path: 'help'
|
||||
path: '/help'
|
||||
}
|
||||
],
|
||||
icons: [
|
||||
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
- [Home](/)
|
||||
- [Introduction](/#introduction)
|
||||
- [Features](/#features)
|
||||
- [User interface layout](/#user-interface-layout)
|
||||
- [Header](/#header)
|
||||
- [Side navigation](/#side-navigation)
|
||||
- [Document List Layout](/#document-list-layout)
|
||||
- [File Viewer](/#file-viewer)
|
||||
- [Info Drawer](/#info-drawer)
|
||||
- [Version Manager](/#version-manager)
|
||||
- [Search results](/#search-results1)
|
||||
- [How to contribute](/#how-to-contribute)
|
||||
- [Getting started](/getting-started/)
|
||||
- [Prerequisites](/getting-started/prerequisites)
|
||||
- [Building from source](/getting-started/building-from-source)
|
||||
- [Internationalization (i18n)](/getting-started/internationalization)
|
||||
- [CORS](/getting-started/cors)
|
||||
- [Configuration](/getting-started/configuration)
|
||||
- [Navigation](/getting-started/navigation)
|
||||
- [Docker](/getting-started/docker)
|
||||
- [Extending](/extending)
|
||||
- [Format](/extending#format)
|
||||
- [Schema](/extending#schema)
|
||||
- [Multiple files](/extending#multiple-files)
|
||||
- [Startup behaviour](/extending#startup-behaviour)
|
||||
- [Disabling content](/extending#disabling-content)
|
||||
- [Routes](/extending#routes)
|
||||
- [Components](/extending#components)
|
||||
- [Actions](/extending#actions)
|
||||
- [Application actions](/extending#application-actions)
|
||||
- [Rules](/extending#rules)
|
||||
- [Core evaluators](/extending#core-evaluators)
|
||||
- [Application evaluators](/extending#application-evaluators)
|
||||
- [Navigation evaluators](/extending#navigation-evaluators)
|
||||
- [Application features](/extending#application-features)
|
||||
- [Content actions](/extending#content-actions)
|
||||
- [Create menu](/extending#create-menu)
|
||||
- [Navigation bar](/extending#navigation-bar)
|
||||
- [Sidebar (Info Drawer)](/extending#sidebar-info-drawer)
|
||||
- [Toolbar](/extending#toolbar)
|
||||
- [Context menu](/extending#context-menu)
|
||||
- [Viewer](/extending#viewer)
|
||||
- [Registration](/extending#registration)
|
||||
- [Creating custom evaluator](/extending#creating-custom-evaluator)
|
||||
- [Tutorials](/extending#tutorials)
|
||||
- [Get help](/help)
|
||||
Executable
+86
@@ -0,0 +1,86 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2018 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, promise } from 'protractor';
|
||||
import { Component } from '../component';
|
||||
|
||||
export class Breadcrumb extends Component {
|
||||
private static selectors = {
|
||||
root: 'adf-breadcrumb',
|
||||
item: '.adf-breadcrumb-item',
|
||||
currentItem: '.adf-breadcrumb-item-current'
|
||||
};
|
||||
|
||||
items: ElementArrayFinder = this.component.all(by.css(Breadcrumb.selectors.item));
|
||||
currentItem: ElementFinder = this.component.element(by.css(Breadcrumb.selectors.currentItem));
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(Breadcrumb.selectors.root, ancestor);
|
||||
}
|
||||
|
||||
getNthItem(nth: number): ElementFinder {
|
||||
return this.items.get(nth - 1);
|
||||
}
|
||||
|
||||
async getNthItemName(nth: number) {
|
||||
return await this.getNthItem(nth).getText();
|
||||
}
|
||||
|
||||
async getItemsCount() {
|
||||
return await this.items.count();
|
||||
}
|
||||
|
||||
async getAllItems() {
|
||||
return this.items.map(async elem => {
|
||||
const str = await elem.getText();
|
||||
return str.split('\nchevron_right')[0];
|
||||
});
|
||||
}
|
||||
|
||||
async getFirstItemName() {
|
||||
return await this.items.get(0).getText();
|
||||
}
|
||||
|
||||
getCurrentItem() {
|
||||
return this.currentItem;
|
||||
}
|
||||
|
||||
async getCurrentItemName() {
|
||||
return await this.currentItem.getText();
|
||||
}
|
||||
|
||||
async clickItem(name: string) {
|
||||
const elem = this.component.element(by.css(`${Breadcrumb.selectors.item}[title=${name}]`));
|
||||
await elem.click();
|
||||
}
|
||||
|
||||
async clickNthItem(nth: number) {
|
||||
await this.getNthItem(nth).click();
|
||||
}
|
||||
|
||||
async getNthItemTooltip(nth: number) {
|
||||
return await this.getNthItem(nth).getAttribute('title');
|
||||
}
|
||||
}
|
||||
+11
-11
@@ -23,21 +23,21 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { ElementFinder, element, by, ExpectedConditions as EC, browser } from 'protractor';
|
||||
import { ElementFinder, ExpectedConditions as EC, browser } from 'protractor';
|
||||
import { BROWSER_WAIT_TIMEOUT } from '../configs';
|
||||
|
||||
export abstract class Component {
|
||||
component: ElementFinder;
|
||||
component: ElementFinder;
|
||||
|
||||
constructor(selector: string, ancestor?: ElementFinder) {
|
||||
const locator = by.css(selector);
|
||||
constructor(selector: string, ancestor?: ElementFinder) {
|
||||
const locator = selector;
|
||||
|
||||
this.component = ancestor
|
||||
? ancestor.element(locator)
|
||||
: element(locator);
|
||||
}
|
||||
this.component = ancestor
|
||||
? ancestor.$$(locator).first()
|
||||
: browser.$$(locator).first();
|
||||
}
|
||||
|
||||
wait() {
|
||||
return browser.wait(EC.presenceOf(this.component), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
async wait() {
|
||||
await browser.wait(EC.presenceOf(this.component), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,4 +32,5 @@ export * from './dialog/create-edit-folder-dialog';
|
||||
export * from './pagination/pagination';
|
||||
export * from './sidenav/sidenav';
|
||||
export * from './toolbar/toolbar';
|
||||
export * from './breadcrumb/breadcrumb';
|
||||
export * from './viewer/viewer';
|
||||
|
||||
@@ -23,242 +23,296 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { ElementFinder, ElementArrayFinder, promise, by, browser, ExpectedConditions as EC, protractor } from 'protractor';
|
||||
import { ElementFinder, ElementArrayFinder, by, browser, ExpectedConditions as EC, protractor } from 'protractor';
|
||||
import { BROWSER_WAIT_TIMEOUT } from '../../configs';
|
||||
import { Component } from '../component';
|
||||
import { Menu } from '../menu/menu';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
|
||||
export class DataTable extends Component {
|
||||
private static selectors = {
|
||||
root: 'adf-datatable',
|
||||
private static selectors = {
|
||||
root: 'adf-datatable',
|
||||
|
||||
head: '.adf-datatable-header',
|
||||
columnHeader: '.adf-datatable-row .adf-datatable-table-cell-header',
|
||||
sortedColumnHeader: `
|
||||
head: '.adf-datatable-header',
|
||||
columnHeader: '.adf-datatable-row .adf-datatable-table-cell-header',
|
||||
sortedColumnHeader: `
|
||||
.adf-data-table__header--sorted-asc,
|
||||
.adf-data-table__header--sorted-desc
|
||||
`,
|
||||
|
||||
body: '.adf-datatable-body',
|
||||
row: '.adf-datatable-row[role]',
|
||||
selectedRow: '.adf-datatable-row.is-selected',
|
||||
cell: '.adf-data-table-cell',
|
||||
locationLink: '.aca-location-link',
|
||||
linkCell: '.adf-location-cell',
|
||||
body: '.adf-datatable-body',
|
||||
row: '.adf-datatable-row[role]',
|
||||
selectedRow: '.adf-datatable-row.is-selected',
|
||||
cell: '.adf-data-table-cell',
|
||||
locationLink: '.aca-location-link',
|
||||
nameLink: '.dl-link',
|
||||
|
||||
selectedIcon: '.mat-icon',
|
||||
selectedIcon: '.mat-icon',
|
||||
|
||||
emptyListContainer: 'div.adf-no-content-container',
|
||||
emptyFolderDragAndDrop: '.adf-empty-list_template .adf-empty-folder',
|
||||
emptyListContainer: 'div.adf-no-content-container',
|
||||
emptyFolderDragAndDrop: '.adf-empty-list_template .adf-empty-folder',
|
||||
|
||||
emptyListTitle: '.adf-empty-content__title',
|
||||
emptyListSubtitle: '.adf-empty-content__subtitle',
|
||||
emptyListText: '.adf-empty-content__text'
|
||||
};
|
||||
emptyListTitle: '.adf-empty-content__title',
|
||||
emptyListSubtitle: '.adf-empty-content__subtitle',
|
||||
emptyListText: '.adf-empty-content__text'
|
||||
};
|
||||
|
||||
head: ElementFinder = this.component.element(by.css(DataTable.selectors.head));
|
||||
body: ElementFinder = this.component.element(by.css(DataTable.selectors.body));
|
||||
cell = by.css(DataTable.selectors.cell);
|
||||
locationLink = by.css(DataTable.selectors.locationLink);
|
||||
linkCell: ElementFinder = this.component.element(by.css(DataTable.selectors.linkCell));
|
||||
emptyList: ElementFinder = this.component.element(by.css(DataTable.selectors.emptyListContainer));
|
||||
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));
|
||||
head: ElementFinder = this.component.element(by.css(DataTable.selectors.head));
|
||||
body: ElementFinder = this.component.element(by.css(DataTable.selectors.body));
|
||||
cell = by.css(DataTable.selectors.cell);
|
||||
locationLink = by.css(DataTable.selectors.locationLink);
|
||||
nameLink: ElementFinder = browser.element(by.css(DataTable.selectors.nameLink));
|
||||
emptyList: ElementFinder = this.component.element(by.css(DataTable.selectors.emptyListContainer));
|
||||
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));
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(DataTable.selectors.root, ancestor);
|
||||
menu: Menu = new Menu();
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(DataTable.selectors.root, ancestor);
|
||||
}
|
||||
|
||||
// Wait methods (waits for elements)
|
||||
waitForHeader() {
|
||||
try {
|
||||
return browser.wait(EC.presenceOf(this.head), BROWSER_WAIT_TIMEOUT);
|
||||
} catch (error) {
|
||||
console.log('----- wait for header catch : ', error);
|
||||
}
|
||||
}
|
||||
|
||||
// Wait methods (waits for elements)
|
||||
waitForHeader() {
|
||||
return browser.wait(EC.presenceOf(this.head), BROWSER_WAIT_TIMEOUT);
|
||||
async waitForEmptyState() {
|
||||
await browser.wait(EC.presenceOf(this.emptyList), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
// Header/Column methods
|
||||
getColumnHeaders() {
|
||||
const locator = by.css(DataTable.selectors.columnHeader);
|
||||
return this.head.all(locator);
|
||||
}
|
||||
|
||||
async getHeaderText() {
|
||||
const el = this.getColumnHeaders();
|
||||
return await el.getText();
|
||||
}
|
||||
|
||||
getNthColumnHeader(nth: number) {
|
||||
return this.getColumnHeaders().get(nth - 1);
|
||||
}
|
||||
|
||||
getColumnHeaderByLabel(label: string) {
|
||||
const locator = by.cssContainingText(DataTable.selectors.columnHeader, label);
|
||||
return this.head.element(locator);
|
||||
}
|
||||
|
||||
getSortedColumnHeader() {
|
||||
const locator = by.css(DataTable.selectors.sortedColumnHeader);
|
||||
return this.head.element(locator);
|
||||
}
|
||||
|
||||
async getSortedColumnHeaderText() {
|
||||
return await this.getSortedColumnHeader().getText();
|
||||
}
|
||||
|
||||
async getSortingOrder() {
|
||||
const str = await this.getSortedColumnHeader().getAttribute('class');
|
||||
if (str.includes('asc')) {
|
||||
return 'asc';
|
||||
}
|
||||
|
||||
waitForEmptyState() {
|
||||
return browser.wait(EC.presenceOf(this.emptyList), BROWSER_WAIT_TIMEOUT);
|
||||
else {
|
||||
if (str.includes('desc')) {
|
||||
return 'desc';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Header/Column methods
|
||||
getColumnHeaders(): ElementArrayFinder {
|
||||
const locator = by.css(DataTable.selectors.columnHeader);
|
||||
return this.head.all(locator);
|
||||
async sortByColumn(columnName: string) {
|
||||
const column = this.getColumnHeaderByLabel(columnName);
|
||||
const click = browser.actions().mouseMove(column).click();
|
||||
|
||||
await click.perform();
|
||||
}
|
||||
|
||||
// Rows methods
|
||||
getRows() {
|
||||
return this.body.all(by.css(DataTable.selectors.row));
|
||||
}
|
||||
|
||||
async countRows() {
|
||||
return await this.getRows().count();
|
||||
}
|
||||
|
||||
getSelectedRows() {
|
||||
return this.body.all(by.css(DataTable.selectors.selectedRow));
|
||||
}
|
||||
|
||||
async countSelectedRows() {
|
||||
return await this.getSelectedRows().count();
|
||||
}
|
||||
|
||||
getNthRow(nth: number) {
|
||||
return this.getRows().get(nth - 1);
|
||||
}
|
||||
|
||||
getRowByName(name: string) {
|
||||
return this.body.element(by.cssContainingText(DataTable.selectors.row, name));
|
||||
}
|
||||
|
||||
getRowFirstCell(name: string) {
|
||||
return this.getRowByName(name).all(by.css(DataTable.selectors.cell)).get(0);
|
||||
}
|
||||
|
||||
getRowNameCell(name: string) {
|
||||
return this.getRowByName(name).all(by.css(DataTable.selectors.cell)).get(1);
|
||||
}
|
||||
|
||||
getRowNameCellText(name: string) {
|
||||
return this.getRowNameCell(name).$('span');
|
||||
}
|
||||
|
||||
async getItemNameTooltip(name: string) {
|
||||
return await this.getRowNameCellText(name).getAttribute('title');
|
||||
}
|
||||
|
||||
async hasCheckMarkIcon(itemName: string) {
|
||||
return await this.getRowByName(itemName).element(by.css(DataTable.selectors.selectedIcon)).isPresent();
|
||||
}
|
||||
|
||||
getNameLink(itemName: string) {
|
||||
return this.getRowNameCell(itemName).$(DataTable.selectors.nameLink);
|
||||
}
|
||||
|
||||
async hasLinkOnName(itemName: string) {
|
||||
return await this.getNameLink(itemName).isPresent();
|
||||
}
|
||||
|
||||
// Navigation/selection methods
|
||||
async doubleClickOnRowByName(name: string) {
|
||||
const item = this.getRowFirstCell(name);
|
||||
await Utils.waitUntilElementClickable(item);
|
||||
await browser.actions().mouseMove(item).perform();
|
||||
await browser.actions().click().click().perform();
|
||||
}
|
||||
|
||||
async selectItem(name: string) {
|
||||
try{
|
||||
const item = this.getRowFirstCell(name);
|
||||
// await Utils.waitUntilElementClickable(item);
|
||||
await item.click();
|
||||
|
||||
} catch (e) {
|
||||
console.log('--- select item catch : ', e);
|
||||
}
|
||||
}
|
||||
|
||||
getNthColumnHeader(nth: number): ElementFinder {
|
||||
return this.getColumnHeaders().get(nth - 1);
|
||||
async clickNameLink(itemName: string) {
|
||||
await this.getNameLink(itemName).click();
|
||||
}
|
||||
|
||||
async selectMultipleItems(names: string[]) {
|
||||
await this.clearSelection();
|
||||
await browser.actions().sendKeys(protractor.Key.COMMAND).perform();
|
||||
for (const name of names) {
|
||||
await this.selectItem(name);
|
||||
}
|
||||
await browser.actions().sendKeys(protractor.Key.NULL).perform();
|
||||
}
|
||||
|
||||
getColumnHeaderByLabel(label: string): ElementFinder {
|
||||
const locator = by.cssContainingText(DataTable.selectors.columnHeader, label);
|
||||
return this.head.element(locator);
|
||||
async clearSelection() {
|
||||
try {
|
||||
const count = await this.countSelectedRows();
|
||||
if (count !== 0) {
|
||||
await browser.refresh();
|
||||
await this.waitForHeader();
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('------ clearSelection catch : ', error);
|
||||
}
|
||||
}
|
||||
|
||||
getSortedColumnHeader(): ElementFinder {
|
||||
const locator = by.css(DataTable.selectors.sortedColumnHeader);
|
||||
return this.head.element(locator);
|
||||
async rightClickOnItem(itemName: string) {
|
||||
const item = this.getRowFirstCell(itemName);
|
||||
await browser.actions().click(item, protractor.Button.RIGHT).perform();
|
||||
}
|
||||
|
||||
async rightClickOnMultipleSelection() {
|
||||
await this.waitForHeader();
|
||||
const itemFromSelection = this.getSelectedRows().get(0);
|
||||
await browser.actions().click(itemFromSelection, protractor.Button.RIGHT).perform();
|
||||
}
|
||||
|
||||
getItemLocationEl(name: string) {
|
||||
return this.getRowByName(name).element(this.locationLink);
|
||||
}
|
||||
|
||||
async getItemLocation(name: string) {
|
||||
return await this.getItemLocationEl(name).getText();
|
||||
}
|
||||
|
||||
async getItemLocationTooltip(name: string) {
|
||||
return await this.getItemLocationEl(name).$('a').getAttribute('title');
|
||||
}
|
||||
|
||||
async getItemLocationTileAttr(name: string) {
|
||||
const location = this.getItemLocationEl(name).$('a');
|
||||
const condition = () => location.getAttribute('title').then(value => value && value.length > 0);
|
||||
|
||||
await browser.actions().mouseMove(location).perform();
|
||||
|
||||
await browser.wait(condition, BROWSER_WAIT_TIMEOUT);
|
||||
return await location.getAttribute('title');
|
||||
}
|
||||
|
||||
async clickItemLocation(name: string) {
|
||||
await this.getItemLocationEl(name).click();
|
||||
}
|
||||
|
||||
// empty state methods
|
||||
async isEmptyList() {
|
||||
return await this.emptyList.isPresent();
|
||||
}
|
||||
|
||||
async isEmptyWithDragAndDrop() {
|
||||
return await this.emptyFolderDragAndDrop.isDisplayed();
|
||||
}
|
||||
|
||||
async getEmptyDragAndDropText() {
|
||||
const isEmpty = await this.isEmptyWithDragAndDrop();
|
||||
if (isEmpty) {
|
||||
return await this.emptyFolderDragAndDrop.getText();
|
||||
}
|
||||
}
|
||||
|
||||
getSortingOrder() {
|
||||
return this.getSortedColumnHeader().getAttribute('class')
|
||||
.then(str => {
|
||||
if (str.includes('asc')) {
|
||||
return 'asc';
|
||||
} else {
|
||||
if (str.includes('desc')) {
|
||||
return 'desc';
|
||||
}
|
||||
}
|
||||
});
|
||||
async getEmptyStateTitle() {
|
||||
const isEmpty = await this.isEmptyList();
|
||||
if (isEmpty) {
|
||||
return await this.emptyListTitle.getText();
|
||||
}
|
||||
}
|
||||
|
||||
sortByColumn(columnName: string): promise.Promise<void> {
|
||||
const column = this.getColumnHeaderByLabel(columnName);
|
||||
const click = browser.actions().mouseMove(column).click();
|
||||
|
||||
return click.perform();
|
||||
async getEmptyStateSubtitle() {
|
||||
const isEmpty = await this.isEmptyList();
|
||||
if (isEmpty) {
|
||||
return await this.emptyListSubtitle.getText();
|
||||
}
|
||||
}
|
||||
|
||||
// Rows methods
|
||||
getRows(): ElementArrayFinder {
|
||||
return this.body.all(by.css(DataTable.selectors.row));
|
||||
async getEmptyStateText() {
|
||||
const isEmpty = await this.isEmptyList();
|
||||
if (isEmpty) {
|
||||
return await this.emptyListText.getText();
|
||||
}
|
||||
}
|
||||
|
||||
countRows(): promise.Promise<number> {
|
||||
return this.getRows().count();
|
||||
}
|
||||
async getCellsContainingName(name: string) {
|
||||
const rows = this.getRows().all(by.cssContainingText(DataTable.selectors.cell, name));
|
||||
return rows.map(async cell => await cell.getText());
|
||||
}
|
||||
|
||||
getSelectedRows(): ElementArrayFinder {
|
||||
return this.body.all(by.css(DataTable.selectors.selectedRow));
|
||||
}
|
||||
|
||||
countSelectedRows(): promise.Promise<number> {
|
||||
return this.getSelectedRows().count();
|
||||
}
|
||||
|
||||
getNthRow(nth: number): ElementFinder {
|
||||
return this.getRows().get(nth - 1);
|
||||
}
|
||||
|
||||
getRowByName(name: string): ElementFinder {
|
||||
return this.body.element(by.cssContainingText(DataTable.selectors.row, name));
|
||||
}
|
||||
|
||||
getRowFirstCell(name: string) {
|
||||
return this.getRowByName(name).all(by.css(DataTable.selectors.cell)).get(0);
|
||||
}
|
||||
|
||||
getRowNameCell(name: string) {
|
||||
return this.getRowByName(name).all(by.css(DataTable.selectors.cell)).get(1);
|
||||
}
|
||||
|
||||
getRowNameCellText(name: string) {
|
||||
return this.getRowNameCell(name).$('span');
|
||||
}
|
||||
|
||||
getItemNameTooltip(name: string): promise.Promise<string> {
|
||||
return this.getRowNameCellText(name).getAttribute('title');
|
||||
}
|
||||
|
||||
hasCheckMarkIcon(itemName: string) {
|
||||
return this.getRowByName(itemName).element(by.css(DataTable.selectors.selectedIcon)).isPresent();
|
||||
}
|
||||
|
||||
// Navigation/selection methods
|
||||
doubleClickOnRowByName(name: string): promise.Promise<any> {
|
||||
const item = this.getRowFirstCell(name);
|
||||
return Utils.waitUntilElementClickable(item)
|
||||
.then(() => browser.actions().mouseMove(item).click().click().perform());
|
||||
}
|
||||
|
||||
selectItem(name: string): promise.Promise<any> {
|
||||
const item = this.getRowFirstCell(name);
|
||||
return Utils.waitUntilElementClickable(item)
|
||||
.then(() => item.click());
|
||||
}
|
||||
|
||||
selectMultipleItems(names: string[]): promise.Promise<void> {
|
||||
return this.clearSelection()
|
||||
.then(() => browser.actions().sendKeys(protractor.Key.COMMAND).perform())
|
||||
.then(() => {
|
||||
names.forEach(name => {
|
||||
this.selectItem(name);
|
||||
});
|
||||
})
|
||||
.then(() => browser.actions().sendKeys(protractor.Key.NULL).perform());
|
||||
}
|
||||
|
||||
clearSelection(): promise.Promise<void> {
|
||||
return this.getSelectedRows().count()
|
||||
.then(count => {
|
||||
if (count !== 0) { browser.refresh().then(() => this.waitForHeader()); }
|
||||
});
|
||||
}
|
||||
|
||||
getItemLocation(name: string) {
|
||||
return this.getRowByName(name).element(this.locationLink);
|
||||
}
|
||||
|
||||
getItemLocationTooltip(name: string): promise.Promise<string> {
|
||||
return this.getItemLocation(name).$('a').getAttribute('title');
|
||||
}
|
||||
|
||||
getItemLocationTileAttr(name: string) {
|
||||
const location = this.getItemLocation(name).$('a');
|
||||
const condition = () => location.getAttribute('title').then((value) => value && value.length > 0);
|
||||
|
||||
browser.actions()
|
||||
.mouseMove(location)
|
||||
.perform();
|
||||
|
||||
browser.wait(condition, BROWSER_WAIT_TIMEOUT);
|
||||
return location.getAttribute('title');
|
||||
}
|
||||
|
||||
clickItemLocation(name: string) {
|
||||
return this.getItemLocation(name).click();
|
||||
}
|
||||
|
||||
// empty state methods
|
||||
isEmptyList(): promise.Promise<boolean> {
|
||||
return this.emptyList.isPresent();
|
||||
}
|
||||
|
||||
isEmptyWithDragAndDrop(): promise.Promise<boolean> {
|
||||
return this.emptyFolderDragAndDrop.isDisplayed();
|
||||
}
|
||||
|
||||
getEmptyDragAndDropText(): promise.Promise<string> {
|
||||
return this.isEmptyWithDragAndDrop()
|
||||
.then(() => {
|
||||
return this.emptyFolderDragAndDrop.getText();
|
||||
});
|
||||
}
|
||||
|
||||
getEmptyStateTitle(): promise.Promise<string> {
|
||||
return this.isEmptyList()
|
||||
.then(() => {
|
||||
return this.emptyListTitle.getText();
|
||||
});
|
||||
}
|
||||
|
||||
getEmptyStateSubtitle(): promise.Promise<string> {
|
||||
return this.isEmptyList()
|
||||
.then(() => {
|
||||
return this.emptyListSubtitle.getText();
|
||||
});
|
||||
}
|
||||
|
||||
getEmptyStateText(): promise.Promise<string> {
|
||||
return this.isEmptyList()
|
||||
.then(() => {
|
||||
return this.emptyListText.getText();
|
||||
});
|
||||
}
|
||||
|
||||
getCellsContainingName(name: string) {
|
||||
return this.getRows().all(by.cssContainingText(DataTable.selectors.cell, name))
|
||||
.map(cell => cell.getText());
|
||||
}
|
||||
async hasContextMenu() {
|
||||
const count = await this.menu.getItemsCount();
|
||||
return count > 0;
|
||||
}
|
||||
}
|
||||
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2018 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';
|
||||
|
||||
export class DateTimePicker extends Component {
|
||||
private static selectors = {
|
||||
root: '.mat-datetimepicker-popup',
|
||||
|
||||
header: '.mat-datetimepicker-calendar-header',
|
||||
year: '.mat-datetimepicker-calendar-header-year',
|
||||
date: '.mat-datetimepicker-calendar-header-date',
|
||||
|
||||
content: '.mat-datetimepicker-calendar-content',
|
||||
dayPicker: 'mat-datetimepicker-month-view',
|
||||
|
||||
today: '.mat-datetimepicker-calendar-body-today',
|
||||
firstActiveDay: '.mat-datetimepicker-calendar-body-active .mat-datetimepicker-calendar-body-cell-content',
|
||||
};
|
||||
|
||||
calendar: ElementFinder = browser.element(by.css(DateTimePicker.selectors.root));
|
||||
headerDate: ElementFinder = this.component.element(by.css(DateTimePicker.selectors.date));
|
||||
headerYear: ElementFinder = this.component.element(by.css(DateTimePicker.selectors.year));
|
||||
dayPicker: ElementFinder = this.component.element(by.css(DateTimePicker.selectors.dayPicker));
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(DateTimePicker.selectors.root, ancestor);
|
||||
}
|
||||
|
||||
async waitForDateTimePickerToOpen() {
|
||||
await browser.wait(EC.presenceOf(this.calendar), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
async waitForDateTimePickerToClose() {
|
||||
await browser.wait(EC.stalenessOf(this.calendar), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
async isCalendarOpen() {
|
||||
return await browser.isElementPresent(by.css(DateTimePicker.selectors.root));
|
||||
}
|
||||
|
||||
async getDate() {
|
||||
return await this.headerDate.getText();
|
||||
}
|
||||
|
||||
async getYear() {
|
||||
return await this.headerYear.getText();
|
||||
}
|
||||
|
||||
async setDefaultDay() {
|
||||
const today = await this.dayPicker.element(by.css(DateTimePicker.selectors.today)).getText();
|
||||
const tomorrow = (parseInt(today, 10) + 1).toString();
|
||||
const date = await this.getDate();
|
||||
const year = await this.getYear();
|
||||
const elem = this.dayPicker.element(by.cssContainingText(DateTimePicker.selectors.firstActiveDay, tomorrow));
|
||||
await elem.click();
|
||||
return `${date} ${year}`;
|
||||
}
|
||||
}
|
||||
@@ -28,42 +28,57 @@ import { BROWSER_WAIT_TIMEOUT } from '../../configs';
|
||||
import { Component } from '../component';
|
||||
|
||||
export class ConfirmDialog extends Component {
|
||||
private static selectors = {
|
||||
root: 'adf-confirm-dialog',
|
||||
private static selectors = {
|
||||
root: 'adf-confirm-dialog',
|
||||
|
||||
title: '.mat-dialog-title',
|
||||
content: '.mat-dialog-content',
|
||||
delete: 'adf-confirm-accept',
|
||||
keep: 'adf-confirm-cancel'
|
||||
};
|
||||
title: '.mat-dialog-title',
|
||||
content: '.mat-dialog-content',
|
||||
accept: 'adf-confirm-accept',
|
||||
cancel: 'adf-confirm-cancel',
|
||||
actionButton: 'adf-confirm'
|
||||
};
|
||||
|
||||
title: ElementFinder = this.component.element(by.css(ConfirmDialog.selectors.title));
|
||||
content: ElementFinder = this.component.element(by.css(ConfirmDialog.selectors.content));
|
||||
deleteButton: ElementFinder = this.component.element(by.id(ConfirmDialog.selectors.delete));
|
||||
keepButton: ElementFinder = this.component.element(by.id(ConfirmDialog.selectors.keep));
|
||||
title: ElementFinder = this.component.element(by.css(ConfirmDialog.selectors.title));
|
||||
content: ElementFinder = this.component.element(by.css(ConfirmDialog.selectors.content));
|
||||
acceptButton: ElementFinder = this.component.element(by.id(ConfirmDialog.selectors.accept));
|
||||
cancelButton: ElementFinder = this.component.element(by.id(ConfirmDialog.selectors.cancel));
|
||||
actionButton: ElementFinder = this.component.element(by.id(ConfirmDialog.selectors.actionButton));
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(ConfirmDialog.selectors.root, ancestor);
|
||||
}
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(ConfirmDialog.selectors.root, ancestor);
|
||||
}
|
||||
|
||||
async waitForDialogToClose() {
|
||||
return await browser.wait(EC.stalenessOf(this.title), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
async waitForDialogToClose() {
|
||||
await browser.wait(EC.stalenessOf(this.title), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
async getTitle() {
|
||||
return await this.title.getText();
|
||||
}
|
||||
async waitForDialogToOpen() {
|
||||
await browser.wait(EC.presenceOf(this.title), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
async getText() {
|
||||
return await this.content.getText();
|
||||
}
|
||||
async isDialogOpen() {
|
||||
return await browser.isElementPresent(by.css(ConfirmDialog.selectors.root));
|
||||
}
|
||||
|
||||
async clickDelete() {
|
||||
await this.deleteButton.click();
|
||||
}
|
||||
async getTitle() {
|
||||
return await this.title.getText();
|
||||
}
|
||||
|
||||
async clickKeep() {
|
||||
await this.keepButton.click();
|
||||
await this.waitForDialogToClose();
|
||||
}
|
||||
async getText() {
|
||||
return await this.content.getText();
|
||||
}
|
||||
|
||||
getButtonByName(name: string) {
|
||||
return this.component.element(by.buttonText(name));
|
||||
}
|
||||
|
||||
async clickButton(name: string) {
|
||||
const button = this.getButtonByName(name);
|
||||
await button.click();
|
||||
}
|
||||
|
||||
async isButtonEnabled(name: string) {
|
||||
const button = this.getButtonByName(name);
|
||||
return await button.isEnabled();
|
||||
}
|
||||
}
|
||||
|
||||
Executable
+124
@@ -0,0 +1,124 @@
|
||||
import { Utils } from './../../utilities/utils';
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2018 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';
|
||||
|
||||
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: '.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 await browser.$(CopyMoveDialog.selectors.root).isDisplayed();
|
||||
}
|
||||
|
||||
async getTitle() {
|
||||
return await 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 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 chooseDestination(folderName: string) {
|
||||
const row = this.getRow(folderName);
|
||||
await Utils.waitUntilElementClickable(row);
|
||||
await row.click();
|
||||
await this.waitForRowToBeSelected();
|
||||
}
|
||||
}
|
||||
@@ -29,80 +29,75 @@ import { Component } from '../component';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
|
||||
export class CreateOrEditFolderDialog extends Component {
|
||||
private static selectors = {
|
||||
root: 'adf-folder-dialog',
|
||||
private static selectors = {
|
||||
root: 'adf-folder-dialog',
|
||||
|
||||
title: '.mat-dialog-title',
|
||||
nameInput: 'input[placeholder="Name" i]',
|
||||
descriptionTextArea: 'textarea[placeholder="Description" i]',
|
||||
button: '.mat-dialog-actions button',
|
||||
validationMessage: '.mat-hint span'
|
||||
};
|
||||
title: '.mat-dialog-title',
|
||||
nameInput: 'input[placeholder="Name" i]',
|
||||
descriptionTextArea: 'textarea[placeholder="Description" i]',
|
||||
button: '.mat-dialog-actions button',
|
||||
validationMessage: '.mat-hint span'
|
||||
};
|
||||
|
||||
title: ElementFinder = this.component.element(by.css(CreateOrEditFolderDialog.selectors.title));
|
||||
nameInput: ElementFinder = this.component.element(by.css(CreateOrEditFolderDialog.selectors.nameInput));
|
||||
descriptionTextArea: ElementFinder = this.component.element(by.css(CreateOrEditFolderDialog.selectors.descriptionTextArea));
|
||||
createButton: ElementFinder = this.component.element(by.cssContainingText(CreateOrEditFolderDialog.selectors.button, 'Create'));
|
||||
cancelButton: ElementFinder = this.component.element(by.cssContainingText(CreateOrEditFolderDialog.selectors.button, 'Cancel'));
|
||||
updateButton: ElementFinder = this.component.element(by.cssContainingText(CreateOrEditFolderDialog.selectors.button, 'Update'));
|
||||
validationMessage: ElementFinder = this.component.element(by.css(CreateOrEditFolderDialog.selectors.validationMessage));
|
||||
title: ElementFinder = this.component.element(by.css(CreateOrEditFolderDialog.selectors.title));
|
||||
nameInput: ElementFinder = this.component.element(by.css(CreateOrEditFolderDialog.selectors.nameInput));
|
||||
descriptionTextArea: ElementFinder = this.component.element(by.css(CreateOrEditFolderDialog.selectors.descriptionTextArea));
|
||||
createButton: ElementFinder = this.component.element(by.cssContainingText(CreateOrEditFolderDialog.selectors.button, 'Create'));
|
||||
cancelButton: ElementFinder = this.component.element(by.cssContainingText(CreateOrEditFolderDialog.selectors.button, 'Cancel'));
|
||||
updateButton: ElementFinder = this.component.element(by.cssContainingText(CreateOrEditFolderDialog.selectors.button, 'Update'));
|
||||
validationMessage: ElementFinder = this.component.element(by.css(CreateOrEditFolderDialog.selectors.validationMessage));
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(CreateOrEditFolderDialog.selectors.root, ancestor);
|
||||
}
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(CreateOrEditFolderDialog.selectors.root, ancestor);
|
||||
}
|
||||
|
||||
waitForDialogToOpen() {
|
||||
return browser.wait(EC.presenceOf(this.title), BROWSER_WAIT_TIMEOUT)
|
||||
.then(() => browser.wait(EC.presenceOf(browser.element(by.css('.cdk-overlay-backdrop'))), BROWSER_WAIT_TIMEOUT));
|
||||
async waitForDialogToOpen() {
|
||||
await browser.wait(EC.presenceOf(this.title), BROWSER_WAIT_TIMEOUT);
|
||||
await browser.wait(EC.presenceOf(browser.element(by.css('.cdk-overlay-backdrop'))), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
}
|
||||
async waitForDialogToClose() {
|
||||
await browser.wait(EC.stalenessOf(this.title), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
waitForDialogToClose() {
|
||||
return browser.wait(EC.stalenessOf(this.title), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
async getTitle() {
|
||||
return await this.title.getText();
|
||||
}
|
||||
|
||||
getTitle(): promise.Promise<string> {
|
||||
return this.title.getText();
|
||||
}
|
||||
async isValidationMessageDisplayed() {
|
||||
return await this.validationMessage.isDisplayed();
|
||||
}
|
||||
|
||||
isValidationMessageDisplayed(): promise.Promise<boolean> {
|
||||
return this.validationMessage.isDisplayed();
|
||||
}
|
||||
async getValidationMessage() {
|
||||
await this.isValidationMessageDisplayed();
|
||||
return await this.validationMessage.getText();
|
||||
}
|
||||
|
||||
getValidationMessage(): promise.Promise<string> {
|
||||
return this.isValidationMessageDisplayed()
|
||||
.then(() => this.validationMessage.getText());
|
||||
}
|
||||
async enterName(name: string) {
|
||||
await this.nameInput.clear();
|
||||
await Utils.typeInField(this.nameInput, name);
|
||||
}
|
||||
|
||||
enterName(name: string) {
|
||||
return this.nameInput.clear()
|
||||
// .then(() => this.nameInput.sendKeys(name));
|
||||
.then(() => Utils.typeInField(this.nameInput, name));
|
||||
}
|
||||
async enterDescription(description: string) {
|
||||
await this.descriptionTextArea.clear();
|
||||
await Utils.typeInField(this.descriptionTextArea, description);
|
||||
}
|
||||
|
||||
enterDescription(description: string) {
|
||||
return this.descriptionTextArea.clear()
|
||||
// .then(() => this.descriptionTextArea.sendKeys(description));
|
||||
.then(() => Utils.typeInField(this.descriptionTextArea, description));
|
||||
}
|
||||
async deleteNameWithBackspace() {
|
||||
await this.nameInput.clear();
|
||||
await this.nameInput.sendKeys(' ', protractor.Key.CONTROL, 'a', protractor.Key.NULL, protractor.Key.BACK_SPACE);
|
||||
}
|
||||
|
||||
deleteNameWithBackspace(): promise.Promise<void> {
|
||||
return this.nameInput.clear()
|
||||
.then(() => {
|
||||
return this.nameInput.sendKeys(' ', protractor.Key.CONTROL, 'a', protractor.Key.NULL, protractor.Key.BACK_SPACE);
|
||||
});
|
||||
}
|
||||
async clickCreate() {
|
||||
await this.createButton.click();
|
||||
}
|
||||
|
||||
clickCreate() {
|
||||
return this.createButton.click();
|
||||
}
|
||||
async clickCancel() {
|
||||
await this.cancelButton.click();
|
||||
await this.waitForDialogToClose();
|
||||
}
|
||||
|
||||
clickCancel() {
|
||||
return this.cancelButton.click()
|
||||
.then(() => this.waitForDialogToClose());
|
||||
}
|
||||
|
||||
clickUpdate() {
|
||||
return this.updateButton.click();
|
||||
}
|
||||
async clickUpdate() {
|
||||
await this.updateButton.click();
|
||||
}
|
||||
}
|
||||
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2018 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';
|
||||
|
||||
export class ManageVersionsDialog extends Component {
|
||||
private static selectors = {
|
||||
root: '.aca-node-versions-dialog',
|
||||
|
||||
title: '.mat-dialog-title',
|
||||
content: '.mat-dialog-content',
|
||||
button: '.mat-button'
|
||||
};
|
||||
|
||||
title: ElementFinder = this.component.element(by.css(ManageVersionsDialog.selectors.title));
|
||||
content: ElementFinder = this.component.element(by.css(ManageVersionsDialog.selectors.content));
|
||||
closeButton: ElementFinder = this.component.element(by.cssContainingText(ManageVersionsDialog.selectors.button, 'Close'));
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(ManageVersionsDialog.selectors.root, ancestor);
|
||||
}
|
||||
|
||||
async waitForDialogToClose() {
|
||||
return await browser.wait(EC.stalenessOf(this.title), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
async isDialogOpen() {
|
||||
return await browser.$(ManageVersionsDialog.selectors.root).isDisplayed();
|
||||
}
|
||||
|
||||
async getTitle() {
|
||||
return await this.title.getText();
|
||||
}
|
||||
|
||||
async getText() {
|
||||
return await this.content.getText();
|
||||
}
|
||||
|
||||
async clickClose() {
|
||||
await this.closeButton.click();
|
||||
await this.waitForDialogToClose();
|
||||
}
|
||||
}
|
||||
Executable
+154
@@ -0,0 +1,154 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2018 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 { DateTimePicker } from '../../components/datetime-picker/datetime-picker';
|
||||
import { Component } from '../component';
|
||||
|
||||
export class ShareDialog extends Component {
|
||||
private static selectors = {
|
||||
root: '.adf-share-dialog',
|
||||
|
||||
title: `[data-automation-id='adf-share-dialog-title']`,
|
||||
info: '.adf-share-link__info',
|
||||
label: '.adf-share-link__label',
|
||||
shareToggle: `[data-automation-id='adf-share-toggle']`,
|
||||
linkUrl: `[data-automation-id='adf-share-link']`,
|
||||
inputAction: '.input-action',
|
||||
expireToggle: `[data-automation-id='adf-expire-toggle']`,
|
||||
datetimePickerButton: '.mat-datetimepicker-toggle',
|
||||
expirationInput: 'input[formcontrolname="time"]',
|
||||
button: `[data-automation-id='adf-share-dialog-close']`
|
||||
};
|
||||
|
||||
dateTimePicker = new DateTimePicker();
|
||||
|
||||
title: ElementFinder = this.component.element(by.css(ShareDialog.selectors.title));
|
||||
infoText: ElementFinder = this.component.element(by.css(ShareDialog.selectors.info));
|
||||
labels: ElementArrayFinder = this.component.all(by.css(ShareDialog.selectors.label));
|
||||
shareToggle: ElementFinder = this.component.element(by.css(ShareDialog.selectors.shareToggle));
|
||||
url: ElementFinder = this.component.element(by.css(ShareDialog.selectors.linkUrl));
|
||||
urlAction: ElementFinder = this.component.element(by.css(ShareDialog.selectors.inputAction));
|
||||
expireToggle: ElementFinder = this.component.element(by.css(ShareDialog.selectors.expireToggle));
|
||||
expireInput: ElementFinder = this.component.element(by.css(ShareDialog.selectors.expirationInput));
|
||||
datetimePickerButton: ElementFinder = this.component.element(by.css(ShareDialog.selectors.datetimePickerButton));
|
||||
closeButton: ElementFinder = this.component.element(by.css(ShareDialog.selectors.button));
|
||||
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(ShareDialog.selectors.root, ancestor);
|
||||
}
|
||||
|
||||
async waitForDialogToClose() {
|
||||
await browser.wait(EC.stalenessOf(this.title), BROWSER_WAIT_TIMEOUT, 'share dialog did not close');
|
||||
}
|
||||
|
||||
async waitForDialogToOpen() {
|
||||
await browser.wait(EC.presenceOf(this.title), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
async isDialogOpen() {
|
||||
return await browser.isElementPresent(by.css(ShareDialog.selectors.root));
|
||||
}
|
||||
|
||||
async getTitle() {
|
||||
return await this.title.getText();
|
||||
}
|
||||
|
||||
async getInfoText() {
|
||||
return await this.infoText.getText();
|
||||
}
|
||||
|
||||
getLabels() {
|
||||
return this.labels;
|
||||
}
|
||||
|
||||
async getLinkUrl() {
|
||||
return await this.url.getAttribute('value');
|
||||
}
|
||||
|
||||
async isUrlReadOnly() {
|
||||
return await this.url.getAttribute('readonly');
|
||||
}
|
||||
|
||||
async clickClose() {
|
||||
await this.closeButton.click();
|
||||
await this.waitForDialogToClose();
|
||||
}
|
||||
|
||||
getShareToggle() {
|
||||
return this.shareToggle;
|
||||
}
|
||||
|
||||
getExpireToggle() {
|
||||
return this.expireToggle;
|
||||
}
|
||||
|
||||
getExpireInput() {
|
||||
return this.expireInput;
|
||||
}
|
||||
|
||||
async isShareToggleChecked() {
|
||||
const toggleClass = await this.getShareToggle().getAttribute('class');
|
||||
return toggleClass.includes('checked');
|
||||
}
|
||||
|
||||
async isShareToggleDisabled() {
|
||||
const toggleClass = await this.getShareToggle().getAttribute('class');
|
||||
return toggleClass.includes('mat-disabled');
|
||||
}
|
||||
|
||||
async isExpireToggleEnabled() {
|
||||
const toggleClass = await this.getExpireToggle().getAttribute('class');
|
||||
return toggleClass.includes('checked');
|
||||
}
|
||||
|
||||
async copyUrl() {
|
||||
return await this.urlAction.click();
|
||||
}
|
||||
|
||||
async openDatetimePicker() {
|
||||
return await this.datetimePickerButton.click();
|
||||
}
|
||||
|
||||
async closeDatetimePicker() {
|
||||
if (await this.dateTimePicker.isCalendarOpen()) {
|
||||
return await this.datetimePickerButton.click();
|
||||
}
|
||||
}
|
||||
|
||||
async getExpireDate() {
|
||||
return await this.getExpireInput().getAttribute('value');
|
||||
}
|
||||
|
||||
async clickExpirationToggle() {
|
||||
await this.expireToggle.click();
|
||||
}
|
||||
|
||||
async clickShareToggle() {
|
||||
await this.shareToggle.click();
|
||||
}
|
||||
}
|
||||
@@ -23,41 +23,54 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { ElementFinder, by } from 'protractor';
|
||||
import { ElementFinder, by, browser } from 'protractor';
|
||||
import { Component } from '../component';
|
||||
import { UserInfo } from './user-info';
|
||||
import { protractor } from 'protractor';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
import { Menu } from '../menu/menu';
|
||||
import { Toolbar } from './../toolbar/toolbar';
|
||||
|
||||
export class Header extends Component {
|
||||
private locators = {
|
||||
logoLink: by.css('.app-menu__title'),
|
||||
userInfo: by.css('aca-current-user'),
|
||||
searchButton: by.css('#adf-search-button'),
|
||||
searchBar: by.css('#adf-control-input')
|
||||
};
|
||||
private locators = {
|
||||
root: 'app-header',
|
||||
logoLink: by.css('.app-menu__title'),
|
||||
userInfo: by.css('aca-current-user'),
|
||||
searchButton: by.css('#adf-search-button'),
|
||||
searchBar: by.css('#adf-control-input'),
|
||||
moreActions: by.id('app.header.more')
|
||||
};
|
||||
|
||||
logoLink: ElementFinder = this.component.element(this.locators.logoLink);
|
||||
userInfo: UserInfo = new UserInfo(this.component);
|
||||
searchButton: ElementFinder = this.component.element(this.locators.searchButton);
|
||||
searchBar: ElementFinder = this.component.element(this.locators.searchBar);
|
||||
logoLink: ElementFinder = this.component.element(this.locators.logoLink);
|
||||
userInfo: UserInfo = new UserInfo(this.component);
|
||||
searchButton: ElementFinder = this.component.element(this.locators.searchButton);
|
||||
searchBar: ElementFinder = this.component.element(this.locators.searchBar);
|
||||
moreActions: ElementFinder = browser.element(this.locators.moreActions);
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super('adf-layout-header', ancestor);
|
||||
}
|
||||
menu: Menu = new Menu();
|
||||
toolbar: Toolbar = new Toolbar();
|
||||
|
||||
searchForText(text: string) {
|
||||
return this.searchBar.clear()
|
||||
.then(() => this.searchBar.sendKeys(text))
|
||||
.then(() => this.searchBar.sendKeys(protractor.Key.ENTER));
|
||||
}
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super('adf-layout-header', ancestor);
|
||||
}
|
||||
|
||||
async waitForSearchButton() {
|
||||
return await Utils.waitUntilElementClickable(this.searchButton);
|
||||
}
|
||||
async searchForText(text: string) {
|
||||
await this.searchBar.clear();
|
||||
await this.searchBar.sendKeys(text);
|
||||
await this.searchBar.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
async waitForSearchBar() {
|
||||
return await Utils.waitUntilElementClickable(this.searchBar);
|
||||
}
|
||||
async waitForSearchButton() {
|
||||
await Utils.waitUntilElementClickable(this.searchButton);
|
||||
}
|
||||
|
||||
async waitForSearchBar() {
|
||||
await Utils.waitUntilElementClickable(this.searchBar);
|
||||
}
|
||||
|
||||
async openMoreMenu() {
|
||||
await this.moreActions.click();
|
||||
await this.menu.waitForMenuToOpen();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,42 +23,40 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { ElementFinder, by, promise } from 'protractor';
|
||||
import { ElementFinder, by } from 'protractor';
|
||||
import { Menu } from '../menu/menu';
|
||||
import { Component } from '../component';
|
||||
|
||||
export class UserInfo extends Component {
|
||||
private locators = {
|
||||
avatar: by.css('.current-user__avatar'),
|
||||
fullName: by.css('.current-user__full-name'),
|
||||
menuItems: by.css('[mat-menu-item]')
|
||||
};
|
||||
private locators = {
|
||||
avatar: by.css('.current-user__avatar'),
|
||||
fullName: by.css('.current-user__full-name'),
|
||||
menuItems: by.css('[mat-menu-item]')
|
||||
};
|
||||
|
||||
fullName: ElementFinder = this.component.element(this.locators.fullName);
|
||||
avatar: ElementFinder = this.component.element(this.locators.avatar);
|
||||
fullName: ElementFinder = this.component.element(this.locators.fullName);
|
||||
avatar: ElementFinder = this.component.element(this.locators.avatar);
|
||||
|
||||
menu: Menu = new Menu();
|
||||
menu: Menu = new Menu();
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super('aca-current-user', ancestor);
|
||||
}
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super('aca-current-user', ancestor);
|
||||
}
|
||||
|
||||
openMenu(): promise.Promise<Menu> {
|
||||
const { menu, avatar } = this;
|
||||
async openMenu() {
|
||||
const { menu, avatar } = this;
|
||||
|
||||
return avatar.click()
|
||||
.then(() => menu.wait())
|
||||
.then(() => menu);
|
||||
}
|
||||
await avatar.click();
|
||||
await menu.wait();
|
||||
return menu;
|
||||
}
|
||||
|
||||
get name(): promise.Promise<string> {
|
||||
return this.fullName.getText();
|
||||
}
|
||||
getName() {
|
||||
return this.fullName.getText();
|
||||
}
|
||||
|
||||
signOut(): promise.Promise<void> {
|
||||
return this.openMenu()
|
||||
.then(menu => {
|
||||
menu.clickMenuItem('Sign out');
|
||||
});
|
||||
}
|
||||
async signOut() {
|
||||
const menu = await this.openMenu();
|
||||
await menu.clickMenuItem('Sign out');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,73 +23,73 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { ElementFinder, ElementArrayFinder, by, protractor, 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';
|
||||
|
||||
export class InfoDrawer extends Component {
|
||||
private static selectors = {
|
||||
root: 'aca-info-drawer',
|
||||
private static selectors = {
|
||||
root: 'aca-info-drawer',
|
||||
|
||||
header: '.adf-info-drawer-layout-header',
|
||||
content: '.adf-info-drawer-layout-content',
|
||||
header: '.adf-info-drawer-layout-header',
|
||||
content: '.adf-info-drawer-layout-content',
|
||||
|
||||
tabs: '.adf-info-drawer-tabs',
|
||||
tabLabel: '.mat-tab-label-content',
|
||||
tabActiveLabel: '.mat-tab-label-active',
|
||||
tabs: '.adf-info-drawer-tabs',
|
||||
tabLabel: '.mat-tab-label-content',
|
||||
tabActiveLabel: '.mat-tab-label-active',
|
||||
|
||||
activeTabContent: '.mat-tab-body-active .mat-tab-body-content adf-dynamic-tab',
|
||||
next: '.mat-tab-header-pagination-after .mat-tab-header-pagination-chevron',
|
||||
previous: '.mat-tab-header-pagination-before .mat-tab-header-pagination-chevron'
|
||||
};
|
||||
activeTabContent: '.mat-tab-body-active .mat-tab-body-content adf-dynamic-tab',
|
||||
next: '.mat-tab-header-pagination-after .mat-tab-header-pagination-chevron',
|
||||
previous: '.mat-tab-header-pagination-before .mat-tab-header-pagination-chevron'
|
||||
};
|
||||
|
||||
header: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.header));
|
||||
tabLabel: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.tabLabel));
|
||||
tabLabelsList: ElementArrayFinder = this.component.all(by.css(InfoDrawer.selectors.tabLabel));
|
||||
tabActiveLabel: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.tabActiveLabel));
|
||||
header: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.header));
|
||||
tabLabel: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.tabLabel));
|
||||
tabLabelsList: ElementArrayFinder = this.component.all(by.css(InfoDrawer.selectors.tabLabel));
|
||||
tabActiveLabel: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.tabActiveLabel));
|
||||
|
||||
tabActiveContent: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.activeTabContent));
|
||||
tabActiveContent: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.activeTabContent));
|
||||
|
||||
nextButton: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.next));
|
||||
previousButton: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.previous));
|
||||
nextButton: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.next));
|
||||
previousButton: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.previous));
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(InfoDrawer.selectors.root, ancestor);
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(InfoDrawer.selectors.root, ancestor);
|
||||
}
|
||||
|
||||
async waitForInfoDrawerToOpen() {
|
||||
return await browser.wait(EC.presenceOf(this.header), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
async isEmpty() {
|
||||
if (await browser.isElementPresent(by.css(InfoDrawer.selectors.tabs))) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
async waitForInfoDrawerToOpen() {
|
||||
return browser.wait(EC.presenceOf(this.header), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
getTabByTitle(title: string) {
|
||||
return this.component.element(by.cssContainingText(InfoDrawer.selectors.tabLabel, title));
|
||||
}
|
||||
|
||||
async isEmpty() {
|
||||
if (await browser.isElementPresent(by.css(InfoDrawer.selectors.tabs))) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
async isTabPresent(title: string) {
|
||||
return await this.getTabByTitle(title).isPresent();
|
||||
}
|
||||
|
||||
getTabByTitle(title: string) {
|
||||
return this.component.element(by.cssContainingText(InfoDrawer.selectors.tabLabel, title));
|
||||
}
|
||||
async isTabDisplayed(title: string) {
|
||||
return await this.getTabByTitle(title).isDisplayed();
|
||||
}
|
||||
|
||||
async isTabPresent(title: string) {
|
||||
return await this.getTabByTitle(title).isPresent();
|
||||
}
|
||||
async getTabTitle(index: number) {
|
||||
return await this.tabLabelsList.get(index - 1).getAttribute('innerText');
|
||||
}
|
||||
|
||||
async isTabDisplayed(title: string) {
|
||||
return await this.getTabByTitle(title).isDisplayed();
|
||||
}
|
||||
async clickTab(title: string) {
|
||||
await this.getTabByTitle(title).click();
|
||||
}
|
||||
|
||||
async getTabTitle(index: number) {
|
||||
return await this.tabLabelsList.get(index - 1).getAttribute('innerText');
|
||||
}
|
||||
|
||||
async clickTab(title: string) {
|
||||
return await this.getTabByTitle(title).click();
|
||||
}
|
||||
|
||||
async getComponentIdOfTab(title: string) {
|
||||
return await this.tabActiveContent.getAttribute('data-automation-id');
|
||||
}
|
||||
async getComponentIdOfTab() {
|
||||
return await this.tabActiveContent.getAttribute('data-automation-id');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,83 +23,76 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { by, ElementFinder, promise } from 'protractor';
|
||||
import { by, ElementFinder } from 'protractor';
|
||||
import { Component } from '../component';
|
||||
|
||||
export class LoginComponent extends Component {
|
||||
static selector = 'adf-login';
|
||||
static selector = 'adf-login';
|
||||
|
||||
private locators = {
|
||||
usernameInput: by.css('input#username'),
|
||||
passwordInput: by.css('input#password'),
|
||||
passwordVisibility: by.css('.adf-login-password-icon'),
|
||||
submitButton: by.css('button#login-button'),
|
||||
errorMessage: by.css('.login-error-message'),
|
||||
copyright: by.css('.copyright')
|
||||
};
|
||||
private locators = {
|
||||
usernameInput: by.css('input#username'),
|
||||
passwordInput: by.css('input#password'),
|
||||
passwordVisibility: by.css('.adf-login-password-icon'),
|
||||
submitButton: by.css('button#login-button'),
|
||||
errorMessage: by.css('.login-error-message'),
|
||||
copyright: by.css('.copyright')
|
||||
};
|
||||
|
||||
usernameInput: ElementFinder = this.component.element(this.locators.usernameInput);
|
||||
passwordInput: ElementFinder = this.component.element(this.locators.passwordInput);
|
||||
submitButton: ElementFinder = this.component.element(this.locators.submitButton);
|
||||
errorMessage: ElementFinder = this.component.element(this.locators.errorMessage);
|
||||
copyright: ElementFinder = this.component.element(this.locators.copyright);
|
||||
passwordVisibility: ElementFinder = this.component.element(this.locators.passwordVisibility);
|
||||
usernameInput: ElementFinder = this.component.element(this.locators.usernameInput);
|
||||
passwordInput: ElementFinder = this.component.element(this.locators.passwordInput);
|
||||
submitButton: ElementFinder = this.component.element(this.locators.submitButton);
|
||||
errorMessage: ElementFinder = this.component.element(this.locators.errorMessage);
|
||||
copyright: ElementFinder = this.component.element(this.locators.copyright);
|
||||
passwordVisibility: ElementFinder = this.component.element(this.locators.passwordVisibility);
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(LoginComponent.selector, ancestor);
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(LoginComponent.selector, ancestor);
|
||||
}
|
||||
|
||||
async enterUsername(username: string) {
|
||||
const { usernameInput } = this;
|
||||
|
||||
await usernameInput.clear();
|
||||
await usernameInput.sendKeys(username);
|
||||
}
|
||||
|
||||
async enterPassword(password: string) {
|
||||
const { passwordInput } = this;
|
||||
|
||||
await passwordInput.clear();
|
||||
await passwordInput.sendKeys(password);
|
||||
}
|
||||
|
||||
async enterCredentials(username: string, password: string) {
|
||||
await this.enterUsername(username);
|
||||
await this.enterPassword(password);
|
||||
}
|
||||
|
||||
submit() {
|
||||
return this.submitButton.click();
|
||||
}
|
||||
|
||||
async getPasswordVisibility() {
|
||||
const text = await this.passwordVisibility.getText();
|
||||
if (text.endsWith('visibility_off')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
enterUsername(username: string): LoginComponent {
|
||||
const { usernameInput } = this;
|
||||
|
||||
usernameInput.clear();
|
||||
usernameInput.sendKeys(username);
|
||||
|
||||
return this;
|
||||
else {
|
||||
if (text.endsWith('visibility')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enterPassword(password: string): LoginComponent {
|
||||
const { passwordInput } = this;
|
||||
|
||||
passwordInput.clear();
|
||||
passwordInput.sendKeys(password);
|
||||
|
||||
return this;
|
||||
async isPasswordShown() {
|
||||
const type = await this.passwordInput.getAttribute('type');
|
||||
if (type === 'text') {
|
||||
return true;
|
||||
}
|
||||
|
||||
enterCredentials(username: string, password: string) {
|
||||
this.enterUsername(username).enterPassword(password);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
submit(): promise.Promise<void> {
|
||||
return this.submitButton.click();
|
||||
}
|
||||
|
||||
getPasswordVisibility() {
|
||||
return this.passwordVisibility.getText()
|
||||
.then(text => {
|
||||
if (text.endsWith('visibility_off')) {
|
||||
return false;
|
||||
} else {
|
||||
if (text.endsWith('visibility')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
isPasswordShown() {
|
||||
return this.passwordInput.getAttribute('type')
|
||||
.then(type => {
|
||||
if (type === 'text') {
|
||||
return true;
|
||||
} else {
|
||||
if (type === 'password') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
else {
|
||||
if (type === 'password') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+133
-64
@@ -23,84 +23,153 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { ElementFinder, ElementArrayFinder, by, browser, ExpectedConditions as EC, promise } from 'protractor';
|
||||
import { ElementFinder, ElementArrayFinder, by, browser, ExpectedConditions as EC } from 'protractor';
|
||||
import { BROWSER_WAIT_TIMEOUT } from '../../configs';
|
||||
import { Component } from '../component';
|
||||
import { Utils } from '../../utilities/utils'
|
||||
|
||||
export class Menu extends Component {
|
||||
private static selectors = {
|
||||
root: '.mat-menu-panel',
|
||||
item: '.mat-menu-item',
|
||||
icon: '.mat-icon',
|
||||
uploadFiles: 'app-upload-files'
|
||||
};
|
||||
private static selectors = {
|
||||
root: '.mat-menu-panel',
|
||||
item: '.mat-menu-item',
|
||||
icon: '.mat-icon',
|
||||
uploadFiles: 'app-upload-files',
|
||||
|
||||
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));
|
||||
submenu: 'app-context-menu-item .mat-menu-item'
|
||||
};
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(Menu.selectors.root, ancestor);
|
||||
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));
|
||||
submenus: ElementArrayFinder = browser.element.all(by.css(Menu.selectors.submenu));
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(Menu.selectors.root, ancestor);
|
||||
}
|
||||
|
||||
async waitForMenuToOpen() {
|
||||
await browser.wait(EC.presenceOf(browser.element(by.css('.cdk-overlay-backdrop'))), BROWSER_WAIT_TIMEOUT);
|
||||
await browser.wait(EC.presenceOf(browser.element(by.css('.mat-menu-panel'))), BROWSER_WAIT_TIMEOUT);
|
||||
await browser.wait(EC.visibilityOf(this.items.get(0)), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
async waitForMenuToClose() {
|
||||
await browser.wait(EC.not(EC.presenceOf(browser.element(by.css('.mat-menu-panel')))), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
async closeMenu() {
|
||||
// if (await this.backdrop.isPresent()) {
|
||||
// return await this.backdrop.click();
|
||||
// } else {
|
||||
// return await browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform();
|
||||
// }
|
||||
return Utils.pressEscape();
|
||||
}
|
||||
|
||||
getNthItem(nth: number) {
|
||||
return this.items.get(nth - 1);
|
||||
}
|
||||
|
||||
getItemByLabel(menuItem: string) {
|
||||
return this.component.element(by.cssContainingText(Menu.selectors.item, menuItem));
|
||||
}
|
||||
|
||||
getSubItemByLabel(subMenuItem: string) {
|
||||
return this.component.element(by.cssContainingText(Menu.selectors.submenu, subMenuItem));
|
||||
}
|
||||
|
||||
getItemById(id: string) {
|
||||
return this.component.element(by.id(id));
|
||||
}
|
||||
|
||||
async getItemTooltip(menuItem: string) {
|
||||
return await this.getItemByLabel(menuItem).getAttribute('title');
|
||||
}
|
||||
|
||||
async getItemIconText(menuItem: string) {
|
||||
return await this.getItemByLabel(menuItem).element(by.css(Menu.selectors.icon)).getText();
|
||||
}
|
||||
|
||||
async getItemIdAttribute(menuItem: string) {
|
||||
return await this.getItemByLabel(menuItem).getAttribute('id');
|
||||
}
|
||||
|
||||
async getItemsCount() {
|
||||
return await this.items.count();
|
||||
}
|
||||
|
||||
async clickNthItem(nth: number) {
|
||||
const elem = this.getNthItem(nth);
|
||||
await browser.wait(EC.elementToBeClickable(elem), BROWSER_WAIT_TIMEOUT);
|
||||
await browser.actions().mouseMove(elem).click().perform();
|
||||
await this.waitForMenuToClose();
|
||||
}
|
||||
|
||||
async clickMenuItem(menuItem: string) {
|
||||
try {
|
||||
const elem = this.getItemByLabel(menuItem);
|
||||
await browser.wait(EC.elementToBeClickable(elem), BROWSER_WAIT_TIMEOUT);
|
||||
await elem.click();
|
||||
} catch (e) {
|
||||
console.log('___click menu item catch___', e);
|
||||
}
|
||||
}
|
||||
|
||||
waitForMenuToOpen() {
|
||||
return browser.wait(EC.presenceOf(browser.element(by.css('.cdk-overlay-backdrop'))), BROWSER_WAIT_TIMEOUT)
|
||||
.then(() => browser.wait(EC.presenceOf(browser.element(by.css('.mat-menu-panel'))), BROWSER_WAIT_TIMEOUT))
|
||||
.then(() => browser.wait(EC.visibilityOf(this.items.get(0)), BROWSER_WAIT_TIMEOUT));
|
||||
async mouseOverMenuItem(menuItem: string) {
|
||||
try {
|
||||
const elem = this.getItemByLabel(menuItem);
|
||||
await browser.wait(EC.elementToBeClickable(elem), BROWSER_WAIT_TIMEOUT);
|
||||
await browser.actions().mouseMove(elem).perform();
|
||||
await browser.sleep(500);
|
||||
} catch (error) {
|
||||
console.log('----- mouse over error: ', error);
|
||||
}
|
||||
}
|
||||
|
||||
waitForMenuToClose() {
|
||||
return browser.wait(EC.not(EC.presenceOf(browser.element(by.css('.mat-menu-panel')))), BROWSER_WAIT_TIMEOUT);
|
||||
async hasSubMenu(menuItem: string) {
|
||||
try {
|
||||
const elem = this.getItemByLabel(menuItem);
|
||||
await browser.wait(EC.elementToBeClickable(elem), BROWSER_WAIT_TIMEOUT);
|
||||
const elemClass = await elem.getAttribute('class');
|
||||
return elemClass.includes('mat-menu-item-submenu-trigger');
|
||||
} catch (error) {
|
||||
console.log('---- has submenu error: ', error);
|
||||
}
|
||||
}
|
||||
|
||||
closeMenu() {
|
||||
if (this.backdrop.isPresent()) {
|
||||
return this.backdrop.click();
|
||||
} else {
|
||||
return browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform();
|
||||
}
|
||||
async clickSubMenuItem(subMenuItem: string) {
|
||||
try {
|
||||
const elem = this.getSubItemByLabel(subMenuItem);
|
||||
await browser.wait(EC.elementToBeClickable(elem), BROWSER_WAIT_TIMEOUT);
|
||||
await elem.click();
|
||||
} catch (e) {
|
||||
console.log('___click submenu item catch___', e);
|
||||
}
|
||||
}
|
||||
|
||||
getNthItem(nth: number): ElementFinder {
|
||||
return this.items.get(nth - 1);
|
||||
async isMenuItemPresent(title: string) {
|
||||
return await this.component.element(by.cssContainingText(Menu.selectors.item, title)).isPresent();
|
||||
}
|
||||
|
||||
async isSubMenuItemPresent(title: string) {
|
||||
return await browser.element(by.cssContainingText(Menu.selectors.submenu, title)).isPresent();
|
||||
}
|
||||
|
||||
async getSubmenuItemsCount() {
|
||||
return await this.submenus.count();
|
||||
}
|
||||
|
||||
async isMenuItemDisabled(title: string) {
|
||||
try {
|
||||
const item = this.getItemByLabel(title);
|
||||
const disabled = await item.getAttribute('disabled');
|
||||
return disabled;
|
||||
} catch (error) {
|
||||
console.log('----- isMenuItemDisabled catch: ', error);
|
||||
}
|
||||
}
|
||||
|
||||
getItemByLabel(menuItem: string): ElementFinder {
|
||||
return this.component.element(by.cssContainingText(Menu.selectors.item, menuItem));
|
||||
}
|
||||
|
||||
getItemTooltip(menuItem: string): promise.Promise<string> {
|
||||
return this.getItemByLabel(menuItem).getAttribute('title');
|
||||
}
|
||||
|
||||
getItemIconText(menuItem: string) {
|
||||
return this.getItemByLabel(menuItem).element(by.css(Menu.selectors.icon)).getText();
|
||||
|
||||
}
|
||||
|
||||
getItemsCount(): promise.Promise<number> {
|
||||
return this.items.count();
|
||||
}
|
||||
|
||||
clickNthItem(nth: number): promise.Promise<any> {
|
||||
const elem = this.getNthItem(nth);
|
||||
return browser.wait(EC.elementToBeClickable(elem), BROWSER_WAIT_TIMEOUT)
|
||||
.then(() => browser.actions().mouseMove(elem).click().perform())
|
||||
.then(() => this.waitForMenuToClose());
|
||||
}
|
||||
|
||||
clickMenuItem(menuItem: string): promise.Promise<any> {
|
||||
const elem = this.getItemByLabel(menuItem);
|
||||
return browser.wait(EC.elementToBeClickable(elem), BROWSER_WAIT_TIMEOUT)
|
||||
.then(() => elem.click())
|
||||
.then(() => this.waitForMenuToClose());
|
||||
}
|
||||
|
||||
isMenuItemPresent(title: string): promise.Promise<boolean> {
|
||||
return this.component.element(by.cssContainingText(Menu.selectors.item, title)).isPresent();
|
||||
}
|
||||
|
||||
uploadFile() {
|
||||
return this.uploadFiles;
|
||||
}
|
||||
uploadFile() {
|
||||
return this.uploadFiles;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2018 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 { Component } from '../component';
|
||||
import { BROWSER_WAIT_TIMEOUT } from '../../configs';
|
||||
|
||||
export class MetadataCard extends Component {
|
||||
private static selectors = {
|
||||
root: 'adf-content-metadata-card',
|
||||
footer: '.adf-content-metadata-card-footer',
|
||||
expandButton: '[data-automation-id="meta-data-card-toggle-expand"]',
|
||||
expansionPanel: '.adf-metadata-grouped-properties-container mat-expansion-panel'
|
||||
};
|
||||
|
||||
footer: ElementFinder = this.component.element(by.css(MetadataCard.selectors.footer));
|
||||
expandButton: ElementFinder = this.component.element(by.css(MetadataCard.selectors.expandButton));
|
||||
expansionPanels: ElementArrayFinder = this.component.all(by.css(MetadataCard.selectors.expansionPanel));
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(MetadataCard.selectors.root, ancestor);
|
||||
}
|
||||
|
||||
async isExpandPresent() {
|
||||
return await this.expandButton.isPresent();
|
||||
}
|
||||
|
||||
async clickExpandButton() {
|
||||
await this.expandButton.click();
|
||||
}
|
||||
|
||||
async waitForFirstExpansionPanel() {
|
||||
return await browser.wait(EC.presenceOf(this.expansionPanels.get(0)), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
async isExpansionPanelPresent(index) {
|
||||
return await this.expansionPanels.get(index).isPresent();
|
||||
}
|
||||
|
||||
async getComponentIdOfPanel(index) {
|
||||
return await this.expansionPanels.get(index).getAttribute('data-automation-id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,76 +23,76 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { ElementFinder, promise, by } from 'protractor';
|
||||
import { ElementFinder, by } from 'protractor';
|
||||
import { Menu } from '../menu/menu';
|
||||
import { Component } from '../component';
|
||||
|
||||
export class Pagination extends Component {
|
||||
private static selectors = {
|
||||
root: 'adf-pagination',
|
||||
range: '.adf-pagination__range',
|
||||
maxItems: '.adf-pagination__max-items',
|
||||
currentPage: '.adf-pagination__current-page',
|
||||
totalPages: '.adf-pagination__total-pages',
|
||||
private static selectors = {
|
||||
root: 'adf-pagination',
|
||||
range: '.adf-pagination__range',
|
||||
maxItems: '.adf-pagination__max-items',
|
||||
currentPage: '.adf-pagination__current-page',
|
||||
totalPages: '.adf-pagination__total-pages',
|
||||
|
||||
previousButton: '.adf-pagination__previous-button',
|
||||
nextButton: '.adf-pagination__next-button',
|
||||
maxItemsButton: '.adf-pagination__max-items + button[mat-icon-button]',
|
||||
pagesButton: '.adf-pagination__current-page + button[mat-icon-button]'
|
||||
};
|
||||
previousButton: '.adf-pagination__previous-button',
|
||||
nextButton: '.adf-pagination__next-button',
|
||||
maxItemsButton: '.adf-pagination__max-items + button[mat-icon-button]',
|
||||
pagesButton: '.adf-pagination__current-page + button[mat-icon-button]'
|
||||
};
|
||||
|
||||
range: ElementFinder = this.component.element(by.css(Pagination.selectors.range));
|
||||
maxItems: ElementFinder = this.component.element(by.css(Pagination.selectors.maxItems));
|
||||
currentPage: ElementFinder = this.component.element(by.css(Pagination.selectors.currentPage));
|
||||
totalPages: ElementFinder = this.component.element(by.css(Pagination.selectors.totalPages));
|
||||
previousButton: ElementFinder = this.component.element(by.css(Pagination.selectors.previousButton));
|
||||
nextButton: ElementFinder = this.component.element(by.css(Pagination.selectors.nextButton));
|
||||
maxItemsButton: ElementFinder = this.component.element(by.css(Pagination.selectors.maxItemsButton));
|
||||
pagesButton: ElementFinder = this.component.element(by.css(Pagination.selectors.pagesButton));
|
||||
range: ElementFinder = this.component.element(by.css(Pagination.selectors.range));
|
||||
maxItems: ElementFinder = this.component.element(by.css(Pagination.selectors.maxItems));
|
||||
currentPage: ElementFinder = this.component.element(by.css(Pagination.selectors.currentPage));
|
||||
totalPages: ElementFinder = this.component.element(by.css(Pagination.selectors.totalPages));
|
||||
previousButton: ElementFinder = this.component.element(by.css(Pagination.selectors.previousButton));
|
||||
nextButton: ElementFinder = this.component.element(by.css(Pagination.selectors.nextButton));
|
||||
maxItemsButton: ElementFinder = this.component.element(by.css(Pagination.selectors.maxItemsButton));
|
||||
pagesButton: ElementFinder = this.component.element(by.css(Pagination.selectors.pagesButton));
|
||||
|
||||
menu: Menu = new Menu();
|
||||
menu: Menu = new Menu();
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(Pagination.selectors.root, ancestor);
|
||||
}
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(Pagination.selectors.root, ancestor);
|
||||
}
|
||||
|
||||
openMaxItemsMenu(): promise.Promise<Menu> {
|
||||
const { menu, maxItemsButton } = this;
|
||||
async openMaxItemsMenu() {
|
||||
const { menu, maxItemsButton } = this;
|
||||
|
||||
return maxItemsButton.click()
|
||||
.then(() => menu.waitForMenuToOpen())
|
||||
.then(() => menu);
|
||||
}
|
||||
await maxItemsButton.click();
|
||||
await menu.waitForMenuToOpen();
|
||||
// return menu;
|
||||
}
|
||||
|
||||
openCurrentPageMenu(): promise.Promise<Menu> {
|
||||
const { menu, pagesButton } = this;
|
||||
async openCurrentPageMenu() {
|
||||
const { menu, pagesButton } = this;
|
||||
|
||||
return pagesButton.click()
|
||||
.then(() => menu.waitForMenuToOpen())
|
||||
.then(() => menu);
|
||||
}
|
||||
await pagesButton.click();
|
||||
await menu.waitForMenuToOpen();
|
||||
// return menu;
|
||||
}
|
||||
|
||||
getText(elem: ElementFinder) {
|
||||
return elem.getText();
|
||||
}
|
||||
async getText(elem: ElementFinder) {
|
||||
return await elem.getText();
|
||||
}
|
||||
|
||||
resetToDefaultPageSize(): promise.Promise<any> {
|
||||
return this.openMaxItemsMenu()
|
||||
.then(menu => menu.clickMenuItem('25'))
|
||||
.then(() => this.menu.waitForMenuToClose());
|
||||
}
|
||||
async resetToDefaultPageSize() {
|
||||
await this.openMaxItemsMenu();
|
||||
await this.menu.clickMenuItem('25');
|
||||
await this.menu.waitForMenuToClose();
|
||||
}
|
||||
|
||||
resetToDefaultPageNumber(): promise.Promise<any> {
|
||||
return this.openCurrentPageMenu()
|
||||
.then(menu => menu.clickMenuItem('1'))
|
||||
.then(() => this.menu.waitForMenuToClose());
|
||||
}
|
||||
async resetToDefaultPageNumber() {
|
||||
await this.openCurrentPageMenu();
|
||||
await this.menu.clickMenuItem('1');
|
||||
await this.menu.waitForMenuToClose();
|
||||
}
|
||||
|
||||
clickNext(): promise.Promise<any> {
|
||||
return this.nextButton.click();
|
||||
}
|
||||
async clickNext() {
|
||||
await this.nextButton.click();
|
||||
}
|
||||
|
||||
clickPrevious(): promise.Promise<any> {
|
||||
return this.previousButton.click();
|
||||
}
|
||||
async clickPrevious() {
|
||||
await this.previousButton.click();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,60 +23,68 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { ElementFinder, ElementArrayFinder, by, promise } from 'protractor';
|
||||
import { ElementFinder, ElementArrayFinder, by } from 'protractor';
|
||||
import { Menu } from '../menu/menu';
|
||||
import { Component } from '../component';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
|
||||
export class Sidenav extends Component {
|
||||
private static selectors = {
|
||||
root: 'app-sidenav',
|
||||
link: '.sidenav-menu__item',
|
||||
label: '.menu__item--label',
|
||||
activeLink: '.menu__item--active',
|
||||
newButton: '.adf-sidebar-action-menu-button'
|
||||
};
|
||||
private static selectors = {
|
||||
root: 'app-sidenav',
|
||||
link: '.sidenav-menu__item',
|
||||
label: '.menu__item--label',
|
||||
activeLink: '.menu__item--active',
|
||||
newButton: '[data-automation-id="create-button"]'
|
||||
};
|
||||
|
||||
links: ElementArrayFinder = this.component.all(by.css(Sidenav.selectors.link));
|
||||
activeLink: ElementFinder = this.component.element(by.css(Sidenav.selectors.activeLink));
|
||||
newButton: ElementArrayFinder = this.component.all(by.css(Sidenav.selectors.newButton));
|
||||
links: ElementArrayFinder = this.component.all(by.css(Sidenav.selectors.link));
|
||||
activeLink: ElementFinder = this.component.element(by.css(Sidenav.selectors.activeLink));
|
||||
newButton: ElementArrayFinder = this.component.all(by.css(Sidenav.selectors.newButton));
|
||||
|
||||
menu: Menu = new Menu();
|
||||
menu: Menu = new Menu();
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(Sidenav.selectors.root, ancestor);
|
||||
}
|
||||
|
||||
openNewMenu(): promise.Promise<Menu> {
|
||||
const { menu, newButton } = this;
|
||||
|
||||
return newButton.click()
|
||||
.then(() => menu.waitForMenuToOpen())
|
||||
.then(() => menu);
|
||||
}
|
||||
|
||||
openCreateDialog(): any {
|
||||
return this.openNewMenu()
|
||||
.then(() => this.menu.clickMenuItem('Create folder'));
|
||||
}
|
||||
|
||||
isActiveByLabel(label: string): promise.Promise<boolean> {
|
||||
return this.getLinkByLabel(label).getAttribute('class')
|
||||
.then(className => className.includes(Sidenav.selectors.activeLink.replace('.', '')));
|
||||
}
|
||||
|
||||
getLink(label: string): ElementFinder {
|
||||
return this.component.element(by.cssContainingText(Sidenav.selectors.link, label));
|
||||
}
|
||||
|
||||
getLinkByLabel(label: string): ElementFinder {
|
||||
return this.component.element(by.cssContainingText(Sidenav.selectors.label, label));
|
||||
}
|
||||
|
||||
getLinkTooltip(label: string): promise.Promise<string> {
|
||||
return this.getLink(label).getAttribute('title');
|
||||
}
|
||||
|
||||
navigateToLinkByLabel(label: string): promise.Promise<any> {
|
||||
return this.getLinkByLabel(label).click();
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(Sidenav.selectors.root, ancestor);
|
||||
}
|
||||
|
||||
async openNewMenu() {
|
||||
const { menu, newButton } = this;
|
||||
|
||||
await newButton.click();
|
||||
await menu.waitForMenuToOpen();
|
||||
}
|
||||
|
||||
async openCreateDialog() {
|
||||
await this.openNewMenu();
|
||||
await this.menu.clickMenuItem('Create folder');
|
||||
}
|
||||
|
||||
async isActiveByLabel(label: string) {
|
||||
const className = await this.getLinkByLabel(label).getAttribute('class');
|
||||
return className.includes(Sidenav.selectors.activeLink.replace('.', ''));
|
||||
}
|
||||
|
||||
getLink(label: string) {
|
||||
return this.component.element(by.cssContainingText(Sidenav.selectors.link, label));
|
||||
}
|
||||
|
||||
getLinkByLabel(label: string) {
|
||||
return this.component.element(by.cssContainingText(Sidenav.selectors.label, label));
|
||||
// return browser.element(by.xpath(`.//*[.="${label}" and class="${Sidenav.selectors.label}"]`))
|
||||
}
|
||||
|
||||
async getLinkTooltip(label: string) {
|
||||
return await this.getLink(label).getAttribute('title');
|
||||
}
|
||||
|
||||
async navigateToLinkByLabel(label: string) {
|
||||
try{
|
||||
const link = this.getLinkByLabel(label);
|
||||
await Utils.waitUntilElementClickable(link);
|
||||
return await link.click();
|
||||
|
||||
} catch (e){
|
||||
console.log('---- sidebar navigation catch : ', e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2018 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, promise, protractor, browser } from 'protractor';
|
||||
import { Menu } from '../menu/menu';
|
||||
import { Component } from '../component';
|
||||
|
||||
export class ToolbarActions extends Component {
|
||||
private static selectors = {
|
||||
root: 'adf-toolbar',
|
||||
button: '.mat-icon-button'
|
||||
};
|
||||
|
||||
menu: Menu = new Menu();
|
||||
buttons: ElementArrayFinder = this.component.all(by.css(ToolbarActions.selectors.button));
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(ToolbarActions.selectors.root, ancestor);
|
||||
}
|
||||
|
||||
async isEmpty() {
|
||||
return await this.buttons.count() === 0;
|
||||
}
|
||||
|
||||
async isButtonPresent(title: string) {
|
||||
return await this.component.element(by.css(`${ToolbarActions.selectors.button}[title="${title}"]`)).isPresent();
|
||||
}
|
||||
|
||||
getButtonByLabel(label: string) {
|
||||
return this.component.element(by.cssContainingText(ToolbarActions.selectors.button, label));
|
||||
}
|
||||
|
||||
getButtonByTitleAttribute(title: string) {
|
||||
return this.component.element(by.css(`${ToolbarActions.selectors.button}[title="${title}"]`));
|
||||
}
|
||||
|
||||
async openMoreMenu() {
|
||||
await this.getButtonByTitleAttribute('More actions').click();
|
||||
await this.menu.waitForMenuToOpen();
|
||||
return this.menu;
|
||||
}
|
||||
|
||||
async closeMoreMenu() {
|
||||
return await browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
}
|
||||
|
||||
async getButtonTooltip(button: ElementFinder) {
|
||||
return await button.getAttribute('title');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2018 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, promise } from 'protractor';
|
||||
import { Component } from '../component';
|
||||
|
||||
export class ToolbarBreadcrumb extends Component {
|
||||
private static selectors = {
|
||||
root: 'adf-breadcrumb',
|
||||
item: '.adf-breadcrumb-item',
|
||||
currentItem: '.adf-breadcrumb-item-current'
|
||||
};
|
||||
|
||||
items: ElementArrayFinder = this.component.all(by.css(ToolbarBreadcrumb.selectors.item));
|
||||
currentItem: ElementFinder = this.component.element(by.css(ToolbarBreadcrumb.selectors.currentItem));
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(ToolbarBreadcrumb.selectors.root, ancestor);
|
||||
}
|
||||
|
||||
getNthItem(nth: number): ElementFinder {
|
||||
return this.items.get(nth - 1);
|
||||
}
|
||||
|
||||
getNthItemName(nth: number) {
|
||||
return this.getNthItem(nth).getText();
|
||||
}
|
||||
|
||||
getItemsCount(): promise.Promise<number> {
|
||||
return this.items.count();
|
||||
}
|
||||
|
||||
getAllItems() {
|
||||
return this.items.map(elem => elem.getText().then(str => str.split('\nchevron_right')[0]));
|
||||
}
|
||||
|
||||
getFirstItemName(): promise.Promise<string> {
|
||||
return this.items.get(0).getText();
|
||||
}
|
||||
|
||||
getCurrentItem() {
|
||||
return this.currentItem;
|
||||
}
|
||||
|
||||
getCurrentItemName(): promise.Promise<string> {
|
||||
return this.currentItem.getText();
|
||||
}
|
||||
|
||||
clickItem(name: string) {
|
||||
return this.component.element(by.css(`${ToolbarBreadcrumb.selectors.item}[title=${name}]`)).click();
|
||||
}
|
||||
|
||||
clickNthItem(nth: number) {
|
||||
return this.getNthItem(nth).click();
|
||||
}
|
||||
|
||||
getNthItemTooltip(nth: number) {
|
||||
return this.getNthItem(nth).getAttribute('title');
|
||||
}
|
||||
}
|
||||
@@ -23,20 +23,62 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { ElementFinder } from 'protractor';
|
||||
import { ElementFinder, ElementArrayFinder, by, protractor, browser } from 'protractor';
|
||||
import { Menu } from '../menu/menu';
|
||||
import { Component } from '../component';
|
||||
import { ToolbarActions } from './toolbar-actions';
|
||||
import { ToolbarBreadcrumb } from './toolbar-breadcrumb';
|
||||
|
||||
export class Toolbar extends Component {
|
||||
private static selectors = {
|
||||
root: '.inner-layout__header'
|
||||
};
|
||||
private static selectors = {
|
||||
root: '.adf-toolbar',
|
||||
button: '.mat-icon-button'
|
||||
};
|
||||
|
||||
actions: ToolbarActions = new ToolbarActions(this.component);
|
||||
breadcrumb: ToolbarBreadcrumb = new ToolbarBreadcrumb(this.component);
|
||||
menu: Menu = new Menu();
|
||||
buttons: ElementArrayFinder = this.component.all(by.css(Toolbar.selectors.button));
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(Toolbar.selectors.root, ancestor);
|
||||
}
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(Toolbar.selectors.root, ancestor);
|
||||
}
|
||||
|
||||
async isEmpty() {
|
||||
const count = await this.buttons.count();
|
||||
return count === 0;
|
||||
}
|
||||
|
||||
async isButtonPresent(title: string) {
|
||||
const elem = this.component.element(by.css(`${Toolbar.selectors.button}[title="${title}"]`));
|
||||
return await elem.isPresent();
|
||||
}
|
||||
|
||||
getButtonByLabel(label: string) {
|
||||
return this.component.element(by.cssContainingText(Toolbar.selectors.button, label));
|
||||
}
|
||||
|
||||
getButtonByTitleAttribute(title: string) {
|
||||
return this.component.element(by.css(`${Toolbar.selectors.button}[title="${title}"]`));
|
||||
}
|
||||
|
||||
getButtonById(id: string) {
|
||||
return this.component.element(by.id(id));
|
||||
}
|
||||
|
||||
async openMoreMenu() {
|
||||
await this.isButtonPresent('More actions');
|
||||
const moreMenu = this.getButtonByTitleAttribute('More actions');
|
||||
await moreMenu.click();
|
||||
await this.menu.waitForMenuToOpen();
|
||||
}
|
||||
|
||||
async closeMoreMenu() {
|
||||
await browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
}
|
||||
|
||||
async getButtonTooltip(button: ElementFinder) {
|
||||
return await button.getAttribute('title');
|
||||
}
|
||||
|
||||
async clickButton(title: string) {
|
||||
const btn = this.getButtonByTitleAttribute(title);
|
||||
await btn.click();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,76 +26,77 @@
|
||||
import { ElementFinder, by, browser, ExpectedConditions as EC } from 'protractor';
|
||||
import { Component } from '../component';
|
||||
import { BROWSER_WAIT_TIMEOUT } from '../../configs';
|
||||
import { ToolbarActions } from '../toolbar/toolbar-actions';
|
||||
import { Toolbar } from '../toolbar/toolbar';
|
||||
|
||||
export class Viewer extends Component {
|
||||
private static selectors = {
|
||||
root: 'adf-viewer',
|
||||
private static selectors = {
|
||||
root: 'adf-viewer',
|
||||
|
||||
layout: '.adf-viewer-layout-content',
|
||||
contentContainer: '.adf-viewer-content-container',
|
||||
closeBtn: '.adf-viewer-close-button',
|
||||
fileTitle: '.adf-viewer__file-title',
|
||||
layout: '.adf-viewer-layout-content',
|
||||
contentContainer: '.adf-viewer-content-container',
|
||||
closeBtn: '.adf-viewer-close-button',
|
||||
fileTitle: '.adf-viewer__file-title',
|
||||
|
||||
viewerExtensionContent: 'app-preview-extension'
|
||||
};
|
||||
viewerExtensionContent: 'app-preview-extension'
|
||||
};
|
||||
|
||||
viewerLayout: ElementFinder = this.component.element(by.css(Viewer.selectors.layout));
|
||||
viewerContainer: ElementFinder = this.component.element(by.css(Viewer.selectors.contentContainer));
|
||||
closeButton: ElementFinder = this.component.element(by.css(Viewer.selectors.closeBtn));
|
||||
fileTitle: ElementFinder = this.component.element(by.css(Viewer.selectors.fileTitle));
|
||||
viewerExtensionContent: ElementFinder = this.component.element(by.css(Viewer.selectors.viewerExtensionContent));
|
||||
root: ElementFinder = browser.$(Viewer.selectors.root);
|
||||
viewerLayout: ElementFinder = this.component.element(by.css(Viewer.selectors.layout));
|
||||
viewerContainer: ElementFinder = this.component.element(by.css(Viewer.selectors.contentContainer));
|
||||
closeButton: ElementFinder = this.component.element(by.css(Viewer.selectors.closeBtn));
|
||||
fileTitle: ElementFinder = this.component.element(by.css(Viewer.selectors.fileTitle));
|
||||
viewerExtensionContent: ElementFinder = this.component.element(by.css(Viewer.selectors.viewerExtensionContent));
|
||||
|
||||
toolbar = new ToolbarActions(this.component);
|
||||
toolbar = new Toolbar(this.component);
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(Viewer.selectors.root, ancestor);
|
||||
}
|
||||
|
||||
async waitForViewerToOpen() {
|
||||
return await browser.wait(EC.presenceOf(this.viewerContainer), BROWSER_WAIT_TIMEOUT)
|
||||
.catch(err => err);
|
||||
}
|
||||
|
||||
async isViewerOpened() {
|
||||
return await browser.isElementPresent(this.viewerLayout);
|
||||
}
|
||||
|
||||
async isViewerContentDisplayed() {
|
||||
return await browser.isElementPresent(this.viewerContainer);
|
||||
}
|
||||
|
||||
async isViewerToolbarDisplayed() {
|
||||
return await browser.isElementPresent(this.toolbar.component);
|
||||
}
|
||||
|
||||
async isCloseButtonDisplayed() {
|
||||
return await browser.isElementPresent(this.closeButton);
|
||||
}
|
||||
|
||||
async isFileTitleDisplayed() {
|
||||
return await browser.isElementPresent(this.fileTitle);
|
||||
}
|
||||
|
||||
async clickClose() {
|
||||
return await this.closeButton.click();
|
||||
}
|
||||
|
||||
async getCloseButtonTooltip() {
|
||||
return await this.toolbar.getButtonTooltip(this.closeButton);
|
||||
}
|
||||
|
||||
async getFileTitle() {
|
||||
return await this.fileTitle.getText();
|
||||
}
|
||||
|
||||
async isCustomContentPresent() {
|
||||
return await browser.isElementPresent(this.viewerExtensionContent);
|
||||
}
|
||||
|
||||
async getComponentIdOfView() {
|
||||
if (await this.isCustomContentPresent()) {
|
||||
return await this.viewerExtensionContent.getAttribute('data-automation-id');
|
||||
}
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(Viewer.selectors.root, ancestor);
|
||||
}
|
||||
|
||||
async waitForViewerToOpen() {
|
||||
await browser.wait(EC.presenceOf(this.viewerContainer), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
async isViewerOpened() {
|
||||
return await browser.isElementPresent(this.viewerLayout);
|
||||
// return await this.viewerLayout.isPresent();
|
||||
}
|
||||
|
||||
async isViewerContentDisplayed() {
|
||||
return await browser.isElementPresent(this.viewerContainer);
|
||||
}
|
||||
|
||||
async isViewerToolbarDisplayed() {
|
||||
return await browser.isElementPresent(this.toolbar.component);
|
||||
}
|
||||
|
||||
async isCloseButtonDisplayed() {
|
||||
return await browser.isElementPresent(this.closeButton);
|
||||
}
|
||||
|
||||
async isFileTitleDisplayed() {
|
||||
return await browser.isElementPresent(this.fileTitle);
|
||||
}
|
||||
|
||||
async clickClose() {
|
||||
await this.closeButton.click();
|
||||
}
|
||||
|
||||
async getCloseButtonTooltip() {
|
||||
return await this.toolbar.getButtonTooltip(this.closeButton);
|
||||
}
|
||||
|
||||
async getFileTitle() {
|
||||
return await this.fileTitle.getText();
|
||||
}
|
||||
|
||||
async isCustomContentPresent() {
|
||||
return await browser.isElementPresent(this.viewerExtensionContent);
|
||||
}
|
||||
|
||||
async getComponentIdOfView() {
|
||||
if (await this.isCustomContentPresent()) {
|
||||
return await this.viewerExtensionContent.getAttribute('data-automation-id');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+36
-32
@@ -29,7 +29,7 @@ export const BROWSER_RESOLUTION_HEIGHT = 800;
|
||||
export const BROWSER_WAIT_TIMEOUT = 10000;
|
||||
|
||||
// Application configs
|
||||
export const APP_HOST = 'http://localhost:4000';
|
||||
export const USE_HASH_STRATEGY = true;
|
||||
|
||||
// Repository configs
|
||||
export const REPO_API_HOST = 'http://localhost:8080';
|
||||
@@ -44,57 +44,61 @@ export const E2E_ROOT_PATH = __dirname;
|
||||
|
||||
// Application Routes
|
||||
export const APP_ROUTES = {
|
||||
FAVORITES: '/favorites',
|
||||
FILE_LIBRARIES: '/libraries',
|
||||
LOGIN: '/login',
|
||||
LOGOUT: '/logout',
|
||||
PERSONAL_FILES: '/personal-files',
|
||||
RECENT_FILES: '/recent-files',
|
||||
SHARED_FILES: '/shared',
|
||||
TRASHCAN: '/trashcan'
|
||||
FAVORITES: '/favorites',
|
||||
FILE_LIBRARIES: '/libraries',
|
||||
LOGIN: '/login',
|
||||
LOGOUT: '/logout',
|
||||
PERSONAL_FILES: '/personal-files',
|
||||
RECENT_FILES: '/recent-files',
|
||||
SHARED_FILES: '/shared',
|
||||
TRASHCAN: '/trashcan'
|
||||
};
|
||||
|
||||
// Sidebar labels
|
||||
export const SIDEBAR_LABELS = {
|
||||
PERSONAL_FILES: 'Personal Files',
|
||||
FILE_LIBRARIES: 'File Libraries',
|
||||
SHARED_FILES: 'Shared',
|
||||
RECENT_FILES: 'Recent Files',
|
||||
FAVORITES: 'Favorites',
|
||||
TRASH: 'Trash'
|
||||
PERSONAL_FILES: 'Personal Files',
|
||||
FILE_LIBRARIES: 'File Libraries',
|
||||
SHARED_FILES: 'Shared',
|
||||
RECENT_FILES: 'Recent Files',
|
||||
FAVORITES: 'Favorites',
|
||||
TRASH: 'Trash'
|
||||
};
|
||||
|
||||
// Page titles
|
||||
export const PAGE_TITLES = {
|
||||
VIEWER: 'Preview',
|
||||
SEARCH: 'Search Results'
|
||||
VIEWER: 'Preview',
|
||||
SEARCH: 'Search Results'
|
||||
};
|
||||
|
||||
// Site visibility
|
||||
export const SITE_VISIBILITY = {
|
||||
PUBLIC: 'PUBLIC',
|
||||
MODERATED: 'MODERATED',
|
||||
PRIVATE: 'PRIVATE'
|
||||
PUBLIC: 'PUBLIC',
|
||||
MODERATED: 'MODERATED',
|
||||
PRIVATE: 'PRIVATE'
|
||||
};
|
||||
|
||||
// Site roles
|
||||
export const SITE_ROLES = {
|
||||
SITE_CONSUMER: 'SiteConsumer',
|
||||
SITE_COLLABORATOR: 'SiteCollaborator',
|
||||
SITE_CONTRIBUTOR: 'SiteContributor',
|
||||
SITE_MANAGER: 'SiteManager'
|
||||
SITE_CONSUMER: 'SiteConsumer',
|
||||
SITE_COLLABORATOR: 'SiteCollaborator',
|
||||
SITE_CONTRIBUTOR: 'SiteContributor',
|
||||
SITE_MANAGER: 'SiteManager'
|
||||
};
|
||||
|
||||
export const FILES = {
|
||||
docxFile: 'file-docx.docx',
|
||||
xlsxFile: 'file-xlsx.xlsx',
|
||||
pdfFile: 'file-pdf.pdf',
|
||||
unsupportedFile: 'file_unsupported.3DS'
|
||||
docxFile: 'file-docx.docx',
|
||||
xlsxFile: 'file-xlsx.xlsx',
|
||||
pdfFile: 'file-pdf.pdf',
|
||||
unsupportedFile: 'file_unsupported.3DS'
|
||||
};
|
||||
|
||||
export const EXTENSIBILITY_CONFIGS = {
|
||||
DEFAULT_EXTENSIONS_CONFIG: 'extensions-default.json',
|
||||
INFO_DRAWER: 'info-drawer-ext.json',
|
||||
INFO_DRAWER_EMPTY: 'info-drawer-no-tabs-ext.json',
|
||||
VIEWER: 'viewer-ext.json'
|
||||
DEFAULT_EXTENSIONS_CONFIG: 'extensions-default.json',
|
||||
INFO_DRAWER: 'info-drawer-ext.json',
|
||||
INFO_DRAWER_EMPTY: 'info-drawer-no-tabs-ext.json',
|
||||
VIEWER: 'viewer-ext.json',
|
||||
HEADER: 'header-ext.json',
|
||||
METADATA_PRESETS: 'metadata-ext.json',
|
||||
DOCUMENT_LIST_PRESETS: 'document-presets-ext.json',
|
||||
CONTEXT_SUBMENUS: 'context-submenus-ext.json'
|
||||
};
|
||||
|
||||
@@ -24,17 +24,18 @@
|
||||
*/
|
||||
|
||||
import { promise } from 'protractor';
|
||||
import { Header, DataTable, Pagination, Toolbar, Sidenav } from '../components/components';
|
||||
import { Header, DataTable, Pagination, Toolbar, Breadcrumb, Sidenav } from '../components/components';
|
||||
import { Page } from './page';
|
||||
|
||||
export class BrowsingPage extends Page {
|
||||
header = new Header(this.app);
|
||||
sidenav = new Sidenav(this.app);
|
||||
toolbar = new Toolbar(this.app);
|
||||
dataTable = new DataTable(this.app);
|
||||
pagination = new Pagination(this.app);
|
||||
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);
|
||||
|
||||
signOut(): promise.Promise<void> {
|
||||
return this.header.userInfo.signOut();
|
||||
}
|
||||
async signOut() {
|
||||
await this.header.userInfo.signOut();
|
||||
}
|
||||
}
|
||||
|
||||
+32
-40
@@ -22,54 +22,46 @@
|
||||
* 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 { browser, ExpectedConditions as EC, promise } from 'protractor';
|
||||
import { browser, ExpectedConditions as EC } from 'protractor';
|
||||
import { LoginComponent } from '../components/components';
|
||||
import { Page } from './page';
|
||||
import { Utils } from '../utilities/utils';
|
||||
|
||||
import {
|
||||
ADMIN_USERNAME,
|
||||
ADMIN_PASSWORD,
|
||||
BROWSER_WAIT_TIMEOUT,
|
||||
APP_ROUTES
|
||||
} from '../configs';
|
||||
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.app);
|
||||
|
||||
/** @override */
|
||||
constructor() {
|
||||
super(APP_ROUTES.LOGIN);
|
||||
}
|
||||
/** @override */
|
||||
constructor() {
|
||||
super(APP_ROUTES.LOGIN);
|
||||
}
|
||||
|
||||
/** @override */
|
||||
load(): promise.Promise<any> {
|
||||
return super.load().then(() => {
|
||||
const { submitButton } = this.login;
|
||||
const hasSubmitButton = EC.presenceOf(submitButton);
|
||||
/** @override */
|
||||
async load() {
|
||||
await super.load();
|
||||
const { submitButton } = this.login;
|
||||
const hasSubmitButton = EC.presenceOf(submitButton);
|
||||
return browser.wait(hasSubmitButton, BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
return browser.wait(hasSubmitButton, BROWSER_WAIT_TIMEOUT)
|
||||
.then(() => Utils.clearLocalStorage())
|
||||
.then(() => browser.manage().deleteAllCookies());
|
||||
});
|
||||
}
|
||||
async loginWith(username: string, password?: string) {
|
||||
const pass = password || username;
|
||||
await this.load();
|
||||
await this.login.enterCredentials(username, pass)
|
||||
await this.login.submit();
|
||||
return super.waitForApp();
|
||||
}
|
||||
|
||||
loginWith(username: string, password?: string): promise.Promise<any> {
|
||||
const pass = password || username;
|
||||
return this.load()
|
||||
.then(() => this.login.enterCredentials(username, pass).submit())
|
||||
.then(() => super.waitForApp());
|
||||
}
|
||||
async loginWithAdmin() {
|
||||
await this.load();
|
||||
return this.loginWith(ADMIN_USERNAME, ADMIN_PASSWORD);
|
||||
}
|
||||
|
||||
loginWithAdmin(): promise.Promise<any> {
|
||||
return this.load()
|
||||
.then(() => this.loginWith(ADMIN_USERNAME, ADMIN_PASSWORD));
|
||||
}
|
||||
|
||||
tryLoginWith(username: string, password?: string): promise.Promise<void> {
|
||||
const pass = password || username;
|
||||
return this.load()
|
||||
.then(() => this.login.enterCredentials(username, pass).submit())
|
||||
.then(() => browser.wait(EC.presenceOf(this.login.errorMessage), BROWSER_WAIT_TIMEOUT));
|
||||
}
|
||||
async tryLoginWith(username: string, password?: string) {
|
||||
const pass = password || username;
|
||||
await this.load();
|
||||
await this.login.enterCredentials(username, pass);
|
||||
await this.login.submit();
|
||||
return browser.wait(EC.presenceOf(this.login.errorMessage), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
}
|
||||
|
||||
+10
-11
@@ -23,21 +23,20 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { promise } from 'protractor';
|
||||
import { Page } from './page';
|
||||
import { APP_ROUTES } from '../configs';
|
||||
import { Utils } from '../utilities/utils';
|
||||
|
||||
export class LogoutPage extends Page {
|
||||
/** @override */
|
||||
constructor() {
|
||||
super(APP_ROUTES.LOGIN);
|
||||
}
|
||||
/** @override */
|
||||
constructor() {
|
||||
super(APP_ROUTES.LOGIN);
|
||||
}
|
||||
|
||||
/** @override */
|
||||
load(): promise.Promise<any> {
|
||||
return Utils.clearLocalStorage()
|
||||
.then(() => Utils.clearSessionStorage())
|
||||
.then(() => super.load());
|
||||
}
|
||||
/** @override */
|
||||
load() {
|
||||
// await Utils.clearLocalStorage();
|
||||
// await Utils.clearSessionStorage();
|
||||
return super.load();
|
||||
}
|
||||
}
|
||||
|
||||
+98
-78
@@ -23,91 +23,111 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { browser, element, by, ElementFinder, promise, ExpectedConditions as EC } from 'protractor';
|
||||
import { BROWSER_WAIT_TIMEOUT } from './../configs';
|
||||
import {
|
||||
browser,
|
||||
element,
|
||||
by,
|
||||
ElementFinder,
|
||||
ExpectedConditions as EC
|
||||
} from 'protractor';
|
||||
import { BROWSER_WAIT_TIMEOUT, USE_HASH_STRATEGY } from './../configs';
|
||||
|
||||
export abstract class Page {
|
||||
private static USE_HASH_STRATEGY = true;
|
||||
private locators = {
|
||||
app: by.css('app-root'),
|
||||
layout: by.css('app-layout'),
|
||||
overlay: by.css('.cdk-overlay-container'),
|
||||
dialogContainer: by.css('.mat-dialog-container'),
|
||||
snackBarContainer: '.cdk-overlay-pane .mat-snack-bar-container',
|
||||
snackBar: '.mat-simple-snackbar',
|
||||
snackBarAction: '.mat-simple-snackbar-action button',
|
||||
|
||||
private locators = {
|
||||
app: by.css('app-root'),
|
||||
layout: by.css('app-layout'),
|
||||
overlay: by.css('.cdk-overlay-container'),
|
||||
dialogContainer: by.css('.mat-dialog-container'),
|
||||
snackBarContainer: '.cdk-overlay-pane .mat-snack-bar-container',
|
||||
snackBar: '.mat-simple-snackbar',
|
||||
snackBarAction: '.mat-simple-snackbar-action button'
|
||||
};
|
||||
genericError: 'aca-generic-error',
|
||||
genericErrorIcon: 'aca-generic-error .mat-icon',
|
||||
genericErrorTitle: '.generic-error__title'
|
||||
};
|
||||
|
||||
public app: ElementFinder = element(this.locators.app);
|
||||
public layout: ElementFinder = element(this.locators.layout);
|
||||
public overlay: ElementFinder = element(this.locators.overlay);
|
||||
snackBar: ElementFinder = browser.$(this.locators.snackBar);
|
||||
dialogContainer: ElementFinder = element(this.locators.dialogContainer);
|
||||
snackBarContainer: ElementFinder = browser.$(this.locators.snackBarContainer);
|
||||
snackBarAction: ElementFinder = browser.$(this.locators.snackBarAction);
|
||||
public app: ElementFinder = element(this.locators.app);
|
||||
public layout: ElementFinder = element(this.locators.layout);
|
||||
public overlay: ElementFinder = element(this.locators.overlay);
|
||||
snackBar: ElementFinder = browser.$(this.locators.snackBar);
|
||||
dialogContainer: ElementFinder = element(this.locators.dialogContainer);
|
||||
snackBarContainer: ElementFinder = browser.$(this.locators.snackBarContainer);
|
||||
snackBarAction: ElementFinder = browser.$(this.locators.snackBarAction);
|
||||
|
||||
constructor(public url: string = '') {}
|
||||
genericError: ElementFinder = browser.$(this.locators.genericError);
|
||||
genericErrorIcon: ElementFinder = browser.$(this.locators.genericErrorIcon);
|
||||
genericErrorTitle: ElementFinder = browser.$(this.locators.genericErrorTitle);
|
||||
|
||||
get title(): promise.Promise<string> {
|
||||
return browser.getTitle();
|
||||
constructor(public url: string = '') {}
|
||||
|
||||
getTitle() {
|
||||
return browser.getTitle();
|
||||
}
|
||||
|
||||
load(relativeUrl: string = '') {
|
||||
const hash = USE_HASH_STRATEGY ? '/#' : '';
|
||||
const path = `${browser.baseUrl}${hash}${this.url}${relativeUrl}`;
|
||||
return browser.get(path);
|
||||
}
|
||||
|
||||
waitForApp() {
|
||||
return browser.wait(EC.presenceOf(this.layout), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
waitForSnackBarToAppear() {
|
||||
return browser.wait(EC.visibilityOf(this.snackBarContainer), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
async waitForSnackBarToClose() {
|
||||
await browser.wait(EC.not(EC.visibilityOf(this.snackBarContainer)), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
async waitForDialog() {
|
||||
await browser.wait(EC.visibilityOf(this.dialogContainer), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
async waitForDialogToClose() {
|
||||
await browser.wait(EC.not(EC.visibilityOf(this.dialogContainer)), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
async refresh() {
|
||||
await browser.refresh();
|
||||
await this.waitForApp();
|
||||
}
|
||||
|
||||
getDialogActionByLabel(label) {
|
||||
return element(by.cssContainingText('.mat-button-wrapper', label));
|
||||
}
|
||||
|
||||
async isSnackBarDisplayed() {
|
||||
return await this.snackBar.isDisplayed();
|
||||
}
|
||||
|
||||
async getSnackBarMessage() {
|
||||
await this.waitForSnackBarToAppear();
|
||||
return await this.snackBar.getAttribute('innerText');
|
||||
}
|
||||
|
||||
async clickSnackBarAction() {
|
||||
try {
|
||||
|
||||
// await this.waitForSnackBarToAppear();
|
||||
|
||||
// return browser.executeScript(function (elem) {
|
||||
// elem.click();
|
||||
// }, this.snackBarAction);
|
||||
return await this.snackBarAction.click();
|
||||
} catch (e) {
|
||||
console.log(e, '.......failed on click snack bar action.........');
|
||||
}
|
||||
}
|
||||
|
||||
load(relativeUrl: string = ''): promise.Promise<void> {
|
||||
const hash = Page.USE_HASH_STRATEGY ? '/#' : '';
|
||||
const path = `${hash}${this.url}${relativeUrl}`;
|
||||
async isGenericErrorDisplayed() {
|
||||
return await this.genericError.isDisplayed();
|
||||
}
|
||||
|
||||
return browser.get(path);
|
||||
}
|
||||
|
||||
waitForApp() {
|
||||
return browser.wait(EC.presenceOf(this.layout), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
waitForSnackBarToAppear() {
|
||||
return browser.wait(EC.visibilityOf(this.snackBarContainer), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
waitForSnackBarToClose() {
|
||||
return browser.wait(EC.not(EC.visibilityOf(this.snackBarContainer)), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
waitForDialog() {
|
||||
return browser.wait(EC.visibilityOf(this.dialogContainer), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
waitForDialogToClose() {
|
||||
return browser.wait(EC.not(EC.visibilityOf(this.dialogContainer)), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
refresh(): promise.Promise<void> {
|
||||
return browser.refresh();
|
||||
}
|
||||
|
||||
getDialogActionByLabel(label) {
|
||||
return element(by.cssContainingText('.mat-button-wrapper', label));
|
||||
}
|
||||
|
||||
isSnackBarDisplayed(): promise.Promise<boolean> {
|
||||
return this.snackBar.isDisplayed();
|
||||
}
|
||||
|
||||
getSnackBarMessage(): promise.Promise<string> {
|
||||
return this.waitForSnackBarToAppear()
|
||||
.then(() => this.snackBar.getAttribute('innerText'));
|
||||
}
|
||||
|
||||
getSnackBarAction() {
|
||||
return this.waitForSnackBarToAppear()
|
||||
.then(() => this.snackBarAction);
|
||||
}
|
||||
|
||||
clickSnackBarAction() {
|
||||
return this.waitForSnackBarToAppear()
|
||||
.then(() => {
|
||||
return browser.executeScript(function (elem) {
|
||||
elem.click();
|
||||
}, this.snackBarAction);
|
||||
});
|
||||
}
|
||||
async getGenericErrorTitle() {
|
||||
return await this.genericErrorTitle.getText();
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,927 @@
|
||||
{
|
||||
"$schema": "../../extension.schema.json",
|
||||
"$name": "app",
|
||||
"$version": "1.0.0",
|
||||
"$references": [
|
||||
"plugin1.json",
|
||||
"dev.tools.json",
|
||||
"app.header.json",
|
||||
"app.create.json",
|
||||
"metadata-plugin.json"
|
||||
],
|
||||
|
||||
"rules": [
|
||||
{
|
||||
"id": "app.toolbar.favorite.canToggle",
|
||||
"comment": "workaround for recent files and search api issue",
|
||||
"type": "core.every",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "core.some",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "app.selection.canAddFavorite"
|
||||
},
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "app.selection.canRemoveFavorite"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "core.some",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "app.navigation.isRecentFiles"
|
||||
},
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "app.navigation.isSharedFiles"
|
||||
},
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "app.navigation.isSearchResults"
|
||||
},
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "app.navigation.isFavorites"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.favorite.canAdd",
|
||||
"type": "core.every",
|
||||
"parameters": [
|
||||
{ "type": "rule", "value": "app.selection.canAddFavorite" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotRecentFiles" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotSharedFiles" },
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "app.navigation.isNotSearchResults"
|
||||
},
|
||||
{ "type": "rule", "value": "app.navigation.isNotFavorites" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.favorite.canRemove",
|
||||
"type": "core.every",
|
||||
"parameters": [
|
||||
{ "type": "rule", "value": "app.selection.canRemoveFavorite" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotRecentFiles" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotSharedFiles" },
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "app.navigation.isNotSearchResults"
|
||||
},
|
||||
{ "type": "rule", "value": "app.navigation.isNotFavorites" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.info",
|
||||
"type": "core.every",
|
||||
"parameters": [
|
||||
{ "type": "rule", "value": "app.selection.notEmpty" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotLibraries" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotTrashcan" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.canCopyNode",
|
||||
"type": "core.every",
|
||||
"parameters": [
|
||||
{ "type": "rule", "value": "app.selection.notEmpty" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotTrashcan" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotLibraries" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.permissions",
|
||||
"type": "core.every",
|
||||
"parameters": [
|
||||
{ "type": "rule", "value": "app.selection.first.canUpdate" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotTrashcan" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.versions",
|
||||
"type": "core.every",
|
||||
"parameters": [
|
||||
{ "type": "rule", "value": "app.selection.file" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotTrashcan" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "app.trashcan.hasSelection",
|
||||
"type": "core.every",
|
||||
"parameters": [
|
||||
{ "type": "rule", "value": "app.selection.notEmpty" },
|
||||
{ "type": "rule", "value": "app.navigation.isTrashcan" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.canEditFolder",
|
||||
"type": "core.every",
|
||||
"parameters": [
|
||||
{ "type": "rule", "value": "app.selection.folder" },
|
||||
{ "type": "rule", "value": "app.selection.folder.canUpdate" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotTrashcan" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.canViewFile",
|
||||
"type": "core.every",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "app.selection.file"
|
||||
},
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "core.not",
|
||||
"parameters": [
|
||||
{ "type": "rule", "value": "app.navigation.isTrashcan" }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.canDownload",
|
||||
"type": "core.every",
|
||||
"parameters": [
|
||||
{ "type": "rule", "value": "app.selection.canDownload" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotTrashcan" }
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
"features": {
|
||||
"create": [
|
||||
{
|
||||
"id": "app.create.uploadFile",
|
||||
"order": 100,
|
||||
"icon": "file_upload",
|
||||
"title": "APP.NEW_MENU.MENU_ITEMS.UPLOAD_FILE",
|
||||
"description": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FILES",
|
||||
"description-disabled": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FILES_NOT_ALLOWED",
|
||||
"actions": {
|
||||
"click": "UPLOAD_FILES"
|
||||
},
|
||||
"rules": {
|
||||
"enabled": "app.navigation.folder.canUpload"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.create.uploadFolder",
|
||||
"order": 200,
|
||||
"icon": "file_upload",
|
||||
"title": "APP.NEW_MENU.MENU_ITEMS.UPLOAD_FOLDER",
|
||||
"description": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FOLDERS",
|
||||
"description-disabled": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FOLDERS_NOT_ALLOWED",
|
||||
"actions": {
|
||||
"click": "UPLOAD_FOLDER"
|
||||
},
|
||||
"rules": {
|
||||
"enabled": "app.navigation.folder.canUpload"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.create.separator.1",
|
||||
"type": "separator",
|
||||
"order": 300
|
||||
},
|
||||
{
|
||||
"id": "app.create.folder",
|
||||
"order": 400,
|
||||
"icon": "create_new_folder",
|
||||
"title": "APP.NEW_MENU.MENU_ITEMS.CREATE_FOLDER",
|
||||
"description": "APP.NEW_MENU.TOOLTIPS.CREATE_FOLDER",
|
||||
"description-disabled": "APP.NEW_MENU.TOOLTIPS.CREATE_FOLDER_NOT_ALLOWED",
|
||||
"actions": {
|
||||
"click": "CREATE_FOLDER"
|
||||
},
|
||||
"rules": {
|
||||
"enabled": "app.navigation.folder.canCreate"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.create.library",
|
||||
"order": 600,
|
||||
"title": "APP.NEW_MENU.MENU_ITEMS.CREATE_LIBRARY",
|
||||
"description": "APP.NEW_MENU.TOOLTIPS.CREATE_LIBRARY",
|
||||
"icon": "create_new_folder",
|
||||
"actions": {
|
||||
"click": "CREATE_LIBRARY"
|
||||
}
|
||||
}
|
||||
],
|
||||
"navbar": [
|
||||
{
|
||||
"id": "app.navbar.primary",
|
||||
"items": [
|
||||
{
|
||||
"id": "app.navbar.personalFiles",
|
||||
"order": 100,
|
||||
"icon": "folder",
|
||||
"title": "APP.BROWSE.PERSONAL.SIDENAV_LINK.LABEL",
|
||||
"description": "APP.BROWSE.PERSONAL.SIDENAV_LINK.TOOLTIP",
|
||||
"route": "personal-files"
|
||||
},
|
||||
{
|
||||
"id": "app.navbar.libraries",
|
||||
"order": 200,
|
||||
"icon": "group_work",
|
||||
"title": "APP.BROWSE.LIBRARIES.SIDENAV_LINK.LABEL",
|
||||
"description": "APP.BROWSE.LIBRARIES.SIDENAV_LINK.TOOLTIP",
|
||||
"route": "libraries"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "app.navbar.secondary",
|
||||
"items": [
|
||||
{
|
||||
"id": "app.navbar.shared",
|
||||
"order": 100,
|
||||
"icon": "people",
|
||||
"title": "APP.BROWSE.SHARED.SIDENAV_LINK.LABEL",
|
||||
"description": "APP.BROWSE.SHARED.SIDENAV_LINK.TOOLTIP",
|
||||
"route": "shared",
|
||||
"rules": {
|
||||
"visible": "repository.isQuickShareEnabled"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.navbar.recentFiles",
|
||||
"order": 200,
|
||||
"icon": "schedule",
|
||||
"title": "APP.BROWSE.RECENT.SIDENAV_LINK.LABEL",
|
||||
"description": "APP.BROWSE.RECENT.SIDENAV_LINK.TOOLTIP",
|
||||
"route": "recent-files"
|
||||
},
|
||||
{
|
||||
"id": "app.navbar.favorites",
|
||||
"order": 300,
|
||||
"icon": "star",
|
||||
"title": "APP.BROWSE.FAVORITES.SIDENAV_LINK.LABEL",
|
||||
"description": "APP.BROWSE.FAVORITES.SIDENAV_LINK.TOOLTIP",
|
||||
"route": "favorites"
|
||||
},
|
||||
{
|
||||
"id": "app.navbar.trashcan",
|
||||
"order": 400,
|
||||
"icon": "delete",
|
||||
"title": "APP.BROWSE.TRASHCAN.SIDENAV_LINK.LABEL",
|
||||
"description": "APP.BROWSE.TRASHCAN.SIDENAV_LINK.TOOLTIP",
|
||||
"route": "trashcan"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"toolbar": [
|
||||
{
|
||||
"id": "app.toolbar.preview",
|
||||
"order": 100,
|
||||
"title": "APP.ACTIONS.VIEW",
|
||||
"icon": "open_in_browser",
|
||||
"actions": {
|
||||
"click": "VIEW_FILE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canViewFile"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.download",
|
||||
"order": 200,
|
||||
"title": "APP.ACTIONS.DOWNLOAD",
|
||||
"icon": "get_app",
|
||||
"actions": {
|
||||
"click": "DOWNLOAD_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canDownload"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.editFolder",
|
||||
"order": 300,
|
||||
"title": "APP.ACTIONS.EDIT",
|
||||
"icon": "create",
|
||||
"actions": {
|
||||
"click": "EDIT_FOLDER"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canEditFolder"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.purgeDeletedNodes",
|
||||
"order": 400,
|
||||
"title": "APP.ACTIONS.DELETE_PERMANENT",
|
||||
"icon": "delete_forever",
|
||||
"actions": {
|
||||
"click": "PURGE_DELETED_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.trashcan.hasSelection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.restoreDeletedNodes",
|
||||
"order": 500,
|
||||
"title": "APP.ACTIONS.RESTORE",
|
||||
"icon": "restore",
|
||||
"actions": {
|
||||
"click": "RESTORE_DELETED_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.trashcan.hasSelection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.info",
|
||||
"type": "custom",
|
||||
"order": 700,
|
||||
"component": "app.toolbar.toggleInfoDrawer",
|
||||
"rules": {
|
||||
"visible": "app.toolbar.info"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.more",
|
||||
"type": "menu",
|
||||
"order": 10000,
|
||||
"icon": "more_vert",
|
||||
"title": "APP.ACTIONS.MORE",
|
||||
"children": [
|
||||
{
|
||||
"id": "app.toolbar.favorite",
|
||||
"comment": "workaround for Recent Files and Search API issue",
|
||||
"type": "custom",
|
||||
"order": 100,
|
||||
"component": "app.toolbar.toggleFavorite",
|
||||
"rules": {
|
||||
"visible": "app.toolbar.favorite.canToggle"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.favorite.add",
|
||||
"order": 200,
|
||||
"title": "APP.ACTIONS.FAVORITE",
|
||||
"icon": "star_border",
|
||||
"actions": {
|
||||
"click": "ADD_FAVORITE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.favorite.canAdd"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.favorite.remove",
|
||||
"order": 300,
|
||||
"title": "APP.ACTIONS.FAVORITE",
|
||||
"icon": "star",
|
||||
"actions": {
|
||||
"click": "REMOVE_FAVORITE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.favorite.canRemove"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.copy",
|
||||
"order": 400,
|
||||
"title": "APP.ACTIONS.COPY",
|
||||
"icon": "content_copy",
|
||||
"actions": {
|
||||
"click": "COPY_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canCopyNode"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.move",
|
||||
"order": 500,
|
||||
"title": "APP.ACTIONS.MOVE",
|
||||
"icon": "library_books",
|
||||
"actions": {
|
||||
"click": "MOVE_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.canDelete"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.share",
|
||||
"order": 600,
|
||||
"title": "APP.ACTIONS.SHARE",
|
||||
"icon": "share",
|
||||
"actions": {
|
||||
"click": "SHARE_NODE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.file.canShare"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.unshare",
|
||||
"order": 700,
|
||||
"title": "APP.ACTIONS.UNSHARE",
|
||||
"icon": "stop_screen_share",
|
||||
"actions": {
|
||||
"click": "UNSHARE_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.canUnshare"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.delete",
|
||||
"order": 800,
|
||||
"title": "APP.ACTIONS.DELETE",
|
||||
"icon": "delete",
|
||||
"actions": {
|
||||
"click": "DELETE_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.canDelete"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.deleteLibrary",
|
||||
"order": 900,
|
||||
"title": "APP.ACTIONS.DELETE",
|
||||
"icon": "delete",
|
||||
"actions": {
|
||||
"click": "DELETE_LIBRARY"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.library"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.versions",
|
||||
"order": 1000,
|
||||
"title": "APP.ACTIONS.VERSIONS",
|
||||
"icon": "history",
|
||||
"actions": {
|
||||
"click": "MANAGE_VERSIONS"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.versions"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.permissions",
|
||||
"order": 1100,
|
||||
"title": "APP.ACTIONS.PERMISSIONS",
|
||||
"icon": "settings_input_component",
|
||||
"actions": {
|
||||
"click": "MANAGE_PERMISSIONS"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.permissions"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"contextMenu": [
|
||||
{
|
||||
"id": "app.context.menu.download",
|
||||
"order": 100,
|
||||
"title": "APP.ACTIONS.DOWNLOAD",
|
||||
"icon": "get_app",
|
||||
"actions": {
|
||||
"click": "DOWNLOAD_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canDownload"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.preview",
|
||||
"order": 200,
|
||||
"title": "APP.ACTIONS.VIEW",
|
||||
"icon": "open_in_browser",
|
||||
"actions": {
|
||||
"click": "VIEW_FILE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canViewFile"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.editFolder",
|
||||
"order": 300,
|
||||
"title": "APP.ACTIONS.EDIT",
|
||||
"icon": "create",
|
||||
"actions": {
|
||||
"click": "EDIT_FOLDER"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canEditFolder"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.share",
|
||||
"title": "APP.ACTIONS.SHARE",
|
||||
"order": 400,
|
||||
"icon": "share",
|
||||
"actions": {
|
||||
"click": "SHARE_NODE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.file.canShare"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.favorite.add",
|
||||
"title": "APP.ACTIONS.FAVORITE",
|
||||
"order": 500,
|
||||
"icon": "star_border",
|
||||
"actions": {
|
||||
"click": "ADD_FAVORITE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.favorite.canAdd"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.favorite.remove",
|
||||
"title": "APP.ACTIONS.FAVORITE",
|
||||
"order": 600,
|
||||
"icon": "star",
|
||||
"actions": {
|
||||
"click": "REMOVE_FAVORITE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.favorite.canRemove"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.favorite",
|
||||
"comment": "workaround for Recent Files and Search API issue",
|
||||
"type": "custom",
|
||||
"order": 501,
|
||||
"component": "app.toolbar.toggleFavorite",
|
||||
"rules": {
|
||||
"visible": "app.toolbar.favorite.canToggle"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.copy",
|
||||
"title": "APP.ACTIONS.COPY",
|
||||
"order": 700,
|
||||
"icon": "content_copy",
|
||||
"actions": {
|
||||
"click": "COPY_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canCopyNode"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.move",
|
||||
"title": "APP.ACTIONS.MOVE",
|
||||
"order": 800,
|
||||
"icon": "library_books",
|
||||
"actions": {
|
||||
"click": "MOVE_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.canDelete"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.delete",
|
||||
"title": "APP.ACTIONS.DELETE",
|
||||
"order": 900,
|
||||
"icon": "delete",
|
||||
"actions": {
|
||||
"click": "DELETE_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.canDelete"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.versions",
|
||||
"title": "APP.ACTIONS.VERSIONS",
|
||||
"order": 1000,
|
||||
"icon": "history",
|
||||
"actions": {
|
||||
"click": "MANAGE_VERSIONS"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.versions"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.permissions",
|
||||
"title": "APP.ACTIONS.PERMISSIONS",
|
||||
"icon": "settings_input_component",
|
||||
"order": 1100,
|
||||
"actions": {
|
||||
"click": "MANAGE_PERMISSIONS"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.permissions"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.purgeDeletedNodes",
|
||||
"order": 1200,
|
||||
"title": "APP.ACTIONS.DELETE_PERMANENT",
|
||||
"icon": "delete_forever",
|
||||
"actions": {
|
||||
"click": "PURGE_DELETED_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.trashcan.hasSelection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.restoreDeletedNodes",
|
||||
"order": 1300,
|
||||
"title": "APP.ACTIONS.RESTORE",
|
||||
"icon": "restore",
|
||||
"actions": {
|
||||
"click": "RESTORE_DELETED_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.trashcan.hasSelection"
|
||||
}
|
||||
}
|
||||
],
|
||||
"viewer": {
|
||||
"toolbarActions": [
|
||||
{
|
||||
"id": "app.toolbar.download",
|
||||
"order": 100,
|
||||
"title": "APP.ACTIONS.DOWNLOAD",
|
||||
"icon": "get_app",
|
||||
"actions": {
|
||||
"click": "DOWNLOAD_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canDownload"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.print",
|
||||
"order": 200,
|
||||
"title": "APP.ACTIONS.PRINT",
|
||||
"icon": "print",
|
||||
"actions": {
|
||||
"click": "PRINT_FILE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canViewFile"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.share",
|
||||
"order": 300,
|
||||
"title": "APP.ACTIONS.SHARE",
|
||||
"icon": "share",
|
||||
"actions": {
|
||||
"click": "SHARE_NODE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.file.canShare"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.fullscreen",
|
||||
"order": 400,
|
||||
"title": "APP.ACTIONS.FULLSCREEN",
|
||||
"icon": "fullscreen",
|
||||
"actions": {
|
||||
"click": "FULLSCREEN_VIEWER"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canViewFile"
|
||||
}
|
||||
}
|
||||
],
|
||||
"toolbarMoreMenu": [
|
||||
{
|
||||
"id": "app.viewer.favorite.add",
|
||||
"order": 100,
|
||||
"title": "APP.ACTIONS.FAVORITE",
|
||||
"icon": "star_border",
|
||||
"actions": {
|
||||
"click": "ADD_FAVORITE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.favorite.canAdd"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.favorite.remove",
|
||||
"order": 200,
|
||||
"title": "APP.ACTIONS.FAVORITE",
|
||||
"icon": "star",
|
||||
"actions": {
|
||||
"click": "REMOVE_FAVORITE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.favorite.canRemove"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.favorite",
|
||||
"comment": "workaround for Recent Files and Search API issue",
|
||||
"type": "custom",
|
||||
"order": 101,
|
||||
"component": "app.toolbar.toggleFavorite",
|
||||
"rules": {
|
||||
"visible": "app.toolbar.favorite.canToggle"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.share",
|
||||
"order": 300,
|
||||
"title": "APP.ACTIONS.SHARE",
|
||||
"icon": "share",
|
||||
"actions": {
|
||||
"click": "SHARE_NODE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.file.canShare"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.copy",
|
||||
"order": 400,
|
||||
"title": "APP.ACTIONS.COPY",
|
||||
"icon": "content_copy",
|
||||
"actions": {
|
||||
"click": "COPY_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canCopyNode"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.move",
|
||||
"order": 500,
|
||||
"title": "APP.ACTIONS.MOVE",
|
||||
"icon": "library_books",
|
||||
"actions": {
|
||||
"click": "MOVE_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.canDelete"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.delete",
|
||||
"order": 600,
|
||||
"title": "APP.ACTIONS.DELETE",
|
||||
"icon": "delete",
|
||||
"actions": {
|
||||
"click": "DELETE_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.canDelete"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.versions",
|
||||
"order": 700,
|
||||
"title": "APP.ACTIONS.VERSIONS",
|
||||
"icon": "history",
|
||||
"actions": {
|
||||
"click": "MANAGE_VERSIONS"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.versions"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.permissions",
|
||||
"order": 800,
|
||||
"title": "APP.ACTIONS.PERMISSIONS",
|
||||
"icon": "settings_input_component",
|
||||
"actions": {
|
||||
"click": "MANAGE_PERMISSIONS"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.permissions"
|
||||
}
|
||||
}
|
||||
],
|
||||
"content": [
|
||||
{
|
||||
"id": "app.viewer.pdf",
|
||||
"disabled": true,
|
||||
"fileExtension": "pdf",
|
||||
"component": "app.components.tabs.metadata"
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.docx",
|
||||
"disabled": true,
|
||||
"fileExtension": "docx",
|
||||
"component": "app.components.tabs.comments"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sidebar": [
|
||||
{
|
||||
"id": "app.sidebar.properties",
|
||||
"order": 100,
|
||||
"title": "APP.INFO_DRAWER.TABS.PROPERTIES",
|
||||
"component": "app.components.tabs.metadata"
|
||||
},
|
||||
{
|
||||
"id": "app.sidebar.comments",
|
||||
"order": 200,
|
||||
"title": "APP.INFO_DRAWER.TABS.COMMENTS",
|
||||
"component": "app.components.tabs.comments"
|
||||
},
|
||||
{
|
||||
"id": "app.sidebar.versions",
|
||||
"order": 300,
|
||||
"disabled": true,
|
||||
"title": "APP.INFO_DRAWER.TABS.VERSIONS",
|
||||
"component": "app.components.tabs.versions"
|
||||
}
|
||||
],
|
||||
"content-metadata-presets": [
|
||||
{
|
||||
"id": "app.content.metadata.custom",
|
||||
"custom": [
|
||||
{
|
||||
"id": "app.content.metadata.customGroup",
|
||||
"title": "APP.CONTENT_METADATA.EXIF_GROUP_TITLE",
|
||||
"items": [
|
||||
{
|
||||
"id": "app.content.metadata.exifAspect",
|
||||
"aspect": "exif:exif",
|
||||
"properties": [
|
||||
"exif:pixelXDimension",
|
||||
"exif:pixelYDimension",
|
||||
"exif:dateTimeOriginal",
|
||||
"exif:exposureTime",
|
||||
"exif:fNumber",
|
||||
"exif:flash",
|
||||
"exif:focalLength",
|
||||
"exif:isoSpeedRatings",
|
||||
"exif:orientation",
|
||||
"exif:manufacturer",
|
||||
"exif:model",
|
||||
"exif:software"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"header": [
|
||||
{
|
||||
"id": "app.header.more",
|
||||
"type": "menu",
|
||||
"order": 10000,
|
||||
"icon": "more_vert",
|
||||
"title": "APP.ACTIONS.MORE",
|
||||
"children": [
|
||||
{
|
||||
"id": "settings",
|
||||
"title": "App settings",
|
||||
"description": "Application settings",
|
||||
"icon": "settings",
|
||||
"disabled": true,
|
||||
"actions": {
|
||||
"click": "app.actions.settings"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canViewFile"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "button",
|
||||
"title": "New Button",
|
||||
"description": "new button description",
|
||||
"icon": "alarm_on",
|
||||
"actions": {
|
||||
"click": "app.actions.settings"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canViewFile"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,920 @@
|
||||
{
|
||||
"$schema": "../../extension.schema.json",
|
||||
"$name": "app",
|
||||
"$version": "1.0.0",
|
||||
"$references": [
|
||||
"plugin1.json",
|
||||
"dev.tools.json",
|
||||
"app.header.json",
|
||||
"app.create.json"
|
||||
],
|
||||
|
||||
"rules": [
|
||||
{
|
||||
"id": "app.toolbar.favorite.canToggle",
|
||||
"comment": "workaround for recent files and search api issue",
|
||||
"type": "core.every",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "core.some",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "app.selection.canAddFavorite"
|
||||
},
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "app.selection.canRemoveFavorite"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "core.some",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "app.navigation.isRecentFiles"
|
||||
},
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "app.navigation.isSharedFiles"
|
||||
},
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "app.navigation.isSearchResults"
|
||||
},
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "app.navigation.isFavorites"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.favorite.canAdd",
|
||||
"type": "core.every",
|
||||
"parameters": [
|
||||
{ "type": "rule", "value": "app.selection.canAddFavorite" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotRecentFiles" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotSharedFiles" },
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "app.navigation.isNotSearchResults"
|
||||
},
|
||||
{ "type": "rule", "value": "app.navigation.isNotFavorites" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.favorite.canRemove",
|
||||
"type": "core.every",
|
||||
"parameters": [
|
||||
{ "type": "rule", "value": "app.selection.canRemoveFavorite" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotRecentFiles" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotSharedFiles" },
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "app.navigation.isNotSearchResults"
|
||||
},
|
||||
{ "type": "rule", "value": "app.navigation.isNotFavorites" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.info",
|
||||
"type": "core.every",
|
||||
"parameters": [
|
||||
{ "type": "rule", "value": "app.selection.notEmpty" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotLibraries" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotTrashcan" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.canCopyNode",
|
||||
"type": "core.every",
|
||||
"parameters": [
|
||||
{ "type": "rule", "value": "app.selection.notEmpty" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotTrashcan" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotLibraries" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.permissions",
|
||||
"type": "core.every",
|
||||
"parameters": [
|
||||
{ "type": "rule", "value": "app.selection.first.canUpdate" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotTrashcan" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.versions",
|
||||
"type": "core.every",
|
||||
"parameters": [
|
||||
{ "type": "rule", "value": "app.selection.file" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotTrashcan" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "app.trashcan.hasSelection",
|
||||
"type": "core.every",
|
||||
"parameters": [
|
||||
{ "type": "rule", "value": "app.selection.notEmpty" },
|
||||
{ "type": "rule", "value": "app.navigation.isTrashcan" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.canEditFolder",
|
||||
"type": "core.every",
|
||||
"parameters": [
|
||||
{ "type": "rule", "value": "app.selection.folder" },
|
||||
{ "type": "rule", "value": "app.selection.folder.canUpdate" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotTrashcan" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.canViewFile",
|
||||
"type": "core.every",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "app.selection.file"
|
||||
},
|
||||
{
|
||||
"type": "rule",
|
||||
"value": "core.not",
|
||||
"parameters": [
|
||||
{ "type": "rule", "value": "app.navigation.isTrashcan" }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.canDownload",
|
||||
"type": "core.every",
|
||||
"parameters": [
|
||||
{ "type": "rule", "value": "app.selection.canDownload" },
|
||||
{ "type": "rule", "value": "app.navigation.isNotTrashcan" }
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
"features": {
|
||||
"create": [
|
||||
{
|
||||
"id": "app.create.uploadFile",
|
||||
"order": 100,
|
||||
"icon": "file_upload",
|
||||
"title": "APP.NEW_MENU.MENU_ITEMS.UPLOAD_FILE",
|
||||
"description": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FILES",
|
||||
"description-disabled": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FILES_NOT_ALLOWED",
|
||||
"actions": {
|
||||
"click": "UPLOAD_FILES"
|
||||
},
|
||||
"rules": {
|
||||
"enabled": "app.navigation.folder.canUpload"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.create.uploadFolder",
|
||||
"order": 200,
|
||||
"icon": "file_upload",
|
||||
"title": "APP.NEW_MENU.MENU_ITEMS.UPLOAD_FOLDER",
|
||||
"description": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FOLDERS",
|
||||
"description-disabled": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FOLDERS_NOT_ALLOWED",
|
||||
"actions": {
|
||||
"click": "UPLOAD_FOLDER"
|
||||
},
|
||||
"rules": {
|
||||
"enabled": "app.navigation.folder.canUpload"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.create.separator.1",
|
||||
"type": "separator",
|
||||
"order": 300
|
||||
},
|
||||
{
|
||||
"id": "app.create.folder",
|
||||
"order": 400,
|
||||
"icon": "create_new_folder",
|
||||
"title": "APP.NEW_MENU.MENU_ITEMS.CREATE_FOLDER",
|
||||
"description": "APP.NEW_MENU.TOOLTIPS.CREATE_FOLDER",
|
||||
"description-disabled": "APP.NEW_MENU.TOOLTIPS.CREATE_FOLDER_NOT_ALLOWED",
|
||||
"actions": {
|
||||
"click": "CREATE_FOLDER"
|
||||
},
|
||||
"rules": {
|
||||
"enabled": "app.navigation.folder.canCreate"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.create.library",
|
||||
"order": 600,
|
||||
"title": "APP.NEW_MENU.MENU_ITEMS.CREATE_LIBRARY",
|
||||
"description": "APP.NEW_MENU.TOOLTIPS.CREATE_LIBRARY",
|
||||
"icon": "create_new_folder",
|
||||
"actions": {
|
||||
"click": "CREATE_LIBRARY"
|
||||
}
|
||||
}
|
||||
],
|
||||
"navbar": [
|
||||
{
|
||||
"id": "app.navbar.primary",
|
||||
"items": [
|
||||
{
|
||||
"id": "app.navbar.personalFiles",
|
||||
"order": 100,
|
||||
"icon": "folder",
|
||||
"title": "APP.BROWSE.PERSONAL.SIDENAV_LINK.LABEL",
|
||||
"description": "APP.BROWSE.PERSONAL.SIDENAV_LINK.TOOLTIP",
|
||||
"route": "personal-files"
|
||||
},
|
||||
{
|
||||
"id": "app.navbar.libraries",
|
||||
"order": 200,
|
||||
"icon": "group_work",
|
||||
"title": "APP.BROWSE.LIBRARIES.SIDENAV_LINK.LABEL",
|
||||
"description": "APP.BROWSE.LIBRARIES.SIDENAV_LINK.TOOLTIP",
|
||||
"route": "libraries"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "app.navbar.secondary",
|
||||
"items": [
|
||||
{
|
||||
"id": "app.navbar.shared",
|
||||
"order": 100,
|
||||
"icon": "people",
|
||||
"title": "APP.BROWSE.SHARED.SIDENAV_LINK.LABEL",
|
||||
"description": "APP.BROWSE.SHARED.SIDENAV_LINK.TOOLTIP",
|
||||
"route": "shared",
|
||||
"rules": {
|
||||
"visible": "repository.isQuickShareEnabled"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.navbar.recentFiles",
|
||||
"order": 200,
|
||||
"icon": "schedule",
|
||||
"title": "APP.BROWSE.RECENT.SIDENAV_LINK.LABEL",
|
||||
"description": "APP.BROWSE.RECENT.SIDENAV_LINK.TOOLTIP",
|
||||
"route": "recent-files"
|
||||
},
|
||||
{
|
||||
"id": "app.navbar.favorites",
|
||||
"order": 300,
|
||||
"icon": "star",
|
||||
"title": "APP.BROWSE.FAVORITES.SIDENAV_LINK.LABEL",
|
||||
"description": "APP.BROWSE.FAVORITES.SIDENAV_LINK.TOOLTIP",
|
||||
"route": "favorites"
|
||||
},
|
||||
{
|
||||
"id": "app.navbar.trashcan",
|
||||
"order": 400,
|
||||
"icon": "delete",
|
||||
"title": "APP.BROWSE.TRASHCAN.SIDENAV_LINK.LABEL",
|
||||
"description": "APP.BROWSE.TRASHCAN.SIDENAV_LINK.TOOLTIP",
|
||||
"route": "trashcan"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"toolbar": [
|
||||
{
|
||||
"id": "app.toolbar.preview",
|
||||
"order": 100,
|
||||
"title": "APP.ACTIONS.VIEW",
|
||||
"icon": "open_in_browser",
|
||||
"actions": {
|
||||
"click": "VIEW_FILE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canViewFile"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.download",
|
||||
"order": 200,
|
||||
"title": "APP.ACTIONS.DOWNLOAD",
|
||||
"icon": "get_app",
|
||||
"actions": {
|
||||
"click": "DOWNLOAD_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canDownload"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.editFolder",
|
||||
"order": 300,
|
||||
"title": "APP.ACTIONS.EDIT",
|
||||
"icon": "create",
|
||||
"actions": {
|
||||
"click": "EDIT_FOLDER"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canEditFolder"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.purgeDeletedNodes",
|
||||
"order": 400,
|
||||
"title": "APP.ACTIONS.DELETE_PERMANENT",
|
||||
"icon": "delete_forever",
|
||||
"actions": {
|
||||
"click": "PURGE_DELETED_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.trashcan.hasSelection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.restoreDeletedNodes",
|
||||
"order": 500,
|
||||
"title": "APP.ACTIONS.RESTORE",
|
||||
"icon": "restore",
|
||||
"actions": {
|
||||
"click": "RESTORE_DELETED_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.trashcan.hasSelection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.info",
|
||||
"type": "custom",
|
||||
"order": 700,
|
||||
"component": "app.toolbar.toggleInfoDrawer",
|
||||
"rules": {
|
||||
"visible": "app.toolbar.info"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.more",
|
||||
"type": "menu",
|
||||
"order": 10000,
|
||||
"icon": "more_vert",
|
||||
"title": "APP.ACTIONS.MORE",
|
||||
"children": [
|
||||
{
|
||||
"id": "app.toolbar.favorite",
|
||||
"comment": "workaround for Recent Files and Search API issue",
|
||||
"type": "custom",
|
||||
"order": 100,
|
||||
"component": "app.toolbar.toggleFavorite",
|
||||
"rules": {
|
||||
"visible": "app.toolbar.favorite.canToggle"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.favorite.add",
|
||||
"order": 200,
|
||||
"title": "APP.ACTIONS.FAVORITE",
|
||||
"icon": "star_border",
|
||||
"actions": {
|
||||
"click": "ADD_FAVORITE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.favorite.canAdd"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.favorite.remove",
|
||||
"order": 300,
|
||||
"title": "APP.ACTIONS.FAVORITE",
|
||||
"icon": "star",
|
||||
"actions": {
|
||||
"click": "REMOVE_FAVORITE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.favorite.canRemove"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.copy",
|
||||
"order": 400,
|
||||
"title": "APP.ACTIONS.COPY",
|
||||
"icon": "content_copy",
|
||||
"actions": {
|
||||
"click": "COPY_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canCopyNode"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.move",
|
||||
"order": 500,
|
||||
"title": "APP.ACTIONS.MOVE",
|
||||
"icon": "library_books",
|
||||
"actions": {
|
||||
"click": "MOVE_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.canDelete"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.share",
|
||||
"order": 600,
|
||||
"title": "APP.ACTIONS.SHARE",
|
||||
"icon": "share",
|
||||
"actions": {
|
||||
"click": "SHARE_NODE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.file.canShare"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.unshare",
|
||||
"order": 700,
|
||||
"title": "APP.ACTIONS.UNSHARE",
|
||||
"icon": "stop_screen_share",
|
||||
"actions": {
|
||||
"click": "UNSHARE_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.canUnshare"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.delete",
|
||||
"order": 800,
|
||||
"title": "APP.ACTIONS.DELETE",
|
||||
"icon": "delete",
|
||||
"actions": {
|
||||
"click": "DELETE_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.canDelete"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.deleteLibrary",
|
||||
"order": 900,
|
||||
"title": "APP.ACTIONS.DELETE",
|
||||
"icon": "delete",
|
||||
"actions": {
|
||||
"click": "DELETE_LIBRARY"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.library"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.versions",
|
||||
"order": 1000,
|
||||
"title": "APP.ACTIONS.VERSIONS",
|
||||
"icon": "history",
|
||||
"actions": {
|
||||
"click": "MANAGE_VERSIONS"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.versions"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.permissions",
|
||||
"order": 1100,
|
||||
"title": "APP.ACTIONS.PERMISSIONS",
|
||||
"icon": "settings_input_component",
|
||||
"actions": {
|
||||
"click": "MANAGE_PERMISSIONS"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.permissions"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"contextMenu": [
|
||||
{
|
||||
"id": "app.context.menu.download",
|
||||
"order": 100,
|
||||
"title": "APP.ACTIONS.DOWNLOAD",
|
||||
"icon": "get_app",
|
||||
"actions": {
|
||||
"click": "DOWNLOAD_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canDownload"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.preview",
|
||||
"order": 200,
|
||||
"title": "APP.ACTIONS.VIEW",
|
||||
"icon": "open_in_browser",
|
||||
"actions": {
|
||||
"click": "VIEW_FILE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canViewFile"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.editFolder",
|
||||
"order": 300,
|
||||
"title": "APP.ACTIONS.EDIT",
|
||||
"icon": "create",
|
||||
"actions": {
|
||||
"click": "EDIT_FOLDER"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canEditFolder"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.share",
|
||||
"title": "APP.ACTIONS.SHARE",
|
||||
"order": 400,
|
||||
"icon": "share",
|
||||
"actions": {
|
||||
"click": "SHARE_NODE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.file.canShare"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.favorite.add",
|
||||
"title": "APP.ACTIONS.FAVORITE",
|
||||
"order": 500,
|
||||
"icon": "star_border",
|
||||
"actions": {
|
||||
"click": "ADD_FAVORITE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.favorite.canAdd"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.favorite.remove",
|
||||
"title": "APP.ACTIONS.FAVORITE",
|
||||
"order": 600,
|
||||
"icon": "star",
|
||||
"actions": {
|
||||
"click": "REMOVE_FAVORITE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.favorite.canRemove"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.favorite",
|
||||
"comment": "workaround for Recent Files and Search API issue",
|
||||
"type": "custom",
|
||||
"order": 501,
|
||||
"component": "app.toolbar.toggleFavorite",
|
||||
"rules": {
|
||||
"visible": "app.toolbar.favorite.canToggle"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.copy",
|
||||
"title": "APP.ACTIONS.COPY",
|
||||
"order": 700,
|
||||
"icon": "content_copy",
|
||||
"actions": {
|
||||
"click": "COPY_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canCopyNode"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.move",
|
||||
"title": "APP.ACTIONS.MOVE",
|
||||
"order": 800,
|
||||
"icon": "library_books",
|
||||
"actions": {
|
||||
"click": "MOVE_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.canDelete"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.delete",
|
||||
"title": "APP.ACTIONS.DELETE",
|
||||
"order": 900,
|
||||
"icon": "delete",
|
||||
"actions": {
|
||||
"click": "DELETE_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.canDelete"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.versions",
|
||||
"title": "APP.ACTIONS.VERSIONS",
|
||||
"order": 1000,
|
||||
"icon": "history",
|
||||
"actions": {
|
||||
"click": "MANAGE_VERSIONS"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.versions"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.permissions",
|
||||
"title": "APP.ACTIONS.PERMISSIONS",
|
||||
"icon": "settings_input_component",
|
||||
"order": 1100,
|
||||
"actions": {
|
||||
"click": "MANAGE_PERMISSIONS"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.permissions"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.purgeDeletedNodes",
|
||||
"order": 1200,
|
||||
"title": "APP.ACTIONS.DELETE_PERMANENT",
|
||||
"icon": "delete_forever",
|
||||
"actions": {
|
||||
"click": "PURGE_DELETED_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.trashcan.hasSelection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.context.menu.restoreDeletedNodes",
|
||||
"order": 1300,
|
||||
"title": "APP.ACTIONS.RESTORE",
|
||||
"icon": "restore",
|
||||
"actions": {
|
||||
"click": "RESTORE_DELETED_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.trashcan.hasSelection"
|
||||
}
|
||||
}
|
||||
],
|
||||
"viewer": {
|
||||
"toolbarActions": [
|
||||
{
|
||||
"id": "app.toolbar.download",
|
||||
"order": 100,
|
||||
"title": "APP.ACTIONS.DOWNLOAD",
|
||||
"icon": "get_app",
|
||||
"actions": {
|
||||
"click": "DOWNLOAD_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canDownload"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.print",
|
||||
"order": 200,
|
||||
"title": "APP.ACTIONS.PRINT",
|
||||
"icon": "print",
|
||||
"actions": {
|
||||
"click": "PRINT_FILE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canViewFile"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.share",
|
||||
"order": 300,
|
||||
"title": "APP.ACTIONS.SHARE",
|
||||
"icon": "share",
|
||||
"actions": {
|
||||
"click": "SHARE_NODE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.file.canShare"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.fullscreen",
|
||||
"order": 400,
|
||||
"title": "APP.ACTIONS.FULLSCREEN",
|
||||
"icon": "fullscreen",
|
||||
"actions": {
|
||||
"click": "FULLSCREEN_VIEWER"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canViewFile"
|
||||
}
|
||||
}
|
||||
],
|
||||
"toolbarMoreMenu": [
|
||||
{
|
||||
"id": "app.viewer.favorite.add",
|
||||
"order": 100,
|
||||
"title": "APP.ACTIONS.FAVORITE",
|
||||
"icon": "star_border",
|
||||
"actions": {
|
||||
"click": "ADD_FAVORITE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.favorite.canAdd"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.favorite.remove",
|
||||
"order": 200,
|
||||
"title": "APP.ACTIONS.FAVORITE",
|
||||
"icon": "star",
|
||||
"actions": {
|
||||
"click": "REMOVE_FAVORITE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.favorite.canRemove"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.favorite",
|
||||
"comment": "workaround for Recent Files and Search API issue",
|
||||
"type": "custom",
|
||||
"order": 101,
|
||||
"component": "app.toolbar.toggleFavorite",
|
||||
"rules": {
|
||||
"visible": "app.toolbar.favorite.canToggle"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.share",
|
||||
"order": 300,
|
||||
"title": "APP.ACTIONS.SHARE",
|
||||
"icon": "share",
|
||||
"actions": {
|
||||
"click": "SHARE_NODE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.file.canShare"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.copy",
|
||||
"order": 400,
|
||||
"title": "APP.ACTIONS.COPY",
|
||||
"icon": "content_copy",
|
||||
"actions": {
|
||||
"click": "COPY_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canCopyNode"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.move",
|
||||
"order": 500,
|
||||
"title": "APP.ACTIONS.MOVE",
|
||||
"icon": "library_books",
|
||||
"actions": {
|
||||
"click": "MOVE_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.canDelete"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.delete",
|
||||
"order": 600,
|
||||
"title": "APP.ACTIONS.DELETE",
|
||||
"icon": "delete",
|
||||
"actions": {
|
||||
"click": "DELETE_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.canDelete"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.versions",
|
||||
"order": 700,
|
||||
"title": "APP.ACTIONS.VERSIONS",
|
||||
"icon": "history",
|
||||
"actions": {
|
||||
"click": "MANAGE_VERSIONS"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.versions"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.permissions",
|
||||
"order": 800,
|
||||
"title": "APP.ACTIONS.PERMISSIONS",
|
||||
"icon": "settings_input_component",
|
||||
"actions": {
|
||||
"click": "MANAGE_PERMISSIONS"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.permissions"
|
||||
}
|
||||
}
|
||||
],
|
||||
"content": [
|
||||
{
|
||||
"id": "app.viewer.pdf",
|
||||
"disabled": true,
|
||||
"fileExtension": "pdf",
|
||||
"component": "app.components.tabs.metadata"
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.docx",
|
||||
"disabled": true,
|
||||
"fileExtension": "docx",
|
||||
"component": "app.components.tabs.comments"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sidebar": [
|
||||
{
|
||||
"id": "app.sidebar.properties",
|
||||
"order": 100,
|
||||
"title": "APP.INFO_DRAWER.TABS.PROPERTIES",
|
||||
"component": "app.components.tabs.metadata"
|
||||
},
|
||||
{
|
||||
"id": "app.sidebar.comments",
|
||||
"order": 200,
|
||||
"title": "APP.INFO_DRAWER.TABS.COMMENTS",
|
||||
"component": "app.components.tabs.comments"
|
||||
},
|
||||
{
|
||||
"id": "app.sidebar.versions",
|
||||
"order": 300,
|
||||
"disabled": true,
|
||||
"title": "APP.INFO_DRAWER.TABS.VERSIONS",
|
||||
"component": "app.components.tabs.versions"
|
||||
}
|
||||
],
|
||||
"content-metadata-presets": [
|
||||
{
|
||||
"id": "app.content.metadata.custom",
|
||||
"custom": [
|
||||
{
|
||||
"id": "a.testGroup",
|
||||
"title": "A Test Group of Properties",
|
||||
"items": [
|
||||
{
|
||||
"id": "app.content.metadata.exifAspect",
|
||||
"aspect": "exif:exif",
|
||||
"properties": [
|
||||
"exif:pixelXDimension",
|
||||
"exif:pixelYDimension",
|
||||
"exif:dateTimeOriginal",
|
||||
"exif:exposureTime",
|
||||
"exif:fNumber",
|
||||
"exif:flash",
|
||||
"exif:focalLength",
|
||||
"exif:isoSpeedRatings",
|
||||
"exif:orientation",
|
||||
"exif:manufacturer",
|
||||
"exif:model",
|
||||
"exif:software"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "another.testGroup",
|
||||
"title": "Another Test Group of Properties",
|
||||
"disabled": false,
|
||||
"items": [
|
||||
{
|
||||
"id": "testAspects",
|
||||
"aspect": "exif:exif",
|
||||
"properties": [
|
||||
"exif:pixelXDimension",
|
||||
"exif:pixelYDimension"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "disabled.testGroup",
|
||||
"title": "Hidden Group of Properties",
|
||||
"disabled": true,
|
||||
"items": [
|
||||
{
|
||||
"id": "testAspects",
|
||||
"aspect": "exif:exif",
|
||||
"properties": [
|
||||
"exif:pixelXDimension",
|
||||
"exif:pixelYDimension"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -628,7 +628,70 @@
|
||||
}
|
||||
],
|
||||
"viewer": {
|
||||
"toolbar": [
|
||||
"toolbarActions": [
|
||||
{
|
||||
"id": "app.toolbar.download",
|
||||
"order": 100,
|
||||
"title": "My custom title",
|
||||
"icon": "get_app",
|
||||
"actions": {
|
||||
"click": "DOWNLOAD_NODES"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canDownload"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.my-action",
|
||||
"order": 150,
|
||||
"title": "My action",
|
||||
"icon": "http",
|
||||
"actions": {
|
||||
"click": "SHARE_NODE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.file.canShare"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.print",
|
||||
"order": 200,
|
||||
"title": "APP.ACTIONS.PRINT",
|
||||
"icon": "print",
|
||||
"disabled": true,
|
||||
"actions": {
|
||||
"click": "PRINT_FILE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canViewFile"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.share",
|
||||
"order": 300,
|
||||
"title": "APP.ACTIONS.SHARE",
|
||||
"icon": "share",
|
||||
"actions": {
|
||||
"click": "SHARE_NODE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.selection.file.canShare"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.fullscreen",
|
||||
"order": 400,
|
||||
"title": "APP.ACTIONS.FULLSCREEN",
|
||||
"icon": "fullscreen",
|
||||
"actions": {
|
||||
"click": "FULLSCREEN_VIEWER"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canViewFile"
|
||||
}
|
||||
}
|
||||
],
|
||||
"toolbarMoreMenu": [
|
||||
{
|
||||
"id": "app.viewer.favorite.add",
|
||||
"order": 100,
|
||||
@@ -653,6 +716,28 @@
|
||||
"visible": "app.toolbar.favorite.canRemove"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.favorite",
|
||||
"comment": "workaround for Recent Files and Search API issue",
|
||||
"type": "custom",
|
||||
"order": 101,
|
||||
"component": "app.toolbar.toggleFavorite",
|
||||
"rules": {
|
||||
"visible": "app.toolbar.favorite.canToggle"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.toolbar.my-secondary-action",
|
||||
"order": 150,
|
||||
"title": "My secondary action",
|
||||
"icon": "alarm",
|
||||
"actions": {
|
||||
"click": "PRINT_FILE"
|
||||
},
|
||||
"rules": {
|
||||
"visible": "app.toolbar.canViewFile"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "app.viewer.share",
|
||||
"order": 300,
|
||||
@@ -680,7 +765,7 @@
|
||||
{
|
||||
"id": "app.viewer.move",
|
||||
"order": 500,
|
||||
"title": "APP.ACTIONS.MOVE",
|
||||
"title": "My new title",
|
||||
"icon": "library_books",
|
||||
"actions": {
|
||||
"click": "MOVE_NODES"
|
||||
@@ -717,6 +802,7 @@
|
||||
"id": "app.viewer.permissions",
|
||||
"order": 800,
|
||||
"title": "APP.ACTIONS.PERMISSIONS",
|
||||
"disabled": true,
|
||||
"icon": "settings_input_component",
|
||||
"actions": {
|
||||
"click": "MANAGE_PERMISSIONS"
|
||||
|
||||
+379
@@ -0,0 +1,379 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2018 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, LogoutPage, BrowsingPage } from '../../pages/pages';
|
||||
import { SITE_VISIBILITY, SIDEBAR_LABELS } from '../../configs';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
|
||||
describe('Context menu actions - multiple selection : ', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const file1 = `file1-${Utils.random()}.txt`; let file1Id;
|
||||
const file2 = `file2-${Utils.random()}.txt`; let file2Id;
|
||||
|
||||
const folder1 = `folder1-${Utils.random()}`; let folder1Id;
|
||||
const folder2 = `folder2-${Utils.random()}`; let folder2Id;
|
||||
|
||||
const fileInTrash1 = `deletedFile1-${Utils.random()}.txt`; let fileInTrash1Id;
|
||||
const fileInTrash2 = `deletedFile2-${Utils.random()}.txt`; let fileInTrash2Id;
|
||||
const folderInTrash1 = `deletedFolder1-${Utils.random()}`; let folderInTrash1Id;
|
||||
const folderInTrash2 = `deletedFolder2-${Utils.random()}`; let folderInTrash2Id;
|
||||
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const file1Site = `file1-${Utils.random()}.txt`;
|
||||
const file2Site = `file2-${Utils.random()}.txt`;
|
||||
const folder1Site = `folder1-${Utils.random()}`;
|
||||
const folder2Site = `folder2-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
const contextMenu = dataTable.menu;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
file1Id = (await apis.user.nodes.createFile(file1)).entry.id;
|
||||
file2Id = (await apis.user.nodes.createFile(file2)).entry.id;
|
||||
folder1Id = (await apis.user.nodes.createFolder(folder1)).entry.id;
|
||||
folder2Id = (await apis.user.nodes.createFolder(folder2)).entry.id;
|
||||
|
||||
await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
const docLibId = (await apis.user.sites.getDocLibId(siteName));
|
||||
await apis.user.nodes.createFile(file1Site, docLibId);
|
||||
await apis.user.nodes.createFile(file2Site, docLibId);
|
||||
await apis.user.nodes.createFolder(folder1Site, docLibId);
|
||||
await apis.user.nodes.createFile(folder2Site, docLibId);
|
||||
|
||||
await apis.user.shared.shareFilesByIds([ file1Id, file2Id ]);
|
||||
await apis.user.shared.waitForApi({ expect: 2 });
|
||||
|
||||
await apis.user.favorites.addFavoritesByIds('file', [ file1Id, file2Id ]);
|
||||
await apis.user.favorites.addFavoritesByIds('folder', [ folder1Id, folder2Id ]);
|
||||
await apis.user.favorites.waitForApi({ expect: 4 + 1 });
|
||||
|
||||
fileInTrash1Id = (await apis.user.nodes.createFile(fileInTrash1)).entry.id;
|
||||
fileInTrash2Id = (await apis.user.nodes.createFile(fileInTrash2)).entry.id;
|
||||
folderInTrash1Id = (await apis.user.nodes.createFolder(folderInTrash1)).entry.id;
|
||||
folderInTrash2Id = (await apis.user.nodes.createFolder(folderInTrash2)).entry.id;
|
||||
await apis.user.nodes.deleteNodesById([ fileInTrash1Id, fileInTrash2Id, folderInTrash1Id, folderInTrash2Id ], false);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodesById([ file1Id, file2Id, folder1Id, folder2Id ]);
|
||||
await apis.user.sites.deleteSite(siteName);
|
||||
await apis.user.trashcan.emptyTrash();
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
xit('');
|
||||
|
||||
describe('Generic tests', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Context menu appears on right click on a multiple selection of items - [C286268]', async () => {
|
||||
await dataTable.selectMultipleItems([ file1, file2 ]);
|
||||
// await dataTable.rightClickOnItem(file1);
|
||||
await dataTable.rightClickOnMultipleSelection();
|
||||
expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed');
|
||||
});
|
||||
|
||||
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 for ${file1}`);
|
||||
expect(await dataTable.countSelectedRows()).toEqual(1, 'incorrect number of selected rows');
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, `Edit 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`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on Personal Files', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple files are selected - [C280661]', async () => {
|
||||
await dataTable.selectMultipleItems([file1, file2]);
|
||||
await dataTable.rightClickOnMultipleSelection();
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(true, `Permissions is not displayed`);
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple folders are selected - [C280632]', async () => {
|
||||
await dataTable.selectMultipleItems([folder1, folder2]);
|
||||
await dataTable.rightClickOnMultipleSelection();
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(true, `Permissions is not displayed`);
|
||||
});
|
||||
|
||||
it('correct actions appear when both files and folders are selected - [C280631]', async () => {
|
||||
await dataTable.selectMultipleItems([file1, file2, folder1, folder2]);
|
||||
await dataTable.rightClickOnMultipleSelection();
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(true, `Permissions is not displayed`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on File Libraries', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple files are selected - [C280641]', async () => {
|
||||
await dataTable.selectMultipleItems([ file1Site, file2Site ]);
|
||||
await dataTable.rightClickOnMultipleSelection();
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(true, `Permissions is not displayed`);
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple folders are selected - [C280574]', async () => {
|
||||
await dataTable.selectMultipleItems([ folder1Site, folder2Site ]);
|
||||
await dataTable.rightClickOnMultipleSelection();
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(true, `Permissions is not displayed`);
|
||||
});
|
||||
|
||||
it('correct actions appear when both files and folders are selected - [C280642]', async () => {
|
||||
await dataTable.selectMultipleItems([ file1Site, file2Site, folder1Site, folder2Site ]);
|
||||
await dataTable.rightClickOnMultipleSelection();
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(true, `Permissions is not displayed`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on Shared Files', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple files are selected - [C280648]', async () => {
|
||||
await dataTable.selectMultipleItems([ file1, file2 ]);
|
||||
await dataTable.rightClickOnMultipleSelection();
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(true, `Permissions is not displayed`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Recent Files', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple files are selected - [C280652]', async () => {
|
||||
await dataTable.selectMultipleItems([ file1, file2 ]);
|
||||
await dataTable.rightClickOnMultipleSelection();
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(true, `Permissions is not displayed`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Favorites', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple files are selected - [C280656]', async () => {
|
||||
await dataTable.selectMultipleItems([ file1, file2 ]);
|
||||
await dataTable.rightClickOnMultipleSelection();
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
// TODO: enable when ACA-1794 is fixed
|
||||
// expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(true, `Permissions is not displayed`);
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple folders are selected - [C280664]', async () => {
|
||||
await dataTable.selectMultipleItems([ folder1, folder2 ]);
|
||||
await dataTable.rightClickOnMultipleSelection();
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
// TODO: enable when ACA-1794 is fixed
|
||||
// expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(true, `Permissions is not displayed`);
|
||||
});
|
||||
|
||||
it('correct actions appear when both files and folders are selected - [C280657]', async () => {
|
||||
await dataTable.selectMultipleItems([ file1, file2, folder1, folder2 ]);
|
||||
await dataTable.rightClickOnMultipleSelection();
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
// TODO: enable when ACA-1794 is fixed
|
||||
// expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(true, `Permissions is not displayed`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Trash', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple files are selected - [C286273]', async () => {
|
||||
await dataTable.selectMultipleItems([ fileInTrash1, fileInTrash2 ]);
|
||||
await dataTable.rightClickOnMultipleSelection();
|
||||
expect(await contextMenu.isMenuItemPresent('Permanently delete')).toBe(true, 'Permanently delete is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Restore')).toBe(true, 'Restore is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(false, 'Download is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(false, `Copy is displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(false, `Move is displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(false, `Favorite is displayed`);
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple folders are selected - [C286274]', async () => {
|
||||
await dataTable.selectMultipleItems([ folderInTrash1, folderInTrash2 ]);
|
||||
await dataTable.rightClickOnMultipleSelection();
|
||||
expect(await contextMenu.isMenuItemPresent('Permanently delete')).toBe(true, 'Permanently delete is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Restore')).toBe(true, 'Restore is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(false, 'Download is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(false, `Copy is displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(false, `Move is displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(false, `Favorite is displayed`);
|
||||
});
|
||||
|
||||
it('correct actions appear when both files and folders are selected - [C286275]', async () => {
|
||||
await dataTable.selectMultipleItems([ fileInTrash1, fileInTrash2, folderInTrash1, folderInTrash2 ]);
|
||||
await dataTable.rightClickOnMultipleSelection();
|
||||
expect(await contextMenu.isMenuItemPresent('Permanently delete')).toBe(true, 'Permanently delete is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Restore')).toBe(true, 'Restore is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(false, 'Download is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(false, `Copy is displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(false, `Move is displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(false, `Favorite is displayed`);
|
||||
});
|
||||
});
|
||||
});
|
||||
+353
@@ -0,0 +1,353 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2018 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 { browser, protractor } from 'protractor';
|
||||
import { LoginPage, LogoutPage, BrowsingPage } from '../../pages/pages';
|
||||
import { SITE_VISIBILITY, SIDEBAR_LABELS } from '../../configs';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
|
||||
describe('Context menu actions - single selection : ', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const fileUser = `fileUser-${Utils.random()}.txt`; let fileUserId;
|
||||
const folderUser = `folderUser-${Utils.random()}`; let folderUserId;
|
||||
const fileInTrash = `fileForDelete-${Utils.random()}.txt`; let fileInTrashId;
|
||||
const folderInTrash = `folderForDelete-${Utils.random()}`; let folderInTrashId;
|
||||
|
||||
const siteName = `userSite-${Utils.random()}`;
|
||||
const fileSiteUser = `fileUser-${Utils.random()}.txt`;
|
||||
const folderSiteUser = `folderUser-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
const contextMenu = dataTable.menu;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
|
||||
fileUserId = (await apis.user.nodes.createFile(fileUser)).entry.id;
|
||||
folderUserId = (await apis.user.nodes.createFolder(folderUser)).entry.id;
|
||||
|
||||
await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
const docLibId = await apis.user.sites.getDocLibId(siteName);
|
||||
await apis.user.nodes.createFile(fileSiteUser, docLibId);
|
||||
await apis.user.nodes.createFolder(folderSiteUser, docLibId);
|
||||
|
||||
fileInTrashId = (await apis.user.nodes.createFiles([fileInTrash])).entry.id;
|
||||
folderInTrashId = (await apis.user.nodes.createFolders([ folderInTrash ])).entry.id;
|
||||
await apis.user.nodes.deleteNodeById(fileInTrashId, false);
|
||||
await apis.user.nodes.deleteNodeById(folderInTrashId, false);
|
||||
|
||||
await apis.user.shared.shareFileById(fileUserId);
|
||||
await apis.user.shared.waitForApi({ expect: 1 });
|
||||
|
||||
await apis.user.favorites.addFavoriteById('file', fileUserId);
|
||||
await apis.user.favorites.addFavoriteById('folder', folderUserId);
|
||||
await apis.user.favorites.waitForApi({ expect: 3 });
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodeById(fileUserId);
|
||||
await apis.user.nodes.deleteNodeById(folderUserId);
|
||||
await apis.user.sites.deleteSite(siteName);
|
||||
await apis.user.trashcan.emptyTrash();
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
xit('');
|
||||
|
||||
describe('Generic tests', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Row is marked with a check circle icon on direct right click - [C286252]', async () => {
|
||||
await dataTable.rightClickOnItem(fileUser);
|
||||
expect(await dataTable.hasCheckMarkIcon(fileUser)).toBe(true, 'check mark missing');
|
||||
});
|
||||
|
||||
it('Context menu appears on direct right click on an item - [C286253]', async () => {
|
||||
await dataTable.rightClickOnItem(fileUser);
|
||||
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(fileUser);
|
||||
await dataTable.rightClickOnItem(fileUser);
|
||||
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(fileUser);
|
||||
await dataTable.rightClickOnItem(folderUser);
|
||||
expect(await dataTable.hasContextMenu()).toBe(true, `Context menu is not displayed for ${folderUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(true, `Edit is not displayed for ${folderUser}`);
|
||||
expect(await dataTable.hasCheckMarkIcon(folderUser)).toBe(true, `${folderUser} is not selected`);
|
||||
expect(await dataTable.hasCheckMarkIcon(fileUser)).toBe(false, `${fileUser} is not selected`);
|
||||
});
|
||||
|
||||
it('Context menu closes when clicking away from it - [C280619]', async () => {
|
||||
await dataTable.rightClickOnItem(fileUser);
|
||||
expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed');
|
||||
await page.sidenav.activeLink.click();
|
||||
expect(await dataTable.hasContextMenu()).toBe(false, 'Context menu is displayed');
|
||||
});
|
||||
|
||||
it('Context menu does not appear for a library - [C286276]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.rightClickOnItem(siteName);
|
||||
expect(await dataTable.hasContextMenu()).toBe(false, 'Context menu is displayed for a site');
|
||||
});
|
||||
});
|
||||
|
||||
describe('on Personal Files', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Context menu has the correct actions for a file - [C280615]', async () => {
|
||||
await dataTable.rightClickOnItem(fileUser);
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(true, `View is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Share')).toBe(true, `Share is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Manage Versions')).toBe(true, `Manage Versions is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(true, `Permissions is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, `Edit is displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View details')).toBe(false, `View details is displayed for ${fileUser}`);
|
||||
});
|
||||
|
||||
it('Context menu has the correct actions for a folder - [C280616]', async () => {
|
||||
await dataTable.rightClickOnItem(folderUser);
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, `Download is not enabled for ${folderUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(true, `Edit is not displayed for ${folderUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folderUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folderUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${folderUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${folderUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(true, `Permissions is not displayed for ${folderUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, `View is displayed for ${folderUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Manage Versions')).toBe(false, `Manage Versions is displayed for ${folderUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Share')).toBe(false, `Share is displayed for ${folderUser}`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('File Libraries', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Context menu has the correct actions for a file - [C280594]', async () => {
|
||||
await dataTable.rightClickOnItem(fileSiteUser);
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, `Download is not displayed for ${fileSiteUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(true, `View is not displayed for ${fileSiteUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileSiteUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileSiteUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileSiteUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileSiteUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Share')).toBe(true, `Share is not displayed for ${fileSiteUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Manage Versions')).toBe(true, `Manage Versions not displayed for ${fileSiteUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(true, `Permissions is not displayed for ${fileSiteUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, `Edit is displayed for ${fileSiteUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View details')).toBe(false, `View details is displayed for ${fileSiteUser}`);
|
||||
});
|
||||
|
||||
it('Context menu has the correct actions for a folder - [C280595]', async () => {
|
||||
await dataTable.rightClickOnItem(folderSiteUser);
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, `Download is not enabled for ${folderSiteUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(true, `Edit is not displayed for ${folderSiteUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folderSiteUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folderSiteUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${folderSiteUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${folderSiteUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(true, `Permissions is not displayed for ${folderSiteUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, `View is displayed for ${folderSiteUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Manage Versions')).toBe(false, `Manage Versions displayed for ${folderSiteUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Share')).toBe(false, `Share is displayed for ${folderSiteUser}`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Shared Files', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Context menu has the correct actions for a file - [C280601]', async () => {
|
||||
await dataTable.rightClickOnItem(fileUser);
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(true, `View is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileUser}`);
|
||||
// TODO: enable this when the action is properly implemented: ACA-92
|
||||
// expect(await contextMenu.isMenuItemPresent('Share')).toBe(true, `Share is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Manage Versions')).toBe(true, `Manage Versions not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(true, `Permissions is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, `Edit is displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View details')).toBe(false, `View details is displayed for ${fileUser}`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Recent Files', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Context menu has the correct actions for a file - [C280622]', async () => {
|
||||
await dataTable.rightClickOnItem(fileUser);
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(true, `View is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Share')).toBe(true, `Share is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Manage Versions')).toBe(true, `Manage Versions not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(true, `Permissions is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, `Edit is displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View details')).toBe(false, `View details is displayed for ${fileUser}`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Favorites', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Context menu has the correct actions for a file - [C280608]', async () => {
|
||||
await dataTable.rightClickOnItem(fileUser);
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(true, `View is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Share')).toBe(true, `Share is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Manage Versions')).toBe(true, `Manage Versions is not displayed for ${fileUser}`);
|
||||
// TODO: enable when ACA-1794 is fixed
|
||||
// expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(true, `Permissions is not displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, `Edit is displayed for ${fileUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View details')).toBe(false, `View details is displayed for ${fileUser}`);
|
||||
});
|
||||
|
||||
it('Context menu has the correct actions for a folder - [C280609]', async () => {
|
||||
await dataTable.rightClickOnItem(folderUser);
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, `Download is not enabled for ${folderUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(true, `Edit is not displayed for ${folderUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folderUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folderUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${folderUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${folderUser}`);
|
||||
// TODO: enable when ACA-1794 is fixed
|
||||
// expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(true, `Permissions is not displayed for ${folderUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, `View is displayed for ${folderUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Manage Versions')).toBe(false, `Manage Versions is displayed for ${folderUser}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Share')).toBe(false, `Share is displayed for ${folderUser}`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Trash', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Context menu has the correct actions for a file - [C286258]', async () => {
|
||||
await dataTable.rightClickOnItem(fileInTrash);
|
||||
expect(await contextMenu.isMenuItemPresent('Permanently delete'))
|
||||
.toBe(true, `Permanently delete is not displayed for ${fileInTrash}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Restore')).toBe(true, `Restore is not displayed for ${fileInTrash}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(false, `Download is not displayed for ${fileInTrash}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, `View is not displayed for ${fileInTrash}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(false, `Favorite is not displayed for ${fileInTrash}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(false, `Copy is not displayed for ${fileInTrash}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(false, `Move is not displayed for ${fileInTrash}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(false, `Delete is not displayed for ${fileInTrash}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Share')).toBe(false, `Share is not displayed for ${fileInTrash}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Manage Versions'))
|
||||
.toBe(false, `Manage Versions is not displayed for ${fileInTrash}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, `Edit is displayed for ${fileInTrash}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View details')).toBe(false, `View details is displayed for ${fileInTrash}`);
|
||||
});
|
||||
|
||||
it('Context menu has the correct actions for a folder - [C286259]', async () => {
|
||||
await dataTable.rightClickOnItem(folderInTrash);
|
||||
expect(await contextMenu.isMenuItemPresent('Permanently delete'))
|
||||
.toBe(true, `Permanently delete is not displayed for ${folderInTrash}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Restore')).toBe(true, `Restore is not displayed for ${folderInTrash}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(false, `Download is not displayed for ${folderInTrash}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, `View is not displayed for ${folderInTrash}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(false, `Favorite is not displayed for ${folderInTrash}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(false, `Copy is not displayed for ${folderInTrash}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(false, `Move is not displayed for ${folderInTrash}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(false, `Delete is not displayed for ${folderInTrash}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Share')).toBe(false, `Share is not displayed for ${folderInTrash}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Manage Versions'))
|
||||
.toBe(false, `Manage Versions is not displayed for ${folderInTrash}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, `Edit is displayed for ${folderInTrash}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View details')).toBe(false, `View details is displayed for ${folderInTrash}`);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -28,263 +28,238 @@ import { browser } from 'protractor';
|
||||
import { SIDEBAR_LABELS, SITE_VISIBILITY, SITE_ROLES } from '../../configs';
|
||||
import { LoginPage, LogoutPage, BrowsingPage } from '../../pages/pages';
|
||||
import { CreateOrEditFolderDialog } from '../../components/dialog/create-edit-folder-dialog';
|
||||
import { Menu } from '../../components/menu/menu';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
|
||||
describe('Create folder', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const parent = `parent-${Utils.random()}`;
|
||||
const folderName1 = `folder-${Utils.random()}`;
|
||||
const folderName2 = `folder-${Utils.random()}`;
|
||||
const folderDescription = 'description of my folder';
|
||||
const duplicateFolderName = `folder-${Utils.random()}`;
|
||||
const nameWithSpaces = ` folder-${Utils.random()} `;
|
||||
const parent = `parent-${Utils.random()}`; let parentId;
|
||||
const folderName1 = `folder-${Utils.random()}`;
|
||||
const folderName2 = `folder-${Utils.random()}`;
|
||||
const folderDescription = 'description of my folder';
|
||||
const duplicateFolderName = `folder-${Utils.random()}`;
|
||||
const nameWithSpaces = ` folder-${Utils.random()} `;
|
||||
|
||||
const siteName = `site-private-${Utils.random()}`;
|
||||
const siteName = `site-private-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const personalFilesPage = new BrowsingPage();
|
||||
const createDialog = new CreateOrEditFolderDialog();
|
||||
const { dataTable } = personalFilesPage;
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const personalFilesPage = new BrowsingPage();
|
||||
const createDialog = new CreateOrEditFolderDialog();
|
||||
const { dataTable } = personalFilesPage;
|
||||
const menu = new Menu();
|
||||
|
||||
beforeAll(done => {
|
||||
apis.admin.people.createUser({ username })
|
||||
.then(() => apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PRIVATE))
|
||||
.then(() => apis.admin.nodes.createFolders([ folderName1 ], `Sites/${siteName}/documentLibrary`))
|
||||
.then(() => apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_CONSUMER))
|
||||
.then(() => apis.user.nodes.createFolders([ duplicateFolderName ], parent))
|
||||
.then(() => loginPage.loginWith(username))
|
||||
.then(done);
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PRIVATE);
|
||||
const docLibId = (await apis.admin.sites.getDocLibId(siteName));
|
||||
await apis.admin.nodes.createFolder(folderName1, docLibId);
|
||||
await apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_CONSUMER);
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
await apis.user.nodes.createFolder(duplicateFolderName, parentId);
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.admin.sites.deleteSite(siteName);
|
||||
await apis.user.nodes.deleteNodeById(parentId);
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
describe('on Personal Files', () => {
|
||||
beforeEach(async (done) => {
|
||||
await personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
Promise
|
||||
.all([
|
||||
apis.admin.sites.deleteSite(siteName),
|
||||
apis.user.nodes.deleteNodes([ parent ]),
|
||||
logoutPage.load()
|
||||
])
|
||||
.then(done);
|
||||
afterEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
done();
|
||||
});
|
||||
|
||||
describe('on Personal Files', () => {
|
||||
beforeEach(done => {
|
||||
personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
});
|
||||
|
||||
afterEach(done => {
|
||||
browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform().then(done);
|
||||
});
|
||||
|
||||
it('option is enabled when having enough permissions - [C216339]', () => {
|
||||
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
|
||||
.then(() => personalFilesPage.sidenav.openNewMenu())
|
||||
.then(menu => {
|
||||
const isEnabled = menu.getItemByLabel('Create folder').isEnabled();
|
||||
expect(isEnabled).toBe(true, 'Create folder is not enabled');
|
||||
});
|
||||
});
|
||||
|
||||
it('creates new folder with name - [C216341]', () => {
|
||||
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
|
||||
.then(() => personalFilesPage.sidenav.openCreateDialog())
|
||||
.then(() => createDialog.waitForDialogToOpen())
|
||||
.then(() => createDialog.enterName(folderName1))
|
||||
.then(() => createDialog.clickCreate())
|
||||
.then(() => createDialog.waitForDialogToClose())
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
const isPresent = dataTable.getRowByName(folderName1).isPresent();
|
||||
expect(isPresent).toBe(true, 'Folder not displayed in list view');
|
||||
});
|
||||
});
|
||||
|
||||
it('creates new folder with name and description - [C216340]', () => {
|
||||
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
|
||||
.then(() => personalFilesPage.sidenav.openCreateDialog())
|
||||
.then(() => createDialog.waitForDialogToOpen())
|
||||
.then(() => createDialog.enterName(folderName2))
|
||||
.then(() => createDialog.enterDescription(folderDescription))
|
||||
.then(() => createDialog.clickCreate())
|
||||
.then(() => createDialog.waitForDialogToClose())
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => expect(dataTable.getRowByName(folderName2).isPresent()).toBe(true, 'Folder not displayed'))
|
||||
.then(() => apis.user.nodes.getNodeDescription(folderName2, parent))
|
||||
.then(desc => expect(desc).toEqual(folderDescription));
|
||||
});
|
||||
|
||||
it('enabled option tooltip - [C216342]', () => {
|
||||
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
|
||||
.then(() => personalFilesPage.sidenav.openNewMenu())
|
||||
.then(menu => browser.actions().mouseMove(menu.getItemByLabel('Create folder')).perform()
|
||||
.then(() => menu))
|
||||
.then(menu => {
|
||||
expect(menu.getItemTooltip('Create folder')).toContain('Create new folder');
|
||||
});
|
||||
});
|
||||
|
||||
it('dialog UI elements - [C216345]', () => {
|
||||
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
|
||||
.then(() => personalFilesPage.sidenav.openCreateDialog())
|
||||
.then(() => createDialog.waitForDialogToOpen())
|
||||
.then(() => {
|
||||
const dialogTitle = createDialog.getTitle();
|
||||
const isFolderNameDisplayed = createDialog.nameInput.isDisplayed();
|
||||
const isDescriptionDisplayed = createDialog.descriptionTextArea.isDisplayed();
|
||||
const isCreateEnabled = createDialog.createButton.isEnabled();
|
||||
const isCancelEnabled = createDialog.cancelButton.isEnabled();
|
||||
|
||||
expect(dialogTitle).toMatch('Create new folder');
|
||||
expect(isFolderNameDisplayed).toBe(true, 'Name input is not displayed');
|
||||
expect(isDescriptionDisplayed).toBe(true, 'Description field is not displayed');
|
||||
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
|
||||
expect(isCancelEnabled).toBe(true, 'Cancel button is not enabled');
|
||||
});
|
||||
});
|
||||
|
||||
it('with empty folder name - [C216346]', () => {
|
||||
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
|
||||
.then(() => personalFilesPage.sidenav.openCreateDialog())
|
||||
.then(() => createDialog.waitForDialogToOpen())
|
||||
.then(() => createDialog.deleteNameWithBackspace())
|
||||
.then(() => {
|
||||
const isCreateEnabled = createDialog.createButton.isEnabled();
|
||||
const validationMessage = createDialog.getValidationMessage();
|
||||
|
||||
expect(isCreateEnabled).toBe(false, 'Create button is enabled');
|
||||
expect(validationMessage).toMatch('Folder name is required');
|
||||
});
|
||||
});
|
||||
|
||||
it('with folder name ending with a dot "." - [C216348]', () => {
|
||||
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
|
||||
.then(() => personalFilesPage.sidenav.openCreateDialog())
|
||||
.then(() => createDialog.waitForDialogToOpen())
|
||||
.then(() => createDialog.enterName('folder-name.'))
|
||||
.then(() => {
|
||||
const isCreateEnabled = createDialog.createButton.isEnabled();
|
||||
const validationMessage = createDialog.getValidationMessage();
|
||||
|
||||
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
|
||||
expect(validationMessage).toMatch(`Folder name can't end with a period .`);
|
||||
});
|
||||
});
|
||||
|
||||
it('with folder name containing special characters - [C216347]', () => {
|
||||
const namesWithSpecialChars = [ 'a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];
|
||||
|
||||
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
|
||||
.then(() => personalFilesPage.sidenav.openCreateDialog())
|
||||
.then(() => createDialog.waitForDialogToOpen())
|
||||
.then(() => namesWithSpecialChars.forEach(name => {
|
||||
createDialog.enterName(name);
|
||||
|
||||
const isCreateEnabled = createDialog.createButton.isEnabled();
|
||||
const validationMessage = createDialog.getValidationMessage();
|
||||
|
||||
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
|
||||
expect(validationMessage).toContain(`Folder name can't contain these characters`);
|
||||
}));
|
||||
});
|
||||
|
||||
it('with folder name containing only spaces - [C280406]', () => {
|
||||
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
|
||||
.then(() => personalFilesPage.sidenav.openCreateDialog())
|
||||
.then(() => createDialog.waitForDialogToOpen())
|
||||
.then(() => createDialog.enterName(' '))
|
||||
.then(() => {
|
||||
const isCreateEnabled = createDialog.createButton.isEnabled();
|
||||
const validationMessage = createDialog.getValidationMessage();
|
||||
|
||||
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
|
||||
expect(validationMessage).toMatch(`Folder name can't contain only spaces`);
|
||||
});
|
||||
});
|
||||
|
||||
it('cancel folder creation - [C216349]', () => {
|
||||
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
|
||||
.then(() => personalFilesPage.sidenav.openCreateDialog())
|
||||
.then(() => createDialog.waitForDialogToOpen())
|
||||
.then(() => createDialog.enterName('test'))
|
||||
.then(() => createDialog.enterDescription('test description'))
|
||||
.then(() => createDialog.clickCancel())
|
||||
.then(() => {
|
||||
expect(createDialog.component.isPresent()).not.toBe(true, 'dialog is not closed');
|
||||
});
|
||||
});
|
||||
|
||||
it('duplicate folder name - [C216350]', () => {
|
||||
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
|
||||
.then(() => personalFilesPage.sidenav.openCreateDialog())
|
||||
.then(() => createDialog.waitForDialogToOpen())
|
||||
.then(() => createDialog.enterName(duplicateFolderName))
|
||||
.then(() => createDialog.clickCreate())
|
||||
.then(() => personalFilesPage.getSnackBarMessage())
|
||||
.then(message => {
|
||||
expect(message).toEqual(`There's already a folder with this name. Try a different name.`);
|
||||
expect(createDialog.component.isPresent()).toBe(true, 'dialog is not present');
|
||||
});
|
||||
});
|
||||
|
||||
it('trim ending spaces from folder name - [C216351]', () => {
|
||||
personalFilesPage.dataTable.doubleClickOnRowByName(parent)
|
||||
.then(() => personalFilesPage.sidenav.openCreateDialog())
|
||||
.then(() => createDialog.waitForDialogToOpen())
|
||||
.then(() => createDialog.enterName(nameWithSpaces))
|
||||
.then(() => createDialog.clickCreate())
|
||||
.then(() => createDialog.waitForDialogToClose())
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
const isPresent = dataTable.getRowByName(nameWithSpaces.trim()).isPresent();
|
||||
expect(isPresent).toBe(true, 'Folder not displayed in list view');
|
||||
});
|
||||
});
|
||||
it('option is enabled when having enough permissions - [C216339]', async () => {
|
||||
await personalFilesPage.dataTable.doubleClickOnRowByName(parent);
|
||||
await personalFilesPage.sidenav.openNewMenu();
|
||||
const isEnabled = await menu.getItemByLabel('Create folder').isEnabled();
|
||||
expect(isEnabled).toBe(true, 'Create folder is not enabled');
|
||||
});
|
||||
|
||||
describe('on File Libraries', () => {
|
||||
const fileLibrariesPage = new BrowsingPage();
|
||||
|
||||
beforeEach(done => {
|
||||
fileLibrariesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
});
|
||||
|
||||
afterEach(done => {
|
||||
browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform().then(done);
|
||||
});
|
||||
|
||||
it('option is disabled when not enough permissions - [C280397]', () => {
|
||||
fileLibrariesPage.dataTable.doubleClickOnRowByName(siteName)
|
||||
.then(() => fileLibrariesPage.dataTable.doubleClickOnRowByName(folderName1))
|
||||
.then(() => fileLibrariesPage.sidenav.openNewMenu())
|
||||
.then(menu => {
|
||||
const isEnabled = menu.getItemByLabel('Create folder').isEnabled();
|
||||
expect(isEnabled).toBe(false, 'Create folder is not disabled');
|
||||
});
|
||||
});
|
||||
|
||||
it('disabled option tooltip - [C280398]', () => {
|
||||
fileLibrariesPage.dataTable.doubleClickOnRowByName(siteName)
|
||||
.then(() => fileLibrariesPage.dataTable.doubleClickOnRowByName(folderName1))
|
||||
.then(() => fileLibrariesPage.sidenav.openNewMenu())
|
||||
.then(menu => browser.actions().mouseMove(menu.getItemByLabel('Create folder')).perform()
|
||||
.then(() => menu))
|
||||
.then(menu => {
|
||||
const tooltip = menu.getItemTooltip('Create folder');
|
||||
expect(tooltip).toContain(`Folders cannot be created whilst viewing the current items`);
|
||||
});
|
||||
});
|
||||
it('creates new folder with name - [C216341]', async () => {
|
||||
await personalFilesPage.dataTable.doubleClickOnRowByName(parent);
|
||||
await personalFilesPage.sidenav.openCreateDialog();
|
||||
await createDialog.waitForDialogToOpen();
|
||||
await createDialog.enterName(folderName1);
|
||||
await createDialog.clickCreate();
|
||||
await createDialog.waitForDialogToClose();
|
||||
await dataTable.waitForHeader();
|
||||
const isPresent = await dataTable.getRowByName(folderName1).isPresent();
|
||||
expect(isPresent).toBe(true, 'Folder not displayed in list view');
|
||||
});
|
||||
|
||||
xit('');
|
||||
it('creates new folder with name and description - [C216340]', async (done) => {
|
||||
await personalFilesPage.dataTable.doubleClickOnRowByName(parent);
|
||||
await personalFilesPage.sidenav.openCreateDialog();
|
||||
await createDialog.waitForDialogToOpen();
|
||||
await createDialog.enterName(folderName2);
|
||||
await createDialog.enterDescription(folderDescription);
|
||||
await createDialog.clickCreate();
|
||||
await createDialog.waitForDialogToClose();
|
||||
await dataTable.waitForHeader();
|
||||
expect(await dataTable.getRowByName(folderName2).isPresent()).toBe(true, 'Folder not displayed');
|
||||
const desc = await apis.user.nodes.getNodeDescription(folderName2, parent);
|
||||
expect(desc).toEqual(folderDescription);
|
||||
done();
|
||||
});
|
||||
|
||||
it('enabled option tooltip - [C216342]', async () => {
|
||||
await personalFilesPage.dataTable.doubleClickOnRowByName(parent);
|
||||
await personalFilesPage.sidenav.openNewMenu();
|
||||
await browser.actions().mouseMove(menu.getItemByLabel('Create folder')).perform();
|
||||
expect(await menu.getItemTooltip('Create folder')).toContain('Create new folder');
|
||||
});
|
||||
|
||||
it('dialog UI elements - [C216345]', async () => {
|
||||
await personalFilesPage.dataTable.doubleClickOnRowByName(parent);
|
||||
await personalFilesPage.sidenav.openCreateDialog();
|
||||
await createDialog.waitForDialogToOpen();
|
||||
const dialogTitle = await createDialog.getTitle();
|
||||
const isFolderNameDisplayed = await createDialog.nameInput.isDisplayed();
|
||||
const isDescriptionDisplayed = await createDialog.descriptionTextArea.isDisplayed();
|
||||
const isCreateEnabled = await createDialog.createButton.isEnabled();
|
||||
const isCancelEnabled = await createDialog.cancelButton.isEnabled();
|
||||
|
||||
expect(dialogTitle).toMatch('Create new folder');
|
||||
expect(isFolderNameDisplayed).toBe(true, 'Name input is not displayed');
|
||||
expect(isDescriptionDisplayed).toBe(true, 'Description field is not displayed');
|
||||
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
|
||||
expect(isCancelEnabled).toBe(true, 'Cancel button is not enabled');
|
||||
});
|
||||
|
||||
it('with empty folder name - [C216346]', async () => {
|
||||
await personalFilesPage.dataTable.doubleClickOnRowByName(parent);
|
||||
await personalFilesPage.sidenav.openCreateDialog();
|
||||
await createDialog.waitForDialogToOpen();
|
||||
await createDialog.deleteNameWithBackspace();
|
||||
const isCreateEnabled = await createDialog.createButton.isEnabled();
|
||||
const validationMessage = await createDialog.getValidationMessage();
|
||||
|
||||
expect(isCreateEnabled).toBe(false, 'Create button is enabled');
|
||||
expect(validationMessage).toMatch('Folder name is required');
|
||||
});
|
||||
|
||||
it('with folder name ending with a dot "." - [C216348]', async () => {
|
||||
await personalFilesPage.dataTable.doubleClickOnRowByName(parent);
|
||||
await personalFilesPage.sidenav.openCreateDialog();
|
||||
await createDialog.waitForDialogToOpen();
|
||||
await createDialog.enterName('folder-name.');
|
||||
const isCreateEnabled = await createDialog.createButton.isEnabled();
|
||||
const validationMessage = await createDialog.getValidationMessage();
|
||||
|
||||
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
|
||||
expect(validationMessage).toMatch(`Folder name can't end with a period .`);
|
||||
});
|
||||
|
||||
it('with folder name containing special characters - [C216347]', async () => {
|
||||
const namesWithSpecialChars = [ 'a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];
|
||||
|
||||
await personalFilesPage.dataTable.doubleClickOnRowByName(parent);
|
||||
await personalFilesPage.sidenav.openCreateDialog();
|
||||
await createDialog.waitForDialogToOpen();
|
||||
|
||||
for (const name of namesWithSpecialChars) {
|
||||
await createDialog.enterName(name);
|
||||
expect(await createDialog.createButton.isEnabled()).toBe(false, 'Create button is not disabled');
|
||||
expect(await createDialog.getValidationMessage()).toContain(`Folder name can't contain these characters`);
|
||||
}
|
||||
});
|
||||
|
||||
it('with folder name containing only spaces - [C280406]', async () => {
|
||||
await personalFilesPage.dataTable.doubleClickOnRowByName(parent);
|
||||
await personalFilesPage.sidenav.openCreateDialog();
|
||||
await createDialog.waitForDialogToOpen();
|
||||
await createDialog.enterName(' ');
|
||||
const isCreateEnabled = await createDialog.createButton.isEnabled();
|
||||
const validationMessage = await createDialog.getValidationMessage();
|
||||
|
||||
expect(isCreateEnabled).toBe(false, 'Create button is not disabled');
|
||||
expect(validationMessage).toMatch(`Folder name can't contain only spaces`);
|
||||
});
|
||||
|
||||
it('cancel folder creation - [C216349]', async () => {
|
||||
await personalFilesPage.dataTable.doubleClickOnRowByName(parent);
|
||||
await personalFilesPage.sidenav.openCreateDialog();
|
||||
await createDialog.waitForDialogToOpen();
|
||||
await createDialog.enterName('test');
|
||||
await createDialog.enterDescription('test description');
|
||||
await createDialog.clickCancel();
|
||||
expect(await createDialog.component.isPresent()).not.toBe(true, 'dialog is not closed');
|
||||
});
|
||||
|
||||
it('duplicate folder name - [C216350]', async () => {
|
||||
await personalFilesPage.dataTable.doubleClickOnRowByName(parent);
|
||||
await personalFilesPage.sidenav.openCreateDialog();
|
||||
await createDialog.waitForDialogToOpen();
|
||||
await createDialog.enterName(duplicateFolderName);
|
||||
await createDialog.clickCreate();
|
||||
const message = await personalFilesPage.getSnackBarMessage();
|
||||
expect(message).toEqual(`There's already a folder with this name. Try a different name.`);
|
||||
expect(await createDialog.component.isPresent()).toBe(true, 'dialog is not present');
|
||||
});
|
||||
|
||||
it('trim ending spaces from folder name - [C216351]', async () => {
|
||||
await personalFilesPage.dataTable.doubleClickOnRowByName(parent);
|
||||
await personalFilesPage.sidenav.openCreateDialog();
|
||||
await createDialog.waitForDialogToOpen();
|
||||
await createDialog.enterName(nameWithSpaces);
|
||||
await createDialog.clickCreate();
|
||||
await createDialog.waitForDialogToClose();
|
||||
await dataTable.waitForHeader();
|
||||
const isPresent = await dataTable.getRowByName(nameWithSpaces.trim()).isPresent();
|
||||
expect(isPresent).toBe(true, 'Folder not displayed in list view');
|
||||
});
|
||||
});
|
||||
|
||||
describe('on File Libraries', () => {
|
||||
const fileLibrariesPage = new BrowsingPage();
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await fileLibrariesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
done();
|
||||
});
|
||||
|
||||
it('option is disabled when not enough permissions - [C280397]', async () => {
|
||||
await fileLibrariesPage.dataTable.doubleClickOnRowByName(siteName);
|
||||
await fileLibrariesPage.dataTable.doubleClickOnRowByName(folderName1);
|
||||
await fileLibrariesPage.sidenav.openNewMenu();
|
||||
const isEnabled = await menu.getItemByLabel('Create folder').isEnabled();
|
||||
expect(isEnabled).toBe(false, 'Create folder is not disabled');
|
||||
});
|
||||
|
||||
it('disabled option tooltip - [C280398]', async () => {
|
||||
await fileLibrariesPage.dataTable.doubleClickOnRowByName(siteName);
|
||||
await fileLibrariesPage.dataTable.doubleClickOnRowByName(folderName1);
|
||||
await fileLibrariesPage.sidenav.openNewMenu();
|
||||
await browser.actions().mouseMove(menu.getItemByLabel('Create folder')).perform();
|
||||
const tooltip = await menu.getItemTooltip('Create folder');
|
||||
expect(tooltip).toContain(`Folders cannot be created whilst viewing the current items`);
|
||||
});
|
||||
});
|
||||
|
||||
xit('');
|
||||
});
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -31,157 +31,151 @@ import { CreateOrEditFolderDialog } from '../../components/dialog/create-edit-fo
|
||||
import { Utils } from '../../utilities/utils';
|
||||
|
||||
describe('Edit folder', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const parent = `parent-${Utils.random()}`;
|
||||
const folderName = `folder-${Utils.random()}`;
|
||||
const folderDescription = 'my folder description';
|
||||
const parent = `parent-${Utils.random()}`; let parentId;
|
||||
const folderName = `folder-${Utils.random()}`;
|
||||
const folderDescription = 'my folder description';
|
||||
|
||||
const folderNameToEdit = `folder-${Utils.random()}`;
|
||||
const duplicateFolderName = `folder-${Utils.random()}`;
|
||||
const folderNameToEdit = `folder-${Utils.random()}`;
|
||||
const duplicateFolderName = `folder-${Utils.random()}`;
|
||||
|
||||
const folderNameEdited = `folder-${Utils.random()}`;
|
||||
const folderDescriptionEdited = 'description edited';
|
||||
const folderNameEdited = `folder-${Utils.random()}`;
|
||||
const folderDescriptionEdited = 'description edited';
|
||||
|
||||
const siteName = `site-private-${Utils.random()}`;
|
||||
const siteName = `site-private-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const personalFilesPage = new BrowsingPage();
|
||||
const editDialog = new CreateOrEditFolderDialog();
|
||||
const { dataTable } = personalFilesPage;
|
||||
const editButton = personalFilesPage.toolbar.actions.getButtonByTitleAttribute('Edit');
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const personalFilesPage = new BrowsingPage();
|
||||
const editDialog = new CreateOrEditFolderDialog();
|
||||
const { dataTable } = personalFilesPage;
|
||||
const editButton = personalFilesPage.toolbar.getButtonByTitleAttribute('Edit');
|
||||
|
||||
beforeAll(done => {
|
||||
apis.admin.people.createUser({ username })
|
||||
.then(() => apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PRIVATE))
|
||||
.then(() => apis.admin.nodes.createFolders([ folderName ], `Sites/${siteName}/documentLibrary`))
|
||||
.then(() => apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_CONSUMER))
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PRIVATE);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(siteName);
|
||||
await apis.admin.nodes.createFolder(folderName, docLibId);
|
||||
await apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_CONSUMER);
|
||||
|
||||
.then(() => apis.user.nodes.createFolder( parent ))
|
||||
.then(resp => apis.user.nodes.createFolder( folderName, resp.entry.id, '', folderDescription ))
|
||||
.then(() => apis.user.nodes.createFolders([ folderNameToEdit, duplicateFolderName ], parent))
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
await apis.user.nodes.createFolder(folderName, parentId, '', folderDescription);
|
||||
await apis.user.nodes.createFolder(folderNameToEdit, parentId);
|
||||
await apis.user.nodes.createFolder(duplicateFolderName, parentId);
|
||||
|
||||
.then(() => loginPage.loginWith(username))
|
||||
.then(done);
|
||||
});
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(done => {
|
||||
personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => dataTable.doubleClickOnRowByName(parent))
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
});
|
||||
beforeEach(async (done) => {
|
||||
await personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(parent);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(done => {
|
||||
browser.actions().sendKeys(protractor.Key.ESCAPE).perform().then(done);
|
||||
});
|
||||
afterEach(async (done) => {
|
||||
await browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
Promise
|
||||
.all([
|
||||
apis.admin.sites.deleteSite(siteName),
|
||||
apis.user.nodes.deleteNodes([ parent ]),
|
||||
logoutPage.load()
|
||||
])
|
||||
.then(done);
|
||||
});
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.sites.deleteSite(siteName),
|
||||
apis.user.nodes.deleteNodeById(parentId),
|
||||
logoutPage.load()
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
it('dialog UI defaults - [C216331]', () => {
|
||||
dataTable.selectItem(folderName)
|
||||
.then(() => editButton.click())
|
||||
.then(() => {
|
||||
expect(editDialog.getTitle()).toEqual('Edit folder');
|
||||
expect(editDialog.nameInput.getAttribute('value')).toBe(folderName);
|
||||
expect(editDialog.descriptionTextArea.getAttribute('value')).toBe(folderDescription);
|
||||
expect(editDialog.updateButton.isEnabled()).toBe(true, 'upload button is not enabled');
|
||||
expect(editDialog.cancelButton.isEnabled()).toBe(true, 'cancel button is not enabled');
|
||||
});
|
||||
});
|
||||
it('dialog UI defaults - [C216331]', async () => {
|
||||
await dataTable.selectItem(folderName);
|
||||
await editButton.click();
|
||||
expect(await editDialog.getTitle()).toEqual('Edit folder');
|
||||
expect(await editDialog.nameInput.getAttribute('value')).toBe(folderName);
|
||||
expect(await editDialog.descriptionTextArea.getAttribute('value')).toBe(folderDescription);
|
||||
expect(await editDialog.updateButton.isEnabled()).toBe(true, 'upload button is not enabled');
|
||||
expect(await editDialog.cancelButton.isEnabled()).toBe(true, 'cancel button is not enabled');
|
||||
});
|
||||
|
||||
it('properties are modified when pressing OK - [C216335]', () => {
|
||||
dataTable.selectItem(folderNameToEdit)
|
||||
.then(() => editButton.click())
|
||||
.then(() => editDialog.waitForDialogToOpen())
|
||||
.then(() => editDialog.enterDescription(folderDescriptionEdited))
|
||||
.then(() => editDialog.enterName(folderNameEdited))
|
||||
.then(() => editDialog.clickUpdate())
|
||||
.then(() => editDialog.waitForDialogToClose())
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => expect(dataTable.getRowByName(folderNameEdited).isPresent()).toBe(true, 'Folder not displayed'))
|
||||
.then(() => apis.user.nodes.getNodeDescription(folderNameEdited, parent))
|
||||
.then(desc => expect(desc).toEqual(folderDescriptionEdited));
|
||||
});
|
||||
it('properties are modified when pressing OK - [C216335]', async (done) => {
|
||||
await dataTable.selectItem(folderNameToEdit);
|
||||
await editButton.click();
|
||||
await editDialog.waitForDialogToOpen();
|
||||
await editDialog.enterDescription(folderDescriptionEdited);
|
||||
await editDialog.enterName(folderNameEdited);
|
||||
await editDialog.clickUpdate();
|
||||
await editDialog.waitForDialogToClose();
|
||||
await dataTable.waitForHeader();
|
||||
expect(await dataTable.getRowByName(folderNameEdited).isPresent()).toBe(true, 'Folder not displayed');
|
||||
const desc = await apis.user.nodes.getNodeDescription(folderNameEdited, parent);
|
||||
expect(desc).toEqual(folderDescriptionEdited);
|
||||
done();
|
||||
});
|
||||
|
||||
it('with empty folder name - [C216332]', () => {
|
||||
dataTable.selectItem(folderName)
|
||||
.then(() => editButton.click())
|
||||
.then(() => editDialog.deleteNameWithBackspace())
|
||||
.then(() => {
|
||||
expect(editDialog.updateButton.isEnabled()).toBe(false, 'upload button is not enabled');
|
||||
expect(editDialog.getValidationMessage()).toMatch('Folder name is required');
|
||||
});
|
||||
});
|
||||
it('with empty folder name - [C216332]', async () => {
|
||||
await dataTable.selectItem(folderName);
|
||||
await editButton.click();
|
||||
await editDialog.deleteNameWithBackspace();
|
||||
expect(await editDialog.updateButton.isEnabled()).toBe(false, 'upload button is not enabled');
|
||||
expect(await editDialog.getValidationMessage()).toMatch('Folder name is required');
|
||||
});
|
||||
|
||||
it('with name with special characters - [C216333]', () => {
|
||||
const namesWithSpecialChars = [ 'a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];
|
||||
it('with name with special characters - [C216333]', async () => {
|
||||
const namesWithSpecialChars = [ 'a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a' ];
|
||||
|
||||
dataTable.selectItem(folderName)
|
||||
.then(() => editButton.click())
|
||||
.then(() => namesWithSpecialChars.forEach(name => {
|
||||
editDialog.enterName(name);
|
||||
await dataTable.selectItem(folderName);
|
||||
await editButton.click();
|
||||
|
||||
expect(editDialog.updateButton.isEnabled()).toBe(false, 'upload button is not disabled');
|
||||
expect(editDialog.getValidationMessage()).toContain(`Folder name can't contain these characters`);
|
||||
}));
|
||||
});
|
||||
for (const name of namesWithSpecialChars) {
|
||||
await editDialog.enterName(name);
|
||||
expect(await editDialog.updateButton.isEnabled()).toBe(false, 'upload button is not disabled');
|
||||
expect(await editDialog.getValidationMessage()).toContain(`Folder name can't contain these characters`);
|
||||
}
|
||||
});
|
||||
|
||||
it('with name ending with a dot - [C216334]', () => {
|
||||
dataTable.selectItem(folderName)
|
||||
.then(() => editButton.click())
|
||||
.then(() => editDialog.nameInput.sendKeys('.'))
|
||||
.then(() => {
|
||||
expect(editDialog.updateButton.isEnabled()).toBe(false, 'upload button is not enabled');
|
||||
expect(editDialog.getValidationMessage()).toMatch(`Folder name can't end with a period .`);
|
||||
});
|
||||
});
|
||||
it('with name ending with a dot - [C216334]', async () => {
|
||||
await dataTable.selectItem(folderName);
|
||||
await editButton.click();
|
||||
await editDialog.waitForDialogToOpen();
|
||||
await editDialog.nameInput.sendKeys('.');
|
||||
expect(await editDialog.updateButton.isEnabled()).toBe(false, 'upload button is not enabled');
|
||||
expect(await editDialog.getValidationMessage()).toMatch(`Folder name can't end with a period .`);
|
||||
});
|
||||
|
||||
it('Cancel button - [C216336]', () => {
|
||||
dataTable.selectItem(folderName)
|
||||
.then(() => editButton.click())
|
||||
.then(() => editDialog.clickCancel())
|
||||
.then(() => {
|
||||
expect(editDialog.component.isPresent()).not.toBe(true, 'dialog is not closed');
|
||||
});
|
||||
});
|
||||
it('Cancel button - [C216336]', async () => {
|
||||
await dataTable.selectItem(folderName);
|
||||
await editButton.click();
|
||||
await editDialog.waitForDialogToOpen();
|
||||
await editDialog.clickCancel();
|
||||
expect(await editDialog.component.isPresent()).not.toBe(true, 'dialog is not closed');
|
||||
});
|
||||
|
||||
it('with duplicate folder name - [C216337]', () => {
|
||||
dataTable.selectItem(folderName)
|
||||
.then(() => editButton.click())
|
||||
.then(() => editDialog.enterName(duplicateFolderName))
|
||||
.then(() => editDialog.clickUpdate())
|
||||
.then(() => personalFilesPage.getSnackBarMessage())
|
||||
.then(message => {
|
||||
expect(message).toEqual(`There's already a folder with this name. Try a different name.`);
|
||||
expect(editDialog.component.isPresent()).toBe(true, 'dialog is not present');
|
||||
});
|
||||
});
|
||||
it('with duplicate folder name - [C216337]', async () => {
|
||||
await dataTable.selectItem(folderName);
|
||||
await editButton.click();
|
||||
await editDialog.waitForDialogToOpen();
|
||||
await editDialog.enterName(duplicateFolderName);
|
||||
await editDialog.clickUpdate();
|
||||
const message = await personalFilesPage.getSnackBarMessage();
|
||||
expect(message).toEqual(`There's already a folder with this name. Try a different name.`);
|
||||
expect(await editDialog.component.isPresent()).toBe(true, 'dialog is not present');
|
||||
});
|
||||
|
||||
it('trim ending spaces - [C216338]', () => {
|
||||
dataTable.selectItem(folderName)
|
||||
.then(() => editButton.click())
|
||||
.then(() => editDialog.nameInput.sendKeys(' '))
|
||||
.then(() => editDialog.clickUpdate())
|
||||
.then(() => editDialog.waitForDialogToClose())
|
||||
.then(() => {
|
||||
expect(personalFilesPage.snackBar.isPresent()).not.toBe(true, 'notification appears');
|
||||
expect(dataTable.getRowByName(folderName).isPresent()).toBe(true, 'Folder not displayed in list view');
|
||||
});
|
||||
});
|
||||
it('trim ending spaces - [C216338]', async () => {
|
||||
await dataTable.selectItem(folderName);
|
||||
await editButton.click();
|
||||
await editDialog.nameInput.sendKeys(' ');
|
||||
await editDialog.clickUpdate();
|
||||
await editDialog.waitForDialogToClose();
|
||||
expect(await personalFilesPage.snackBar.isPresent()).not.toBe(true, 'notification appears');
|
||||
expect(await dataTable.getRowByName(folderName).isPresent()).toBe(true, 'Folder not displayed in list view');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -27,22 +27,22 @@ import { LoginPage, LogoutPage, BrowsingPage } from '../../pages/pages';
|
||||
import { SIDEBAR_LABELS, SITE_VISIBILITY } from '../../configs';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
describe('Mark items as favorites', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const file1NotFav = `file-${Utils.random()}.txt`;
|
||||
const file2NotFav = `file-${Utils.random()}.txt`;
|
||||
const file3Fav = `file-${Utils.random()}.txt`;
|
||||
const file4Fav = `file-${Utils.random()}.txt`;
|
||||
const file1NotFav = `file1-${Utils.random()}.txt`;
|
||||
const file2NotFav = `file2-${Utils.random()}.txt`;
|
||||
const file3Fav = `file3-${Utils.random()}.txt`;
|
||||
const file4Fav = `file4-${Utils.random()}.txt`;
|
||||
const folder1 = `folder-${Utils.random()}`;
|
||||
|
||||
const siteName = `site-public-${Utils.random()}`;
|
||||
const fileSiteNotFav1 = `file-site${Utils.random()}.txt`;
|
||||
const fileSiteNotFav2 = `file-site${Utils.random()}.txt`;
|
||||
const folderSite = `folder-${Utils.random()}`;
|
||||
const fileSiteFav1 = `file-${Utils.random()}.txt`;
|
||||
const fileSiteFav2 = `file-${Utils.random()}.txt`;
|
||||
const fileSiteNotFav1 = `file1-site-${Utils.random()}.txt`;
|
||||
const fileSiteNotFav2 = `file2-site-${Utils.random()}.txt`;
|
||||
const folderSite = `folder-site-${Utils.random()}`;
|
||||
const fileSiteFav1 = `file3-${Utils.random()}.txt`;
|
||||
const fileSiteFav2 = `file4-${Utils.random()}.txt`;
|
||||
|
||||
let file1Id, file2Id, file3Id, file4Id, folder1Id, fileSiteNotFav1Id, fileSiteNotFav2Id, folderSiteId, fileSiteFav1Id, fileSiteFav2Id;
|
||||
|
||||
@@ -56,486 +56,449 @@ describe('Mark items as favorites', () => {
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, toolbar } = page;
|
||||
|
||||
beforeAll(done => {
|
||||
apis.admin.people.createUser({ username })
|
||||
.then(() => apis.user.nodes.createFile( file1NotFav ).then(resp => file1Id = resp.entry.id))
|
||||
.then(() => apis.user.nodes.createFile( file2NotFav ).then(resp => file2Id = resp.entry.id))
|
||||
.then(() => apis.user.nodes.createFile( file3Fav ).then(resp => file3Id = resp.entry.id))
|
||||
.then(() => apis.user.nodes.createFile( file4Fav ).then(resp => file4Id = resp.entry.id))
|
||||
.then(() => apis.user.nodes.createFolder( folder1 ).then(resp => folder1Id = resp.entry.id))
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
file1Id = (await apis.user.nodes.createFile(file1NotFav)).entry.id;
|
||||
file2Id = (await apis.user.nodes.createFile(file2NotFav)).entry.id;
|
||||
file3Id = (await apis.user.nodes.createFile(file3Fav)).entry.id;
|
||||
file4Id = (await apis.user.nodes.createFile(file4Fav)).entry.id;
|
||||
folder1Id = (await apis.user.nodes.createFolder(folder1)).entry.id;
|
||||
|
||||
.then(() => apis.user.favorites.addFavoriteById('file', file3Id))
|
||||
.then(() => apis.user.favorites.addFavoriteById('file', file4Id))
|
||||
await apis.user.favorites.addFavoriteById('file', file3Id);
|
||||
await apis.user.favorites.addFavoriteById('file', file4Id);
|
||||
|
||||
.then(() => apis.user.search.waitForApi(username, { expect: 4 }))
|
||||
.then(() => apis.user.favorites.waitForApi({ expect: 2 }))
|
||||
await apis.user.shared.shareFilesByIds([ file1Id, file2Id, file3Id, file4Id ]);
|
||||
|
||||
.then(() => loginPage.loginWith(username))
|
||||
.then(done);
|
||||
await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
const docLibId = await apis.user.sites.getDocLibId(siteName);
|
||||
folderSiteId = (await apis.user.nodes.createFolder(folderSite, docLibId)).entry.id;
|
||||
fileSiteNotFav1Id = (await apis.user.nodes.createFile(fileSiteNotFav1, folderSiteId)).entry.id;
|
||||
fileSiteFav1Id = (await apis.user.nodes.createFile(fileSiteFav1, folderSiteId)).entry.id;
|
||||
fileSiteNotFav2Id = (await apis.user.nodes.createFile(fileSiteNotFav2, folderSiteId)).entry.id;
|
||||
fileSiteFav2Id = (await apis.user.nodes.createFile(fileSiteFav2, folderSiteId)).entry.id;
|
||||
await apis.user.favorites.addFavoriteById('file', fileSiteFav1Id);
|
||||
await apis.user.favorites.addFavoriteById('file', fileSiteFav2Id);
|
||||
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
await apis.user.search.waitForApi(username, { expect: 8 });
|
||||
await apis.user.shared.waitForApi({ expect: 4 });
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
Promise.all([
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.user.nodes.deleteNodesById([ file1Id, file2Id, file3Id, file4Id, folder1Id]),
|
||||
apis.user.sites.deleteSite(siteName),
|
||||
logoutPage.load()
|
||||
])
|
||||
.then(done);
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
xit('');
|
||||
|
||||
describe('on Personal Files', () => {
|
||||
beforeAll(done => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(done => {
|
||||
toolbar.actions.closeMoreMenu().then(done);
|
||||
it('Favorite action has empty star icon for an item not marked as favorite - [C217186]', async () => {
|
||||
await dataTable.selectItem(file1NotFav);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.getItemIconText('Favorite')).toEqual('star_border');
|
||||
});
|
||||
|
||||
it('Favorite action has empty star icon for an item not marked as favorite - [C217186]', () => {
|
||||
dataTable.selectItem(file1NotFav)
|
||||
.then(() => toolbar.actions.openMoreMenu())
|
||||
.then(() => expect(toolbar.actions.menu.getItemIconText('Favorite')).toEqual('star_border'));
|
||||
it('Favorite action has empty star icon for multiple selection of items when some are not favorite - [C217187]', async () => {
|
||||
await dataTable.selectMultipleItems([ file1NotFav, file3Fav ]);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.getItemIconText('Favorite')).toEqual('star_border');
|
||||
});
|
||||
|
||||
it('Favorite action has empty star icon for multiple selection of items when some are not favorite - [C217187]', () => {
|
||||
dataTable.selectMultipleItems([ file1NotFav, file3Fav ])
|
||||
.then(() => toolbar.actions.openMoreMenu())
|
||||
.then(() => expect(toolbar.actions.menu.getItemIconText('Favorite')).toEqual('star_border'));
|
||||
it('Favorite action has full star icon for items marked as favorite - [C217188]', async () => {
|
||||
await dataTable.selectItem(file3Fav);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.getItemIconText('Favorite')).toEqual('star');
|
||||
});
|
||||
|
||||
it('Favorite action has full star icon for items marked as favorite - [C217188]', () => {
|
||||
dataTable.selectItem(file3Fav)
|
||||
.then(() => toolbar.actions.openMoreMenu())
|
||||
.then(() => expect(toolbar.actions.menu.getItemIconText('Favorite')).toEqual('star'));
|
||||
it('favorite a file - [C217189]', async () => {
|
||||
await dataTable.selectItem(file1NotFav);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 6 });
|
||||
const isFavorite = await apis.user.favorites.isFavorite(file1Id);
|
||||
expect(isFavorite).toBe(true, `${file1NotFav} not marked as favorite`);
|
||||
|
||||
await apis.user.favorites.removeFavoriteById(file1Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
|
||||
it('favorite a file - [C217189]', () => {
|
||||
dataTable.selectItem(file1NotFav)
|
||||
.then(() => toolbar.actions.openMoreMenu())
|
||||
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
|
||||
.then(() => apis.user.favorites.waitForApi({ expect: 3 }))
|
||||
.then(() => apis.user.favorites.isFavorite(file1Id))
|
||||
.then(isFavorite => expect(isFavorite).toBe(true, `${file1NotFav} not marked as favorite`))
|
||||
it('favorite a folder - [C280390]', async () => {
|
||||
await dataTable.selectItem(folder1);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 6 });
|
||||
const isFavorite = await apis.user.favorites.isFavorite(folder1Id);
|
||||
expect(isFavorite).toBe(true, `${folder1} not marked as favorite`);
|
||||
|
||||
.then(() => apis.user.favorites.removeFavoriteById(file1Id));
|
||||
await apis.user.favorites.removeFavoriteById(folder1Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
|
||||
it('favorite a folder - [C280390]', () => {
|
||||
dataTable.selectItem(folder1)
|
||||
.then(() => toolbar.actions.openMoreMenu())
|
||||
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
|
||||
.then(() => apis.user.favorites.waitForApi({ expect: 3 }))
|
||||
.then(() => apis.user.favorites.isFavorite(folder1Id))
|
||||
.then(isFavorite => expect(isFavorite).toBe(true, `${folder1} not marked as favorite`))
|
||||
it('unfavorite an item - [C217190]', async () => {
|
||||
await dataTable.selectItem(file3Fav);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 4 });
|
||||
const isFavorite = await apis.user.favorites.isFavorite(file3Id);
|
||||
expect(isFavorite).toBe(false, `${file3Fav} is marked as favorite`);
|
||||
|
||||
.then(() => apis.user.favorites.removeFavoriteById(folder1Id));
|
||||
await apis.user.favorites.addFavoriteById('file', file3Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
|
||||
it('unfavorite an item - [C217190]', () => {
|
||||
dataTable.selectItem(file3Fav)
|
||||
.then(() => toolbar.actions.openMoreMenu())
|
||||
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
|
||||
.then(() => apis.user.favorites.waitForApi({ expect: 1 }))
|
||||
.then(() => apis.user.favorites.isFavorite(file3Id))
|
||||
.then(isFavorite => expect(isFavorite).toBe(false, `${file3Fav} is marked as favorite`))
|
||||
it('favorite multiple items - all unfavorite - [C217192]', async () => {
|
||||
await dataTable.selectMultipleItems([ file1NotFav, file2NotFav ]);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 7 });
|
||||
const isFile1Fav = await apis.user.favorites.isFavorite(file1Id);
|
||||
const isFile2Fav = await apis.user.favorites.isFavorite(file2Id);
|
||||
expect(isFile1Fav).toBe(true, 'item not marked as favorite');
|
||||
expect(isFile2Fav).toBe(true, 'item not marked as favorite');
|
||||
|
||||
.then(() => apis.user.favorites.addFavoriteById('file', file3Id));
|
||||
await apis.user.favorites.removeFavoriteById(file1Id);
|
||||
await apis.user.favorites.removeFavoriteById(file2Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
|
||||
it('favorite multiple items - all unfavorite - [C217192]', () => {
|
||||
dataTable.selectMultipleItems([ file1NotFav, file2NotFav ])
|
||||
.then(() => toolbar.actions.openMoreMenu())
|
||||
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
|
||||
.then(() => apis.user.favorites.waitForApi({ expect: 4 }))
|
||||
.then(() => Promise.all([
|
||||
apis.user.favorites.isFavorite(file1Id),
|
||||
apis.user.favorites.isFavorite(file2Id)
|
||||
]))
|
||||
.then(resp => {
|
||||
expect(resp[0]).toBe(true, 'item not marked as favorite');
|
||||
expect(resp[1]).toBe(true, 'item not marked as favorite');
|
||||
})
|
||||
it('favorite multiple items - some favorite and some unfavorite - [C217194]', async () => {
|
||||
await dataTable.selectMultipleItems([ file1NotFav, file3Fav ]);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 6 });
|
||||
const isFile1Fav = await apis.user.favorites.isFavorite(file1Id);
|
||||
const isFile2Fav = await apis.user.favorites.isFavorite(file3Id);
|
||||
expect(isFile1Fav).toBe(true, 'item not marked as favorite');
|
||||
expect(isFile2Fav).toBe(true, 'item not marked as favorite');
|
||||
|
||||
.then(() => apis.user.favorites.removeFavoriteById(file1Id))
|
||||
.then(() => apis.user.favorites.removeFavoriteById(file2Id));
|
||||
await apis.user.favorites.removeFavoriteById(file1Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
|
||||
it('favorite multiple items - some favorite and some unfavorite - [C217194]', () => {
|
||||
dataTable.selectMultipleItems([ file1NotFav, file3Fav ])
|
||||
.then(() => toolbar.actions.openMoreMenu())
|
||||
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
|
||||
.then(() => apis.user.favorites.waitForApi({ expect: 3 }))
|
||||
.then(() => Promise.all([
|
||||
apis.user.favorites.isFavorite(file1Id),
|
||||
apis.user.favorites.isFavorite(file3Id)
|
||||
]))
|
||||
.then(resp => {
|
||||
expect(resp[0]).toBe(true, 'item not marked as favorite');
|
||||
expect(resp[1]).toBe(true, 'item not marked as favorite');
|
||||
})
|
||||
it('unfavorite multiple items - [C217193]', async () => {
|
||||
await dataTable.selectMultipleItems([ file3Fav, file4Fav ])
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 3 });
|
||||
const isFile1Fav = await apis.user.favorites.isFavorite(file3Id);
|
||||
const isFile2Fav = await apis.user.favorites.isFavorite(file4Id);
|
||||
expect(isFile1Fav).toBe(false, 'item marked as favorite');
|
||||
expect(isFile2Fav).toBe(false, 'item marked as favorite');
|
||||
|
||||
.then(() => apis.user.favorites.removeFavoriteById(file1Id));
|
||||
});
|
||||
|
||||
it('unfavorite multiple items - [C217193]', () => {
|
||||
dataTable.selectMultipleItems([ file3Fav, file4Fav ])
|
||||
.then(() => toolbar.actions.openMoreMenu())
|
||||
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
|
||||
.then(() => browser.sleep(2000))
|
||||
.then(() => Promise.all([
|
||||
apis.user.favorites.isFavorite(file3Id),
|
||||
apis.user.favorites.isFavorite(file4Id)
|
||||
]))
|
||||
.then(resp => {
|
||||
expect(resp[0]).toBe(false, 'item marked as favorite');
|
||||
expect(resp[1]).toBe(false, 'item marked as favorite');
|
||||
})
|
||||
|
||||
.then(() => apis.user.favorites.addFavoriteById('file', file3Id))
|
||||
.then(() => apis.user.favorites.addFavoriteById('file', file4Id));
|
||||
await apis.user.favorites.addFavoriteById('file', file3Id);
|
||||
await apis.user.favorites.addFavoriteById('file', file4Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
});
|
||||
|
||||
describe('on Recent Files', () => {
|
||||
beforeAll(done => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(done => {
|
||||
toolbar.actions.closeMoreMenu().then(done);
|
||||
it('favorite a file - [C280352]', async () => {
|
||||
await dataTable.selectItem(file1NotFav);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 6 });
|
||||
const isFavorite = await apis.user.favorites.isFavorite(file1Id);
|
||||
expect(isFavorite).toBe(true, `${file1NotFav} not marked as favorite`);
|
||||
|
||||
await apis.user.favorites.removeFavoriteById(file1Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
|
||||
it('favorite a file - [C280352]', () => {
|
||||
dataTable.selectItem(file1NotFav)
|
||||
.then(() => toolbar.actions.openMoreMenu())
|
||||
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
|
||||
.then(() => apis.user.favorites.waitForApi({ expect: 3 }))
|
||||
.then(() => apis.user.favorites.isFavorite(file1Id))
|
||||
.then(isFavorite => expect(isFavorite).toBe(true, `${file1NotFav} not marked as favorite`))
|
||||
it('unfavorite an item - [C280353]', async () => {
|
||||
await dataTable.selectItem(file3Fav);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 4 });
|
||||
const isFavorite = await apis.user.favorites.isFavorite(file3Id);
|
||||
expect(isFavorite).toBe(false, `${file3Fav} is marked as favorite`);
|
||||
|
||||
.then(() => apis.user.favorites.removeFavoriteById(file1Id));
|
||||
await apis.user.favorites.addFavoriteById('file', file3Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
|
||||
it('unfavorite an item - [C280353]', () => {
|
||||
dataTable.selectItem(file3Fav)
|
||||
.then(() => toolbar.actions.openMoreMenu())
|
||||
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
|
||||
.then(() => apis.user.favorites.waitForApi({ expect: 1 }))
|
||||
.then(() => apis.user.favorites.isFavorite(file3Id))
|
||||
.then(isFavorite => expect(isFavorite).toBe(false, `${file3Fav} is marked as favorite`))
|
||||
it('favorite multiple items - all unfavorite - [C280355]', async () => {
|
||||
await dataTable.selectMultipleItems([ file1NotFav, file2NotFav ]);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 7 });
|
||||
const isFile1Fav = await apis.user.favorites.isFavorite(file1Id);
|
||||
const isFile2Fav = await apis.user.favorites.isFavorite(file2Id);
|
||||
expect(isFile1Fav).toBe(true, 'item not marked as favorite');
|
||||
expect(isFile2Fav).toBe(true, 'item not marked as favorite');
|
||||
|
||||
.then(() => apis.user.favorites.addFavoriteById('file', file3Id));
|
||||
await apis.user.favorites.removeFavoriteById(file1Id);
|
||||
await apis.user.favorites.removeFavoriteById(file2Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
|
||||
it('favorite multiple items - all unfavorite - [C280355]', () => {
|
||||
dataTable.selectMultipleItems([ file1NotFav, file2NotFav ])
|
||||
.then(() => toolbar.actions.openMoreMenu())
|
||||
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
|
||||
.then(() => apis.user.favorites.waitForApi({ expect: 4 }))
|
||||
.then(() => Promise.all([
|
||||
apis.user.favorites.isFavorite(file1Id),
|
||||
apis.user.favorites.isFavorite(file2Id)
|
||||
]))
|
||||
.then(resp => {
|
||||
expect(resp[0]).toBe(true, 'item not marked as favorite');
|
||||
expect(resp[1]).toBe(true, 'item not marked as favorite');
|
||||
})
|
||||
it('favorite multiple items - some favorite and some unfavorite - [C280357]', async () => {
|
||||
await dataTable.selectMultipleItems([ file1NotFav, file3Fav ]);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 6 });
|
||||
const isFile1Fav = await apis.user.favorites.isFavorite(file1Id);
|
||||
const isFile2Fav = await apis.user.favorites.isFavorite(file3Id);
|
||||
expect(isFile1Fav).toBe(true, 'item not marked as favorite');
|
||||
expect(isFile2Fav).toBe(true, 'item not marked as favorite');
|
||||
|
||||
.then(() => apis.user.favorites.removeFavoriteById(file1Id))
|
||||
.then(() => apis.user.favorites.removeFavoriteById(file2Id));
|
||||
await apis.user.favorites.removeFavoriteById(file1Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
|
||||
it('favorite multiple items - some favorite and some unfavorite - [C280357]', () => {
|
||||
dataTable.selectMultipleItems([ file1NotFav, file3Fav ])
|
||||
.then(() => toolbar.actions.openMoreMenu())
|
||||
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
|
||||
.then(() => apis.user.favorites.waitForApi({ expect: 3 }))
|
||||
.then(() => Promise.all([
|
||||
apis.user.favorites.isFavorite(file1Id),
|
||||
apis.user.favorites.isFavorite(file3Id)
|
||||
]))
|
||||
.then(resp => {
|
||||
expect(resp[0]).toBe(true, 'item not marked as favorite');
|
||||
expect(resp[1]).toBe(true, 'item not marked as favorite');
|
||||
})
|
||||
it('unfavorite multiple items - [C280356]', async () => {
|
||||
await dataTable.selectMultipleItems([ file3Fav, file4Fav ]);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 3 });
|
||||
const isFile1Fav = await apis.user.favorites.isFavorite(file3Id);
|
||||
const isFile2Fav = await apis.user.favorites.isFavorite(file4Id);
|
||||
expect(isFile1Fav).toBe(false, 'item marked as favorite');
|
||||
expect(isFile2Fav).toBe(false, 'item marked as favorite');
|
||||
|
||||
.then(() => apis.user.favorites.removeFavoriteById(file1Id));
|
||||
});
|
||||
|
||||
it('unfavorite multiple items - [C280356]', () => {
|
||||
dataTable.selectMultipleItems([ file3Fav, file4Fav ])
|
||||
.then(() => toolbar.actions.openMoreMenu())
|
||||
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
|
||||
.then(() => browser.sleep(2000))
|
||||
.then(() => Promise.all([
|
||||
apis.user.favorites.isFavorite(file3Id),
|
||||
apis.user.favorites.isFavorite(file4Id)
|
||||
]))
|
||||
.then(resp => {
|
||||
expect(resp[0]).toBe(false, 'item marked as favorite');
|
||||
expect(resp[1]).toBe(false, 'item marked as favorite');
|
||||
})
|
||||
|
||||
.then(() => apis.user.favorites.addFavoriteById('file', file3Id))
|
||||
.then(() => apis.user.favorites.addFavoriteById('file', file4Id));
|
||||
await apis.user.favorites.addFavoriteById('file', file3Id);
|
||||
await apis.user.favorites.addFavoriteById('file', file4Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
});
|
||||
|
||||
describe('on Shared Files', () => {
|
||||
beforeAll(done => {
|
||||
apis.user.shared.shareFilesByIds([ file1Id, file2Id, file3Id, file4Id ])
|
||||
.then(() => apis.user.shared.waitForApi({ expect: 4 }))
|
||||
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES))
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
beforeAll(async (done) => {
|
||||
await page.refresh();
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(done => {
|
||||
// browser.actions().sendKeys(protractor.Key.ESCAPE).perform().then(done);
|
||||
browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform().then(done);
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
it('favorite a file - [C280362]', () => {
|
||||
dataTable.selectItem(file1NotFav)
|
||||
.then(() => toolbar.actions.openMoreMenu())
|
||||
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
|
||||
.then(() => apis.user.favorites.waitForApi({ expect: 3 }))
|
||||
.then(() => apis.user.favorites.isFavorite(file1Id))
|
||||
.then(isFavorite => expect(isFavorite).toBe(true, `${file1NotFav} not marked as favorite`))
|
||||
it('favorite a file - [C280362]', async () => {
|
||||
await dataTable.selectItem(file1NotFav);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 6 });
|
||||
const isFavorite = await apis.user.favorites.isFavorite(file1Id);
|
||||
expect(isFavorite).toBe(true, `${file1NotFav} not marked as favorite`);
|
||||
|
||||
.then(() => apis.user.favorites.removeFavoriteById(file1Id));
|
||||
await apis.user.favorites.removeFavoriteById(file1Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
|
||||
it('unfavorite an item - [C280363]', () => {
|
||||
dataTable.selectItem(file3Fav)
|
||||
.then(() => toolbar.actions.openMoreMenu())
|
||||
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
|
||||
.then(() => apis.user.favorites.waitForApi({ expect: 1 }))
|
||||
.then(() => apis.user.favorites.isFavorite(file3Id))
|
||||
.then(isFavorite => expect(isFavorite).toBe(false, `${file3Fav} is marked as favorite`))
|
||||
it('unfavorite an item - [C280363]', async () => {
|
||||
await dataTable.selectItem(file3Fav);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 4 });
|
||||
const isFavorite = await apis.user.favorites.isFavorite(file3Id);
|
||||
expect(isFavorite).toBe(false, `${file3Fav} is marked as favorite`);
|
||||
|
||||
.then(() => apis.user.favorites.addFavoriteById('file', file3Id));
|
||||
await apis.user.favorites.addFavoriteById('file', file3Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
|
||||
it('favorite multiple items - all unfavorite - [C280365]', () => {
|
||||
dataTable.selectMultipleItems([ file1NotFav, file2NotFav ])
|
||||
.then(() => toolbar.actions.openMoreMenu())
|
||||
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
|
||||
.then(() => apis.user.favorites.waitForApi({ expect: 4 }))
|
||||
.then(() => Promise.all([
|
||||
apis.user.favorites.isFavorite(file1Id),
|
||||
apis.user.favorites.isFavorite(file2Id)
|
||||
]))
|
||||
.then(resp => {
|
||||
expect(resp[0]).toBe(true, 'item not marked as favorite');
|
||||
expect(resp[1]).toBe(true, 'item not marked as favorite');
|
||||
})
|
||||
it('favorite multiple items - all unfavorite - [C280365]', async () => {
|
||||
await dataTable.selectMultipleItems([ file1NotFav, file2NotFav ]);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 7 });
|
||||
const isFile1Fav = await apis.user.favorites.isFavorite(file1Id);
|
||||
const isFile2Fav = await apis.user.favorites.isFavorite(file2Id);
|
||||
expect(isFile1Fav).toBe(true, 'item not marked as favorite');
|
||||
expect(isFile2Fav).toBe(true, 'item not marked as favorite');
|
||||
|
||||
.then(() => apis.user.favorites.removeFavoriteById(file1Id))
|
||||
.then(() => apis.user.favorites.removeFavoriteById(file2Id));
|
||||
await apis.user.favorites.removeFavoriteById(file1Id);
|
||||
await apis.user.favorites.removeFavoriteById(file2Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
|
||||
it('favorite multiple items - some favorite and some unfavorite - [C280367]', () => {
|
||||
dataTable.selectMultipleItems([ file1NotFav, file3Fav ])
|
||||
.then(() => toolbar.actions.openMoreMenu())
|
||||
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
|
||||
.then(() => apis.user.favorites.waitForApi({ expect: 3 }))
|
||||
.then(() => Promise.all([
|
||||
apis.user.favorites.isFavorite(file1Id),
|
||||
apis.user.favorites.isFavorite(file3Id)
|
||||
]))
|
||||
.then(resp => {
|
||||
expect(resp[0]).toBe(true, 'item not marked as favorite');
|
||||
expect(resp[1]).toBe(true, 'item not marked as favorite');
|
||||
})
|
||||
it('favorite multiple items - some favorite and some unfavorite - [C280367]', async () => {
|
||||
await dataTable.selectMultipleItems([ file1NotFav, file3Fav ]);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 6 });
|
||||
const isFile1Fav = await apis.user.favorites.isFavorite(file1Id);
|
||||
const isFile2Fav = await apis.user.favorites.isFavorite(file3Id);
|
||||
expect(isFile1Fav).toBe(true, 'item not marked as favorite');
|
||||
expect(isFile2Fav).toBe(true, 'item not marked as favorite');
|
||||
|
||||
.then(() => apis.user.favorites.removeFavoriteById(file1Id));
|
||||
await apis.user.favorites.removeFavoriteById(file1Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
|
||||
it('unfavorite multiple items - [C280366]', () => {
|
||||
dataTable.selectMultipleItems([ file3Fav, file4Fav ])
|
||||
.then(() => toolbar.actions.openMoreMenu())
|
||||
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
|
||||
.then(() => browser.sleep(2000))
|
||||
.then(() => Promise.all([
|
||||
apis.user.favorites.isFavorite(file3Id),
|
||||
apis.user.favorites.isFavorite(file4Id)
|
||||
]))
|
||||
.then(resp => {
|
||||
expect(resp[0]).toBe(false, 'item marked as favorite');
|
||||
expect(resp[1]).toBe(false, 'item marked as favorite');
|
||||
})
|
||||
it('unfavorite multiple items - [C280366]', async () => {
|
||||
await dataTable.selectMultipleItems([ file3Fav, file4Fav ]);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 3 });
|
||||
const isFile1Fav = await apis.user.favorites.isFavorite(file3Id);
|
||||
const isFile2Fav = await apis.user.favorites.isFavorite(file4Id);
|
||||
expect(isFile1Fav).toBe(false, 'item marked as favorite');
|
||||
expect(isFile2Fav).toBe(false, 'item marked as favorite');
|
||||
|
||||
.then(() => apis.user.favorites.addFavoriteById('file', file3Id))
|
||||
.then(() => apis.user.favorites.addFavoriteById('file', file4Id));
|
||||
await apis.user.favorites.addFavoriteById('file', file3Id);
|
||||
await apis.user.favorites.addFavoriteById('file', file4Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
});
|
||||
|
||||
describe('on Favorites', () => {
|
||||
beforeAll(done => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.refresh();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(done => {
|
||||
page.refresh().then(done);
|
||||
it('unfavorite an item - [C280368]', async () => {
|
||||
await dataTable.selectItem(file3Fav);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 4 });
|
||||
const isFavorite = await apis.user.favorites.isFavorite(file3Id);
|
||||
expect(isFavorite).toBe(false, 'item is marked as favorite');
|
||||
expect(await dataTable.getRowByName(file3Fav).isPresent()).toBe(false, 'item still displayed');
|
||||
|
||||
await apis.user.favorites.addFavoriteById('file', file3Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
|
||||
it('unfavorite an item - [C280368]', () => {
|
||||
dataTable.selectItem(file3Fav)
|
||||
.then(() => toolbar.actions.openMoreMenu())
|
||||
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
|
||||
.then(() => apis.user.favorites.waitForApi({ expect: 1 }))
|
||||
.then(() => apis.user.favorites.isFavorite(file3Id))
|
||||
.then(isFavorite => {
|
||||
expect(isFavorite).toBe(false, 'item is marked as favorite');
|
||||
expect(dataTable.getRowByName(file3Fav).isPresent()).toBe(false, 'item still displayed');
|
||||
})
|
||||
it('unfavorite multiple items - [C280374]', async () => {
|
||||
await dataTable.selectMultipleItems([ file3Fav, file4Fav ]);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 3 });
|
||||
const isFavorite3 = await apis.user.favorites.isFavorite(file3Id);
|
||||
const isFavorite4 = await apis.user.favorites.isFavorite(file4Id);
|
||||
expect(isFavorite3).toBe(false, 'file3 marked as favorite');
|
||||
expect(isFavorite4).toBe(false, 'file4 marked as favorite');
|
||||
expect(await dataTable.getRowByName(file3Fav).isPresent()).toBe(false, 'file3 still displayed');
|
||||
expect(await dataTable.getRowByName(file4Fav).isPresent()).toBe(false, 'file4 still displayed');
|
||||
|
||||
.then(() => apis.user.favorites.addFavoriteById('file', file3Id));
|
||||
await apis.user.favorites.addFavoriteById('file', file3Id);
|
||||
await apis.user.favorites.addFavoriteById('file', file4Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
|
||||
it('unfavorite multiple items - [C280374]', () => {
|
||||
dataTable.selectMultipleItems([ file3Fav, file4Fav ])
|
||||
.then(() => toolbar.actions.openMoreMenu())
|
||||
.then(() => toolbar.actions.menu.clickMenuItem('Favorite'))
|
||||
.then(() => browser.sleep(2000))
|
||||
.then(() => apis.user.favorites.isFavorite(file3Id))
|
||||
.then(resp => {
|
||||
expect(resp).toBe(false, 'file3 marked as favorite');
|
||||
expect(dataTable.getRowByName(file3Fav).isPresent()).toBe(false, 'file3 still displayed');
|
||||
})
|
||||
.then(() => apis.user.favorites.isFavorite(file4Id))
|
||||
.then(resp => {
|
||||
expect(resp).toBe(false, 'file4 marked as favorite');
|
||||
expect(dataTable.getRowByName(file4Fav).isPresent()).toBe(false, 'file4 still displayed');
|
||||
})
|
||||
|
||||
.then(() => apis.user.favorites.addFavoriteById('file', file3Id))
|
||||
.then(() => apis.user.favorites.addFavoriteById('file', file4Id));
|
||||
});
|
||||
|
||||
it('Favorite action has full star icon for items marked as favorite - [C280371]', () => {
|
||||
dataTable.selectItem(file3Fav)
|
||||
.then(() => toolbar.actions.openMoreMenu())
|
||||
.then(() => expect(toolbar.actions.menu.getItemIconText('Favorite')).toEqual('star'));
|
||||
it('Favorite action has full star icon for items marked as favorite - [C280371]', async () => {
|
||||
await dataTable.selectItem(file3Fav);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.getItemIconText('Favorite')).toEqual('star');
|
||||
});
|
||||
});
|
||||
|
||||
describe ('on File Libraries', () => {
|
||||
const fileLibrariesPage = new BrowsingPage();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
const docLibId = (await apis.user.sites.getDocLibId(siteName));
|
||||
folderSiteId = (await apis.user.nodes.createFolder(folderSite, docLibId)).entry.id;
|
||||
fileSiteNotFav1Id = (await apis.user.nodes.createFile(fileSiteNotFav1, folderSiteId)).entry.id;
|
||||
fileSiteFav1Id = (await apis.user.nodes.createFile(fileSiteFav1, folderSiteId)).entry.id;
|
||||
fileSiteNotFav2Id = (await apis.user.nodes.createFile(fileSiteNotFav2, folderSiteId)).entry.id;
|
||||
fileSiteFav2Id = (await apis.user.nodes.createFile(fileSiteFav2, folderSiteId)).entry.id;
|
||||
await apis.user.favorites.addFavoriteById('file', fileSiteFav1Id);
|
||||
await apis.user.favorites.addFavoriteById('file', fileSiteFav2Id);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await fileLibrariesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await fileLibrariesPage.dataTable.waitForHeader();
|
||||
await fileLibrariesPage.dataTable.doubleClickOnRowByName(siteName);
|
||||
await fileLibrariesPage.dataTable.waitForHeader();
|
||||
await toolbar.actions.closeMoreMenu();
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await browser.refresh();
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await page.dataTable.waitForHeader();
|
||||
await page.dataTable.doubleClickOnRowByName(siteName);
|
||||
await page.dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Favorite a folder - [C280391]', async () => {
|
||||
await dataTable.selectItem(folderSite);
|
||||
await toolbar.actions.openMoreMenu();
|
||||
await toolbar.actions.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 3 });
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 6 });
|
||||
const isFavorite = await apis.user.favorites.isFavorite(folderSiteId);
|
||||
expect(isFavorite).toBe(true, `${folderSite} not marked as favorite`);
|
||||
await apis.user.favorites.removeFavoriteById(folderSiteId);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
|
||||
it('Favorite a file - [C280342]', async () => {
|
||||
await fileLibrariesPage.dataTable.doubleClickOnRowByName(folderSite);
|
||||
await page.dataTable.doubleClickOnRowByName(folderSite);
|
||||
await dataTable.selectItem(fileSiteNotFav1);
|
||||
await toolbar.actions.openMoreMenu();
|
||||
await toolbar.actions.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 3 });
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 6 });
|
||||
const isFavorite = await apis.user.favorites.isFavorite(fileSiteNotFav1Id);
|
||||
expect(isFavorite).toBe(true, `${fileSiteNotFav1} not marked as favorite`);
|
||||
await apis.user.favorites.removeFavoriteById(fileSiteNotFav1Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
|
||||
it('Unfavorite an item - [C280343]', async () => {
|
||||
await fileLibrariesPage.dataTable.doubleClickOnRowByName(folderSite);
|
||||
await page.dataTable.doubleClickOnRowByName(folderSite);
|
||||
await dataTable.selectItem(fileSiteFav1);
|
||||
await toolbar.actions.openMoreMenu();
|
||||
await toolbar.actions.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 3 });
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 4 });
|
||||
const isFavorite = await apis.user.favorites.isFavorite(fileSiteFav1Id);
|
||||
expect(isFavorite).toBe(false, `${fileSiteFav1} is marked as favorite`);
|
||||
await apis.user.favorites.addFavoriteById('file', fileSiteFav1Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
|
||||
it('Favorite multiple items - all unfavorite - [C280345]', async () => {
|
||||
await fileLibrariesPage.dataTable.doubleClickOnRowByName(folderSite);
|
||||
await page.dataTable.doubleClickOnRowByName(folderSite);
|
||||
await dataTable.selectMultipleItems([ fileSiteNotFav1, fileSiteNotFav2 ]);
|
||||
await toolbar.actions.openMoreMenu();
|
||||
await toolbar.actions.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 4 });
|
||||
const listItems1 = await Promise.all([
|
||||
apis.user.favorites.isFavorite(fileSiteNotFav1Id),
|
||||
apis.user.favorites.isFavorite(fileSiteNotFav2Id)
|
||||
]);
|
||||
expect(listItems1[0]).toBe(true, 'item not marked as favorite');
|
||||
expect(listItems1[1]).toBe(true, 'item not marked as favorite');
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 7 });
|
||||
|
||||
const isFile1Fav = await apis.user.favorites.isFavorite(fileSiteNotFav1Id);
|
||||
const isFile2Fav = await apis.user.favorites.isFavorite(fileSiteNotFav2Id);
|
||||
expect(isFile1Fav).toBe(true, 'item not marked as favorite');
|
||||
expect(isFile2Fav).toBe(true, 'item not marked as favorite');
|
||||
await apis.user.favorites.removeFavoriteById(fileSiteNotFav1Id);
|
||||
await apis.user.favorites.removeFavoriteById(fileSiteNotFav2Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
|
||||
it('Unfavorite multiple items - [C280346]', async () => {
|
||||
await fileLibrariesPage.dataTable.doubleClickOnRowByName(folderSite);
|
||||
await page.dataTable.doubleClickOnRowByName(folderSite);
|
||||
await dataTable.selectMultipleItems([ fileSiteFav1, fileSiteFav2 ]);
|
||||
await toolbar.actions.openMoreMenu();
|
||||
await toolbar.actions.menu.clickMenuItem('Favorite');
|
||||
const listItems2 = await Promise.all([
|
||||
apis.user.favorites.isFavorite(fileSiteFav1Id),
|
||||
apis.user.favorites.isFavorite(fileSiteFav2Id)
|
||||
]);
|
||||
expect(listItems2[0]).toBe(false, 'item marked as favorite');
|
||||
expect(listItems2[1]).toBe(false, 'item marked as favorite');
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 3 });
|
||||
const isFile1Fav = await apis.user.favorites.isFavorite(fileSiteFav1Id);
|
||||
const isFile2Fav = await apis.user.favorites.isFavorite(fileSiteFav2Id);
|
||||
expect(isFile1Fav).toBe(false, 'item marked as favorite');
|
||||
expect(isFile2Fav).toBe(false, 'item marked as favorite');
|
||||
await apis.user.favorites.addFavoriteById('file', fileSiteFav1Id);
|
||||
await apis.user.favorites.addFavoriteById('file', fileSiteFav2Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
|
||||
it('Favorite multiple items - some favorite and some unfavorite - [C280347]', async () => {
|
||||
await fileLibrariesPage.dataTable.doubleClickOnRowByName(folderSite);
|
||||
await page.dataTable.doubleClickOnRowByName(folderSite);
|
||||
await dataTable.selectMultipleItems([ fileSiteNotFav1, fileSiteFav1 ]);
|
||||
await toolbar.actions.openMoreMenu();
|
||||
await toolbar.actions.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 3 });
|
||||
const listItems3 = await Promise.all([
|
||||
apis.user.favorites.isFavorite(fileSiteNotFav1Id),
|
||||
apis.user.favorites.isFavorite(fileSiteFav1)
|
||||
]);
|
||||
expect(listItems3[0]).toBe(true, 'item not marked as favorite');
|
||||
expect(listItems3[1]).toBe(true, 'item not marked as favorite');
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Favorite');
|
||||
await apis.user.favorites.waitForApi({ expect: 6 });
|
||||
|
||||
const isFile1Fav = await apis.user.favorites.isFavorite(fileSiteNotFav1Id);
|
||||
const isFile2Fav = await apis.user.favorites.isFavorite(fileSiteFav1);
|
||||
expect(isFile1Fav).toBe(true, 'item not marked as favorite');
|
||||
expect(isFile2Fav).toBe(true, 'item not marked as favorite');
|
||||
await apis.user.favorites.removeFavoriteById(fileSiteNotFav1Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 5 });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { browser, protractor } from 'protractor';
|
||||
import { LoginPage, LogoutPage, BrowsingPage } from '../../pages/pages';
|
||||
import { ConfirmDialog } from './../../components/components';
|
||||
import { SIDEBAR_LABELS } from '../../configs';
|
||||
@@ -81,62 +80,66 @@ describe('Permanently delete from Trash', () => {
|
||||
|
||||
it('delete file - [C217091]', async () => {
|
||||
await dataTable.selectItem(file1);
|
||||
await toolbar.actions.getButtonByTitleAttribute('Permanently delete').click();
|
||||
await toolbar.getButtonByTitleAttribute('Permanently delete').click();
|
||||
await trashPage.waitForDialog();
|
||||
await trashPage.getDialogActionByLabel('Delete').click();
|
||||
await trashPage.waitForDialogToClose();
|
||||
// await trashPage.getDialogActionByLabel('Delete').click();
|
||||
// await trashPage.waitForDialogToClose();
|
||||
await confirmDialog.clickButton('Delete');
|
||||
const text = await trashPage.getSnackBarMessage();
|
||||
|
||||
expect(text).toEqual(`${file1} deleted`);
|
||||
expect(dataTable.getRowByName(file1).isPresent()).toBe(false, 'Item was not deleted');
|
||||
expect(await dataTable.getRowByName(file1).isPresent()).toBe(false, 'Item was not deleted');
|
||||
});
|
||||
|
||||
it('delete folder - [C280416]', async () => {
|
||||
await dataTable.selectItem(folder1);
|
||||
await toolbar.actions.getButtonByTitleAttribute('Permanently delete').click();
|
||||
await toolbar.getButtonByTitleAttribute('Permanently delete').click();
|
||||
await trashPage.waitForDialog();
|
||||
await trashPage.getDialogActionByLabel('Delete').click();
|
||||
await trashPage.waitForDialogToClose();
|
||||
// await trashPage.getDialogActionByLabel('Delete').click();
|
||||
// await trashPage.waitForDialogToClose();
|
||||
await confirmDialog.clickButton('Delete');
|
||||
const text = await trashPage.getSnackBarMessage();
|
||||
|
||||
expect(text).toEqual(`${folder1} deleted`);
|
||||
expect(dataTable.getRowByName(folder1).isPresent()).toBe(false, 'Item was not deleted');
|
||||
expect(await dataTable.getRowByName(folder1).isPresent()).toBe(false, 'Item was not deleted');
|
||||
});
|
||||
|
||||
it('delete multiple items - [C280417]', async () => {
|
||||
await dataTable.selectMultipleItems([ file2, folder2 ]);
|
||||
await toolbar.actions.getButtonByTitleAttribute('Permanently delete').click();
|
||||
await toolbar.getButtonByTitleAttribute('Permanently delete').click();
|
||||
await trashPage.waitForDialog();
|
||||
await trashPage.getDialogActionByLabel('Delete').click();
|
||||
await trashPage.waitForDialogToClose();
|
||||
// await trashPage.getDialogActionByLabel('Delete').click();
|
||||
// await trashPage.waitForDialogToClose();
|
||||
await confirmDialog.clickButton('Delete');
|
||||
const text = await trashPage.getSnackBarMessage();
|
||||
|
||||
expect(text).toEqual(`2 items deleted`);
|
||||
expect(dataTable.getRowByName(file2).isPresent()).toBe(false, 'Item was not deleted');
|
||||
expect(dataTable.getRowByName(folder2).isPresent()).toBe(false, 'Item was not deleted');
|
||||
expect(await dataTable.getRowByName(file2).isPresent()).toBe(false, 'Item was not deleted');
|
||||
expect(await dataTable.getRowByName(folder2).isPresent()).toBe(false, 'Item was not deleted');
|
||||
});
|
||||
|
||||
it('Confirmation dialog UI - [C269113]', async () => {
|
||||
await dataTable.selectItem(file3);
|
||||
await toolbar.actions.getButtonByTitleAttribute('Permanently delete').click();
|
||||
await toolbar.getButtonByTitleAttribute('Permanently delete').click();
|
||||
await trashPage.waitForDialog();
|
||||
|
||||
expect(await confirmDialog.isDialogOpen()).toBe(true, 'Confirm delete dialog not open');
|
||||
expect(await confirmDialog.getTitle()).toContain('Delete from trash');
|
||||
expect(await confirmDialog.getText()).toContain('This will permanently remove the selected item(s)');
|
||||
expect(await confirmDialog.deleteButton.isEnabled()).toBe(true, 'DELETE button is not enabled');
|
||||
expect(await confirmDialog.keepButton.isEnabled()).toBe(true, 'KEEP button is not enabled');
|
||||
expect(await confirmDialog.isButtonEnabled('Delete')).toBe(true, 'DELETE button is not enabled');
|
||||
expect(await confirmDialog.isButtonEnabled('Keep')).toBe(true, 'KEEP button is not enabled');
|
||||
|
||||
await browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
await Utils.pressEscape();
|
||||
await dataTable.clearSelection();
|
||||
});
|
||||
|
||||
it('"Keep" action cancels the deletion - [C269115]', async () => {
|
||||
it('Keep action cancels the deletion - [C269115]', async () => {
|
||||
await dataTable.selectItem(file3);
|
||||
await toolbar.actions.getButtonByTitleAttribute('Permanently delete').click();
|
||||
await toolbar.getButtonByTitleAttribute('Permanently delete').click();
|
||||
await trashPage.waitForDialog();
|
||||
|
||||
expect(await confirmDialog.keepButton.isEnabled()).toBe(true, 'KEEP button is not enabled');
|
||||
await confirmDialog.clickKeep();
|
||||
expect(dataTable.getRowByName(file3).isPresent()).toBe(true, 'Item was deleted');
|
||||
expect(await confirmDialog.isButtonEnabled('Keep')).toBe(true, 'KEEP button is not enabled');
|
||||
await confirmDialog.clickButton('Keep');
|
||||
expect(await dataTable.getRowByName(file3).isPresent()).toBe(true, 'Item was deleted');
|
||||
});
|
||||
});
|
||||
|
||||
+222
-221
@@ -30,239 +30,240 @@ import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
|
||||
describe('Restore from Trash', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, toolbar } = page;
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, toolbar } = page;
|
||||
|
||||
beforeAll(done => {
|
||||
apis.admin.people.createUser({ username })
|
||||
.then(() => loginPage.loginWith(username))
|
||||
.then(done);
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.trashcan.emptyTrash(),
|
||||
logoutPage.load()
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
xit('');
|
||||
|
||||
describe('successful restore', () => {
|
||||
const file = `file-${Utils.random()}.txt`;
|
||||
let fileId;
|
||||
const folder = `folder-${Utils.random()}`;
|
||||
let folderId;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
fileId = (await apis.user.nodes.createFile(file)).entry.id;
|
||||
folderId = (await apis.user.nodes.createFolder(folder)).entry.id;
|
||||
await apis.user.nodes.deleteNodesById([fileId, folderId], false);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
Promise.all([
|
||||
apis.admin.trashcan.emptyTrash(),
|
||||
logoutPage.load()
|
||||
])
|
||||
.then(done);
|
||||
beforeEach(async (done) => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
xit('');
|
||||
|
||||
describe('successful restore', () => {
|
||||
const file = `file-${Utils.random()}.txt`; let fileId;
|
||||
const folder = `folder-${Utils.random()}`; let folderId;
|
||||
|
||||
beforeAll(done => {
|
||||
apis.user.nodes.createFile(file).then(resp => fileId = resp.entry.id)
|
||||
.then(() => apis.user.nodes.createFolder(folder).then(resp => folderId = resp.entry.id))
|
||||
.then(() => apis.user.nodes.deleteNodesById([ fileId, folderId ], false))
|
||||
.then(done);
|
||||
});
|
||||
|
||||
beforeEach(done => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
apis.user.trashcan.emptyTrash().then(done);
|
||||
});
|
||||
|
||||
it('restore file - [C217177]', () => {
|
||||
dataTable.selectItem(file)
|
||||
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click())
|
||||
.then(() => page.getSnackBarMessage())
|
||||
.then(text => {
|
||||
expect(text).toContain(`${file} restored`);
|
||||
expect(text).toContain(`View`);
|
||||
expect(dataTable.getRowByName(file).isPresent()).toBe(false, 'Item was not removed from list');
|
||||
})
|
||||
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES))
|
||||
.then(() => page.dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
expect(page.dataTable.getRowByName(file).isPresent()).toBe(true, 'Item not displayed in list');
|
||||
})
|
||||
|
||||
.then(() => apis.user.nodes.deleteNodeById(fileId, false));
|
||||
});
|
||||
|
||||
it('restore folder - [C280438]', () => {
|
||||
dataTable.selectItem(folder)
|
||||
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click())
|
||||
.then(() => page.getSnackBarMessage())
|
||||
.then(text => {
|
||||
expect(text).toContain(`${folder} restored`);
|
||||
expect(text).toContain(`View`);
|
||||
expect(dataTable.getRowByName(folder).isPresent()).toBe(false, 'Item was not removed from list');
|
||||
})
|
||||
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES))
|
||||
.then(() => page.dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
expect(page.dataTable.getRowByName(folder).isPresent()).toBe(true, 'Item not displayed in list');
|
||||
})
|
||||
|
||||
.then(() => apis.user.nodes.deleteNodeById(folderId, false));
|
||||
});
|
||||
|
||||
it('restore multiple items - [C217182]', () => {
|
||||
dataTable.selectMultipleItems([ file, folder ])
|
||||
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click())
|
||||
.then(() => page.getSnackBarMessage())
|
||||
.then(text => {
|
||||
expect(text).toContain(`Restore successful`);
|
||||
expect(text).not.toContain(`View`);
|
||||
expect(dataTable.getRowByName(file).isPresent()).toBe(false, 'Item was not removed from list');
|
||||
expect(dataTable.getRowByName(folder).isPresent()).toBe(false, 'Item was not removed from list');
|
||||
})
|
||||
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES))
|
||||
.then(() => page.dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
expect(page.dataTable.getRowByName(file).isPresent()).toBe(true, 'Item not displayed in list');
|
||||
expect(page.dataTable.getRowByName(folder).isPresent()).toBe(true, 'Item not displayed in list');
|
||||
})
|
||||
|
||||
.then(() => apis.user.nodes.deleteNodesById([ fileId, folderId ], false));
|
||||
});
|
||||
|
||||
it('View from notification - [C217181]', () => {
|
||||
dataTable.selectItem(file)
|
||||
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click())
|
||||
.then(() => page.clickSnackBarAction())
|
||||
.then(() => page.dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
expect(page.sidenav.isActiveByLabel('Personal Files')).toBe(true, 'Personal Files sidebar link not active');
|
||||
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
|
||||
})
|
||||
|
||||
.then(() => apis.user.nodes.deleteNodeById(fileId, false));
|
||||
});
|
||||
afterAll(async (done) => {
|
||||
await apis.user.trashcan.emptyTrash();
|
||||
done();
|
||||
});
|
||||
|
||||
describe('failure to restore', () => {
|
||||
const file1 = `file-${Utils.random()}.txt`; let file1Id1, file1Id2;
|
||||
const file2 = `file-${Utils.random()}.txt`; let file2Id;
|
||||
|
||||
const folder1 = `folder-${Utils.random()}`; let folder1Id;
|
||||
const folder2 = `folder-${Utils.random()}`; let folder2Id;
|
||||
|
||||
beforeAll(done => {
|
||||
apis.user.nodes.createFolder(folder1).then(resp => folder1Id = resp.entry.id)
|
||||
.then(() => apis.user.nodes.createFile(file1, folder1Id).then(resp => file1Id1 = resp.entry.id))
|
||||
.then(() => apis.user.nodes.deleteNodeById(file1Id1, false))
|
||||
.then(() => apis.user.nodes.createFile(file1, folder1Id).then(resp => file1Id2 = resp.entry.id))
|
||||
|
||||
.then(() => apis.user.nodes.createFolder(folder2).then(resp => folder2Id = resp.entry.id))
|
||||
.then(() => apis.user.nodes.createFile(file2, folder2Id).then(resp => file2Id = resp.entry.id))
|
||||
.then(() => apis.user.nodes.deleteNodeById(file2Id, false))
|
||||
.then(() => apis.user.nodes.deleteNodeById(folder2Id, false))
|
||||
|
||||
.then(done);
|
||||
});
|
||||
|
||||
beforeEach(done => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
Promise.all([
|
||||
apis.user.nodes.deleteNodeById(file1Id2),
|
||||
apis.user.trashcan.emptyTrash()
|
||||
])
|
||||
.then(done);
|
||||
});
|
||||
|
||||
it('Restore a file when another file with same name exists on the restore location - [C217178]', () => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH)
|
||||
.then(() => dataTable.selectItem(file1))
|
||||
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click())
|
||||
.then(() => page.getSnackBarMessage())
|
||||
.then(text => expect(text).toEqual(`Can't restore, ${file1} already exists`));
|
||||
});
|
||||
|
||||
it('Restore a file when original location no longer exists - [C217179]', () => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH)
|
||||
.then(() => dataTable.selectItem(file2))
|
||||
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click())
|
||||
.then(() => page.getSnackBarMessage())
|
||||
.then(text => expect(text).toEqual(`Can't restore ${file2}, the original location no longer exists`));
|
||||
});
|
||||
it('restore file - [C217177]', async () => {
|
||||
await dataTable.selectItem(file);
|
||||
await toolbar.getButtonByTitleAttribute('Restore').click();
|
||||
const text = await page.getSnackBarMessage();
|
||||
expect(text).toContain(`${file} restored`);
|
||||
expect(text).toContain(`View`);
|
||||
expect(await dataTable.getRowByName(file).isPresent()).toBe(false, 'Item was not removed from list');
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await page.dataTable.waitForHeader();
|
||||
expect(await page.dataTable.getRowByName(file).isPresent()).toBe(true, 'Item not displayed in list');
|
||||
|
||||
await apis.user.nodes.deleteNodeById(fileId, false);
|
||||
});
|
||||
|
||||
describe('Notification on partial success', () => {
|
||||
const folder1 = `folder1-${Utils.random()}.txt`; let folder1Id;
|
||||
const folder2 = `folder2-${Utils.random()}.txt`; let folder2Id;
|
||||
const file1 = `file-${Utils.random()}.txt`; let file1Id;
|
||||
const file2 = `file-${Utils.random()}.txt`; let file2Id;
|
||||
it('restore folder - [C280438]', async () => {
|
||||
await dataTable.selectItem(folder);
|
||||
await toolbar.getButtonByTitleAttribute('Restore').click();
|
||||
const text = await page.getSnackBarMessage();
|
||||
expect(text).toContain(`${folder} restored`);
|
||||
expect(text).toContain(`View`);
|
||||
expect(await dataTable.getRowByName(folder).isPresent()).toBe(false, 'Item was not removed from list');
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await page.dataTable.waitForHeader();
|
||||
expect(await page.dataTable.getRowByName(folder).isPresent()).toBe(true, 'Item not displayed in list');
|
||||
|
||||
const folder3 = `folder3-${Utils.random()}.txt`; let folder3Id;
|
||||
const folder4 = `folder4-${Utils.random()}.txt`; let folder4Id;
|
||||
const file3 = `file3-${Utils.random()}.txt`; let file3Id;
|
||||
const file4 = `file4-${Utils.random()}.txt`; let file4Id;
|
||||
const file5 = `file5-${Utils.random()}.txt`; let file5Id;
|
||||
|
||||
beforeAll(done => {
|
||||
apis.user.nodes.createFolder(folder1).then(resp => folder1Id = resp.entry.id)
|
||||
.then(() => apis.user.nodes.createFile(file1, folder1Id).then(resp => file1Id = resp.entry.id))
|
||||
.then(() => apis.user.nodes.createFolder(folder2).then(resp => folder2Id = resp.entry.id))
|
||||
.then(() => apis.user.nodes.createFile(file2, folder2Id).then(resp => file2Id = resp.entry.id))
|
||||
.then(() => apis.user.nodes.deleteNodeById(file1Id, false))
|
||||
.then(() => apis.user.nodes.deleteNodeById(folder1Id, false))
|
||||
.then(() => apis.user.nodes.deleteNodeById(file2Id, false))
|
||||
|
||||
.then(() => apis.user.nodes.createFolder(folder3).then(resp => folder3Id = resp.entry.id))
|
||||
.then(() => apis.user.nodes.createFile(file3, folder3Id).then(resp => file3Id = resp.entry.id))
|
||||
.then(() => apis.user.nodes.createFile(file4, folder3Id).then(resp => file4Id = resp.entry.id))
|
||||
.then(() => apis.user.nodes.createFolder(folder4).then(resp => folder4Id = resp.entry.id))
|
||||
.then(() => apis.user.nodes.createFile(file5, folder4Id).then(resp => file5Id = resp.entry.id))
|
||||
.then(() => apis.user.nodes.deleteNodeById(file3Id, false))
|
||||
.then(() => apis.user.nodes.deleteNodeById(file4Id, false))
|
||||
.then(() => apis.user.nodes.deleteNodeById(folder3Id, false))
|
||||
.then(() => apis.user.nodes.deleteNodeById(file5Id, false))
|
||||
|
||||
.then(() => loginPage.loginWith(username))
|
||||
.then(done);
|
||||
});
|
||||
|
||||
beforeEach(done => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
Promise.all([
|
||||
apis.user.trashcan.emptyTrash(),
|
||||
logoutPage.load()
|
||||
])
|
||||
.then(done);
|
||||
});
|
||||
|
||||
it('one failure - [C217183]', () => {
|
||||
dataTable.selectMultipleItems([ file1, file2 ])
|
||||
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click())
|
||||
.then(() => page.getSnackBarMessage())
|
||||
.then(text => expect(text).toEqual(`Can't restore ${file1}, the original location no longer exists`));
|
||||
});
|
||||
|
||||
it('multiple failures - [C217184]', () => {
|
||||
dataTable.selectMultipleItems([ file3, file4, file5 ])
|
||||
.then(() => toolbar.actions.getButtonByTitleAttribute('Restore').click())
|
||||
.then(() => page.getSnackBarMessage())
|
||||
.then(text => expect(text).toEqual('2 items not restored because of issues with the restore location'));
|
||||
});
|
||||
await apis.user.nodes.deleteNodeById(folderId, false);
|
||||
});
|
||||
|
||||
it('restore multiple items - [C217182]', async () => {
|
||||
await dataTable.selectMultipleItems([file, folder]);
|
||||
await toolbar.getButtonByTitleAttribute('Restore').click();
|
||||
const text = await page.getSnackBarMessage();
|
||||
expect(text).toContain(`Restore successful`);
|
||||
expect(text).not.toContain(`View`);
|
||||
expect(await dataTable.getRowByName(file).isPresent()).toBe(false, 'Item was not removed from list');
|
||||
expect(await dataTable.getRowByName(folder).isPresent()).toBe(false, 'Item was not removed from list');
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await page.dataTable.waitForHeader();
|
||||
expect(await page.dataTable.getRowByName(file).isPresent()).toBe(true, 'Item not displayed in list');
|
||||
expect(await page.dataTable.getRowByName(folder).isPresent()).toBe(true, 'Item not displayed in list');
|
||||
|
||||
await apis.user.nodes.deleteNodesById([fileId, folderId], false);
|
||||
});
|
||||
|
||||
it('View from notification - [C217181]', async () => {
|
||||
await dataTable.selectItem(file);
|
||||
await toolbar.getButtonByTitleAttribute('Restore').click();
|
||||
await page.clickSnackBarAction();
|
||||
await page.dataTable.waitForHeader();
|
||||
expect(await page.sidenav.isActiveByLabel('Personal Files')).toBe(true, 'Personal Files sidebar link not active');
|
||||
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
|
||||
|
||||
await apis.user.nodes.deleteNodeById(fileId, false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('failure to restore', () => {
|
||||
const file1 = `file-${Utils.random()}.txt`;
|
||||
let file1Id1, file1Id2;
|
||||
const file2 = `file-${Utils.random()}.txt`;
|
||||
let file2Id;
|
||||
|
||||
const folder1 = `folder-${Utils.random()}`;
|
||||
let folder1Id;
|
||||
const folder2 = `folder-${Utils.random()}`;
|
||||
let folder2Id;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
folder1Id = (await apis.user.nodes.createFolder(folder1)).entry.id;
|
||||
file1Id1 = (await apis.user.nodes.createFile(file1, folder1Id)).entry.id;
|
||||
await apis.user.nodes.deleteNodeById(file1Id1, false);
|
||||
file1Id2 = (await apis.user.nodes.createFile(file1, folder1Id)).entry.id;
|
||||
|
||||
folder2Id = (await apis.user.nodes.createFolder(folder2)).entry.id;
|
||||
file2Id = (await apis.user.nodes.createFile(file2, folder2Id)).entry.id;
|
||||
await apis.user.nodes.deleteNodeById(file2Id, false);
|
||||
await apis.user.nodes.deleteNodeById(folder2Id, false);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.user.nodes.deleteNodeById(file1Id2),
|
||||
apis.user.trashcan.emptyTrash()
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
it('Restore a file when another file with same name exists on the restore location - [C217178]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||
await dataTable.selectItem(file1);
|
||||
await toolbar.getButtonByTitleAttribute('Restore').click();
|
||||
const text = await page.getSnackBarMessage();
|
||||
expect(text).toEqual(`Can't restore, ${file1} already exists`);
|
||||
});
|
||||
|
||||
it('Restore a file when original location no longer exists - [C217179]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||
await dataTable.selectItem(file2);
|
||||
await toolbar.getButtonByTitleAttribute('Restore').click();
|
||||
const text = await page.getSnackBarMessage();
|
||||
expect(text).toEqual(`Can't restore ${file2}, the original location no longer exists`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Notification on partial success', () => {
|
||||
const folder1 = `folder1-${Utils.random()}.txt`;
|
||||
let folder1Id;
|
||||
const folder2 = `folder2-${Utils.random()}.txt`;
|
||||
let folder2Id;
|
||||
const file1 = `file-${Utils.random()}.txt`;
|
||||
let file1Id;
|
||||
const file2 = `file-${Utils.random()}.txt`;
|
||||
let file2Id;
|
||||
|
||||
const folder3 = `folder3-${Utils.random()}.txt`;
|
||||
let folder3Id;
|
||||
const folder4 = `folder4-${Utils.random()}.txt`;
|
||||
let folder4Id;
|
||||
const file3 = `file3-${Utils.random()}.txt`;
|
||||
let file3Id;
|
||||
const file4 = `file4-${Utils.random()}.txt`;
|
||||
let file4Id;
|
||||
const file5 = `file5-${Utils.random()}.txt`;
|
||||
let file5Id;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
folder1Id = (await apis.user.nodes.createFolder(folder1)).entry.id;
|
||||
file1Id = (await apis.user.nodes.createFile(file1, folder1Id)).entry.id;
|
||||
folder2Id = (await apis.user.nodes.createFolder(folder2)).entry.id;
|
||||
file2Id = (await apis.user.nodes.createFile(file2, folder2Id)).entry.id;
|
||||
await apis.user.nodes.deleteNodeById(file1Id, false);
|
||||
await apis.user.nodes.deleteNodeById(folder1Id, false);
|
||||
await apis.user.nodes.deleteNodeById(file2Id, false);
|
||||
|
||||
folder3Id = (await apis.user.nodes.createFolder(folder3)).entry.id;
|
||||
file3Id = (await apis.user.nodes.createFile(file3, folder3Id)).entry.id;
|
||||
file4Id = (await apis.user.nodes.createFile(file4, folder3Id)).entry.id;
|
||||
folder4Id = (await apis.user.nodes.createFolder(folder4)).entry.id;
|
||||
file5Id = (await apis.user.nodes.createFile(file5, folder4Id)).entry.id;
|
||||
await apis.user.nodes.deleteNodeById(file3Id, false);
|
||||
await apis.user.nodes.deleteNodeById(file4Id, false);
|
||||
await apis.user.nodes.deleteNodeById(folder3Id, false);
|
||||
await apis.user.nodes.deleteNodeById(file5Id, false);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.user.trashcan.emptyTrash(),
|
||||
logoutPage.load()
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
it('one failure - [C217183]', async () => {
|
||||
await dataTable.selectMultipleItems([file1, file2]);
|
||||
await toolbar.getButtonByTitleAttribute('Restore').click();
|
||||
const text = await page.getSnackBarMessage();
|
||||
expect(text).toEqual(`Can't restore ${file1}, the original location no longer exists`);
|
||||
});
|
||||
|
||||
it('multiple failures - [C217184]', async () => {
|
||||
await dataTable.selectMultipleItems([file3, file4, file5]);
|
||||
await toolbar.getButtonByTitleAttribute('Restore').click();
|
||||
const text = await page.getSnackBarMessage();
|
||||
expect(text).toEqual('2 items not restored because of issues with the restore location');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Executable
+1069
File diff suppressed because it is too large
Load Diff
Executable
+208
@@ -0,0 +1,208 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2018 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, LogoutPage, BrowsingPage } from '../../pages/pages';
|
||||
import { Viewer } from '../../components/viewer/viewer';
|
||||
import { SIDEBAR_LABELS } from '../../configs';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
|
||||
describe('Single click on item name', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const file1 = `file1-${Utils.random()}.txt`; let file1Id;
|
||||
const folder1 = `folder1-${Utils.random()}`; let folder1Id;
|
||||
|
||||
const deletedFile1 = `file1-${Utils.random()}.txt`; let deletedFile1Id;
|
||||
const deletedFolder1 = `folder1-${Utils.random()}`; let deletedFolder1Id;
|
||||
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const fileSite = `fileSite-${Utils.random()}.txt`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, breadcrumb } = page;
|
||||
const viewer = new Viewer();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
file1Id = (await apis.user.nodes.createFile(file1)).entry.id;
|
||||
folder1Id = (await apis.user.nodes.createFolder(folder1)).entry.id;
|
||||
|
||||
deletedFile1Id = (await apis.user.nodes.createFile(deletedFile1)).entry.id;
|
||||
deletedFolder1Id = (await apis.user.nodes.createFolder(deletedFolder1)).entry.id;
|
||||
await apis.user.nodes.deleteNodeById(deletedFile1Id, false);
|
||||
await apis.user.nodes.deleteNodeById(deletedFolder1Id, false);
|
||||
|
||||
await apis.user.sites.createSite(siteName);
|
||||
const docLibId = (await apis.user.sites.getDocLibId(siteName));
|
||||
await apis.user.nodes.createFile(fileSite, docLibId);
|
||||
|
||||
await apis.user.shared.shareFileById(file1Id);
|
||||
await apis.user.shared.waitForApi({ expect: 1 });
|
||||
|
||||
await apis.user.favorites.addFavoriteById('file', file1Id);
|
||||
await apis.user.favorites.addFavoriteById('folder', folder1Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 2 + 1 });
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.sites.deleteSite(siteName);
|
||||
await apis.user.nodes.deleteNodeById(folder1Id);
|
||||
await apis.user.nodes.deleteNodeById(file1Id);
|
||||
await apis.user.trashcan.emptyTrash();
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Hyperlink does not appear for items in the Trash - [C284899]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||
await dataTable.waitForHeader();
|
||||
|
||||
expect(await dataTable.hasLinkOnName(deletedFile1)).toBe(false, 'Link on name is present');
|
||||
expect(await dataTable.hasLinkOnName(deletedFolder1)).toBe(false, 'Link on name is present');
|
||||
});
|
||||
|
||||
describe('on Personal Files', () => {
|
||||
beforeEach(async (done) => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Hyperlink appears when mouse over a file/folder - [C280032]', async () => {
|
||||
expect(await dataTable.hasLinkOnName(file1)).toBe(true, 'Link on name is missing');
|
||||
});
|
||||
|
||||
it('File preview opens when clicking the hyperlink - [C280033]', async () => {
|
||||
await dataTable.clickNameLink(file1);
|
||||
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
it('Navigate inside the folder when clicking the hyperlink - [C280034]', async () => {
|
||||
await dataTable.clickNameLink(folder1);
|
||||
|
||||
expect(await breadcrumb.getCurrentItemName()).toBe(folder1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on File Libraries', () => {
|
||||
beforeEach(async (done) => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Hyperlink appears when mouse over a library - [C284901]', async () => {
|
||||
expect(await dataTable.hasLinkOnName(siteName)).toBe(true, 'Link on site name is missing');
|
||||
});
|
||||
|
||||
it('Navigate inside the library when clicking the hyperlink - [C284902]', async () => {
|
||||
await dataTable.clickNameLink(siteName);
|
||||
|
||||
expect(await breadcrumb.getCurrentItemName()).toBe(siteName);
|
||||
expect(await dataTable.getRowByName(fileSite).isPresent()).toBe(true, `${fileSite} not displayed`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on Shared Files', () => {
|
||||
beforeEach(async (done) => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Hyperlink appears when mouse over a file - [C284905]', async () => {
|
||||
expect(await dataTable.hasLinkOnName(file1)).toBe(true, 'Link on name is missing');
|
||||
});
|
||||
|
||||
it('File preview opens when clicking the hyperlink - [C284906]', async () => {
|
||||
await dataTable.clickNameLink(file1);
|
||||
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
});
|
||||
|
||||
describe('on Recent Files', () => {
|
||||
beforeEach(async (done) => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Hyperlink appears when mouse over a file - [C284907]', async () => {
|
||||
expect(await dataTable.hasLinkOnName(file1)).toBe(true, 'Link on name is missing');
|
||||
});
|
||||
|
||||
it('File preview opens when clicking the hyperlink - [C284908]', async () => {
|
||||
await dataTable.clickNameLink(file1);
|
||||
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
});
|
||||
|
||||
describe('on Favorites', () => {
|
||||
beforeEach(async (done) => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Hyperlink appears when mouse over a file/folder - [C284909]', async () => {
|
||||
expect(await dataTable.hasLinkOnName(file1)).toBe(true, 'Link on name is missing');
|
||||
});
|
||||
|
||||
it('File preview opens when clicking the hyperlink - [C284910]', async () => {
|
||||
await dataTable.clickNameLink(file1);
|
||||
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
it('Navigate inside the folder when clicking the hyperlink - [C284911]', async () => {
|
||||
await dataTable.clickNameLink(folder1);
|
||||
|
||||
expect(await breadcrumb.getCurrentItemName()).toBe(folder1);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,720 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2018 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, LogoutPage, BrowsingPage } from '../../pages/pages';
|
||||
import { SITE_VISIBILITY, SITE_ROLES, SIDEBAR_LABELS, FILES } from '../../configs';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
import { Viewer } from '../../components/viewer/viewer';
|
||||
|
||||
describe('Granular permissions available actions : ', () => {
|
||||
const userConsumer = `consumer-${Utils.random()}`;
|
||||
const userManager = `manager-${Utils.random()}`;
|
||||
|
||||
const siteName = `site-private-${Utils.random()}`;
|
||||
const file1 = `file1-${Utils.random()}.txt`;
|
||||
let file1Id;
|
||||
const file2 = `file2-${Utils.random()}.txt`;
|
||||
let file2Id;
|
||||
const file3 = `file3-${Utils.random()}.txt`;
|
||||
let file3Id;
|
||||
|
||||
const folder1 = `folder1-${Utils.random()}`;
|
||||
let folder1Id;
|
||||
const folder2 = `folder2-${Utils.random()}`;
|
||||
let folder2Id;
|
||||
|
||||
const docxFile = FILES.docxFile;
|
||||
let docxFileId;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
userConsumer: new RepoClient(userConsumer, userConsumer),
|
||||
userManager: new RepoClient(userManager, userManager)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, toolbar } = page;
|
||||
const contextMenu = dataTable.menu;
|
||||
const viewer = new Viewer();
|
||||
const viewerToolbar = viewer.toolbar;
|
||||
|
||||
beforeAll(async done => {
|
||||
await apis.admin.people.createUser({ username: userConsumer });
|
||||
await apis.admin.people.createUser({ username: userManager });
|
||||
|
||||
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, userManager, SITE_ROLES.SITE_MANAGER);
|
||||
await apis.admin.sites.addSiteMember(siteName, userConsumer, SITE_ROLES.SITE_CONSUMER);
|
||||
|
||||
await apis.admin.nodes.setGranularPermission(file3Id, false, userConsumer, SITE_ROLES.SITE_MANAGER);
|
||||
|
||||
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: 4 });
|
||||
|
||||
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 loginPage.loginWith(userConsumer);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async done => {
|
||||
await apis.admin.sites.deleteSite(siteName);
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
xit('');
|
||||
|
||||
describe('toolbar displays correct actions when selecting multiple files with different granular permissions', () => {
|
||||
beforeEach(async done => {
|
||||
await Utils.pressEscape();
|
||||
done();
|
||||
});
|
||||
|
||||
it('on File Libraries - [C280476]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectMultipleItems([file1, file2]);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed for selected files`);
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`);
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
|
||||
it('on Shared Files - [C280477]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectMultipleItems([file1, file2]);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed for selected files`);
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`);
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
|
||||
it('on Favorites - [C280478]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectMultipleItems([file1, file2]);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed for selected files`);
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`);
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
// TODO: enable when ACA-1737 is done
|
||||
// expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`);
|
||||
// expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
});
|
||||
|
||||
describe('toolbar actions appear correctly for a file - consumer', () => {
|
||||
beforeEach(async done => {
|
||||
await Utils.pressEscape();
|
||||
done();
|
||||
});
|
||||
|
||||
it('on File Libraries - [C280455]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectItem(file1);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(true, `View is not displayed for ${file1}`);
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${file1}`);
|
||||
expect(await toolbar.isButtonPresent('View details')).toBe(true, `View details is not displayed for ${file1}`);
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${file1}`);
|
||||
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${file1}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${file1}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${file1}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${file1}`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
|
||||
it('on Shared Files - [C280456]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await page.dataTable.waitForHeader();
|
||||
await page.dataTable.selectItem(file1);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(true, `View is not displayed for ${file1}`);
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${file1}`);
|
||||
expect(await toolbar.isButtonPresent('View details')).toBe(true, `View details is not displayed for ${file1}`);
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${file1}`);
|
||||
await toolbar.openMoreMenu();
|
||||
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${file1}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${file1}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${file1}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${file1}`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
|
||||
it('on Favorites - [C213121]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectItem(file1);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(true, `View is not displayed for ${file1}`);
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${file1}`);
|
||||
expect(await toolbar.isButtonPresent('View details')).toBe(true, `View details is not displayed for ${file1}`);
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${file1}`);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${file1}`);
|
||||
// TODO: enable when ACA-1737 is done
|
||||
// expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${file1}`);
|
||||
// expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${file1}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${file1}`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
});
|
||||
|
||||
describe('toolbar actions appear correctly for a folder - consumer', () => {
|
||||
beforeEach(async done => {
|
||||
await Utils.pressEscape();
|
||||
done();
|
||||
});
|
||||
|
||||
it('on File Libraries - [C280444]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectItem(folder1);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed for ${folder1}`);
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${folder1}`);
|
||||
expect(await toolbar.isButtonPresent('View details')).toBe(true, `View details is not displayed for ${folder1}`);
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${folder1}`);
|
||||
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folder1}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${folder1}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${folder1}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folder1}`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
|
||||
it('on Favorites - [C286266]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectItem(folder1);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, `View is not displayed for ${folder1}`);
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${folder1}`);
|
||||
expect(await toolbar.isButtonPresent('View details')).toBe(true, `View details is not displayed for ${folder1}`);
|
||||
// TODO: enable when ACA-1737 is done
|
||||
// expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${folder1}`);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folder1}`);
|
||||
// TODO: enable when ACA-1737 is done
|
||||
// expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${folder1}`);
|
||||
// expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${folder1}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folder1}`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
});
|
||||
|
||||
describe('toolbar actions appear correctly for multiple selection of files - consumer', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('on File Libraries - [C280464]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectMultipleItems([file1, file2]);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
|
||||
it('on Shared Files - [C286284]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectMultipleItems([file1, file2]);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed for selected files`);
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`);
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
|
||||
it('on Favorites - [C286285]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectMultipleItems([file1, file2]);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed for selected files`);
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`);
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
// TODO: enable when ACA-1737 is done
|
||||
// expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`);
|
||||
// expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
});
|
||||
|
||||
describe('toolbar actions appear correctly for multiple selection of folders - consumer', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('on File Libraries - [C280465]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectMultipleItems([folder1, folder2]);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
|
||||
it('on Favorites - [C286286]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectMultipleItems([folder1, folder2]);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed for selected files`);
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`);
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
// TODO: enable when ACA-1737 is done
|
||||
// expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`);
|
||||
// expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
});
|
||||
|
||||
describe('toolbar actions appear correctly for when both files and folders are selected - consumer', () => {
|
||||
beforeEach(async done => {
|
||||
await Utils.pressEscape();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('on File Libraries - [C280466]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectMultipleItems([file1, folder1]);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
|
||||
it('on Favorites - [C286287]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectMultipleItems([file1, folder1]);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed for selected files`);
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`);
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
// TODO: enable when ACA-1737 is done
|
||||
// expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`);
|
||||
// expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
});
|
||||
|
||||
describe('context menu actions are correct for a file - consumer', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
done();
|
||||
});
|
||||
|
||||
it('on File Libraries - [C280599]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.rightClickOnItem(file1);
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, `Download is not displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(true, `View is not displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Share')).toBe(true, `Share is not displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Manage Versions')).toBe(true, `Manage Versions not displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(false, `Permissions is displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, `Edit is displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View details')).toBe(false, `View details is displayed for ${file1}`);
|
||||
});
|
||||
|
||||
it('on Shared Files - [C286264]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.rightClickOnItem(file1);
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, `Download is not displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(true, `View is not displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${file1}`);
|
||||
// TODO: enable this when the action is properly implemented: ACA-92
|
||||
// expect(await contextMenu.isMenuItemPresent('Share')).toBe(true, `Share is not displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Manage Versions')).toBe(true, `Manage Versions not displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(false, `Permissions is displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, `Edit is displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View details')).toBe(false, `View details is displayed for ${file1}`);
|
||||
});
|
||||
|
||||
it('on Favorites - [C286262]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.rightClickOnItem(file1);
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, `Download is not displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(true, `View is not displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${file1}`);
|
||||
// TODO: enable when ACA-1737 is done
|
||||
// expect(await contextMenu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${file1}`);
|
||||
// expect(await contextMenu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Share')).toBe(true, `Share is not displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Manage Versions')).toBe(true, `Manage Versions is not displayed for ${file1}`);
|
||||
// TODO: enable when ACA-1794 is fixed
|
||||
// expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(true, `Permissions is not displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, `Edit is displayed for ${file1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View details')).toBe(false, `View details is displayed for ${file1}`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('context menu actions are correct for a folder - consumer', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
done();
|
||||
});
|
||||
|
||||
it('on File Libraries - [C280600]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.rightClickOnItem(folder1);
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, `Download is not enabled for ${folder1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, `Edit is displayed for ${folder1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folder1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folder1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${folder1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${folder1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(false, `Permissions is displayed for ${folder1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, `View is displayed for ${folder1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Manage Versions')).toBe(false, `Manage Versions displayed for ${folder1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Share')).toBe(false, `Share is displayed for ${folder1}`);
|
||||
});
|
||||
|
||||
it('on Favorites - [C286263]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.rightClickOnItem(folder1);
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, `Download is not enabled for ${folder1}`);
|
||||
// enable when ACA-1737 is done
|
||||
// expect(await contextMenu.isMenuItemPresent('Edit')).toBe(false, `Edit is displayed for ${folder1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folder1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folder1}`);
|
||||
// TODO: enable when ACA-1737 is done
|
||||
// expect(await contextMenu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${folder1}`);
|
||||
// expect(await contextMenu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${folder1}`);
|
||||
// TODO: enable when ACA-1794 is fixed
|
||||
// expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(true, `Permissions is not displayed for ${folder1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, `View is displayed for ${folder1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Manage Versions')).toBe(false, `Manage Versions is displayed for ${folder1}`);
|
||||
expect(await contextMenu.isMenuItemPresent('Share')).toBe(false, `Share is displayed for ${folder1}`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('context menu actions are correct for multiple selection of files - consumer', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('on File Libraries - [C280647]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectMultipleItems([file1, file2]);
|
||||
await dataTable.rightClickOnMultipleSelection();
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(false, `Move is displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(false, `Permissions is displayed`);
|
||||
});
|
||||
|
||||
it('on Shared Files - [C286283]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectMultipleItems([file1, file2]);
|
||||
await dataTable.rightClickOnMultipleSelection();
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(false, `Move is displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(false, `Permissions is displayed`);
|
||||
});
|
||||
|
||||
it('on Favorites - [C286280]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectMultipleItems([file1, file2]);
|
||||
await dataTable.rightClickOnMultipleSelection();
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
// TODO: enable when ACA-1737 is done
|
||||
// expect(await contextMenu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed`);
|
||||
// expect(await contextMenu.isMenuItemPresent('Move')).toBe(false, `Move is displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(false, `Permissions is displayed`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('context menu actions are correct for multiple selection of folders - consumer', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('on File Libraries - [C280666]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectMultipleItems([folder1, folder2]);
|
||||
await dataTable.rightClickOnMultipleSelection();
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(false, `Move is displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(false, `Permissions is displayed`);
|
||||
});
|
||||
|
||||
it('on Favorites - [C286281]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectMultipleItems([folder1, folder2]);
|
||||
await dataTable.rightClickOnMultipleSelection();
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
// TODO: enable when ACA-1737 is done
|
||||
// expect(await contextMenu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed`);
|
||||
// expect(await contextMenu.isMenuItemPresent('Move')).toBe(false, `Move is displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(false, `Permissions is displayed`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('context menu actions are correct when both files and folders are selected - consumer', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('on File Libraries - [C280669]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectMultipleItems([file1, folder1]);
|
||||
await dataTable.rightClickOnMultipleSelection();
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Move')).toBe(false, `Move is displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(false, `Permissions is displayed`);
|
||||
});
|
||||
|
||||
it('on Favorites - [C286282]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectMultipleItems([file1, folder1]);
|
||||
await dataTable.rightClickOnMultipleSelection();
|
||||
expect(await contextMenu.isMenuItemPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await contextMenu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
// TODO: enable when ACA-1737 is done
|
||||
// expect(await contextMenu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed`);
|
||||
// expect(await contextMenu.isMenuItemPresent('Move')).toBe(false, `Move is displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
expect(await contextMenu.isMenuItemPresent('Permissions')).toBe(false, `Permissions is displayed`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('toolbar actions appear correctly in the viewer - consumer', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
done();
|
||||
});
|
||||
|
||||
it('file from File Libraries - [C268128]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(docxFile);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
expect(await viewerToolbar.isEmpty()).toBe(false, `viewer toolbar is empty`);
|
||||
expect(await viewerToolbar.isButtonPresent('View')).toBe(false, `View is displayed`);
|
||||
expect(await viewerToolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed`);
|
||||
expect(await viewerToolbar.isButtonPresent('Print')).toBe(true, `Print is not displayed`);
|
||||
expect(await viewerToolbar.isButtonPresent('Activate full-screen mode')).toBe(true, `Full screen is not displayed`);
|
||||
expect(await viewerToolbar.isButtonPresent('View details')).toBe(true, `View details is not displayed`);
|
||||
await viewerToolbar.openMoreMenu();
|
||||
expect(await viewerToolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
expect(await viewerToolbar.menu.isMenuItemPresent('Share')).toBe(true, `Share is not displayed`);
|
||||
expect(await viewerToolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
expect(await viewerToolbar.menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed`);
|
||||
expect(await viewerToolbar.menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed`);
|
||||
expect(await viewerToolbar.menu.isMenuItemPresent('Manage Versions')).toBe(true, `Manage versions is displayed`);
|
||||
expect(await viewerToolbar.menu.isMenuItemPresent('Permissions')).toBe(false, `Permissions is displayed`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
|
||||
it('file from Shared Files - [C286310]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await page.dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(docxFile);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
expect(await viewerToolbar.isEmpty()).toBe(false, `viewer toolbar is empty`);
|
||||
expect(await viewerToolbar.isButtonPresent('View')).toBe(false, `View is displayed`);
|
||||
expect(await viewerToolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed`);
|
||||
expect(await viewerToolbar.isButtonPresent('Print')).toBe(true, `Print is not displayed`);
|
||||
expect(await viewerToolbar.isButtonPresent('Activate full-screen mode')).toBe(true, `Full screen is not displayed`);
|
||||
expect(await viewerToolbar.isButtonPresent('View details')).toBe(true, `View details is not displayed`);
|
||||
await viewerToolbar.openMoreMenu();
|
||||
expect(await viewerToolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
expect(await viewerToolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
expect(await viewerToolbar.menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed`);
|
||||
expect(await viewerToolbar.menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed`);
|
||||
expect(await viewerToolbar.menu.isMenuItemPresent('Manage Versions')).toBe(true, `Manage versions is displayed`);
|
||||
expect(await viewerToolbar.menu.isMenuItemPresent('Permissions')).toBe(false, `Permissions is displayed`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
|
||||
it('file from Favorites - [C286311]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(docxFile);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
expect(await viewerToolbar.isEmpty()).toBe(false, `viewer toolbar is empty`);
|
||||
expect(await viewerToolbar.isButtonPresent('View')).toBe(false, `View is displayed`);
|
||||
expect(await viewerToolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed`);
|
||||
expect(await viewerToolbar.isButtonPresent('Print')).toBe(true, `Print is not displayed`);
|
||||
expect(await viewerToolbar.isButtonPresent('Activate full-screen mode')).toBe(true, `Full screen is not displayed`);
|
||||
expect(await viewerToolbar.isButtonPresent('View details')).toBe(true, `View details is not displayed`);
|
||||
await viewerToolbar.openMoreMenu();
|
||||
expect(await viewerToolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
expect(await viewerToolbar.menu.isMenuItemPresent('Share')).toBe(true, `Share is not displayed`);
|
||||
expect(await viewerToolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
// TODO: enable when ACA-1737 is done
|
||||
// expect(await viewerToolbar.menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed`);
|
||||
// expect(await viewerToolbar.menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed`);
|
||||
expect(await viewerToolbar.menu.isMenuItemPresent('Manage Versions')).toBe(true, `Manage versions is displayed`);
|
||||
expect(await viewerToolbar.menu.isMenuItemPresent('Permissions')).toBe(false, `Permissions is displayed`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -25,473 +25,333 @@
|
||||
|
||||
import { browser, protractor } from 'protractor';
|
||||
import { LoginPage, LogoutPage, BrowsingPage } from '../../pages/pages';
|
||||
import { SITE_VISIBILITY, SITE_ROLES, SIDEBAR_LABELS } from '../../configs';
|
||||
import { SITE_VISIBILITY, SIDEBAR_LABELS } from '../../configs';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
|
||||
describe('Toolbar actions - multiple selection : ', () => {
|
||||
const user1 = `user-${Utils.random()}`;
|
||||
const user2 = `user-${Utils.random()}`;
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const file1 = `file-${Utils.random()}.txt`;
|
||||
let file1Id;
|
||||
const file2 = `file-${Utils.random()}.txt`;
|
||||
let file2Id;
|
||||
const file1 = `file1-${Utils.random()}.txt`;
|
||||
let file1Id;
|
||||
const file2 = `file2-${Utils.random()}.txt`;
|
||||
let file2Id;
|
||||
|
||||
const folder1 = `folder-${Utils.random()}`;
|
||||
let folder1Id;
|
||||
const folder2 = `folder-${Utils.random()}`;
|
||||
let folder2Id;
|
||||
const folder1 = `folder1-${Utils.random()}`;
|
||||
let folder1Id;
|
||||
const folder2 = `folder2-${Utils.random()}`;
|
||||
let folder2Id;
|
||||
|
||||
const fileForDelete1 = `file-${Utils.random()}.txt`; let fileForDelete1Id;
|
||||
const fileForDelete2 = `file-${Utils.random()}.txt`; let fileForDelete2Id;
|
||||
const folderForDelete1 = `folder-${Utils.random()}`; let folderForDelete1Id;
|
||||
const folderForDelete2 = `folder-${Utils.random()}`; let folderForDelete2Id;
|
||||
const fileForDelete1 = `file-${Utils.random()}.txt`;
|
||||
let fileForDelete1Id;
|
||||
const fileForDelete2 = `file-${Utils.random()}.txt`;
|
||||
let fileForDelete2Id;
|
||||
const folderForDelete1 = `folder-${Utils.random()}`;
|
||||
let folderForDelete1Id;
|
||||
const folderForDelete2 = `folder-${Utils.random()}`;
|
||||
let folderForDelete2Id;
|
||||
|
||||
const siteName = `site-private-${Utils.random()}`;
|
||||
const file1Admin = `file-${Utils.random()}.txt`;
|
||||
const file2Admin = `file-${Utils.random()}.txt`;
|
||||
const folder1Admin = `folder-${Utils.random()}`;
|
||||
const folder2Admin = `folder-${Utils.random()}`;
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const file1InSite = `file1-${Utils.random()}.txt`;
|
||||
const file2InSite = `file2-${Utils.random()}.txt`;
|
||||
const folder1InSite = `folder1-${Utils.random()}`;
|
||||
const folder2InSite = `folder2-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(user1, user1)
|
||||
};
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
const { toolbar } = page;
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, toolbar } = page;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username: user1 });
|
||||
file1Id = (await apis.user.nodes.createFiles([ file1 ])).entry.id;
|
||||
file2Id = (await apis.user.nodes.createFiles([ file2 ])).entry.id;
|
||||
folder1Id = (await apis.user.nodes.createFolders([ folder1 ])).entry.id;
|
||||
folder2Id = (await apis.user.nodes.createFolders([ folder2 ])).entry.id;
|
||||
fileForDelete1Id = (await apis.user.nodes.createFiles([ fileForDelete1 ])).entry.id;
|
||||
fileForDelete2Id = (await apis.user.nodes.createFiles([ fileForDelete2 ])).entry.id;
|
||||
folderForDelete1Id = (await apis.user.nodes.createFolders([ folderForDelete1 ])).entry.id;
|
||||
folderForDelete2Id = (await apis.user.nodes.createFolders([ folderForDelete2 ])).entry.id;
|
||||
beforeAll(async done => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
|
||||
await apis.user.shared.shareFilesByIds([ file1Id, file2Id ]);
|
||||
await apis.user.shared.waitForApi({ expect: 2 });
|
||||
file1Id = (await apis.user.nodes.createFiles([file1])).entry.id;
|
||||
file2Id = (await apis.user.nodes.createFiles([file2])).entry.id;
|
||||
folder1Id = (await apis.user.nodes.createFolders([folder1])).entry.id;
|
||||
folder2Id = (await apis.user.nodes.createFolders([folder2])).entry.id;
|
||||
fileForDelete1Id = (await apis.user.nodes.createFiles([fileForDelete1])).entry.id;
|
||||
fileForDelete2Id = (await apis.user.nodes.createFiles([fileForDelete2])).entry.id;
|
||||
folderForDelete1Id = (await apis.user.nodes.createFolders([folderForDelete1])).entry.id;
|
||||
folderForDelete2Id = (await apis.user.nodes.createFolders([folderForDelete2])).entry.id;
|
||||
|
||||
await apis.user.favorites.addFavoritesByIds('file', [ file1Id, file2Id ]);
|
||||
await apis.user.favorites.addFavoritesByIds('folder', [ folder1Id, folder2Id ]);
|
||||
await apis.user.favorites.waitForApi({ expect: 4 });
|
||||
await apis.user.shared.shareFilesByIds([file1Id, file2Id]);
|
||||
await apis.user.shared.waitForApi({ expect: 2 });
|
||||
|
||||
await apis.user.nodes.deleteNodesById([ fileForDelete1Id, fileForDelete2Id, folderForDelete1Id, folderForDelete2Id ], false);
|
||||
await apis.user.favorites.addFavoritesByIds('file', [file1Id, file2Id]);
|
||||
await apis.user.favorites.addFavoritesByIds('folder', [folder1Id, folder2Id]);
|
||||
await apis.user.favorites.waitForApi({ expect: 4 });
|
||||
|
||||
done();
|
||||
await apis.user.nodes.deleteNodesById([fileForDelete1Id, fileForDelete2Id, folderForDelete1Id, folderForDelete2Id], false);
|
||||
await apis.user.trashcan.waitForApi({ expect: 4 });
|
||||
|
||||
await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PRIVATE);
|
||||
const docLibId = await apis.user.sites.getDocLibId(siteName);
|
||||
await apis.user.nodes.createFile(file1InSite, docLibId);
|
||||
await apis.user.nodes.createFile(file2InSite, docLibId);
|
||||
await apis.user.nodes.createFolder(folder1InSite, docLibId);
|
||||
await apis.user.nodes.createFolder(folder2InSite, docLibId);
|
||||
await apis.user.search.waitForApi(username, { expect: 4 });
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async done => {
|
||||
await Promise.all([
|
||||
apis.user.nodes.deleteNodesById([file1Id, file2Id, folder1Id, folder2Id]),
|
||||
apis.user.trashcan.emptyTrash(),
|
||||
apis.user.sites.deleteSite(siteName),
|
||||
logoutPage.load()
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
xit('');
|
||||
|
||||
describe('Personal Files', () => {
|
||||
beforeEach(async done => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.user.nodes.deleteNodesById([ file1Id, file2Id, folder1Id, folder2Id ]),
|
||||
apis.user.trashcan.emptyTrash(),
|
||||
logoutPage.load()
|
||||
]);
|
||||
done();
|
||||
it('Unselect items with single click - [C280458]', async () => {
|
||||
await dataTable.selectMultipleItems([file1, file2, folder1, folder2]);
|
||||
expect(await dataTable.countSelectedRows()).toEqual(4, 'incorrect selected rows number');
|
||||
await dataTable.selectItem(file1);
|
||||
expect(await dataTable.countSelectedRows()).toEqual(1, 'incorrect selected rows number');
|
||||
});
|
||||
|
||||
xit('');
|
||||
it('Select / unselect selected items by CMD+click - [C217110]', async () => {
|
||||
await browser.actions().sendKeys(protractor.Key.COMMAND).perform();
|
||||
await dataTable.selectItem(file1);
|
||||
await dataTable.selectItem(file2);
|
||||
await dataTable.selectItem(folder1);
|
||||
await dataTable.selectItem(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.selectItem(file1);
|
||||
await dataTable.selectItem(file2);
|
||||
await browser.actions().sendKeys(protractor.Key.NULL).perform();
|
||||
|
||||
describe('Personal Files', () => {
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.loginWith(user1);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Unselect items with single click - [C280458]', async () => {
|
||||
await dataTable.selectMultipleItems([ file1, file2, folder1, folder2 ]);
|
||||
expect(await dataTable.countSelectedRows()).toEqual(4, 'incorrect selected rows number');
|
||||
await dataTable.selectItem(file1);
|
||||
expect(await dataTable.countSelectedRows()).toEqual(1, 'incorrect selected rows number');
|
||||
await dataTable.clearSelection();
|
||||
});
|
||||
|
||||
it('Select / unselect selected items by CMD+click - [C217110]', async () => {
|
||||
await browser.actions().sendKeys(protractor.Key.COMMAND).perform();
|
||||
await dataTable.selectItem(file1);
|
||||
await dataTable.selectItem(file2);
|
||||
await dataTable.selectItem(folder1);
|
||||
await dataTable.selectItem(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.selectItem(file1);
|
||||
await dataTable.selectItem(file2);
|
||||
await browser.actions().sendKeys(protractor.Key.NULL).perform();
|
||||
expect(await dataTable.countSelectedRows()).toEqual(2, 'incorrect selected rows number');
|
||||
await dataTable.clearSelection();
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple files are selected - [C217112]', async () => {
|
||||
await dataTable.selectMultipleItems([file1, file2]);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
await browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
await dataTable.clearSelection();
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple folders are selected - [C280459]', async () => {
|
||||
await dataTable.selectMultipleItems([folder1, folder2]);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
await browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
await dataTable.clearSelection();
|
||||
});
|
||||
|
||||
it('correct actions appear when both files and folders are selected - [C280460]', async () => {
|
||||
await dataTable.selectMultipleItems([file1, file2, folder1, folder2]);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
await browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
await dataTable.clearSelection();
|
||||
});
|
||||
expect(await dataTable.countSelectedRows()).toEqual(2, 'incorrect selected rows number');
|
||||
});
|
||||
|
||||
describe('File Libraries', () => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
await apis.admin.people.createUser({ username: user2 });
|
||||
await apis.admin.sites.addSiteMember(siteName, user1, SITE_ROLES.SITE_MANAGER);
|
||||
await apis.admin.sites.addSiteMember(siteName, user2, SITE_ROLES.SITE_CONSUMER);
|
||||
await apis.admin.nodes.createFiles([ file1Admin, file2Admin ], `Sites/${siteName}/documentLibrary`);
|
||||
await apis.admin.nodes.createFolders([ folder1Admin, folder2Admin ], `Sites/${siteName}/documentLibrary`);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.admin.sites.deleteSite(siteName);
|
||||
done();
|
||||
});
|
||||
|
||||
xit('');
|
||||
|
||||
describe('user is Manager', () => {
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.loginWith(user1);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple files are selected - [C280461]', async () => {
|
||||
await dataTable.selectMultipleItems([file1Admin, file2Admin]);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed for selected files');
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed for selected files');
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed for selected files');
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
|
||||
await browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform();
|
||||
await dataTable.clearSelection();
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple folders are selected - [C280462]', async () => {
|
||||
await dataTable.selectMultipleItems([folder1Admin, folder2Admin]);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
|
||||
await browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform();
|
||||
await dataTable.clearSelection();
|
||||
});
|
||||
|
||||
it('correct actions appear when both files and folders are selected - [C280463]', async () => {
|
||||
await dataTable.selectMultipleItems([file1Admin, file2Admin, folder1Admin, folder2Admin]);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
|
||||
await browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform();
|
||||
await dataTable.clearSelection();
|
||||
});
|
||||
});
|
||||
|
||||
describe('user is Consumer', () => {
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.loginWith(user2);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple files are selected - [C280464]', async () => {
|
||||
await dataTable.selectMultipleItems([file1Admin, file2Admin]);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed for selected files');
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed for selected files');
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed for selected files');
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
|
||||
await browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform();
|
||||
await dataTable.clearSelection();
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple folders are selected - [C280465]', async () => {
|
||||
await dataTable.selectMultipleItems([folder1Admin, folder2Admin]);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed`);
|
||||
|
||||
await browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform();
|
||||
await dataTable.clearSelection();
|
||||
});
|
||||
|
||||
it('correct actions appear when both files and folders are selected - [C280466]', async () => {
|
||||
await dataTable.selectMultipleItems([file1Admin, file2Admin, folder1Admin, folder2Admin]);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed for selected files');
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
|
||||
await browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform();
|
||||
await dataTable.clearSelection();
|
||||
});
|
||||
});
|
||||
it('correct actions appear when multiple files are selected - [C217112]', async () => {
|
||||
await dataTable.selectMultipleItems([file1, file2]);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
|
||||
describe('Shared Files', () => {
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.loginWith(user1);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple files are selected - [C280467]', async () => {
|
||||
await dataTable.selectMultipleItems([file1, file2]);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed for selected files');
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed for selected files');
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
|
||||
await browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform();
|
||||
await dataTable.clearSelection();
|
||||
});
|
||||
it('correct actions appear when multiple folders are selected - [C280459]', async () => {
|
||||
await dataTable.selectMultipleItems([folder1, folder2]);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
|
||||
describe('Recent Files', () => {
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.loginWith(user1);
|
||||
done();
|
||||
});
|
||||
it('correct actions appear when both files and folders are selected - [C280460]', async () => {
|
||||
await dataTable.selectMultipleItems([file1, file2, folder1, folder2]);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple files are selected - [C280468]', async () => {
|
||||
await dataTable.selectMultipleItems([file1, file2]);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
|
||||
await browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform();
|
||||
await dataTable.clearSelection();
|
||||
});
|
||||
describe('File Libraries', () => {
|
||||
beforeEach(async done => {
|
||||
// await browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform();
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
describe('Favorites', () => {
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.loginWith(user1);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple files are selected - [C280469]', async () => {
|
||||
await dataTable.selectMultipleItems([file1, file2]);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
|
||||
await browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform();
|
||||
await dataTable.clearSelection();
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple folders are selected - [C280470]', async () => {
|
||||
await dataTable.selectMultipleItems([folder1, folder2]);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
|
||||
await browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform();
|
||||
await dataTable.clearSelection();
|
||||
});
|
||||
|
||||
it('correct actions appear when both files and folders are selected - [C280471]', async () => {
|
||||
await dataTable.selectMultipleItems([file1, file2, folder1, folder2]);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, 'Download is not displayed for selected files');
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
|
||||
await browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform();
|
||||
await dataTable.clearSelection();
|
||||
});
|
||||
it('correct actions appear when multiple files are selected - [C280461]', async () => {
|
||||
await dataTable.selectMultipleItems([file1InSite, file2InSite]);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed for selected files');
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed for selected files');
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed for selected files');
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
});
|
||||
|
||||
describe('Trash', () => {
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.loginWith(user1);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple files are selected - [C280472]', async () => {
|
||||
await dataTable.selectMultipleItems([fileForDelete1, fileForDelete2]);
|
||||
expect(await toolbar.actions.isButtonPresent('Permanently delete'))
|
||||
.toBe(true, 'Permanently delete is displayed for selected files');
|
||||
expect(await toolbar.actions.isButtonPresent('Restore')).toBe(true, 'Restore is not displayed for selected files');
|
||||
await dataTable.clearSelection();
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple folders are selected - [C280473]', async () => {
|
||||
await dataTable.selectMultipleItems([folderForDelete1, folderForDelete2]);
|
||||
expect(await toolbar.actions.isButtonPresent('Permanently delete'))
|
||||
.toBe(true, 'Permanently delete is displayed for selected files');
|
||||
expect(await toolbar.actions.isButtonPresent('Restore')).toBe(true, 'Restore is not displayed for selected files');
|
||||
await dataTable.clearSelection();
|
||||
});
|
||||
|
||||
it('correct actions appear when both files and folders are selected - [C280474]', async () => {
|
||||
await dataTable.selectMultipleItems([fileForDelete1, fileForDelete2, folderForDelete1, folderForDelete2]);
|
||||
expect(await toolbar.actions.isButtonPresent('Permanently delete'))
|
||||
.toBe(true, 'Permanently delete is displayed for selected files');
|
||||
expect(await toolbar.actions.isButtonPresent('Restore')).toBe(true, 'Restore is not displayed for selected files');
|
||||
await dataTable.clearSelection();
|
||||
});
|
||||
it('correct actions appear when multiple folders are selected - [C280462]', async () => {
|
||||
await dataTable.selectMultipleItems([folder1InSite, folder2InSite]);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
});
|
||||
|
||||
it('correct actions appear when both files and folders are selected - [C280463]', async () => {
|
||||
await dataTable.selectMultipleItems([file1InSite, file2InSite, folder1InSite, folder2InSite]);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Shared Files', () => {
|
||||
beforeEach(async done => {
|
||||
// await browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform();
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple files are selected - [C280467]', async () => {
|
||||
await dataTable.selectMultipleItems([file1, file2]);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed for selected files');
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed for selected files');
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Recent Files', () => {
|
||||
beforeEach(async done => {
|
||||
// await browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform();
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple files are selected - [C280468]', async () => {
|
||||
await dataTable.selectMultipleItems([file1, file2]);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Favorites', () => {
|
||||
beforeEach(async done => {
|
||||
// await browser.actions().mouseMove(browser.$('body'), { x: 0, y: 0 }).click().perform();
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple files are selected - [C280469]', async () => {
|
||||
await dataTable.selectMultipleItems([file1, file2]);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple folders are selected - [C280470]', async () => {
|
||||
await dataTable.selectMultipleItems([folder1, folder2]);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed');
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
});
|
||||
|
||||
it('correct actions appear when both files and folders are selected - [C280471]', async () => {
|
||||
await dataTable.selectMultipleItems([file1, file2, folder1, folder2]);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, 'View is displayed');
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, 'Download is not displayed for selected files');
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, 'Edit is displayed');
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for selected files`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Trash', () => {
|
||||
beforeEach(async done => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple files are selected - [C280472]', async () => {
|
||||
await dataTable.selectMultipleItems([fileForDelete1, fileForDelete2]);
|
||||
expect(await toolbar.isButtonPresent('Permanently delete')).toBe(true, 'Permanently delete is displayed');
|
||||
expect(await toolbar.isButtonPresent('Restore')).toBe(true, 'Restore is not displayed');
|
||||
});
|
||||
|
||||
it('correct actions appear when multiple folders are selected - [C280473]', async () => {
|
||||
await dataTable.selectMultipleItems([folderForDelete1, folderForDelete2]);
|
||||
expect(await toolbar.isButtonPresent('Permanently delete')).toBe(true, 'Permanently delete is displayed');
|
||||
expect(await toolbar.isButtonPresent('Restore')).toBe(true, 'Restore is not displayed');
|
||||
});
|
||||
|
||||
it('correct actions appear when both files and folders are selected - [C280474]', async () => {
|
||||
await dataTable.selectMultipleItems([fileForDelete1, fileForDelete2, folderForDelete1, folderForDelete2]);
|
||||
expect(await toolbar.isButtonPresent('Permanently delete')).toBe(true, 'Permanently delete is displayed');
|
||||
expect(await toolbar.isButtonPresent('Restore')).toBe(true, 'Restore is not displayed');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -23,627 +23,300 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { browser, protractor } from 'protractor';
|
||||
import { LoginPage, LogoutPage, BrowsingPage } from '../../pages/pages';
|
||||
import { SITE_VISIBILITY, SITE_ROLES, SIDEBAR_LABELS } from '../../configs';
|
||||
import { SITE_VISIBILITY, SIDEBAR_LABELS } from '../../configs';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
|
||||
describe('Toolbar actions - single selection : ', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const username2 = `user-${Utils.random()}`;
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const fileUser = `fileUser-${Utils.random()}.txt`; let fileUserId;
|
||||
const folderUser = `folderUser-${Utils.random()}`; let folderUserId;
|
||||
const fileForDelete = `fileForDelete-${Utils.random()}.txt`; let fileForDeleteId;
|
||||
const folderForDelete = `folderForDelete-${Utils.random()}`; let folderForDeleteId;
|
||||
const fileUser = `fileUser-${Utils.random()}.txt`; let fileUserId;
|
||||
const folderUser = `folderUser-${Utils.random()}`; let folderUserId;
|
||||
const fileForDelete = `fileForDelete-${Utils.random()}.txt`; let fileForDeleteId;
|
||||
const folderForDelete = `folderForDelete-${Utils.random()}`; let folderForDeleteId;
|
||||
|
||||
const siteName = `site-private-${Utils.random()}`;
|
||||
const fileAdmin = `fileAdmin-${Utils.random()}.txt`;
|
||||
const folderAdmin = `folderAdmin-${Utils.random()}`;
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const fileInSite = `fileAdmin-${Utils.random()}.txt`;
|
||||
const folderInSite = `folderAdmin-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, toolbar } = page;
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, toolbar } = page;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
|
||||
fileUserId = (await apis.user.nodes.createFiles([fileUser])).entry.id;
|
||||
fileForDeleteId = (await apis.user.nodes.createFiles([fileForDelete])).entry.id;
|
||||
folderForDeleteId = (await apis.user.nodes.createFolders([ folderForDelete ])).entry.id;
|
||||
folderUserId = (await apis.user.nodes.createFolders([ folderUser ])).entry.id;
|
||||
fileUserId = (await apis.user.nodes.createFile(fileUser)).entry.id;
|
||||
fileForDeleteId = (await apis.user.nodes.createFile(fileForDelete)).entry.id;
|
||||
folderForDeleteId = (await apis.user.nodes.createFolder(folderForDelete)).entry.id;
|
||||
folderUserId = (await apis.user.nodes.createFolder(folderUser)).entry.id;
|
||||
|
||||
await apis.user.shared.shareFileById(fileUserId);
|
||||
await apis.user.shared.waitForApi({ expect: 1 });
|
||||
await apis.user.shared.shareFileById(fileUserId);
|
||||
await apis.user.shared.waitForApi({ expect: 1 });
|
||||
|
||||
await apis.user.favorites.addFavoriteById('file', fileUserId);
|
||||
await apis.user.favorites.addFavoriteById('folder', folderUserId);
|
||||
await apis.user.favorites.waitForApi({ expect: 2 });
|
||||
await apis.user.favorites.addFavoriteById('file', fileUserId);
|
||||
await apis.user.favorites.addFavoriteById('folder', folderUserId);
|
||||
await apis.user.favorites.waitForApi({ expect: 2 });
|
||||
|
||||
done();
|
||||
await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PRIVATE);
|
||||
const docLibId = await apis.user.sites.getDocLibId(siteName);
|
||||
|
||||
await apis.user.nodes.createFile(fileInSite, docLibId);
|
||||
await apis.user.nodes.createFolder(folderInSite, docLibId);
|
||||
|
||||
await apis.user.nodes.deleteNodeById(fileForDeleteId, false);
|
||||
await apis.user.nodes.deleteNodeById(folderForDeleteId, false);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.user.nodes.deleteNodeById(fileUserId),
|
||||
apis.user.nodes.deleteNodeById(folderUserId),
|
||||
apis.user.sites.deleteSite(siteName),
|
||||
apis.user.trashcan.emptyTrash(),
|
||||
logoutPage.load()
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
xit('');
|
||||
|
||||
describe('General tests', () => {
|
||||
it('actions not displayed for top level of File Libraries - [C213135]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectItem(siteName);
|
||||
expect(await toolbar.isEmpty()).toBe(true, 'toolbar not empty');
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.user.nodes.deleteNodeById(fileUserId),
|
||||
apis.user.nodes.deleteNodeById(folderUserId)
|
||||
]);
|
||||
it('selected row is marked with a check circle icon - [C213134]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectItem(fileUser);
|
||||
expect(await dataTable.hasCheckMarkIcon(fileUser)).toBe(true, 'check mark missing');
|
||||
});
|
||||
});
|
||||
|
||||
done();
|
||||
describe('Personal Files', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
xit('');
|
||||
|
||||
describe('General tests', () => {
|
||||
const userSite = `userSite-${Utils.random()}`;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.user.sites.createSite(userSite, SITE_VISIBILITY.PUBLIC);
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.user.sites.deleteSite(userSite),
|
||||
logoutPage.load()
|
||||
]);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('actions not displayed for top level of File Libraries - [C213135]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectItem(userSite);
|
||||
expect(await toolbar.actions.isEmpty()).toBe(true, 'toolbar not empty');
|
||||
});
|
||||
|
||||
it('selected row is marked with a check circle icon - [C213134]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectItem(fileUser);
|
||||
expect(await dataTable.hasCheckMarkIcon(fileUser)).toBe(true, 'check mark missing');
|
||||
});
|
||||
it('actions are not displayed when no item is selected - [C213120]', async () => {
|
||||
expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`);
|
||||
});
|
||||
|
||||
describe('granular permissions', () => {
|
||||
const site = `site-${Utils.random()}`;
|
||||
const file1 = `file1-${Utils.random()}`; let file1Id;
|
||||
const file2 = `file2-${Utils.random()}`; let file2Id;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(site, SITE_VISIBILITY.PRIVATE);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(site);
|
||||
|
||||
file1Id = (await apis.admin.nodes.createFile(file1, docLibId)).entry.id;
|
||||
file2Id = (await apis.admin.nodes.createFile(file2, docLibId)).entry.id;
|
||||
|
||||
await apis.admin.sites.addSiteMember(site, username, SITE_ROLES.SITE_CONSUMER);
|
||||
await apis.admin.nodes.setGranularPermission(file1Id, false, username, SITE_ROLES.SITE_CONSUMER);
|
||||
await apis.admin.nodes.setGranularPermission(file2Id, false, username, SITE_ROLES.SITE_MANAGER);
|
||||
|
||||
await apis.user.shared.shareFileById(file1Id);
|
||||
await apis.admin.shared.shareFileById(file2Id);
|
||||
await apis.user.shared.waitForApi({ expect: 3 });
|
||||
|
||||
await apis.user.favorites.addFavoritesByIds('file', [file1Id, file2Id]);
|
||||
await apis.user.favorites.waitForApi({ expect: 3 });
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.sites.deleteSite(site),
|
||||
logoutPage.load()
|
||||
]);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
describe('actions update accordingly for files with different granular permissions', () => {
|
||||
beforeEach(async (done) => {
|
||||
await browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
done();
|
||||
});
|
||||
|
||||
it('on File Libraries - [C280455]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(site);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectItem(file1);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${file1}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${file1}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${file1}`);
|
||||
|
||||
let menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${file1}`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${file1}`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${file1}`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${file1}`);
|
||||
await toolbar.actions.closeMoreMenu();
|
||||
|
||||
await dataTable.selectItem(file2);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${file2}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${file2}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${file2}`);
|
||||
|
||||
menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${file2}`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${file2}`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${file2}`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${file2}`);
|
||||
await toolbar.actions.closeMoreMenu();
|
||||
});
|
||||
|
||||
it('on Shared Files - [C280456]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await page.dataTable.waitForHeader();
|
||||
await page.dataTable.selectItem(file1);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${file1}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${file1}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${file1}`);
|
||||
let menu = await toolbar.actions.openMoreMenu();
|
||||
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${file1}`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${file1}`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${file1}`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${file1}`);
|
||||
await toolbar.actions.closeMoreMenu();
|
||||
|
||||
await page.dataTable.selectItem(file2);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${file2}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${file2}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${file2}`);
|
||||
menu = await toolbar.actions.openMoreMenu();
|
||||
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${file2}`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${file2}`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${file2}`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${file2}`);
|
||||
await toolbar.actions.closeMoreMenu();
|
||||
});
|
||||
|
||||
// disabled until ACA-1184 is done
|
||||
xit('on Favorites - [C213121]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectItem(file1);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${file1}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${file1}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${file1}`);
|
||||
let menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${file1}`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${file1}`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${file1}`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${file1}`);
|
||||
await toolbar.actions.closeMoreMenu();
|
||||
|
||||
await dataTable.selectItem(file2);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${file2}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${file2}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${file2}`);
|
||||
menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${file2}`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${file2}`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${file2}`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${file2}`);
|
||||
await toolbar.actions.closeMoreMenu();
|
||||
});
|
||||
});
|
||||
|
||||
describe('correct actions are displayed when selecting multiple files with different granular permissions', () => {
|
||||
beforeEach(async (done) => {
|
||||
await browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
done();
|
||||
});
|
||||
|
||||
it('on File Libraries - [C280476]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(site);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectMultipleItems([ file1, file2 ]);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for selected files`);
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`);
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`);
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
await toolbar.actions.closeMoreMenu();
|
||||
});
|
||||
|
||||
it('on Shared Files - [C280477]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectMultipleItems([ file1, file2 ]);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for selected files`);
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`);
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`);
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
await toolbar.actions.closeMoreMenu();
|
||||
});
|
||||
|
||||
// disabled until ACA-1184 is done
|
||||
xit('on Favorites - [C280478]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectMultipleItems([ file1, file2 ]);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for selected files`);
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for selected files`);
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for selected files`);
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for selected files`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for selected files`);
|
||||
await toolbar.actions.closeMoreMenu();
|
||||
});
|
||||
});
|
||||
|
||||
xit('');
|
||||
it('correct actions appear when a file is selected - [C213122]', async () => {
|
||||
await dataTable.selectItem(fileUser);
|
||||
expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${fileUser}`);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileUser}`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
|
||||
describe('Personal Files', () => {
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
it('correct actions appear when a folder is selected - [C213123]', async () => {
|
||||
await dataTable.selectItem(folderUser);
|
||||
expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${folderUser}`);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed for ${folderUser}`);
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not enabled for ${folderUser}`);
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(true, `Edit is not displayed for ${folderUser}`);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folderUser}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${folderUser}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${folderUser}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folderUser}`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('actions are not displayed when no item is selected - [C213120]', async () => {
|
||||
expect(await toolbar.actions.isEmpty()).toBe(true, `actions displayed though nothing selected`);
|
||||
});
|
||||
|
||||
it('correct actions appear when a file is selected - [C213122]', async () => {
|
||||
await dataTable.selectItem(fileUser);
|
||||
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${fileUser}`);
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileUser}`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileUser}`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileUser}`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileUser}`);
|
||||
await toolbar.actions.closeMoreMenu();
|
||||
});
|
||||
|
||||
it('correct actions appear when a folder is selected - [C213123]', async () => {
|
||||
await dataTable.selectItem(folderUser);
|
||||
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderUser}`);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for ${folderUser}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not enabled for ${folderUser}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(true, `Edit is not displayed for ${folderUser}`);
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folderUser}`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${folderUser}`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${folderUser}`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folderUser}`);
|
||||
await toolbar.actions.closeMoreMenu();
|
||||
});
|
||||
describe('File Libraries', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
describe('File Libraries', () => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(siteName);
|
||||
|
||||
await apis.admin.people.createUser({ username: username2 });
|
||||
await apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_MANAGER);
|
||||
await apis.admin.sites.addSiteMember(siteName, username2, SITE_ROLES.SITE_CONSUMER);
|
||||
|
||||
await apis.admin.nodes.createFile(fileAdmin, docLibId);
|
||||
await apis.admin.nodes.createFolder(folderAdmin, docLibId);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.admin.sites.deleteSite(siteName);
|
||||
done();
|
||||
});
|
||||
|
||||
xit('');
|
||||
|
||||
describe('user is Manager', () => {
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('actions are not displayed when no item is selected - [C280439]', async () => {
|
||||
expect(await toolbar.actions.isEmpty()).toBe(true, `actions displayed though nothing selected`);
|
||||
});
|
||||
|
||||
it('correct actions appear when a file is selected - [C280440]', async () => {
|
||||
await dataTable.selectItem(fileAdmin);
|
||||
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileAdmin}`);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileAdmin}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileAdmin}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${fileAdmin}`);
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileAdmin}`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileAdmin}`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileAdmin}`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileAdmin}`);
|
||||
await toolbar.actions.closeMoreMenu();
|
||||
});
|
||||
|
||||
it('correct actions appear when a folder is selected - [C280441]', async () => {
|
||||
await dataTable.selectItem(folderAdmin);
|
||||
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderAdmin}`);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for ${folderAdmin}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not enabled for ${folderAdmin}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(true, `Edit is not displayed for ${folderAdmin}`);
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folderAdmin}`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${folderAdmin}`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${folderAdmin}`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folderAdmin}`);
|
||||
await toolbar.actions.closeMoreMenu();
|
||||
});
|
||||
});
|
||||
|
||||
describe('user is Consumer', () => {
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.loginWith(username2);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('actions are not displayed when no item is selected - [C280442]', async () => {
|
||||
expect(await toolbar.actions.isEmpty()).toBe(true, `actions displayed though nothing selected`);
|
||||
});
|
||||
|
||||
it('correct actions appear when a file is selected - [C280443]', async () => {
|
||||
await dataTable.selectItem(fileAdmin);
|
||||
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileAdmin}`);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileAdmin}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileAdmin}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${fileAdmin}`);
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileAdmin}`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${fileAdmin}`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${fileAdmin}`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileAdmin}`);
|
||||
await toolbar.actions.closeMoreMenu();
|
||||
});
|
||||
|
||||
it('correct actions appear when a folder is selected - [C280444]', async () => {
|
||||
await dataTable.selectItem(folderAdmin);
|
||||
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderAdmin}`);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for ${folderAdmin}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not enabled for ${folderAdmin}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${folderAdmin}`);
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folderAdmin}`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(false, `Delete is displayed for ${folderAdmin}`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(false, `Move is displayed for ${folderAdmin}`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folderAdmin}`);
|
||||
await toolbar.actions.closeMoreMenu();
|
||||
});
|
||||
});
|
||||
it('actions are not displayed when no item is selected - [C280439]', async () => {
|
||||
expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`);
|
||||
});
|
||||
|
||||
describe('Shared Files', () => {
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await page.dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('actions are not displayed when no item is selected - [C280445]', async () => {
|
||||
expect(await toolbar.actions.isEmpty()).toBe(true, `actions displayed though nothing selected`);
|
||||
});
|
||||
|
||||
it('correct actions appear when a file is selected - [C280446]', async () => {
|
||||
await page.dataTable.selectItem(fileUser);
|
||||
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${fileUser}`);
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileUser}`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileUser}`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileUser}`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileUser}`);
|
||||
await toolbar.actions.closeMoreMenu();
|
||||
});
|
||||
it('correct actions appear when a file is selected - [C280440]', async () => {
|
||||
await dataTable.selectItem(fileInSite);
|
||||
expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${fileInSite}`);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileInSite}`);
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileInSite}`);
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${fileInSite}`);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileInSite}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileInSite}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileInSite}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileInSite}`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
|
||||
describe('Recent Files', () => {
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
it('correct actions appear when a folder is selected - [C280441]', async () => {
|
||||
await dataTable.selectItem(folderInSite);
|
||||
expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${folderInSite}`);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed for ${folderInSite}`);
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not enabled for ${folderInSite}`);
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(true, `Edit is not displayed for ${folderInSite}`);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folderInSite}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${folderInSite}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${folderInSite}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folderInSite}`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('actions are not displayed when no item is selected - [C280447]', async () => {
|
||||
expect(await toolbar.actions.isEmpty()).toBe(true, `actions displayed though nothing selected`);
|
||||
});
|
||||
|
||||
it('correct actions appear when a file is selected - [C280448]', async () => {
|
||||
await dataTable.selectItem(fileUser);
|
||||
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${fileUser}`);
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileUser}`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileUser}`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileUser}`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileUser}`);
|
||||
await toolbar.actions.closeMoreMenu();
|
||||
});
|
||||
describe('Shared Files', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await page.dataTable.waitForHeader();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
describe('Favorites', () => {
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('actions are not displayed when no item is selected - [C280449]', async () => {
|
||||
expect(await toolbar.actions.isEmpty()).toBe(true, `actions displayed though nothing selected`);
|
||||
});
|
||||
|
||||
it('correct actions appear when a file is selected - [C280450]', async () => {
|
||||
await dataTable.selectItem(fileUser);
|
||||
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${fileUser}`);
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileUser}`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileUser}`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileUser}`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileUser}`);
|
||||
await toolbar.actions.closeMoreMenu();
|
||||
});
|
||||
|
||||
it('correct actions appear when a folder is selected - [C280451]', async () => {
|
||||
await dataTable.selectItem(folderUser);
|
||||
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderUser}`);
|
||||
expect(await toolbar.actions.isButtonPresent('View')).toBe(false, `View is displayed for ${folderUser}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Download')).toBe(true, `Download is not enabled for ${folderUser}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Edit')).toBe(true, `Edit is not displayed for ${folderUser}`);
|
||||
const menu = await toolbar.actions.openMoreMenu();
|
||||
expect(await menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folderUser}`);
|
||||
expect(await menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${folderUser}`);
|
||||
expect(await menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${folderUser}`);
|
||||
expect(await menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folderUser}`);
|
||||
await toolbar.actions.closeMoreMenu();
|
||||
});
|
||||
it('actions are not displayed when no item is selected - [C280445]', async () => {
|
||||
expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`);
|
||||
});
|
||||
|
||||
describe('Trash', () => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodeById(fileForDeleteId, false);
|
||||
await apis.user.nodes.deleteNodeById(folderForDeleteId, false);
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await browser.actions().sendKeys(protractor.Key.ESCAPE);
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.user.trashcan.permanentlyDelete(fileForDeleteId),
|
||||
apis.user.trashcan.permanentlyDelete(folderForDeleteId),
|
||||
logoutPage.load()
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
it('actions are not displayed when no item is selected - [C280452]', async () => {
|
||||
expect(await toolbar.actions.isEmpty()).toBe(true, `actions displayed though nothing selected`);
|
||||
});
|
||||
|
||||
it('correct actions appear when a file is selected - [C280453]', async () => {
|
||||
await dataTable.selectItem(fileForDelete);
|
||||
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${fileForDelete}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Permanently delete')).toBe(true, `Permanently delete is not displayed for file`);
|
||||
expect(await toolbar.actions.isButtonPresent('Restore')).toBe(true, `Restore is not displayed for file`);
|
||||
});
|
||||
|
||||
it('correct actions appear when a folder is selected - [C280454]', async () => {
|
||||
await dataTable.selectItem(folderForDelete);
|
||||
expect(await toolbar.actions.isEmpty()).toBe(false, `actions not displayed for ${folderForDelete}`);
|
||||
expect(await toolbar.actions.isButtonPresent('Permanently delete')).toBe(true, `Permanently delete is displayed for folder`);
|
||||
expect(await toolbar.actions.isButtonPresent('Restore')).toBe(true, `Restore is not enabled for folder`);
|
||||
});
|
||||
it('correct actions appear when a file is selected - [C286265]', async () => {
|
||||
await page.dataTable.selectItem(fileUser);
|
||||
expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${fileUser}`);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Shared link settings')).toBe(true, `Shared is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileUser}`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Recent Files', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('actions are not displayed when no item is selected - [C280447]', async () => {
|
||||
expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`);
|
||||
});
|
||||
|
||||
it('correct actions appear when a file is selected - [C280448]', async () => {
|
||||
await dataTable.selectItem(fileUser);
|
||||
expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${fileUser}`);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileUser}`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Favorites', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('actions are not displayed when no item is selected - [C280449]', async () => {
|
||||
expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`);
|
||||
});
|
||||
|
||||
it('correct actions appear when a file is selected - [C280450]', async () => {
|
||||
await dataTable.selectItem(fileUser);
|
||||
expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(true, `View is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(false, `Edit is displayed for ${fileUser}`);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${fileUser}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${fileUser}`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
|
||||
it('correct actions appear when a folder is selected - [C280451]', async () => {
|
||||
await dataTable.selectItem(folderUser);
|
||||
expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${folderUser}`);
|
||||
expect(await toolbar.isButtonPresent('View')).toBe(false, `View is displayed for ${folderUser}`);
|
||||
expect(await toolbar.isButtonPresent('Download')).toBe(true, `Download is not enabled for ${folderUser}`);
|
||||
expect(await toolbar.isButtonPresent('Edit')).toBe(true, `Edit is not displayed for ${folderUser}`);
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Copy')).toBe(true, `Copy is not displayed for ${folderUser}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Delete')).toBe(true, `Delete is not displayed for ${folderUser}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Move')).toBe(true, `Move is not displayed for ${folderUser}`);
|
||||
expect(await toolbar.menu.isMenuItemPresent('Favorite')).toBe(true, `Favorite is not displayed for ${folderUser}`);
|
||||
await toolbar.closeMoreMenu();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Trash', () => {
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.clearSelection();
|
||||
done();
|
||||
});
|
||||
|
||||
it('actions are not displayed when no item is selected - [C280452]', async () => {
|
||||
expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`);
|
||||
});
|
||||
|
||||
it('correct actions appear when a file is selected - [C280453]', async () => {
|
||||
await dataTable.selectItem(fileForDelete);
|
||||
expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${fileForDelete}`);
|
||||
expect(await toolbar.isButtonPresent('Permanently delete')).toBe(true, `Permanently delete is not displayed for file`);
|
||||
expect(await toolbar.isButtonPresent('Restore')).toBe(true, `Restore is not displayed for file`);
|
||||
});
|
||||
|
||||
it('correct actions appear when a folder is selected - [C280454]', async () => {
|
||||
await dataTable.selectItem(folderForDelete);
|
||||
expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${folderForDelete}`);
|
||||
expect(await toolbar.isButtonPresent('Permanently delete')).toBe(true, `Permanently delete is displayed for folder`);
|
||||
expect(await toolbar.isButtonPresent('Restore')).toBe(true, `Restore is not enabled for folder`);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Executable
+823
@@ -0,0 +1,823 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2018 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 { browser } from 'protractor';
|
||||
import { LoginPage, LogoutPage, BrowsingPage } from '../../pages/pages';
|
||||
import { SIDEBAR_LABELS, SITE_VISIBILITY, SITE_ROLES } from '../../configs';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
import { ShareDialog } from '../../components/dialog/share-dialog';
|
||||
import { ConfirmDialog } from '../../components/dialog/confirm-dialog';
|
||||
import { Viewer } from '../../components/viewer/viewer';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
|
||||
describe('Unshare a file', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const parent = `parent-${Utils.random()}`; let parentId;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, toolbar } = page;
|
||||
const shareDialog = new ShareDialog();
|
||||
const confirmDialog = new ConfirmDialog();
|
||||
const contextMenu = dataTable.menu;
|
||||
const viewer = new Viewer();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.user.nodes.deleteNodeById(parentId),
|
||||
logoutPage.load()
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
describe('from Personal Files', () => {
|
||||
|
||||
const file1 = `file1-${Utils.random()}.txt`; let file1Id;
|
||||
const file2 = `file2-${Utils.random()}.txt`; let file2Id;
|
||||
const file3 = `file3-${Utils.random()}.txt`; let file3Id;
|
||||
const file4 = `file4-${Utils.random()}.txt`; let file4Id;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id;
|
||||
file2Id = (await apis.user.nodes.createFile(file2, parentId)).entry.id;
|
||||
file3Id = (await apis.user.nodes.createFile(file3, parentId)).entry.id;
|
||||
file4Id = (await apis.user.nodes.createFile(file4, parentId)).entry.id;
|
||||
await apis.user.shared.shareFileById(file1Id);
|
||||
await apis.user.shared.shareFileById(file2Id);
|
||||
await apis.user.shared.shareFileById(file3Id);
|
||||
await apis.user.shared.shareFileById(file4Id);
|
||||
await apis.user.shared.waitForApi({ expect: 4 });
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await page.refresh();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(parent);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodeById(file1Id);
|
||||
await apis.user.nodes.deleteNodeById(file2Id);
|
||||
await apis.user.nodes.deleteNodeById(file3Id);
|
||||
await apis.user.nodes.deleteNodeById(file4Id);
|
||||
await apis.user.shared.waitForApi({ expect: 0 });
|
||||
done();
|
||||
});
|
||||
|
||||
it('Unshare dialog UI - [C286339]', async () => {
|
||||
await dataTable.selectItem(file1);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Shared link settings');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
|
||||
expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle not checked');
|
||||
await shareDialog.clickShareToggle();
|
||||
|
||||
expect(await confirmDialog.isDialogOpen()).toBe(true, 'Unshare dialog is not open');
|
||||
expect(await confirmDialog.getTitle()).toContain('Remove this shared link');
|
||||
expect(await confirmDialog.getText()).toContain('This link will be deleted and a new link will be created next time this file is shared');
|
||||
expect(await confirmDialog.isButtonEnabled('Remove')).toBe(true, 'REMOVE button is not enabled');
|
||||
expect(await confirmDialog.isButtonEnabled('Cancel')).toBe(true, 'CANCEL button is not enabled');
|
||||
});
|
||||
|
||||
it('Unshare a file - [C286340]', async () => {
|
||||
await dataTable.selectItem(file2);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Shared link settings');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
const url = await shareDialog.getLinkUrl();
|
||||
await shareDialog.clickShareToggle();
|
||||
|
||||
await confirmDialog.clickButton('Remove');
|
||||
await confirmDialog.waitForDialogToClose();
|
||||
await shareDialog.waitForDialogToClose();
|
||||
expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog open');
|
||||
expect(await apis.user.nodes.isFileShared(file2Id)).toBe(false, `${file2} is shared`);
|
||||
|
||||
// TODO: disable check cause api is slow to update
|
||||
// await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
// expect(await dataTable.getRowByName(file2).isPresent()).toBe(false, `${file2} is in the Shared files list`);
|
||||
|
||||
await browser.get(url);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open');
|
||||
expect(await viewer.getFileTitle()).not.toEqual(file2);
|
||||
|
||||
await page.load();
|
||||
});
|
||||
|
||||
it('Cancel the Unshare action - [C286341]', async () => {
|
||||
await dataTable.selectItem(file3);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Shared link settings');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
|
||||
const urlBefore = await shareDialog.getLinkUrl();
|
||||
await shareDialog.clickShareToggle();
|
||||
|
||||
await confirmDialog.clickButton('Cancel');
|
||||
await confirmDialog.waitForDialogToClose();
|
||||
expect(await shareDialog.isDialogOpen()).toBe(true, 'Share dialog not open');
|
||||
expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle is off');
|
||||
|
||||
const urlAfter = await shareDialog.getLinkUrl();
|
||||
expect(urlBefore).toEqual(urlAfter);
|
||||
});
|
||||
|
||||
it('Unshare a file from the context menu - [C286359]', async () => {
|
||||
await dataTable.rightClickOnItem(file4);
|
||||
await contextMenu.clickMenuItem('Shared link settings');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
const url = await shareDialog.getLinkUrl();
|
||||
await shareDialog.clickShareToggle();
|
||||
|
||||
await confirmDialog.clickButton('Remove');
|
||||
await confirmDialog.waitForDialogToClose();
|
||||
await shareDialog.waitForDialogToClose();
|
||||
expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog open');
|
||||
expect(await apis.user.nodes.isFileShared(file4Id)).toBe(false, `${file4} is shared`);
|
||||
|
||||
// TODO: disable check cause api is slow to update
|
||||
// await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
// expect(await dataTable.getRowByName(file4).isPresent()).toBe(false, `${file4} is in the Shared files list`);
|
||||
|
||||
await browser.get(url);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open');
|
||||
expect(await viewer.getFileTitle()).not.toEqual(file4);
|
||||
|
||||
await page.load();
|
||||
});
|
||||
});
|
||||
|
||||
describe('from File Libraries', () => {
|
||||
|
||||
const file1 = `file1-${Utils.random()}.txt`; let file1Id;
|
||||
const file2 = `file2-${Utils.random()}.txt`; let file2Id;
|
||||
const file3 = `file3-${Utils.random()}.txt`; let file3Id;
|
||||
const file4 = `file4-${Utils.random()}.txt`; let file4Id;
|
||||
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const parentInSite = `parent-site-${Utils.random()}`; let parentInSiteId;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
const docLibId = await apis.user.sites.getDocLibId(siteName);
|
||||
parentInSiteId = (await apis.user.nodes.createFolder(parentInSite, docLibId)).entry.id;
|
||||
|
||||
file1Id = (await apis.user.nodes.createFile(file1, parentInSiteId)).entry.id;
|
||||
file2Id = (await apis.user.nodes.createFile(file2, parentInSiteId)).entry.id;
|
||||
file3Id = (await apis.user.nodes.createFile(file3, parentInSiteId)).entry.id;
|
||||
file4Id = (await apis.user.nodes.createFile(file4, parentInSiteId)).entry.id;
|
||||
await apis.user.shared.shareFileById(file1Id);
|
||||
await apis.user.shared.shareFileById(file2Id);
|
||||
await apis.user.shared.shareFileById(file3Id);
|
||||
await apis.user.shared.shareFileById(file4Id);
|
||||
await apis.user.shared.waitForApi({ expect: 4 });
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await page.refresh();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(siteName);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(parentInSite);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.admin.sites.deleteSite(siteName);
|
||||
await apis.user.shared.waitForApi({ expect: 0 });
|
||||
done();
|
||||
});
|
||||
|
||||
it('Unshare dialog UI - [C286679]', async () => {
|
||||
await dataTable.selectItem(file1);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Shared link settings');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
|
||||
expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle not checked');
|
||||
await shareDialog.clickShareToggle();
|
||||
|
||||
expect(await confirmDialog.isDialogOpen()).toBe(true, 'Unshare dialog is not open');
|
||||
expect(await confirmDialog.getTitle()).toContain('Remove this shared link');
|
||||
expect(await confirmDialog.getText()).toContain('This link will be deleted and a new link will be created next time this file is shared');
|
||||
expect(await confirmDialog.isButtonEnabled('Remove')).toBe(true, 'REMOVE button is not enabled');
|
||||
expect(await confirmDialog.isButtonEnabled('Cancel')).toBe(true, 'CANCEL button is not enabled');
|
||||
});
|
||||
|
||||
it('Unshare a file - [C286680]', async () => {
|
||||
await dataTable.selectItem(file2);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Shared link settings');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
const url = await shareDialog.getLinkUrl();
|
||||
await shareDialog.clickShareToggle();
|
||||
|
||||
await confirmDialog.clickButton('Remove');
|
||||
await confirmDialog.waitForDialogToClose();
|
||||
await shareDialog.waitForDialogToClose();
|
||||
expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog open');
|
||||
expect(await apis.user.nodes.isFileShared(file2Id)).toBe(false, `${file2} is shared`);
|
||||
|
||||
// TODO: disable check cause api is slow to update
|
||||
// await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
// expect(await dataTable.getRowByName(file2).isPresent()).toBe(false, `${file2} is in the Shared files list`);
|
||||
|
||||
await browser.get(url);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open');
|
||||
expect(await viewer.getFileTitle()).not.toEqual(file2);
|
||||
|
||||
await page.load();
|
||||
});
|
||||
|
||||
it('Cancel the Unshare action - [C286681]', async () => {
|
||||
await dataTable.selectItem(file3);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Shared link settings');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
|
||||
const urlBefore = await shareDialog.getLinkUrl();
|
||||
await shareDialog.clickShareToggle();
|
||||
|
||||
await confirmDialog.clickButton('Cancel');
|
||||
await confirmDialog.waitForDialogToClose();
|
||||
expect(await shareDialog.isDialogOpen()).toBe(true, 'Share dialog not open');
|
||||
expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle is off');
|
||||
|
||||
const urlAfter = await shareDialog.getLinkUrl();
|
||||
expect(urlBefore).toEqual(urlAfter);
|
||||
});
|
||||
|
||||
it('Unshare a file from the context menu - [C286683]', async () => {
|
||||
await dataTable.rightClickOnItem(file4);
|
||||
await contextMenu.clickMenuItem('Shared link settings');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
const url = await shareDialog.getLinkUrl();
|
||||
await shareDialog.clickShareToggle();
|
||||
|
||||
await confirmDialog.clickButton('Remove');
|
||||
await confirmDialog.waitForDialogToClose();
|
||||
await shareDialog.waitForDialogToClose();
|
||||
expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog open');
|
||||
expect(await apis.user.nodes.isFileShared(file4Id)).toBe(false, `${file4} is shared`);
|
||||
|
||||
// TODO: disable check cause api is slow to update
|
||||
// await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
// expect(await dataTable.getRowByName(file4).isPresent()).toBe(false, `${file4} is in the Shared files list`);
|
||||
|
||||
await browser.get(url);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open');
|
||||
expect(await viewer.getFileTitle()).not.toEqual(file4);
|
||||
|
||||
await page.load();
|
||||
});
|
||||
});
|
||||
|
||||
describe('from Recent Files', () => {
|
||||
|
||||
const file1 = `file1-${Utils.random()}.txt`; let file1Id;
|
||||
const file2 = `file2-${Utils.random()}.txt`; let file2Id;
|
||||
const file3 = `file3-${Utils.random()}.txt`; let file3Id;
|
||||
const file4 = `file4-${Utils.random()}.txt`; let file4Id;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id;
|
||||
file2Id = (await apis.user.nodes.createFile(file2, parentId)).entry.id;
|
||||
file3Id = (await apis.user.nodes.createFile(file3, parentId)).entry.id;
|
||||
file4Id = (await apis.user.nodes.createFile(file4, parentId)).entry.id;
|
||||
await apis.user.shared.shareFileById(file1Id);
|
||||
await apis.user.shared.shareFileById(file2Id);
|
||||
await apis.user.shared.shareFileById(file3Id);
|
||||
await apis.user.shared.shareFileById(file4Id);
|
||||
await apis.user.shared.waitForApi({ expect: 4 });
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await page.refresh();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodeById(file1Id);
|
||||
await apis.user.nodes.deleteNodeById(file2Id);
|
||||
await apis.user.nodes.deleteNodeById(file3Id);
|
||||
await apis.user.nodes.deleteNodeById(file4Id);
|
||||
await apis.user.shared.waitForApi({ expect: 0 });
|
||||
done();
|
||||
});
|
||||
|
||||
it('Unshare dialog UI - [C286689]', async () => {
|
||||
await dataTable.selectItem(file1);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Shared link settings');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
|
||||
expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle not checked');
|
||||
await shareDialog.clickShareToggle();
|
||||
|
||||
expect(await confirmDialog.isDialogOpen()).toBe(true, 'Unshare dialog is not open');
|
||||
expect(await confirmDialog.getTitle()).toContain('Remove this shared link');
|
||||
expect(await confirmDialog.getText()).toContain('This link will be deleted and a new link will be created next time this file is shared');
|
||||
expect(await confirmDialog.isButtonEnabled('Remove')).toBe(true, 'REMOVE button is not enabled');
|
||||
expect(await confirmDialog.isButtonEnabled('Cancel')).toBe(true, 'CANCEL button is not enabled');
|
||||
});
|
||||
|
||||
it('Unshare a file - [C286690]', async () => {
|
||||
await dataTable.selectItem(file2);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Shared link settings');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
const url = await shareDialog.getLinkUrl();
|
||||
await shareDialog.clickShareToggle();
|
||||
|
||||
await confirmDialog.clickButton('Remove');
|
||||
await confirmDialog.waitForDialogToClose();
|
||||
await shareDialog.waitForDialogToClose();
|
||||
expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog open');
|
||||
expect(await apis.user.nodes.isFileShared(file2Id)).toBe(false, `${file2} is shared`);
|
||||
|
||||
// TODO: disable check cause api is slow to update
|
||||
// await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
// expect(await dataTable.getRowByName(file2).isPresent()).toBe(false, `${file2} is in the Shared files list`);
|
||||
|
||||
await browser.get(url);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open');
|
||||
expect(await viewer.getFileTitle()).not.toEqual(file2);
|
||||
|
||||
await page.load();
|
||||
});
|
||||
|
||||
it('Cancel the Unshare action - [C286691]', async () => {
|
||||
await dataTable.selectItem(file3);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Shared link settings');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
|
||||
const urlBefore = await shareDialog.getLinkUrl();
|
||||
await shareDialog.clickShareToggle();
|
||||
|
||||
await confirmDialog.clickButton('Cancel');
|
||||
await confirmDialog.waitForDialogToClose();
|
||||
expect(await shareDialog.isDialogOpen()).toBe(true, 'Share dialog not open');
|
||||
expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle is off');
|
||||
|
||||
const urlAfter = await shareDialog.getLinkUrl();
|
||||
expect(urlBefore).toEqual(urlAfter);
|
||||
});
|
||||
|
||||
it('Unshare a file from the context menu - [C286693]', async () => {
|
||||
await dataTable.rightClickOnItem(file4);
|
||||
await contextMenu.clickMenuItem('Shared link settings');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
const url = await shareDialog.getLinkUrl();
|
||||
await shareDialog.clickShareToggle();
|
||||
|
||||
await confirmDialog.clickButton('Remove');
|
||||
await confirmDialog.waitForDialogToClose();
|
||||
await shareDialog.waitForDialogToClose();
|
||||
expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog open');
|
||||
expect(await apis.user.nodes.isFileShared(file4Id)).toBe(false, `${file4} is shared`);
|
||||
|
||||
// TODO: disable check cause api is slow to update
|
||||
// await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
// expect(await dataTable.getRowByName(file4).isPresent()).toBe(false, `${file4} is in the Shared files list`);
|
||||
|
||||
await browser.get(url);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open');
|
||||
expect(await viewer.getFileTitle()).not.toEqual(file4);
|
||||
|
||||
await page.load();
|
||||
});
|
||||
});
|
||||
|
||||
describe('from Shared Files', () => {
|
||||
|
||||
const file1 = `file1-${Utils.random()}.txt`; let file1Id;
|
||||
const file2 = `file2-${Utils.random()}.txt`; let file2Id;
|
||||
const file3 = `file3-${Utils.random()}.txt`; let file3Id;
|
||||
const file4 = `file4-${Utils.random()}.txt`; let file4Id;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id;
|
||||
file2Id = (await apis.user.nodes.createFile(file2, parentId)).entry.id;
|
||||
file3Id = (await apis.user.nodes.createFile(file3, parentId)).entry.id;
|
||||
file4Id = (await apis.user.nodes.createFile(file4, parentId)).entry.id;
|
||||
await apis.user.shared.shareFileById(file1Id);
|
||||
await apis.user.shared.shareFileById(file2Id);
|
||||
await apis.user.shared.shareFileById(file3Id);
|
||||
await apis.user.shared.shareFileById(file4Id);
|
||||
await apis.user.shared.waitForApi({ expect: 4 });
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await page.refresh();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodeById(file1Id);
|
||||
await apis.user.nodes.deleteNodeById(file2Id);
|
||||
await apis.user.nodes.deleteNodeById(file3Id);
|
||||
await apis.user.nodes.deleteNodeById(file4Id);
|
||||
await apis.user.shared.waitForApi({ expect: 0 });
|
||||
done();
|
||||
});
|
||||
|
||||
it('Unshare dialog UI - [C286684]', async () => {
|
||||
await dataTable.selectItem(file1);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Shared link settings');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
|
||||
expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle not checked');
|
||||
await shareDialog.clickShareToggle();
|
||||
|
||||
expect(await confirmDialog.isDialogOpen()).toBe(true, 'Unshare dialog is not open');
|
||||
expect(await confirmDialog.getTitle()).toContain('Remove this shared link');
|
||||
expect(await confirmDialog.getText()).toContain('This link will be deleted and a new link will be created next time this file is shared');
|
||||
expect(await confirmDialog.isButtonEnabled('Remove')).toBe(true, 'REMOVE button is not enabled');
|
||||
expect(await confirmDialog.isButtonEnabled('Cancel')).toBe(true, 'CANCEL button is not enabled');
|
||||
});
|
||||
|
||||
it('Unshare a file - [C286685]', async () => {
|
||||
await dataTable.selectItem(file2);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Shared link settings');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
const url = await shareDialog.getLinkUrl();
|
||||
await shareDialog.clickShareToggle();
|
||||
|
||||
await confirmDialog.clickButton('Remove');
|
||||
await confirmDialog.waitForDialogToClose();
|
||||
await shareDialog.waitForDialogToClose();
|
||||
expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog open');
|
||||
expect(await apis.user.nodes.isFileShared(file2Id)).toBe(false, `${file2} is shared`);
|
||||
|
||||
// TODO: disable check cause api is slow to update
|
||||
// expect(await dataTable.getRowByName(file2).isPresent()).toBe(false, `${file2} is in the Shared files list`);
|
||||
|
||||
await browser.get(url);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open');
|
||||
expect(await viewer.getFileTitle()).not.toEqual(file2);
|
||||
|
||||
await page.load();
|
||||
});
|
||||
|
||||
it('Cancel the Unshare action - [C286686]', async () => {
|
||||
await dataTable.selectItem(file3);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Shared link settings');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
|
||||
const urlBefore = await shareDialog.getLinkUrl();
|
||||
await shareDialog.clickShareToggle();
|
||||
|
||||
await confirmDialog.clickButton('Cancel');
|
||||
await confirmDialog.waitForDialogToClose();
|
||||
expect(await shareDialog.isDialogOpen()).toBe(true, 'Share dialog not open');
|
||||
expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle is off');
|
||||
|
||||
const urlAfter = await shareDialog.getLinkUrl();
|
||||
expect(urlBefore).toEqual(urlAfter);
|
||||
});
|
||||
|
||||
it('Unshare a file from the context menu - [C286688]', async () => {
|
||||
await dataTable.rightClickOnItem(file4);
|
||||
await contextMenu.clickMenuItem('Shared link settings');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
const url = await shareDialog.getLinkUrl();
|
||||
await shareDialog.clickShareToggle();
|
||||
|
||||
await confirmDialog.clickButton('Remove');
|
||||
await confirmDialog.waitForDialogToClose();
|
||||
await shareDialog.waitForDialogToClose();
|
||||
expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog open');
|
||||
expect(await apis.user.nodes.isFileShared(file4Id)).toBe(false, `${file4} is shared`);
|
||||
|
||||
// TODO: disable check cause api is slow to update
|
||||
// expect(await dataTable.getRowByName(file4).isPresent()).toBe(false, `${file4} is in the Shared files list`);
|
||||
|
||||
await browser.get(url);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open');
|
||||
expect(await viewer.getFileTitle()).not.toEqual(file4);
|
||||
|
||||
await page.load();
|
||||
});
|
||||
});
|
||||
|
||||
describe('from Favorites', () => {
|
||||
|
||||
const file1 = `file1-${Utils.random()}.txt`; let file1Id;
|
||||
const file2 = `file2-${Utils.random()}.txt`; let file2Id;
|
||||
const file3 = `file3-${Utils.random()}.txt`; let file3Id;
|
||||
const file4 = `file4-${Utils.random()}.txt`; let file4Id;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id;
|
||||
file2Id = (await apis.user.nodes.createFile(file2, parentId)).entry.id;
|
||||
file3Id = (await apis.user.nodes.createFile(file3, parentId)).entry.id;
|
||||
file4Id = (await apis.user.nodes.createFile(file4, parentId)).entry.id;
|
||||
await apis.user.shared.shareFileById(file1Id);
|
||||
await apis.user.shared.shareFileById(file2Id);
|
||||
await apis.user.shared.shareFileById(file3Id);
|
||||
await apis.user.shared.shareFileById(file4Id);
|
||||
|
||||
await apis.user.favorites.addFavoriteById('file', file1Id);
|
||||
await apis.user.favorites.addFavoriteById('file', file2Id);
|
||||
await apis.user.favorites.addFavoriteById('file', file3Id);
|
||||
await apis.user.favorites.addFavoriteById('file', file4Id);
|
||||
|
||||
await apis.user.favorites.waitForApi({ expect: 4 });
|
||||
await apis.user.shared.waitForApi({ expect: 4 });
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await page.refresh();
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodeById(file1Id);
|
||||
await apis.user.nodes.deleteNodeById(file2Id);
|
||||
await apis.user.nodes.deleteNodeById(file3Id);
|
||||
await apis.user.nodes.deleteNodeById(file4Id);
|
||||
await apis.user.shared.waitForApi({ expect: 0 });
|
||||
done();
|
||||
});
|
||||
|
||||
it('Unshare dialog UI - [C286694]', async () => {
|
||||
await dataTable.selectItem(file1);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Share');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
|
||||
expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle not checked');
|
||||
await shareDialog.clickShareToggle();
|
||||
|
||||
expect(await confirmDialog.isDialogOpen()).toBe(true, 'Unshare dialog is not open');
|
||||
expect(await confirmDialog.getTitle()).toContain('Remove this shared link');
|
||||
expect(await confirmDialog.getText()).toContain('This link will be deleted and a new link will be created next time this file is shared');
|
||||
expect(await confirmDialog.isButtonEnabled('Remove')).toBe(true, 'REMOVE button is not enabled');
|
||||
expect(await confirmDialog.isButtonEnabled('Cancel')).toBe(true, 'CANCEL button is not enabled');
|
||||
});
|
||||
|
||||
it('Unshare a file - [C286695]', async () => {
|
||||
await dataTable.selectItem(file2);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Share');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
const url = await shareDialog.getLinkUrl();
|
||||
await shareDialog.clickShareToggle();
|
||||
|
||||
await confirmDialog.clickButton('Remove');
|
||||
await confirmDialog.waitForDialogToClose();
|
||||
await shareDialog.waitForDialogToClose();
|
||||
expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog open');
|
||||
expect(await apis.user.nodes.isFileShared(file2Id)).toBe(false, `${file2} is shared`);
|
||||
|
||||
// TODO: disable check cause api is slow to update
|
||||
// await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
// expect(await dataTable.getRowByName(file2).isPresent()).toBe(false, `${file2} is in the Shared files list`);
|
||||
|
||||
await browser.get(url);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open');
|
||||
expect(await viewer.getFileTitle()).not.toEqual(file2);
|
||||
|
||||
await page.load();
|
||||
});
|
||||
|
||||
it('Cancel the Unshare action - [C286696]', async () => {
|
||||
await dataTable.selectItem(file3);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Share');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
|
||||
const urlBefore = await shareDialog.getLinkUrl();
|
||||
await shareDialog.clickShareToggle();
|
||||
|
||||
await confirmDialog.clickButton('Cancel');
|
||||
await confirmDialog.waitForDialogToClose();
|
||||
expect(await shareDialog.isDialogOpen()).toBe(true, 'Share dialog not open');
|
||||
expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle is off');
|
||||
|
||||
const urlAfter = await shareDialog.getLinkUrl();
|
||||
expect(urlBefore).toEqual(urlAfter);
|
||||
});
|
||||
|
||||
it('Unshare a file from the context menu - [C286698]', async () => {
|
||||
await dataTable.rightClickOnItem(file4);
|
||||
await contextMenu.clickMenuItem('Share');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
const url = await shareDialog.getLinkUrl();
|
||||
await shareDialog.clickShareToggle();
|
||||
|
||||
await confirmDialog.clickButton('Remove');
|
||||
await confirmDialog.waitForDialogToClose();
|
||||
await shareDialog.waitForDialogToClose();
|
||||
expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog open');
|
||||
expect(await apis.user.nodes.isFileShared(file4Id)).toBe(false, `${file4} is shared`);
|
||||
|
||||
// TODO: disable check cause api is slow to update
|
||||
// await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
// expect(await dataTable.getRowByName(file4).isPresent()).toBe(false, `${file4} is in the Shared files list`);
|
||||
|
||||
await browser.get(url);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open');
|
||||
expect(await viewer.getFileTitle()).not.toEqual(file4);
|
||||
|
||||
await page.load();
|
||||
});
|
||||
});
|
||||
|
||||
describe('as Consumer', () => {
|
||||
|
||||
const sitePrivate = `site-private-${Utils.random()}`;
|
||||
|
||||
const file1 = `file1-${Utils.random()}.txt`; let file1Id;
|
||||
const file2 = `file2-${Utils.random()}.txt`; let file2Id;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(sitePrivate);
|
||||
|
||||
file1Id = (await apis.admin.nodes.createFile(file1, docLibId)).entry.id;
|
||||
file2Id = (await apis.admin.nodes.createFile(file2, docLibId)).entry.id;
|
||||
|
||||
await apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_CONSUMER);
|
||||
|
||||
await apis.admin.shared.shareFileById(file1Id);
|
||||
await apis.user.shared.shareFileById(file2Id);
|
||||
await apis.user.shared.waitForApi({ expect: 2 });
|
||||
|
||||
await apis.user.favorites.addFavoriteById('file', file1Id);
|
||||
await apis.user.favorites.addFavoriteById('file', file2Id);
|
||||
await apis.user.favorites.waitForApi({ expect: 2 });
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.admin.sites.deleteSite(sitePrivate);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await page.refresh();
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
done();
|
||||
});
|
||||
|
||||
it('on File Libraries - file shared by other user - [C286682]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(sitePrivate);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectItem(file1);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Shared link settings');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
|
||||
expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle enabled for consumer');
|
||||
});
|
||||
|
||||
it('on File Libraries - file shared by the user - [C286701]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(sitePrivate);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectItem(file2);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Shared link settings');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
|
||||
expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle enabled for consumer');
|
||||
});
|
||||
|
||||
it('on Shared Files - file shared by other user - [C286687]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectItem(file1);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Shared link settings');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
|
||||
expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle enabled for consumer');
|
||||
});
|
||||
|
||||
it('on Shared Files - file shared by the user - [C286702]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectItem(file1);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Shared link settings');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
|
||||
expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle enabled for consumer');
|
||||
});
|
||||
|
||||
it('on Favorites - file shared by other user - [C286697]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectItem(file1);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Share');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
|
||||
expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle enabled for consumer');
|
||||
});
|
||||
|
||||
it('on Favorites - file shared by the user - [C286703]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.selectItem(file1);
|
||||
await toolbar.openMoreMenu();
|
||||
await toolbar.menu.clickMenuItem('Share');
|
||||
await shareDialog.waitForDialogToOpen();
|
||||
|
||||
expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle enabled for consumer');
|
||||
});
|
||||
});
|
||||
|
||||
xit('');
|
||||
});
|
||||
@@ -30,45 +30,45 @@ import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
|
||||
describe('Upload files', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const folder1 = `folder1-${Utils.random()}`; let folder1Id;
|
||||
const folder1 = `folder1-${Utils.random()}`; let folder1Id;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
|
||||
beforeAll(done => {
|
||||
apis.admin.people.createUser({ username })
|
||||
.then(() => apis.user.nodes.createFolder(folder1).then(resp => folder1Id = resp.entry.id))
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
folder1Id = (await apis.user.nodes.createFolder(folder1)).entry.id;
|
||||
|
||||
.then(() => loginPage.loginWith(username))
|
||||
.then(done);
|
||||
});
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(done => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
});
|
||||
beforeEach(async (done) => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
Promise.all([
|
||||
// apis.user.nodes.deleteNodeById(folder1Id),
|
||||
logoutPage.load()
|
||||
])
|
||||
.then(done);
|
||||
});
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.user.nodes.deleteNodeById(folder1Id),
|
||||
logoutPage.load()
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
it('Upload a file', () => {
|
||||
dataTable.doubleClickOnRowByName(folder1)
|
||||
.then(() => page.sidenav.openNewMenu())
|
||||
.then(() => page.sidenav.menu.uploadFile().sendKeys(`${__dirname}/create-folder.test.ts`));
|
||||
});
|
||||
it('Upload a file', async () => {
|
||||
await dataTable.doubleClickOnRowByName(folder1);
|
||||
await page.sidenav.openNewMenu();
|
||||
await page.sidenav.menu.uploadFile().sendKeys(`${__dirname}/create-folder.test.ts`);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2018 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 { browser } from 'protractor';
|
||||
import { BrowsingPage, LoginPage, LogoutPage } from '../../pages/pages';
|
||||
import { CreateOrEditFolderDialog } from '../../components/dialog/create-edit-folder-dialog';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
|
||||
describe('General', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const page = new BrowsingPage();
|
||||
const createDialog = new CreateOrEditFolderDialog();
|
||||
const adminApi = new RepoClient();
|
||||
const { nodes: nodesApi, authentication: authApi } = adminApi;
|
||||
const folder = `folder-${Utils.random()}`;
|
||||
let folderId;
|
||||
xit('');
|
||||
|
||||
describe('on session expire', () => {
|
||||
beforeAll(async (done) => {
|
||||
folderId = (await nodesApi.createFolder(folder)).entry.id;
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await nodesApi.deleteNodeById(folderId);
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('should close opened dialogs - [C286473]', async () => {
|
||||
await loginPage.loginWithAdmin();
|
||||
|
||||
await page.sidenav.openCreateDialog();
|
||||
await createDialog.waitForDialogToOpen();
|
||||
await createDialog.enterName(folder);
|
||||
|
||||
await authApi.logout();
|
||||
|
||||
await createDialog.clickCreate();
|
||||
expect(await browser.getTitle()).toContain('Sign in');
|
||||
const message = await page.getSnackBarMessage();
|
||||
expect(message).toEqual('The action was unsuccessful. Try again or contact your IT Team.');
|
||||
|
||||
await createDialog.waitForDialogToClose();
|
||||
expect(createDialog.component.isPresent()).not.toBe(true, 'dialog is present');
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -32,147 +32,109 @@ import { Utils } from '../../utilities/utils';
|
||||
|
||||
|
||||
describe('Page titles', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const page = new BrowsingPage();
|
||||
const adminApi = new RepoClient();
|
||||
const { nodes: nodesApi } = adminApi;
|
||||
const file = `file-${Utils.random()}.txt`; let fileId;
|
||||
const header = page.header;
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const page = new BrowsingPage();
|
||||
const adminApi = new RepoClient();
|
||||
const { nodes: nodesApi } = adminApi;
|
||||
const file = `file-${Utils.random()}.txt`; let fileId;
|
||||
const header = page.header;
|
||||
|
||||
xit('');
|
||||
xit('');
|
||||
|
||||
describe('on Login / Logout pages', () => {
|
||||
it('on Login page - [C217155]', () => {
|
||||
loginPage.load()
|
||||
.then(() => {
|
||||
expect(browser.getTitle()).toContain('Sign in');
|
||||
});
|
||||
});
|
||||
|
||||
it('after logout - [C217156]', () => {
|
||||
loginPage.loginWithAdmin()
|
||||
.then(() => page.signOut())
|
||||
.then(() => {
|
||||
expect(browser.getTitle()).toContain('Sign in');
|
||||
});
|
||||
});
|
||||
|
||||
it('when pressing Back after Logout - [C280414]', () => {
|
||||
loginPage.loginWithAdmin()
|
||||
.then(() => page.signOut())
|
||||
.then(() => browser.navigate().back())
|
||||
.then(() => {
|
||||
expect(browser.getTitle()).toContain('Sign in');
|
||||
});
|
||||
});
|
||||
describe('on Login / Logout pages', () => {
|
||||
it('on Login page - [C217155]', async () => {
|
||||
await loginPage.load();
|
||||
expect(await browser.getTitle()).toContain('Sign in');
|
||||
});
|
||||
|
||||
describe('on list views', () => {
|
||||
beforeAll(done => {
|
||||
loginPage.loginWithAdmin().then(done);
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
logoutPage.load()
|
||||
.then(done);
|
||||
});
|
||||
|
||||
it('Personal Files page - [C217157]', () => {
|
||||
const label = SIDEBAR_LABELS.PERSONAL_FILES;
|
||||
|
||||
page.sidenav.navigateToLinkByLabel(label)
|
||||
.then(() => {
|
||||
expect(browser.getTitle()).toContain(label);
|
||||
});
|
||||
});
|
||||
|
||||
it('File Libraries page - [C217158]', () => {
|
||||
const label = SIDEBAR_LABELS.FILE_LIBRARIES;
|
||||
|
||||
page.sidenav.navigateToLinkByLabel(label)
|
||||
.then(() => {
|
||||
expect(browser.getTitle()).toContain(label);
|
||||
});
|
||||
});
|
||||
|
||||
it('Shared Files page - [C217159]', () => {
|
||||
const label = SIDEBAR_LABELS.SHARED_FILES;
|
||||
|
||||
page.sidenav.navigateToLinkByLabel(label)
|
||||
.then(() => {
|
||||
expect(browser.getTitle()).toContain(label);
|
||||
});
|
||||
});
|
||||
|
||||
it('Recent Files page - [C217160]', () => {
|
||||
const label = SIDEBAR_LABELS.RECENT_FILES;
|
||||
|
||||
page.sidenav.navigateToLinkByLabel(label)
|
||||
.then(() => {
|
||||
expect(browser.getTitle()).toContain(label);
|
||||
});
|
||||
});
|
||||
|
||||
it('Favorites page - [C217161]', () => {
|
||||
const label = SIDEBAR_LABELS.FAVORITES;
|
||||
|
||||
page.sidenav.navigateToLinkByLabel(label)
|
||||
.then(() => {
|
||||
expect(browser.getTitle()).toContain(label);
|
||||
});
|
||||
});
|
||||
|
||||
it('Trash page - [C217162]', () => {
|
||||
const label = SIDEBAR_LABELS.TRASH;
|
||||
|
||||
page.sidenav.navigateToLinkByLabel(label)
|
||||
.then(() => {
|
||||
expect(browser.getTitle()).toContain(label);
|
||||
});
|
||||
});
|
||||
|
||||
it('after logout - [C217156]', async () => {
|
||||
await loginPage.loginWithAdmin();
|
||||
await page.signOut();
|
||||
expect(await browser.getTitle()).toContain('Sign in');
|
||||
});
|
||||
|
||||
describe('on File Viewer', () => {
|
||||
beforeAll( async (done) => {
|
||||
fileId = (await nodesApi.createFile(file)).entry.id;
|
||||
await loginPage.loginWithAdmin();
|
||||
done();
|
||||
});
|
||||
it('when pressing Back after Logout - [C280414]', async () => {
|
||||
await loginPage.loginWithAdmin();
|
||||
await page.signOut();
|
||||
await browser.navigate().back();
|
||||
expect(await browser.getTitle()).toContain('Sign in');
|
||||
});
|
||||
});
|
||||
|
||||
afterAll( async (done) => {
|
||||
await logoutPage.load();
|
||||
await adminApi.nodes.deleteNodeById(fileId);
|
||||
done();
|
||||
});
|
||||
|
||||
it('File Preview page - [C280415]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await page.dataTable.waitForHeader();
|
||||
await page.dataTable.doubleClickOnRowByName(file);
|
||||
expect(await browser.getTitle()).toContain(PAGE_TITLES.VIEWER);
|
||||
});
|
||||
describe('on app pages', () => {
|
||||
beforeAll(async (done) => {
|
||||
fileId = (await nodesApi.createFile(file)).entry.id;
|
||||
await loginPage.loginWithAdmin();
|
||||
done();
|
||||
});
|
||||
|
||||
describe ('on Search query', () => {
|
||||
beforeAll( async (done) => {
|
||||
await loginPage.loginWithAdmin();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll( async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Search Results page - [C280413]', async () => {
|
||||
await header.waitForSearchButton();
|
||||
await header.searchButton.click();
|
||||
await page.dataTable.waitForHeader();
|
||||
await header.waitForSearchBar();
|
||||
await header.searchForText(file);
|
||||
expect(await browser.getTitle()).toContain(PAGE_TITLES.SEARCH);
|
||||
});
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
logoutPage.load(),
|
||||
adminApi.nodes.deleteNodeById(fileId)
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
it('Personal Files page - [C217157]', async () => {
|
||||
const label = SIDEBAR_LABELS.PERSONAL_FILES;
|
||||
|
||||
await page.sidenav.navigateToLinkByLabel(label);
|
||||
expect(await browser.getTitle()).toContain(label);
|
||||
});
|
||||
|
||||
it('File Libraries page - [C217158]', async () => {
|
||||
const label = SIDEBAR_LABELS.FILE_LIBRARIES;
|
||||
|
||||
await page.sidenav.navigateToLinkByLabel(label);
|
||||
expect(await browser.getTitle()).toContain(label);
|
||||
});
|
||||
|
||||
it('Shared Files page - [C217159]', async () => {
|
||||
const label = SIDEBAR_LABELS.SHARED_FILES;
|
||||
|
||||
await page.sidenav.navigateToLinkByLabel(label);
|
||||
expect(await browser.getTitle()).toContain(label);
|
||||
});
|
||||
|
||||
it('Recent Files page - [C217160]', async () => {
|
||||
const label = SIDEBAR_LABELS.RECENT_FILES;
|
||||
|
||||
await page.sidenav.navigateToLinkByLabel(label);
|
||||
expect(await browser.getTitle()).toContain(label);
|
||||
});
|
||||
|
||||
it('Favorites page - [C217161]', async () => {
|
||||
const label = SIDEBAR_LABELS.FAVORITES;
|
||||
|
||||
await page.sidenav.navigateToLinkByLabel(label);
|
||||
expect(await browser.getTitle()).toContain(label);
|
||||
});
|
||||
|
||||
it('Trash page - [C217162]', async () => {
|
||||
const label = SIDEBAR_LABELS.TRASH;
|
||||
|
||||
await page.sidenav.navigateToLinkByLabel(label);
|
||||
expect(await browser.getTitle()).toContain(label);
|
||||
});
|
||||
|
||||
it('File Preview page - [C280415]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await page.dataTable.waitForHeader();
|
||||
await page.dataTable.doubleClickOnRowByName(file);
|
||||
expect(await browser.getTitle()).toContain(PAGE_TITLES.VIEWER);
|
||||
await Utils.pressEscape();
|
||||
});
|
||||
|
||||
it('Search Results page - [C280413]', async () => {
|
||||
await header.waitForSearchButton();
|
||||
await header.searchButton.click();
|
||||
await page.dataTable.waitForHeader();
|
||||
await header.waitForSearchBar();
|
||||
await header.searchForText(file);
|
||||
expect(await browser.getTitle()).toContain(PAGE_TITLES.SEARCH);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -29,205 +29,176 @@ import { APP_ROUTES } from '../../configs';
|
||||
import { LoginPage, LogoutPage, BrowsingPage } from '../../pages/pages';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
import { navigate } from '../../utilities/browser-utils';
|
||||
|
||||
describe('Login', () => {
|
||||
const peopleApi = new RepoClient().people;
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const peopleApi = new RepoClient().people;
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
|
||||
/* cspell:disable-next-line */
|
||||
const testUser = `user-${Utils.random()}@alfness`;
|
||||
|
||||
const russianUser = {
|
||||
/* cspell:disable-next-line */
|
||||
const testUser = `user-${Utils.random()}@alfness`;
|
||||
username: `пользвате${Utils.random()}`,
|
||||
password: '密碼中國'
|
||||
};
|
||||
|
||||
const russianUser = {
|
||||
/* cspell:disable-next-line */
|
||||
username: `пользвате${Utils.random()}`,
|
||||
password: '密碼中國'
|
||||
};
|
||||
const johnDoe = {
|
||||
username: `user-${Utils.random()}`,
|
||||
get password() { return this.username; },
|
||||
firstName: 'John',
|
||||
lastName: 'Doe'
|
||||
};
|
||||
|
||||
const johnDoe = {
|
||||
username: `user-${Utils.random()}`,
|
||||
get password() { return this.username; },
|
||||
firstName: 'John',
|
||||
lastName: 'Doe'
|
||||
};
|
||||
const disabledUser = `user-${Utils.random()}`;
|
||||
const testUser2 = {
|
||||
username: `user-${Utils.random()}`,
|
||||
password: 'user2 password'
|
||||
};
|
||||
const newPassword = 'new password';
|
||||
|
||||
const disabledUser = `user-${Utils.random()}`;
|
||||
const testUser2 = {
|
||||
username: `user-${Utils.random()}`,
|
||||
password: 'user2 password'
|
||||
};
|
||||
const newPassword = 'new password';
|
||||
beforeAll(async (done) => {
|
||||
await peopleApi.createUser({ username: testUser });
|
||||
await peopleApi.createUser(russianUser);
|
||||
await peopleApi.createUser(johnDoe);
|
||||
await peopleApi.createUser({ username: disabledUser });
|
||||
await peopleApi.createUser(testUser2);
|
||||
await peopleApi.disableUser(disabledUser);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeAll(done => {
|
||||
Promise
|
||||
.all([
|
||||
peopleApi.createUser({ username: testUser }),
|
||||
peopleApi.createUser(russianUser),
|
||||
peopleApi.createUser(johnDoe),
|
||||
peopleApi.createUser({ username: disabledUser })
|
||||
.then(() => peopleApi.disableUser(disabledUser)),
|
||||
peopleApi.createUser(testUser2)
|
||||
])
|
||||
.then(done);
|
||||
afterEach(async (done) => {
|
||||
await logoutPage.load();
|
||||
await Utils.clearLocalStorage();
|
||||
done();
|
||||
});
|
||||
|
||||
xit('');
|
||||
|
||||
describe('general tests', () => {
|
||||
beforeEach(async (done) => {
|
||||
await loginPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(done => {
|
||||
logoutPage.load()
|
||||
.then(() => Utils.clearLocalStorage())
|
||||
.then(done);
|
||||
it('login page layout - [C213089]', async () => {
|
||||
expect(await loginPage.login.usernameInput.isEnabled()).toBe(true, 'username input is not enabled');
|
||||
expect(await loginPage.login.passwordInput.isEnabled()).toBe(true, 'password input is not enabled');
|
||||
expect(await loginPage.login.submitButton.isEnabled()).toBe(false, 'SIGN IN button is enabled');
|
||||
expect(await loginPage.login.getPasswordVisibility()).toBe(false, 'Password is not hidden by default');
|
||||
});
|
||||
|
||||
xit('');
|
||||
it('change password visibility - [C213091]', async () => {
|
||||
await loginPage.login.enterPassword('some password');
|
||||
expect(await loginPage.login.isPasswordShown()).toBe(false, 'password is visible');
|
||||
await loginPage.login.passwordVisibility.click();
|
||||
expect(await loginPage.login.getPasswordVisibility()).toBe(true, 'Password visibility not changed');
|
||||
expect(await loginPage.login.isPasswordShown()).toBe(true, 'password is not visible');
|
||||
});
|
||||
});
|
||||
|
||||
describe('general tests', () => {
|
||||
beforeEach(done => {
|
||||
loginPage.load().then(done);
|
||||
});
|
||||
describe('with valid credentials', () => {
|
||||
it('navigate to "Personal Files" - [C213092]', async () => {
|
||||
const { username } = johnDoe;
|
||||
|
||||
it('login page layout - [C213089]', () => {
|
||||
expect(loginPage.login.usernameInput.isEnabled()).toBe(true, 'username input is not enabled');
|
||||
expect(loginPage.login.passwordInput.isEnabled()).toBe(true, 'password input is not enabled');
|
||||
expect(loginPage.login.submitButton.isEnabled()).toBe(false, 'SIGN IN button is enabled');
|
||||
expect(loginPage.login.getPasswordVisibility()).toBe(false, 'Password is not hidden by default');
|
||||
});
|
||||
|
||||
it('change password visibility - [C213091]', () => {
|
||||
loginPage.login.enterPassword('some password');
|
||||
expect(loginPage.login.isPasswordShown()).toBe(false, 'password is visible');
|
||||
loginPage.login.passwordVisibility.click()
|
||||
.then(() => {
|
||||
expect(loginPage.login.getPasswordVisibility()).toBe(true, 'Password visibility not changed');
|
||||
expect(loginPage.login.isPasswordShown()).toBe(true, 'password is not visible');
|
||||
});
|
||||
});
|
||||
await loginPage.loginWith(username);
|
||||
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
|
||||
});
|
||||
|
||||
describe('with valid credentials', () => {
|
||||
it('navigate to "Personal Files" - [C213092]', () => {
|
||||
const { username } = johnDoe;
|
||||
it(`displays user's name in header - [C213108]`, async () => {
|
||||
const { userInfo } = new BrowsingPage(APP_ROUTES.PERSONAL_FILES).header;
|
||||
const { username, firstName, lastName } = johnDoe;
|
||||
|
||||
loginPage.loginWith(username)
|
||||
.then(() => {
|
||||
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
|
||||
});
|
||||
});
|
||||
|
||||
it(`displays user's name in header - [C213108]`, () => {
|
||||
const { userInfo } = new BrowsingPage(APP_ROUTES.PERSONAL_FILES).header;
|
||||
const { username, firstName, lastName } = johnDoe;
|
||||
|
||||
loginPage.loginWith(username)
|
||||
.then(() => {
|
||||
expect(userInfo.name).toEqual(`${firstName} ${lastName}`);
|
||||
});
|
||||
});
|
||||
|
||||
it(`logs in with user having username containing "@" - [C213096]`, () => {
|
||||
loginPage
|
||||
.loginWith(testUser)
|
||||
.then(() => {
|
||||
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
|
||||
});
|
||||
});
|
||||
|
||||
it('logs in with user with non-latin characters - [C213097]', () => {
|
||||
const { username, password } = russianUser;
|
||||
|
||||
loginPage
|
||||
.loginWith(username, password)
|
||||
.then(() => {
|
||||
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
|
||||
});
|
||||
});
|
||||
|
||||
it('redirects to Home Page when navigating to the Login page while already logged in - [C213107]', () => {
|
||||
const { username } = johnDoe;
|
||||
|
||||
loginPage
|
||||
.loginWith(username)
|
||||
.then(() => browser.get(APP_ROUTES.LOGIN)
|
||||
.then(() => {
|
||||
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('redirects to Personal Files when pressing browser Back while already logged in - [C213109]', () => {
|
||||
const { username } = johnDoe;
|
||||
|
||||
loginPage
|
||||
.loginWith(username)
|
||||
.then(() => browser.navigate().back())
|
||||
.then(() => {
|
||||
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
|
||||
});
|
||||
});
|
||||
|
||||
it('user is able to login after changing his password - [C213104]', () => {
|
||||
loginPage.loginWith(testUser2.username, testUser2.password)
|
||||
.then(() => logoutPage.load())
|
||||
.then(() => peopleApi.changePassword(testUser2.username, newPassword))
|
||||
.then(() => loginPage.loginWith(testUser2.username, newPassword))
|
||||
.then(() => {
|
||||
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
|
||||
});
|
||||
});
|
||||
await loginPage.loginWith(username);
|
||||
expect(await userInfo.getName()).toEqual(`${firstName} ${lastName}`);
|
||||
});
|
||||
|
||||
describe('with invalid credentials', () => {
|
||||
const { login: loginComponent } = loginPage;
|
||||
const { submitButton, errorMessage } = loginComponent;
|
||||
|
||||
beforeEach(done => {
|
||||
loginPage.load().then(done);
|
||||
});
|
||||
|
||||
it('disabled submit button when password is empty - [C280072]', () => {
|
||||
loginComponent.enterUsername('any-username');
|
||||
expect(submitButton.isEnabled()).toBe(false);
|
||||
});
|
||||
|
||||
it('disabled submit button when username is empty - [C280070]', () => {
|
||||
loginPage.login.enterPassword('any-password');
|
||||
expect(submitButton.isEnabled()).toBe(false);
|
||||
});
|
||||
|
||||
it('shows error when entering nonexistent user - [C213093]', () => {
|
||||
loginPage
|
||||
.tryLoginWith('nonexistent-user', 'any-password')
|
||||
.then(() => {
|
||||
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.LOGIN);
|
||||
expect(errorMessage.isDisplayed()).toBe(true);
|
||||
expect(errorMessage.getText()).toBe(`You've entered an unknown username or password`);
|
||||
});
|
||||
});
|
||||
|
||||
it('shows error when entering invalid password - [C280071]', () => {
|
||||
const { username } = johnDoe;
|
||||
|
||||
loginPage
|
||||
.tryLoginWith(username, 'incorrect-password')
|
||||
.then(() => {
|
||||
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.LOGIN);
|
||||
expect(errorMessage.isDisplayed()).toBe(true);
|
||||
expect(errorMessage.getText()).toBe(`You've entered an unknown username or password`);
|
||||
});
|
||||
});
|
||||
|
||||
it('unauthenticated user is redirected to Login page - [C213106]', () => {
|
||||
browser.get(APP_ROUTES.PERSONAL_FILES)
|
||||
.then(() => {
|
||||
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.LOGIN);
|
||||
});
|
||||
});
|
||||
|
||||
it('disabled user is not logged in - [C213100]', () => {
|
||||
loginPage.tryLoginWith(disabledUser)
|
||||
.then(() => {
|
||||
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.LOGIN);
|
||||
expect(errorMessage.isDisplayed()).toBe(true);
|
||||
expect(errorMessage.getText()).toBe(`You've entered an unknown username or password`);
|
||||
});
|
||||
});
|
||||
it(`logs in with user having username containing "@" - [C213096]`, async () => {
|
||||
await loginPage.loginWith(testUser);
|
||||
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
|
||||
});
|
||||
|
||||
it('logs in with user with non-latin characters - [C213097]', async () => {
|
||||
const { username, password } = russianUser;
|
||||
|
||||
await loginPage.loginWith(username, password);
|
||||
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
|
||||
});
|
||||
|
||||
// TODO: ACA-245
|
||||
xit('redirects to Home Page when navigating to the Login page while already logged in - [C213107]', async () => {
|
||||
const { username } = johnDoe;
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
|
||||
await navigate(APP_ROUTES.LOGIN);
|
||||
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
|
||||
});
|
||||
|
||||
it('redirects to Personal Files when pressing browser Back while already logged in - [C213109]', async () => {
|
||||
const { username } = johnDoe;
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
await browser.navigate().back();
|
||||
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
|
||||
});
|
||||
|
||||
it('user is able to login after changing his password - [C213104]', async () => {
|
||||
await loginPage.loginWith(testUser2.username, testUser2.password);
|
||||
await logoutPage.load();
|
||||
await peopleApi.changePassword(testUser2.username, newPassword);
|
||||
await loginPage.loginWith(testUser2.username, newPassword);
|
||||
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
|
||||
});
|
||||
});
|
||||
|
||||
describe('with invalid credentials', () => {
|
||||
const { login: loginComponent } = loginPage;
|
||||
const { submitButton, errorMessage } = loginComponent;
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await loginPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('disabled submit button when password is empty - [C280072]', async () => {
|
||||
await loginComponent.enterUsername('any-username');
|
||||
expect(await submitButton.isEnabled()).toBe(false, 'submit button is enabled');
|
||||
});
|
||||
|
||||
it('disabled submit button when username is empty - [C280070]', async () => {
|
||||
await loginPage.login.enterPassword('any-password');
|
||||
expect(await submitButton.isEnabled()).toBe(false, 'submit button is enabled');
|
||||
});
|
||||
|
||||
it('shows error when entering nonexistent user - [C213093]', async () => {
|
||||
await loginPage.tryLoginWith('nonexistent-user', 'any-password');
|
||||
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.LOGIN);
|
||||
expect(await errorMessage.isDisplayed()).toBe(true, 'error message is not displayed');
|
||||
expect(await errorMessage.getText()).toBe(`You've entered an unknown username or password`);
|
||||
});
|
||||
|
||||
it('shows error when entering invalid password - [C280071]', async () => {
|
||||
const { username } = johnDoe;
|
||||
|
||||
await loginPage.tryLoginWith(username, 'incorrect-password');
|
||||
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.LOGIN);
|
||||
expect(await errorMessage.isDisplayed()).toBe(true, 'error message is not displayed');
|
||||
expect(await errorMessage.getText()).toBe(`You've entered an unknown username or password`);
|
||||
});
|
||||
|
||||
it('unauthenticated user is redirected to Login page - [C213106]', async () => {
|
||||
await navigate(APP_ROUTES.PERSONAL_FILES);
|
||||
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.LOGIN);
|
||||
});
|
||||
|
||||
it('disabled user is not logged in - [C213100]', async () => {
|
||||
await loginPage.tryLoginWith(disabledUser);
|
||||
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.LOGIN);
|
||||
expect(await errorMessage.isDisplayed()).toBe(true, 'error message is not displayed');
|
||||
expect(await errorMessage.getText()).toBe(`You've entered an unknown username or password`);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -30,53 +30,48 @@ import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
import { APP_ROUTES } from '../../configs';
|
||||
|
||||
describe('Logout', () => {
|
||||
const page = new BrowsingPage();
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const page = new BrowsingPage();
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
|
||||
const peopleApi = new RepoClient().people;
|
||||
const peopleApi = new RepoClient().people;
|
||||
|
||||
const johnDoe = `user-${Utils.random()}`;
|
||||
const johnDoe = `user-${Utils.random()}`;
|
||||
|
||||
beforeAll((done) => {
|
||||
peopleApi
|
||||
.createUser({ username: johnDoe })
|
||||
.then(done);
|
||||
});
|
||||
beforeAll(async (done) => {
|
||||
await peopleApi.createUser({ username: johnDoe });
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach((done) => {
|
||||
loginPage.loginWith(johnDoe).then(done);
|
||||
});
|
||||
beforeEach(async (done) => {
|
||||
await loginPage.loginWith(johnDoe);
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach((done) => {
|
||||
logoutPage.load().then(done);
|
||||
});
|
||||
afterEach(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Sign out option is available - [C213143]', () => {
|
||||
page.header.userInfo.openMenu()
|
||||
.then(() => expect(page.header.userInfo.menu.isMenuItemPresent('Sign out')).toBe(true, 'Sign out option not displayed'));
|
||||
});
|
||||
it('Sign out option is available - [C213143]', async () => {
|
||||
await page.header.userInfo.openMenu();
|
||||
expect(await page.header.userInfo.menu.isMenuItemPresent('Sign out')).toBe(true, 'Sign out option not displayed');
|
||||
});
|
||||
|
||||
it('redirects to Login page on sign out - [C213144]', () => {
|
||||
page.signOut()
|
||||
.then(() => {
|
||||
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.LOGIN);
|
||||
});
|
||||
});
|
||||
it('redirects to Login page on sign out - [C213144]', async () => {
|
||||
await page.signOut();
|
||||
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.LOGIN);
|
||||
});
|
||||
|
||||
it('redirects to Login page when pressing browser Back after logout - [C213145]', () => {
|
||||
page.signOut()
|
||||
.then(() => browser.navigate().back())
|
||||
.then(() => {
|
||||
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.LOGIN);
|
||||
});
|
||||
});
|
||||
it('redirects to Login page when pressing browser Back after logout - [C213145]', async () => {
|
||||
await page.signOut();
|
||||
await browser.navigate().back();
|
||||
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.LOGIN);
|
||||
});
|
||||
|
||||
it('redirects to Login page when trying to access a part of the app after logout - [C213146]', () => {
|
||||
page.signOut()
|
||||
.then(() => page.load('/favorites'))
|
||||
.then(() => {
|
||||
expect(browser.getCurrentUrl()).toContain(APP_ROUTES.LOGIN);
|
||||
});
|
||||
});
|
||||
it('redirects to Login page when trying to access a part of the app after logout - [C213146]', async () => {
|
||||
await page.signOut();
|
||||
await page.load('/favorites');
|
||||
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.LOGIN);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2018 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, LogoutPage, BrowsingPage } from '../../pages/pages';
|
||||
import { EXTENSIBILITY_CONFIGS, SIDEBAR_LABELS } from '../../configs';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
|
||||
describe('Extensions - Context submenu', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const file = `file-${Utils.random()}.txt`;
|
||||
let fileId;
|
||||
const folder = `folder-${Utils.random()}`;
|
||||
let folderId;
|
||||
|
||||
const restrictedPermissionsItem = 'Share';
|
||||
|
||||
const menuItem1 = {
|
||||
label: 'Test Menu1',
|
||||
submenu: [ 'Test submenu1', 'Test submenu2', restrictedPermissionsItem ]
|
||||
};
|
||||
const menuItem2 = {
|
||||
label: 'Test Menu2',
|
||||
submenu: [ restrictedPermissionsItem ]
|
||||
};
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const personalFilesPage = new BrowsingPage();
|
||||
const {dataTable} = personalFilesPage;
|
||||
const contextMenu = dataTable.menu;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({username});
|
||||
fileId = (await apis.user.nodes.createFile(file)).entry.id;
|
||||
folderId = (await apis.user.nodes.createFolder(folder)).entry.id;
|
||||
|
||||
await loginPage.load();
|
||||
await Utils.setSessionStorageFromConfig('"aca.extension.config"', EXTENSIBILITY_CONFIGS.CONTEXT_SUBMENUS);
|
||||
await loginPage.loginWith(username);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
await dataTable.clearSelection();
|
||||
await personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodeById(fileId, true);
|
||||
await apis.user.nodes.deleteNodeById(folderId, true);
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Displays the submenu actions set from config - [C286717]', async () => {
|
||||
await dataTable.rightClickOnItem(file);
|
||||
expect(await contextMenu.isMenuItemPresent(menuItem1.label)).toBe(true, `${menuItem1.label} is not displayed for ${file}`);
|
||||
expect(await contextMenu.hasSubMenu(menuItem1.label)).toBe(true, 'Menu does not have submenu');
|
||||
await contextMenu.mouseOverMenuItem(menuItem1.label);
|
||||
|
||||
expect(await contextMenu.getSubmenuItemsCount()).toBe(3, 'submenu has wrong number of items');
|
||||
expect(await contextMenu.isSubMenuItemPresent(menuItem1.submenu[0])).toBe(true, `${menuItem1.submenu[0]} is not displayed for ${file}`);
|
||||
expect(await contextMenu.isSubMenuItemPresent(menuItem1.submenu[1])).toBe(true, `${menuItem1.submenu[1]} is not displayed for ${file}`);
|
||||
expect(await contextMenu.isSubMenuItemPresent(menuItem1.submenu[2])).toBe(true, `${restrictedPermissionsItem} is not displayed for ${file}`);
|
||||
});
|
||||
|
||||
it('Does not display submenu actions without permissions - [C286718]', async () => {
|
||||
await dataTable.rightClickOnItem(folder);
|
||||
expect(await contextMenu.isMenuItemPresent(menuItem1.label)).toBe(true, `${menuItem1.label} is not displayed for ${folder}`);
|
||||
await contextMenu.mouseOverMenuItem(menuItem1.label);
|
||||
|
||||
expect(await contextMenu.getSubmenuItemsCount()).toBe(2, 'submenu has wrong number of items');
|
||||
expect(await contextMenu.isSubMenuItemPresent(menuItem1.submenu[0])).toBe(true, `${menuItem1.submenu[0]} is not displayed for ${file}`);
|
||||
expect(await contextMenu.isSubMenuItemPresent(menuItem1.submenu[1])).toBe(true, `${menuItem1.submenu[1]} is not displayed for ${file}`);
|
||||
expect(await contextMenu.isSubMenuItemPresent(menuItem1.submenu[2])).toBe(false, `no permission submenu ${restrictedPermissionsItem} is displayed`);
|
||||
});
|
||||
|
||||
it('The parent item is not displayed if all its children have no permission to be displayed - [C287784]', async () => {
|
||||
await dataTable.rightClickOnItem(folder);
|
||||
expect(await contextMenu.isMenuItemPresent(menuItem2.label)).toBe(false, `${menuItem2.label} menu is displayed for ${folder}`);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,113 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2018 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, LoginPage, LogoutPage } from '../../pages/pages';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
import { EXTENSIBILITY_CONFIGS, SIDEBAR_LABELS } from '../../configs';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
|
||||
describe('Extensions - DocumentList presets', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const file = `file-${Utils.random()}.txt`;
|
||||
let fileId;
|
||||
|
||||
const testData = [
|
||||
{
|
||||
id: 'app.files.name',
|
||||
fixtureLabel: 'Name'
|
||||
},
|
||||
{
|
||||
id: 'app.files.thumbnail',
|
||||
fixtureLabel: 'Thumbnail'
|
||||
},
|
||||
{
|
||||
id: 'app.files.size',
|
||||
fixtureLabel: 'Size',
|
||||
disabled: true
|
||||
},
|
||||
{
|
||||
id: 'app.files.modifiedBy',
|
||||
fixtureLabel: 'Test header'
|
||||
},
|
||||
{
|
||||
id: 'some.id.createdBy',
|
||||
fixtureLabel: 'New column'
|
||||
}
|
||||
];
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const personalFilesPage = new BrowsingPage();
|
||||
const { dataTable } = personalFilesPage;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
fileId = (await apis.user.nodes.createFile(file)).entry.id;
|
||||
|
||||
await loginPage.load();
|
||||
await Utils.setSessionStorageFromConfig('"aca.extension.config"', EXTENSIBILITY_CONFIGS.DOCUMENT_LIST_PRESETS);
|
||||
await loginPage.loginWith(username);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async done => {
|
||||
await personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodeById(fileId);
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Sets the columns to display - [C286700]', async () => {
|
||||
const labels = testData
|
||||
.filter(item => !item.disabled)
|
||||
.map(data => data.fixtureLabel);
|
||||
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
|
||||
|
||||
expect(await dataTable.getColumnHeaders().count()).toBe(labels.length, 'Incorrect number of columns');
|
||||
|
||||
await elements.forEach(async (element, index) => {
|
||||
expect(await element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
});
|
||||
});
|
||||
|
||||
it('Disabled items are not shown - [C286699]', async () => {
|
||||
const noColumnLabel = testData.find(item => item.disabled).fixtureLabel;
|
||||
const element = dataTable.getColumnHeaderByLabel(noColumnLabel);
|
||||
|
||||
expect(await element.isPresent()).toBe(false, `"${noColumnLabel}" is displayed`);
|
||||
});
|
||||
});
|
||||
Executable
+91
@@ -0,0 +1,91 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2018 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, LogoutPage } from '../../pages/pages';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
import { EXTENSIBILITY_CONFIGS } from '../../configs';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
import { Header } from '../../components/components';
|
||||
import { Menu } from './../../components/menu/menu';
|
||||
|
||||
describe('Extensions - Info Drawer', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const disabledMenu = {
|
||||
id: 'settings',
|
||||
title: 'App settings',
|
||||
description: 'Application settings',
|
||||
icon: 'settings'
|
||||
};
|
||||
|
||||
const enabledMenu = {
|
||||
id: 'button',
|
||||
title: 'New Button',
|
||||
description: 'new button description',
|
||||
icon: 'alarm_on'
|
||||
};
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const header = new Header();
|
||||
const toolbarMenu = new Menu();
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await loginPage.load();
|
||||
await Utils.setSessionStorageFromConfig('"aca.extension.config"', EXTENSIBILITY_CONFIGS.HEADER);
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Add a new button in the header - [C286474]', async () => {
|
||||
await header.openMoreMenu();
|
||||
expect(await toolbarMenu.isMenuItemPresent(enabledMenu.title)).toBe(true, 'menu item not present');
|
||||
expect(await toolbarMenu.getItemIconText(enabledMenu.title)).toEqual(enabledMenu.icon);
|
||||
});
|
||||
|
||||
it('Disable a button from the header - [C286477]', async () => {
|
||||
await header.openMoreMenu();
|
||||
expect(await toolbarMenu.isMenuItemPresent(disabledMenu.title)).toBe(true, `${disabledMenu.title} menu item not present`);
|
||||
expect(await toolbarMenu.isMenuItemDisabled(disabledMenu.title)).toEqual('true', `${disabledMenu.title} is not disabled`);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -101,16 +101,17 @@ describe('Extensions - Info Drawer', () => {
|
||||
|
||||
it('Add a new tab with icon and title - [C284646]', async () => {
|
||||
await page.dataTable.selectItem(file);
|
||||
await page.toolbar.actions.getButtonByTitleAttribute('View details').click();
|
||||
await page.toolbar.getButtonByTitleAttribute('View details').click();
|
||||
await infoDrawer.waitForInfoDrawerToOpen();
|
||||
|
||||
const val = await infoDrawer.getTabTitle(custom_tab.order);
|
||||
expect(await infoDrawer.isTabPresent(custom_tab.title)).toBe(true, `${custom_tab.title} tab is not present`);
|
||||
expect(await infoDrawer.getTabTitle(custom_tab.order)).toEqual(`${custom_tab.icon}\n${custom_tab.title}\n`);
|
||||
expect(val).toEqual(`${custom_tab.icon}\n${custom_tab.title}`);
|
||||
});
|
||||
|
||||
it('Remove existing tab - [C284647]', async () => {
|
||||
await page.dataTable.selectItem(file);
|
||||
await page.toolbar.actions.getButtonByTitleAttribute('View details').click();
|
||||
await page.toolbar.getButtonByTitleAttribute('View details').click();
|
||||
await infoDrawer.waitForInfoDrawerToOpen();
|
||||
|
||||
expect(await infoDrawer.isTabPresent(comments_tab.title)).toBe(false, `${comments_tab.title} tab should not be present!`);
|
||||
@@ -118,7 +119,7 @@ describe('Extensions - Info Drawer', () => {
|
||||
|
||||
it('Change tab title - [C284648]', async () => {
|
||||
await page.dataTable.selectItem(file);
|
||||
await page.toolbar.actions.getButtonByTitleAttribute('View details').click();
|
||||
await page.toolbar.getButtonByTitleAttribute('View details').click();
|
||||
await infoDrawer.waitForInfoDrawerToOpen();
|
||||
|
||||
expect(await infoDrawer.isTabPresent(properties_tab.title)).toBe(true, `${properties_tab.title} tab is not present`);
|
||||
@@ -127,21 +128,21 @@ describe('Extensions - Info Drawer', () => {
|
||||
|
||||
it('Tab with icon and no title - [C284649]', async () => {
|
||||
await page.dataTable.selectItem(file);
|
||||
await page.toolbar.actions.getButtonByTitleAttribute('View details').click();
|
||||
await page.toolbar.getButtonByTitleAttribute('View details').click();
|
||||
await infoDrawer.waitForInfoDrawerToOpen();
|
||||
|
||||
expect(await infoDrawer.isTabPresent(no_title_tab.title)).toBe(true, `${no_title_tab.title} tab is not present`);
|
||||
expect(await infoDrawer.getTabTitle(no_title_tab.order)).toEqual(`${no_title_tab.icon}\n`);
|
||||
expect(await infoDrawer.getTabTitle(no_title_tab.order)).toEqual(`${no_title_tab.icon}`);
|
||||
});
|
||||
|
||||
it('Insert new component in tab - [C284651]', async () => {
|
||||
await page.dataTable.selectItem(file);
|
||||
await page.toolbar.actions.getButtonByTitleAttribute('View details').click();
|
||||
await page.toolbar.getButtonByTitleAttribute('View details').click();
|
||||
await infoDrawer.waitForInfoDrawerToOpen();
|
||||
|
||||
expect(await infoDrawer.isTabDisplayed(custom_tab.title)).toBe(true, `${custom_tab.title} tab is not displayed`);
|
||||
await infoDrawer.clickTab(custom_tab.title);
|
||||
expect(await infoDrawer.getComponentIdOfTab(custom_tab.title)).toEqual(custom_tab.component);
|
||||
expect(await infoDrawer.getComponentIdOfTab()).toEqual(custom_tab.component);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -162,7 +163,7 @@ describe('Extensions - Info Drawer', () => {
|
||||
|
||||
it('Remove all tabs - [C284650]', async () => {
|
||||
await page.dataTable.selectItem(file);
|
||||
await page.toolbar.actions.getButtonByTitleAttribute('View details').click();
|
||||
await page.toolbar.getButtonByTitleAttribute('View details').click();
|
||||
await infoDrawer.waitForInfoDrawerToOpen();
|
||||
|
||||
expect(await infoDrawer.isEmpty()).toBe(true, 'Info Drawer is not empty');
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2018 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, LoginPage, LogoutPage } from '../../pages/pages';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
import { EXTENSIBILITY_CONFIGS } from '../../configs';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
import { InfoDrawer } from '../../components/info-drawer/info-drawer';
|
||||
import { MetadataCard } from '../../components/metadata-card/metadata-card';
|
||||
|
||||
describe('Extensions - Metadata presets', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const file = `file-${Utils.random()}.png`;
|
||||
|
||||
let fileId;
|
||||
|
||||
const properties_tab = {
|
||||
title: 'Properties',
|
||||
component: 'app.components.tabs.metadata'
|
||||
};
|
||||
|
||||
const customGroup1 = {
|
||||
id: 'a.testGroup',
|
||||
title: 'A Test Group of Properties'
|
||||
};
|
||||
|
||||
const customGroup2 = {
|
||||
id: 'another.testGroup',
|
||||
title: 'Another Test Group of Properties'
|
||||
};
|
||||
|
||||
const disabledGroup = {
|
||||
id: 'disabled.testGroup',
|
||||
title: 'Hidden Group of Properties'
|
||||
};
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const infoDrawer = new InfoDrawer();
|
||||
const metadataCard = new MetadataCard();
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const page = new BrowsingPage();
|
||||
|
||||
beforeAll(async done => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
fileId = (await apis.user.nodes.createImage(file)).entry.id;
|
||||
|
||||
await loginPage.load();
|
||||
await Utils.setSessionStorageFromConfig('"aca.extension.config"', EXTENSIBILITY_CONFIGS.METADATA_PRESETS);
|
||||
await loginPage.loginWith(username);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async done => {
|
||||
await page.refresh();
|
||||
|
||||
await page.dataTable.selectItem(file);
|
||||
await page.toolbar.getButtonByTitleAttribute('View details').click();
|
||||
await infoDrawer.waitForInfoDrawerToOpen();
|
||||
|
||||
await infoDrawer.clickTab(properties_tab.title);
|
||||
await metadataCard.clickExpandButton();
|
||||
await metadataCard.waitForFirstExpansionPanel();
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async done => {
|
||||
await apis.user.nodes.deleteNodeById(fileId);
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('Set groups of properties to display - [C286636]', async () => {
|
||||
expect(await metadataCard.isExpansionPanelPresent(0)).toBe(true, `expansion panel is not present`);
|
||||
expect(await metadataCard.getComponentIdOfPanel(0)).toEqual(`adf-metadata-group-${customGroup1.title}`);
|
||||
expect(await metadataCard.isExpansionPanelPresent(1)).toBe(true, `expansion panel is not present`);
|
||||
expect(await metadataCard.getComponentIdOfPanel(1)).toEqual(`adf-metadata-group-${customGroup2.title}`);
|
||||
});
|
||||
|
||||
it('Disabled group is not displayed - [C286637]', async () => {
|
||||
expect(await metadataCard.isExpansionPanelPresent(2)).toBe(false, `disabled group is displayed`);
|
||||
expect(await metadataCard.getComponentIdOfPanel(1)).not.toEqual(`adf-metadata-group-${disabledGroup.title}`);
|
||||
expect(await metadataCard.getComponentIdOfPanel(0)).not.toEqual(`adf-metadata-group-${disabledGroup.title}`);
|
||||
});
|
||||
});
|
||||
@@ -44,6 +44,28 @@ describe('Extensions - Viewer', () => {
|
||||
};
|
||||
let docxFileId;
|
||||
|
||||
const customAction = {
|
||||
id: 'app.toolbar.my-action',
|
||||
title: 'My action',
|
||||
icon: 'http'
|
||||
};
|
||||
|
||||
const customSecondaryAction = {
|
||||
id: 'app.toolbar.my-secondary-action',
|
||||
title: 'My secondary action',
|
||||
icon: 'alarm'
|
||||
};
|
||||
|
||||
const downloadButton = {
|
||||
id: 'app.toolbar.download',
|
||||
title: 'My custom title'
|
||||
};
|
||||
|
||||
const moveAction = {
|
||||
id: 'app.viewer.move',
|
||||
title: 'My new title'
|
||||
}
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
@@ -54,6 +76,7 @@ describe('Extensions - Viewer', () => {
|
||||
const page = new BrowsingPage();
|
||||
|
||||
const viewer = new Viewer();
|
||||
const { toolbar } = viewer;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
@@ -67,10 +90,8 @@ describe('Extensions - Viewer', () => {
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.user.nodes.deleteNodesById([ pdfFileId, docxFileId ]),
|
||||
logoutPage.load()
|
||||
]);
|
||||
await apis.user.nodes.deleteNodesById([ pdfFileId, docxFileId ]);
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -80,17 +101,78 @@ describe('Extensions - Viewer', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
it('Insert new component in a content viewer - [C284659]', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(pdfFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
expect(await viewer.isCustomContentPresent()).toBe(true, 'Custom content is not present');
|
||||
expect(await viewer.getComponentIdOfView()).toEqual(pdfFile.component);
|
||||
await viewer.clickClose();
|
||||
|
||||
await page.dataTable.doubleClickOnRowByName(docxFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
expect(await viewer.isCustomContentPresent()).toBe(true, 'Custom content is not present');
|
||||
expect(await viewer.getComponentIdOfView()).toEqual(docxFile.component);
|
||||
afterEach(async (done) => {
|
||||
await Utils.pressEscape();
|
||||
done();
|
||||
});
|
||||
|
||||
xit('');
|
||||
|
||||
describe('content', () => {
|
||||
it('Insert new component in a content viewer - [C284659]', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(pdfFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
expect(await viewer.isCustomContentPresent()).toBe(true, 'Custom content is not present');
|
||||
expect(await viewer.getComponentIdOfView()).toEqual(pdfFile.component);
|
||||
await viewer.clickClose();
|
||||
|
||||
await page.dataTable.doubleClickOnRowByName(docxFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
expect(await viewer.isCustomContentPresent()).toBe(true, 'Custom content is not present');
|
||||
expect(await viewer.getComponentIdOfView()).toEqual(docxFile.component);
|
||||
});
|
||||
});
|
||||
|
||||
describe('toolbar actions', () => {
|
||||
it('Add a new action in the toolbar - [C286416]', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(pdfFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
expect(await toolbar.isButtonPresent(customAction.title)).toBe(true, 'Custom action is not present');
|
||||
expect(await toolbar.getButtonByTitleAttribute(customAction.title).getAttribute('id')).toEqual(customAction.id);
|
||||
expect(await toolbar.getButtonByTitleAttribute(customAction.title).getText()).toEqual(customAction.icon);
|
||||
});
|
||||
|
||||
it('Modify title of action from toolbar - [C286417]', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(pdfFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
expect(await toolbar.getButtonById(downloadButton.id).getAttribute('title')).toEqual(downloadButton.title);
|
||||
});
|
||||
|
||||
it('Remove action from toolbar - [C286419]', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(pdfFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
expect(await toolbar.isButtonPresent('Print')).toBe(false, 'Print button is still displayed');
|
||||
});
|
||||
});
|
||||
|
||||
describe('toolbar More actions menu', () => {
|
||||
it('Add a new action - [C286420]', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(pdfFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent(customSecondaryAction.title)).toBe(true, 'action is not present');
|
||||
expect(await toolbar.menu.getItemIconText(customSecondaryAction.title)).toEqual(customSecondaryAction.icon);
|
||||
expect(await toolbar.menu.getItemIdAttribute(customSecondaryAction.title)).toEqual(customSecondaryAction.id);
|
||||
});
|
||||
|
||||
it('Modify title of action from More actions menu - [C286421]', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(pdfFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.getItemById(moveAction.id).getAttribute('title')).toEqual(moveAction.title);
|
||||
});
|
||||
|
||||
it('Remove action from More actions menu - [C286423]', async () => {
|
||||
await page.dataTable.doubleClickOnRowByName(pdfFile.file_name);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened');
|
||||
|
||||
await toolbar.openMoreMenu();
|
||||
expect(await toolbar.menu.isMenuItemPresent('Permissions')).toBe(false, 'Action is still displayed');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -29,80 +29,69 @@ import { Utils } from '../../utilities/utils';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
|
||||
describe('Empty list views', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const password = username;
|
||||
const username = `user-${Utils.random()}`;
|
||||
const password = username;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, password)
|
||||
};
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, password)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
|
||||
beforeAll(done => {
|
||||
apis.admin.people.createUser({ username })
|
||||
.then(() => loginPage.loginWith(username))
|
||||
.then(done);
|
||||
});
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
logoutPage.load().then(done);
|
||||
});
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('empty Personal Files - [C280131]', () => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
|
||||
.then(() => {
|
||||
expect(dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(dataTable.getEmptyDragAndDropText()).toContain('Drag and drop');
|
||||
});
|
||||
});
|
||||
it('empty Personal Files - [C280131]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.getEmptyDragAndDropText()).toContain('Drag and drop');
|
||||
});
|
||||
|
||||
it('empty File Libraries - [C217099]', () => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES)
|
||||
.then(() => {
|
||||
expect(dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(dataTable.getEmptyStateTitle()).toContain(`You aren't a member of any File Libraries yet`);
|
||||
expect(dataTable.getEmptyStateSubtitle()).toContain('Join libraries to upload, view, and share files.');
|
||||
});
|
||||
});
|
||||
it('empty File Libraries - [C217099]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.getEmptyStateTitle()).toContain(`You aren't a member of any File Libraries yet`);
|
||||
expect(await dataTable.getEmptyStateSubtitle()).toContain('Join libraries to upload, view, and share files.');
|
||||
});
|
||||
|
||||
it('empty Shared Files - [C280132]', () => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES)
|
||||
.then(() => {
|
||||
expect(dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(dataTable.getEmptyStateTitle()).toContain('No shared files or folders');
|
||||
expect(dataTable.getEmptyStateSubtitle()).toContain('Items you share using the Share option are shown here.');
|
||||
});
|
||||
});
|
||||
it('empty Shared Files - [C280132]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.getEmptyStateTitle()).toContain('No shared files or folders');
|
||||
expect(await dataTable.getEmptyStateSubtitle()).toContain('Items you share using the Share option are shown here.');
|
||||
});
|
||||
|
||||
it('empty Recent Files - [C213169]', () => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES)
|
||||
.then(() => {
|
||||
expect(dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(dataTable.getEmptyStateTitle()).toContain('No recent files');
|
||||
expect(dataTable.getEmptyStateSubtitle()).toContain('Items you upload or edit in the last 30 days are shown here.');
|
||||
});
|
||||
});
|
||||
it('empty Recent Files - [C213169]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES)
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.getEmptyStateTitle()).toContain('No recent files');
|
||||
expect(await dataTable.getEmptyStateSubtitle()).toContain('Items you upload or edit in the last 30 days are shown here.');
|
||||
});
|
||||
|
||||
it('empty Favorites - [C280133]', () => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES)
|
||||
.then(() => {
|
||||
expect(dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(dataTable.getEmptyStateTitle()).toContain('No favorite files or folders');
|
||||
expect(dataTable.getEmptyStateSubtitle()).toContain('Favorite items that you want to easily find later.');
|
||||
});
|
||||
});
|
||||
it('empty Favorites - [C280133]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.getEmptyStateTitle()).toContain('No favorite files or folders');
|
||||
expect(await dataTable.getEmptyStateSubtitle()).toContain('Favorite items that you want to easily find later.');
|
||||
});
|
||||
|
||||
it('empty Trash - [C280134]', () => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH)
|
||||
.then(() => {
|
||||
expect(dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(dataTable.getEmptyStateTitle()).toContain('Trash is empty');
|
||||
expect(dataTable.getEmptyStateText()).toContain('Items you delete are moved to the Trash.');
|
||||
expect(dataTable.getEmptyStateText()).toContain('Empty Trash to permanently delete items.');
|
||||
});
|
||||
});
|
||||
it('empty Trash - [C280134]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||
expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty');
|
||||
expect(await dataTable.getEmptyStateTitle()).toContain('Trash is empty');
|
||||
expect(await dataTable.getEmptyStateText()).toContain('Items you delete are moved to the Trash.');
|
||||
expect(await dataTable.getEmptyStateText()).toContain('Empty Trash to permanently delete items.');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -29,131 +29,121 @@ import { Utils } from '../../utilities/utils';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
|
||||
describe('Favorites', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const password = username;
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const favFolderName = `favFolder-${Utils.random()}`;
|
||||
const parentFolder = `parent-${Utils.random()}`;
|
||||
const fileName1 = `file1-${Utils.random()}.txt`;
|
||||
const fileName2 = `file2-${Utils.random()}.txt`;
|
||||
const fileName3 = `file3-${Utils.random()}.txt`;
|
||||
const fileName4 = `file4-${Utils.random()}.txt`;
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const favFolderName = `favFolder-${Utils.random()}`;
|
||||
const parentFolder = `parent-${Utils.random()}`;
|
||||
const fileName1 = `file1-${Utils.random()}.txt`;
|
||||
const fileName2 = `file2-${Utils.random()}.txt`;
|
||||
const fileName3 = `file3-${Utils.random()}.txt`;
|
||||
const fileName4 = `file4-${Utils.random()}.txt`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, password)
|
||||
};
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const favoritesPage = new BrowsingPage();
|
||||
const { dataTable } = favoritesPage;
|
||||
const { breadcrumb } = favoritesPage.toolbar;
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const favoritesPage = new BrowsingPage();
|
||||
const { dataTable, breadcrumb } = favoritesPage;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
|
||||
await apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(siteName);
|
||||
await apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_MANAGER);
|
||||
await apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(siteName);
|
||||
await apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_MANAGER);
|
||||
|
||||
const file1Id = (await apis.admin.nodes.createFile(fileName1, docLibId)).entry.id;
|
||||
await apis.user.favorites.addFavoriteById('file', file1Id);
|
||||
const file1Id = (await apis.admin.nodes.createFile(fileName1, docLibId)).entry.id;
|
||||
const folderId = (await apis.user.nodes.createFolder(favFolderName)).entry.id;
|
||||
const parentId = (await apis.user.nodes.createFolder(parentFolder)).entry.id;
|
||||
const file2Id = (await apis.user.nodes.createFile(fileName2, parentId)).entry.id;
|
||||
const file3Id = (await apis.user.nodes.createFile(fileName3, parentId)).entry.id;
|
||||
const file4Id = (await apis.user.nodes.createFile(fileName4, parentId)).entry.id;
|
||||
|
||||
const folderId = (await apis.user.nodes.createFolder(favFolderName)).entry.id;
|
||||
await apis.user.favorites.addFavoriteById('folder', folderId);
|
||||
await apis.user.favorites.addFavoriteById('file', file1Id);
|
||||
await apis.user.favorites.addFavoriteById('folder', folderId);
|
||||
await apis.user.favorites.addFavoriteById('file', file2Id);
|
||||
await apis.user.favorites.addFavoriteById('file', file3Id);
|
||||
await apis.user.favorites.addFavoriteById('file', file4Id);
|
||||
await apis.user.nodes.deleteNodeById(file3Id, false);
|
||||
await apis.user.nodes.deleteNodeById(file4Id, false);
|
||||
await apis.user.trashcan.restore(file4Id);
|
||||
|
||||
const parentId = (await apis.user.nodes.createFolder(parentFolder)).entry.id;
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
const file2Id = (await apis.user.nodes.createFile(fileName2, parentId)).entry.id;
|
||||
await apis.user.favorites.addFavoriteById('file', file2Id);
|
||||
beforeEach(async (done) => {
|
||||
await favoritesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
const file3Id = (await apis.user.nodes.createFile(fileName3, parentId)).entry.id;
|
||||
await apis.user.favorites.addFavoriteById('file', file3Id);
|
||||
await apis.user.nodes.deleteNodeById(file3Id, false);
|
||||
afterAll(async (done) => {
|
||||
await apis.admin.sites.deleteSite(siteName);
|
||||
await apis.user.nodes.deleteNodes([ favFolderName, parentFolder ]);
|
||||
await apis.admin.trashcan.emptyTrash();
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
const file4Id = (await apis.user.nodes.createFile(fileName4, parentId)).entry.id;
|
||||
await apis.user.favorites.addFavoriteById('file', file4Id);
|
||||
await apis.user.nodes.deleteNodeById(file4Id, false);
|
||||
await apis.user.trashcan.restore(file4Id);
|
||||
it('has the correct columns - [C280482]', async () => {
|
||||
const expectedHeader = [ 'Thumbnail', 'Name', 'Location', 'Size', 'Modified', 'Modified by' ];
|
||||
const headers = dataTable.getColumnHeaders();
|
||||
const count = await headers.count();
|
||||
expect(count).toBe(5 + 1, 'Incorrect number of columns');
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
expect(await dataTable.getHeaderText()).toEqual(expectedHeader);
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await favoritesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
it('displays the favorite files and folders - [C213226]', async () => {
|
||||
expect(await dataTable.countRows()).toEqual(4, 'Incorrect number of items displayed');
|
||||
expect(await dataTable.getRowByName(fileName1).isPresent()).toBe(true, `${fileName1} not displayed`);
|
||||
expect(await dataTable.getRowByName(fileName2).isPresent()).toBe(true, `${fileName2} not displayed`);
|
||||
expect(await dataTable.getRowByName(favFolderName).isPresent()).toBe(true, `${favFolderName} not displayed`);
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.sites.deleteSite(siteName),
|
||||
apis.user.nodes.deleteNodes([ favFolderName, parentFolder ]),
|
||||
apis.admin.trashcan.emptyTrash(),
|
||||
logoutPage.load()
|
||||
]);
|
||||
done();
|
||||
});
|
||||
it(`deleted favorite file does not appear - [C213228]`, async () => {
|
||||
expect(await dataTable.getRowByName(fileName3).isPresent()).not.toBe(true, `${fileName3} is displayed`);
|
||||
});
|
||||
|
||||
it('has the correct columns - [C280482]', async () => {
|
||||
const labels = [ 'Name', 'Location', 'Size', 'Modified', 'Modified by' ];
|
||||
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
|
||||
it(`file is displayed after it is restored from Trashcan - [C213229]`, async () => {
|
||||
expect(await dataTable.getRowByName(fileName4).isPresent()).toBe(true, `${fileName4} not displayed`);
|
||||
});
|
||||
|
||||
expect(await dataTable.getColumnHeaders().count()).toBe(5 + 1, 'Incorrect number of columns');
|
||||
it('Location column displays the parent folder of the files - [C213231]', async () => {
|
||||
expect(await dataTable.getItemLocation(fileName1)).toEqual(siteName);
|
||||
expect(await dataTable.getItemLocation(fileName2)).toEqual(parentFolder);
|
||||
expect(await dataTable.getItemLocation(favFolderName)).toEqual('Personal Files');
|
||||
});
|
||||
|
||||
await elements.forEach(async (element, index) => {
|
||||
expect(await element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
});
|
||||
});
|
||||
it('Location column displays a tooltip with the entire path of the file - [C213671]', async () => {
|
||||
expect(await dataTable.getItemLocationTileAttr(fileName1)).toEqual(`File Libraries/${siteName}`);
|
||||
expect(await dataTable.getItemLocationTileAttr(fileName2)).toEqual(`Personal Files/${parentFolder}`);
|
||||
expect(await dataTable.getItemLocationTileAttr(favFolderName)).toEqual('Personal Files');
|
||||
});
|
||||
|
||||
it('displays the favorite files and folders - [C213226]', async () => {
|
||||
expect(await dataTable.countRows()).toEqual(4, 'Incorrect number of items displayed');
|
||||
expect(await dataTable.getRowByName(fileName1).isPresent()).toBe(true, `${fileName1} not displayed`);
|
||||
expect(await dataTable.getRowByName(fileName2).isPresent()).toBe(true, `${fileName2} not displayed`);
|
||||
expect(await dataTable.getRowByName(favFolderName).isPresent()).toBe(true, `${favFolderName} not displayed`);
|
||||
});
|
||||
it('Location column redirect - item in user Home - [C213650]', async () => {
|
||||
await dataTable.clickItemLocation(favFolderName);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]);
|
||||
});
|
||||
|
||||
it(`deleted favorite file does not appear - [C213228]`, async () => {
|
||||
expect(await dataTable.getRowByName(fileName3).isPresent()).not.toBe(true, `${fileName3} is displayed`);
|
||||
});
|
||||
it('Location column redirect - file in folder - [C280484]', async () => {
|
||||
await dataTable.clickItemLocation(fileName2);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files', parentFolder ]);
|
||||
});
|
||||
|
||||
it(`file is displayed after it is restored from Trashcan - [C213229]`, async () => {
|
||||
expect(await dataTable.getRowByName(fileName4).isPresent()).toBe(true, `${fileName4} not displayed`);
|
||||
});
|
||||
it('Location column redirect - file in site - [C280485]', async () => {
|
||||
await dataTable.clickItemLocation(fileName1);
|
||||
expect(breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName ]);
|
||||
});
|
||||
|
||||
it('Location column displays the parent folder of the files - [C213231]', async () => {
|
||||
expect(await dataTable.getItemLocation(fileName1).getText()).toEqual(siteName);
|
||||
expect(await dataTable.getItemLocation(fileName2).getText()).toEqual(parentFolder);
|
||||
expect(await dataTable.getItemLocation(favFolderName).getText()).toEqual('Personal Files');
|
||||
});
|
||||
|
||||
it('Location column displays a tooltip with the entire path of the file - [C213671]', async () => {
|
||||
expect(dataTable.getItemLocationTileAttr(fileName1)).toEqual(`File Libraries/${siteName}`);
|
||||
expect(dataTable.getItemLocationTileAttr(fileName2)).toEqual(`Personal Files/${parentFolder}`);
|
||||
expect(dataTable.getItemLocationTileAttr(favFolderName)).toEqual('Personal Files');
|
||||
});
|
||||
|
||||
it('Location column redirect - item in user Home - [C213650]', async () => {
|
||||
await dataTable.clickItemLocation(favFolderName);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]);
|
||||
});
|
||||
|
||||
it('Location column redirect - file in folder - [C280484]', async () => {
|
||||
await dataTable.clickItemLocation(fileName2);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files', parentFolder ]);
|
||||
});
|
||||
|
||||
it('Location column redirect - file in site - [C280485]', async () => {
|
||||
await dataTable.clickItemLocation(fileName1);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName ]);
|
||||
});
|
||||
|
||||
it('Navigate into folder from Favorites - [C213230]', async () => {
|
||||
await dataTable.doubleClickOnRowByName(favFolderName);
|
||||
await dataTable.waitForEmptyState();
|
||||
expect(await breadcrumb.getCurrentItemName()).toBe(favFolderName);
|
||||
});
|
||||
it('Navigate into folder from Favorites - [C213230]', async () => {
|
||||
await dataTable.doubleClickOnRowByName(favFolderName);
|
||||
await dataTable.waitForEmptyState();
|
||||
expect(await breadcrumb.getCurrentItemName()).toBe(favFolderName);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -29,131 +29,113 @@ import { Utils } from '../../utilities/utils';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
|
||||
describe('File Libraries', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const password = username;
|
||||
const username = `user-${Utils.random()}`;
|
||||
const password = username;
|
||||
|
||||
const sitePrivate = `private-${Utils.random()}`;
|
||||
const siteModerated = `moderated-${Utils.random()}`;
|
||||
const sitePublic = `public-${Utils.random()}`;
|
||||
const siteName = `siteName-${Utils.random()}`;
|
||||
const siteId1 = Utils.random();
|
||||
const siteId2 = Utils.random();
|
||||
const adminSite = `admin-${Utils.random()}`;
|
||||
const sitePrivate = `private-${Utils.random()}`;
|
||||
const siteModerated = `moderated-${Utils.random()}`;
|
||||
const sitePublic = `public-${Utils.random()}`;
|
||||
const siteName = `siteName-${Utils.random()}`;
|
||||
const siteId1 = Utils.random();
|
||||
const siteId2 = Utils.random();
|
||||
const adminSite = `admin-${Utils.random()}`;
|
||||
|
||||
const siteDescription = 'my site description';
|
||||
const siteDescription = 'my site description';
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, password)
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, password)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const fileLibrariesPage = new BrowsingPage();
|
||||
const { dataTable } = fileLibrariesPage;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await apis.admin.sites.createSite(sitePublic, SITE_VISIBILITY.PUBLIC);
|
||||
await apis.admin.sites.createSite(siteModerated, SITE_VISIBILITY.MODERATED, siteDescription);
|
||||
await apis.admin.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE, null);
|
||||
await apis.admin.sites.createSite(adminSite, SITE_VISIBILITY.PUBLIC);
|
||||
await apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC, null, siteId1);
|
||||
await apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC, null, siteId2);
|
||||
await apis.admin.sites.addSiteMember(sitePublic, username, SITE_ROLES.SITE_CONSUMER);
|
||||
await apis.admin.sites.addSiteMember(siteModerated, username, SITE_ROLES.SITE_MANAGER);
|
||||
await apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_CONTRIBUTOR);
|
||||
await apis.admin.sites.addSiteMember(siteId1, username, SITE_ROLES.SITE_CONTRIBUTOR);
|
||||
await apis.admin.sites.addSiteMember(siteId2, username, SITE_ROLES.SITE_CONTRIBUTOR);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await fileLibrariesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.admin.sites.deleteSites([ sitePublic, siteModerated, sitePrivate, adminSite, siteId1, siteId2 ]);
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('has the correct columns - [C217095]', async () => {
|
||||
const labels = [ 'Title', 'Status' ];
|
||||
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
|
||||
|
||||
expect(await dataTable.getColumnHeaders().count()).toBe(2 + 1, 'Incorrect number of columns');
|
||||
|
||||
await elements.forEach(async (element, index) => {
|
||||
expect(await element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
});
|
||||
});
|
||||
|
||||
it('User can see only the sites he is a member of - [C280501]', async () => {
|
||||
const sitesCount = await dataTable.countRows();
|
||||
|
||||
const expectedSites = {
|
||||
[sitePrivate]: SITE_VISIBILITY.PRIVATE,
|
||||
[siteModerated]: SITE_VISIBILITY.MODERATED,
|
||||
[sitePublic]: SITE_VISIBILITY.PUBLIC
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const fileLibrariesPage = new BrowsingPage();
|
||||
const { dataTable } = fileLibrariesPage;
|
||||
expect(sitesCount).toEqual(5, 'Incorrect number of sites displayed');
|
||||
expect(await dataTable.getRowByName(adminSite).isPresent()).toBe(false, 'Incorrect site appears in list');
|
||||
|
||||
beforeAll(done => {
|
||||
Promise
|
||||
.all([
|
||||
apis.admin.people.createUser({ username }),
|
||||
apis.admin.sites.createSite(sitePublic, SITE_VISIBILITY.PUBLIC),
|
||||
apis.admin.sites.createSite(siteModerated, SITE_VISIBILITY.MODERATED, siteDescription),
|
||||
apis.admin.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE, null),
|
||||
apis.admin.sites.createSite(adminSite, SITE_VISIBILITY.PUBLIC),
|
||||
apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC, null, siteId1),
|
||||
apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC, null, siteId2)
|
||||
])
|
||||
.then(() => apis.admin.sites.addSiteMember(sitePublic, username, SITE_ROLES.SITE_CONSUMER))
|
||||
.then(() => apis.admin.sites.addSiteMember(siteModerated, username, SITE_ROLES.SITE_MANAGER))
|
||||
.then(() => apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_CONTRIBUTOR))
|
||||
.then(() => apis.admin.sites.addSiteMember(siteId1, username, SITE_ROLES.SITE_CONTRIBUTOR))
|
||||
.then(() => apis.admin.sites.addSiteMember(siteId2, username, SITE_ROLES.SITE_CONTRIBUTOR))
|
||||
|
||||
.then(() => loginPage.loginWith(username))
|
||||
.then(done);
|
||||
const rowCells = await dataTable.getRows().map((row) => {
|
||||
return row.all(dataTable.cell).map(async cell => await cell.getText());
|
||||
});
|
||||
const sitesList = rowCells.reduce((acc, cell) => {
|
||||
acc[cell[1]] = cell[2].toUpperCase();
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
beforeEach(done => {
|
||||
fileLibrariesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FILE_LIBRARIES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
Object.keys(expectedSites).forEach((site) => {
|
||||
expect(sitesList[site]).toEqual(expectedSites[site]);
|
||||
});
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
Promise.all([
|
||||
apis.admin.sites.deleteSites([
|
||||
sitePublic,
|
||||
siteModerated,
|
||||
sitePrivate,
|
||||
adminSite,
|
||||
siteId1,
|
||||
siteId2
|
||||
]),
|
||||
logoutPage.load()
|
||||
])
|
||||
.then(done);
|
||||
});
|
||||
it('Site ID is displayed when two sites have the same name - [C217098]', async () => {
|
||||
const expectedSites = [
|
||||
`${siteName} (${siteId1})`,
|
||||
`${siteName} (${siteId2})`
|
||||
];
|
||||
const cells = await dataTable.getCellsContainingName(siteName);
|
||||
const expectedJSON = JSON.stringify(expectedSites.sort());
|
||||
const actualJSON = JSON.stringify(cells.sort());
|
||||
expect(actualJSON).toEqual(expectedJSON);
|
||||
});
|
||||
|
||||
it('has the correct columns - [C217095]', () => {
|
||||
const labels = [ 'Title', 'Status' ];
|
||||
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
|
||||
it('Tooltip for sites without description - [C217096]', async () => {
|
||||
const tooltip = await dataTable.getItemNameTooltip(sitePrivate);
|
||||
expect(tooltip).toBe(`${sitePrivate}`);
|
||||
});
|
||||
|
||||
expect(dataTable.getColumnHeaders().count()).toBe(2 + 1, 'Incorrect number of columns');
|
||||
|
||||
elements.forEach((element, index) => {
|
||||
expect(element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
});
|
||||
});
|
||||
|
||||
it('User can see only the sites he is a member of - [C280501]', () => {
|
||||
const sitesCount = dataTable.countRows();
|
||||
|
||||
const expectedSites = {
|
||||
[sitePrivate]: SITE_VISIBILITY.PRIVATE,
|
||||
[siteModerated]: SITE_VISIBILITY.MODERATED,
|
||||
[sitePublic]: SITE_VISIBILITY.PUBLIC
|
||||
};
|
||||
|
||||
expect(sitesCount).toEqual(5, 'Incorrect number of sites displayed');
|
||||
expect(dataTable.getRowByName(adminSite).isPresent()).toBe(false, 'Incorrect site appears in list');
|
||||
|
||||
dataTable.getRows()
|
||||
.map((row) => {
|
||||
return row.all(dataTable.cell).map(cell => cell.getText());
|
||||
})
|
||||
.then((rowCells) => {
|
||||
return rowCells.reduce((acc, cell) => {
|
||||
acc[cell[1]] = cell[2].toUpperCase();
|
||||
return acc;
|
||||
}, {});
|
||||
})
|
||||
.then((sitesList) => {
|
||||
Object.keys(expectedSites).forEach((site) => {
|
||||
expect(sitesList[site]).toEqual(expectedSites[site]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('Site ID is displayed when two sites have the same name - [C217098]', () => {
|
||||
const expectedSites = [
|
||||
`${siteName} (${siteId1})`,
|
||||
`${siteName} (${siteId2})`
|
||||
];
|
||||
dataTable.getCellsContainingName(siteName)
|
||||
.then(resp => {
|
||||
const expectedJSON = JSON.stringify(expectedSites.sort());
|
||||
const actualJSON = JSON.stringify(resp.sort());
|
||||
expect(actualJSON).toEqual(expectedJSON);
|
||||
});
|
||||
});
|
||||
|
||||
it('Tooltip for sites without description - [C217096]', () => {
|
||||
const tooltip = dataTable.getItemNameTooltip(sitePrivate);
|
||||
expect(tooltip).toBe(`${sitePrivate}`);
|
||||
});
|
||||
|
||||
it('Tooltip for sites with description - [C217097]', () => {
|
||||
const tooltip = dataTable.getItemNameTooltip(siteModerated);
|
||||
expect(tooltip).toBe(`${siteDescription}`);
|
||||
});
|
||||
it('Tooltip for sites with description - [C217097]', async () => {
|
||||
const tooltip = await dataTable.getItemNameTooltip(siteModerated);
|
||||
expect(tooltip).toBe(`${siteDescription}`);
|
||||
});
|
||||
});
|
||||
|
||||
Executable
+106
@@ -0,0 +1,106 @@
|
||||
/*!
|
||||
* @license
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* Copyright (C) 2005 - 2018 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 { browser } from 'protractor';
|
||||
import { SIDEBAR_LABELS } from '../../configs';
|
||||
import { LoginPage, LogoutPage, BrowsingPage } from '../../pages/pages';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
|
||||
describe('Generic errors', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const username2 = `user2-${Utils.random()}`;
|
||||
|
||||
const parent = `folder-${Utils.random()}`; let parentId;
|
||||
const file1 = `file1-${Utils.random()}.txt`; let file1Id;
|
||||
const file2 = `file2-${Utils.random()}.txt`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await apis.admin.people.createUser({ username: username2 });
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id;
|
||||
await apis.user.nodes.createFile(file2, parentId);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodeById(parentId);
|
||||
await apis.user.trashcan.emptyTrash();
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('File / folder not found - [C217313]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(parent);
|
||||
await dataTable.doubleClickOnRowByName(file1);
|
||||
const URL = await browser.getCurrentUrl();
|
||||
await apis.user.nodes.deleteNodeById(file1Id, false);
|
||||
await browser.get(URL);
|
||||
|
||||
expect(await page.isGenericErrorDisplayed()).toBe(true, 'Generic error page not displayed');
|
||||
expect(await page.getGenericErrorTitle()).toContain(`This file or folder no longer exists or you don't have permission to view it.`);
|
||||
});
|
||||
|
||||
it('Invalid URL - [C217315]', async () => {
|
||||
await page.load('/invalid page');
|
||||
|
||||
expect(await page.isGenericErrorDisplayed()).toBe(true, 'Generic error page not displayed');
|
||||
expect(await page.getGenericErrorTitle()).toContain(`This file or folder no longer exists or you don't have permission to view it.`);
|
||||
|
||||
});
|
||||
|
||||
it('Permission denied - [C217314]', async () => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
await dataTable.doubleClickOnRowByName(parent);
|
||||
await dataTable.doubleClickOnRowByName(file2);
|
||||
const URL = await browser.getCurrentUrl();
|
||||
await logoutPage.load();
|
||||
await loginPage.loginWith(username2);
|
||||
await browser.get(URL);
|
||||
|
||||
expect(await page.isGenericErrorDisplayed()).toBe(true, 'Generic error page not displayed');
|
||||
expect(await page.getGenericErrorTitle()).toContain(`This file or folder no longer exists or you don't have permission to view it.`);
|
||||
|
||||
await logoutPage.load();
|
||||
await loginPage.loginWith(username);
|
||||
});
|
||||
});
|
||||
@@ -29,153 +29,136 @@ import { Utils } from '../../utilities/utils';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
|
||||
describe('Special permissions', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const password = username;
|
||||
const username = `user-${Utils.random()}`;
|
||||
const password = username;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, password)
|
||||
};
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, password)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const recentFilesPage = new BrowsingPage();
|
||||
const favoritesPage = new BrowsingPage();
|
||||
const sharedPage = new BrowsingPage();
|
||||
const { dataTable } = recentFilesPage;
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const recentFilesPage = new BrowsingPage();
|
||||
const favoritesPage = new BrowsingPage();
|
||||
const sharedPage = new BrowsingPage();
|
||||
const { dataTable } = recentFilesPage;
|
||||
|
||||
xit('');
|
||||
xit('');
|
||||
|
||||
beforeAll(done => {
|
||||
apis.admin.people.createUser({ username }).then(done);
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
done();
|
||||
});
|
||||
|
||||
describe('file not displayed if user no longer has permissions on it', () => {
|
||||
const sitePrivate = `private-${Utils.random()}`;
|
||||
const fileName = `file-${Utils.random()}.txt`;
|
||||
let fileId;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE);
|
||||
await apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_COLLABORATOR);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(sitePrivate);
|
||||
fileId = (await apis.admin.nodes.createFile(fileName, docLibId)).entry.id;
|
||||
await apis.user.favorites.addFavoriteById('file', fileId);
|
||||
await apis.admin.shared.shareFileById(fileId);
|
||||
await apis.user.nodes.editNodeContent(fileId, 'edited by user');
|
||||
|
||||
await apis.user.search.waitForApi(username, { expect: 1 });
|
||||
await apis.user.shared.waitForApi({ expect: 1 });
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
describe('file not displayed if user no longer has permissions on it', () => {
|
||||
const sitePrivate = `private-${Utils.random()}`;
|
||||
const fileName = `file-${Utils.random()}.txt`;
|
||||
let fileId;
|
||||
|
||||
beforeAll(done => {
|
||||
apis.admin.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE)
|
||||
.then(() => apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_COLLABORATOR))
|
||||
.then(() => apis.admin.nodes.createFiles([ fileName ], `Sites/${sitePrivate}/documentLibrary`)
|
||||
.then(resp => fileId = resp.entry.id))
|
||||
.then(() => apis.user.favorites.addFavoriteById('file', fileId))
|
||||
.then(() => apis.admin.shared.shareFileById(fileId))
|
||||
.then(() => apis.user.nodes.editNodeContent(fileId, 'edited by user'))
|
||||
|
||||
.then(() => apis.user.search.waitForApi(username, { expect: 1 }))
|
||||
.then(() => apis.user.shared.waitForApi({ expect: 1 }))
|
||||
|
||||
.then(() => loginPage.loginWith(username))
|
||||
.then(done);
|
||||
});
|
||||
|
||||
afterEach(done => {
|
||||
apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_COLLABORATOR).then(done);
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
Promise.all([
|
||||
apis.admin.sites.deleteSite(sitePrivate),
|
||||
logoutPage.load()
|
||||
])
|
||||
.then(done);
|
||||
});
|
||||
|
||||
it('on Recent Files - [C213173]', () => {
|
||||
recentFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
expect(dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
})
|
||||
.then(() => apis.admin.sites.deleteSiteMember(sitePrivate, username))
|
||||
.then(() => recentFilesPage.refresh())
|
||||
.then(() => {
|
||||
expect(dataTable.countRows()).toBe(0, 'Incorrect number of items');
|
||||
});
|
||||
});
|
||||
|
||||
it('on Favorites - [C213227]', () => {
|
||||
favoritesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
expect(dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
})
|
||||
.then(() => apis.admin.sites.deleteSiteMember(sitePrivate, username))
|
||||
.then(() => favoritesPage.refresh())
|
||||
.then(() => {
|
||||
expect(dataTable.countRows()).toBe(0, 'Incorrect number of items');
|
||||
});
|
||||
});
|
||||
|
||||
it('on Shared Files - [C213116]', () => {
|
||||
sharedPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
expect(dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
})
|
||||
.then(() => apis.admin.sites.deleteSiteMember(sitePrivate, username))
|
||||
.then(() => sharedPage.refresh())
|
||||
.then(() => {
|
||||
expect(dataTable.countRows()).toBe(0, 'Incorrect number of items');
|
||||
});
|
||||
});
|
||||
afterEach(async (done) => {
|
||||
await apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_COLLABORATOR);
|
||||
done();
|
||||
});
|
||||
|
||||
describe(`Location column is empty if user doesn't have permissions on the file's parent folder`, () => {
|
||||
const sitePrivate = `private-${Utils.random()}`;
|
||||
const fileName = `file-${Utils.random()}.txt`;
|
||||
let fileId;
|
||||
|
||||
beforeAll(done => {
|
||||
apis.admin.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE)
|
||||
.then(() => apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_COLLABORATOR))
|
||||
.then(() => apis.admin.sites.getDocLibId(sitePrivate))
|
||||
.then(resp => apis.user.nodes.createFile(fileName, resp))
|
||||
.then(resp => fileId = resp.entry.id)
|
||||
.then(() => apis.user.favorites.addFavoriteById('file', fileId))
|
||||
.then(() => apis.user.shared.shareFileById(fileId))
|
||||
.then(() => apis.user.shared.waitForApi({ expect: 1 }))
|
||||
.then(() => apis.user.search.waitForApi(username, { expect: 1 }))
|
||||
.then(() => apis.admin.sites.deleteSiteMember(sitePrivate, username))
|
||||
.then(() => loginPage.loginWith(username))
|
||||
.then(done);
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
Promise.all([
|
||||
apis.admin.sites.deleteSite(sitePrivate),
|
||||
logoutPage.load()
|
||||
])
|
||||
.then(done);
|
||||
});
|
||||
|
||||
it(`on Recent Files - [C213178]`, () => {
|
||||
recentFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
expect(dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
expect(dataTable.getItemLocation(fileName).getText()).toEqual('');
|
||||
});
|
||||
});
|
||||
|
||||
it(`on Favorites - [C213672]`, () => {
|
||||
favoritesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
expect(dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
expect(dataTable.getItemLocation(fileName).getText()).toEqual('');
|
||||
});
|
||||
});
|
||||
|
||||
it(`on Shared Files - [C213668]`, () => {
|
||||
sharedPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(() => {
|
||||
expect(dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
expect(dataTable.getItemLocation(fileName).getText()).toEqual('');
|
||||
});
|
||||
});
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.sites.deleteSite(sitePrivate),
|
||||
logoutPage.load()
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
it('on Recent Files - [C213173]', async () => {
|
||||
await recentFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
await apis.admin.sites.deleteSiteMember(sitePrivate, username);
|
||||
await recentFilesPage.refresh();
|
||||
expect(await dataTable.countRows()).toBe(0, 'Incorrect number of items');
|
||||
});
|
||||
|
||||
it('on Favorites - [C213227]', async () => {
|
||||
await favoritesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
await apis.admin.sites.deleteSiteMember(sitePrivate, username);
|
||||
await favoritesPage.refresh();
|
||||
expect(await dataTable.countRows()).toBe(0, 'Incorrect number of items');
|
||||
});
|
||||
|
||||
it('on Shared Files - [C213116]', async () => {
|
||||
await sharedPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
await apis.admin.sites.deleteSiteMember(sitePrivate, username);
|
||||
await sharedPage.refresh();
|
||||
expect(await dataTable.countRows()).toBe(0, 'Incorrect number of items');
|
||||
});
|
||||
});
|
||||
|
||||
describe(`Location column is empty if user doesn't have permissions on the file's parent folder`, () => {
|
||||
const sitePrivate = `private-${Utils.random()}`;
|
||||
const fileName = `file-${Utils.random()}.txt`;
|
||||
let fileId;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE);
|
||||
await apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_COLLABORATOR);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(sitePrivate);
|
||||
fileId = (await apis.user.nodes.createFile(fileName, docLibId)).entry.id;
|
||||
await apis.user.favorites.addFavoriteById('file', fileId);
|
||||
await apis.user.shared.shareFileById(fileId);
|
||||
await apis.user.shared.waitForApi({ expect: 1 });
|
||||
await apis.user.search.waitForApi(username, { expect: 1 });
|
||||
await apis.admin.sites.deleteSiteMember(sitePrivate, username);
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.sites.deleteSite(sitePrivate),
|
||||
logoutPage.load()
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
it(`on Recent Files - [C213178]`, async () => {
|
||||
await recentFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
expect(await dataTable.getItemLocation(fileName)).toEqual('');
|
||||
});
|
||||
|
||||
it(`on Favorites - [C213672]`, async () => {
|
||||
await favoritesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
expect(await dataTable.getItemLocation(fileName)).toEqual('');
|
||||
});
|
||||
|
||||
it(`on Shared Files - [C213668]`, async () => {
|
||||
await sharedPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items');
|
||||
expect(await dataTable.getItemLocation(fileName)).toEqual('');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -31,143 +31,129 @@ import { Utils } from '../../utilities/utils';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
|
||||
describe('Personal Files', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const personalFilesPage = new BrowsingPage();
|
||||
const { dataTable } = personalFilesPage;
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const personalFilesPage = new BrowsingPage();
|
||||
const { dataTable } = personalFilesPage;
|
||||
|
||||
const adminFolder = `admin-folder-${Utils.random()}`;
|
||||
const adminFolder = `admin-folder-${Utils.random()}`;
|
||||
|
||||
const userFolder = `user-folder-${Utils.random()}`;
|
||||
const userFile = `file-${Utils.random()}.txt`;
|
||||
const userFolder = `user-folder-${Utils.random()}`;
|
||||
const userFile = `file-${Utils.random()}.txt`;
|
||||
|
||||
beforeAll(done => {
|
||||
Promise
|
||||
.all([
|
||||
apis.admin.people.createUser({ username }),
|
||||
apis.admin.nodes.createFolders([ adminFolder ])
|
||||
])
|
||||
.then(() => apis.user.nodes.createFolders([ userFolder ]))
|
||||
.then(() => apis.user.nodes.createFiles([ userFile ], userFolder))
|
||||
.then(done);
|
||||
beforeAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.people.createUser({ username }),
|
||||
apis.admin.nodes.createFolders([ adminFolder ])
|
||||
]);
|
||||
await apis.user.nodes.createFolders([ userFolder ]);
|
||||
await apis.user.nodes.createFiles([ userFile ], userFolder);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.nodes.deleteNodes([ adminFolder ]),
|
||||
apis.user.nodes.deleteNodes([ userFolder ])
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
xit('');
|
||||
|
||||
describe(`Admin user's personal files`, () => {
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.loginWithAdmin();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
Promise
|
||||
.all([
|
||||
apis.admin.nodes.deleteNodes([ adminFolder ]),
|
||||
apis.user.nodes.deleteNodes([ userFolder ])
|
||||
])
|
||||
.then(done);
|
||||
beforeEach(async (done) => {
|
||||
await personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
xit('');
|
||||
|
||||
describe(`Admin user's personal files`, () => {
|
||||
beforeAll(done => {
|
||||
loginPage.loginWithAdmin().then(done);
|
||||
});
|
||||
|
||||
beforeEach(done => {
|
||||
personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
logoutPage.load().then(done);
|
||||
});
|
||||
|
||||
it('has Data Dictionary and created content - [C213241]', () => {
|
||||
expect(dataTable.getRowByName('Data Dictionary').isPresent()).toBe(true);
|
||||
expect(dataTable.getRowByName(adminFolder).isPresent()).toBe(true);
|
||||
});
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
describe(`Regular user's personal files`, () => {
|
||||
beforeAll(done => {
|
||||
loginPage.loginWith(username).then(done);
|
||||
});
|
||||
|
||||
beforeEach(done => {
|
||||
personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
logoutPage.load().then(done);
|
||||
});
|
||||
|
||||
it('has the correct columns - [C217142]', () => {
|
||||
const labels = [ 'Name', 'Size', 'Modified', 'Modified by' ];
|
||||
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
|
||||
|
||||
expect(dataTable.getColumnHeaders().count()).toBe(4 + 1, 'Incorrect number of columns');
|
||||
|
||||
elements.forEach((element, index) => {
|
||||
expect(element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
});
|
||||
});
|
||||
|
||||
it('has default sorted column - [C217143]', () => {
|
||||
expect(dataTable.getSortedColumnHeader().getText()).toBe('Modified');
|
||||
});
|
||||
|
||||
it('has user created content - [C213242]', () => {
|
||||
expect(dataTable.getRowByName(userFolder).isPresent())
|
||||
.toBe(true);
|
||||
});
|
||||
|
||||
it('navigates to folder - [C213244]', () => {
|
||||
const getNodeIdPromise = apis.user.nodes
|
||||
.getNodeByPath(`/${userFolder}`)
|
||||
.then(response => response.entry.id);
|
||||
|
||||
const navigatePromise = dataTable
|
||||
.doubleClickOnRowByName(userFolder)
|
||||
.then(() => dataTable.waitForHeader());
|
||||
|
||||
Promise
|
||||
.all([
|
||||
getNodeIdPromise,
|
||||
navigatePromise
|
||||
])
|
||||
.then(([ nodeId ]) => {
|
||||
expect(browser.getCurrentUrl())
|
||||
.toContain(nodeId, 'Node ID is not in the URL');
|
||||
|
||||
expect(dataTable.getRowByName(userFile).isPresent())
|
||||
.toBe(true, 'user file is missing');
|
||||
});
|
||||
});
|
||||
|
||||
it('redirects to Personal Files on clicking the link from sidebar - [C213245]', () => {
|
||||
personalFilesPage.dataTable.doubleClickOnRowByName(userFolder)
|
||||
.then(() => personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES))
|
||||
.then(() => browser.getCurrentUrl())
|
||||
.then(url => expect(url.endsWith(APP_ROUTES.PERSONAL_FILES)).toBe(true, 'incorrect url'));
|
||||
});
|
||||
|
||||
it('page loads correctly after browser refresh - [C213246]', () => {
|
||||
personalFilesPage.refresh()
|
||||
.then(() => expect(browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES));
|
||||
});
|
||||
|
||||
it('page load by URL - [C213247]', () => {
|
||||
let url;
|
||||
browser.getCurrentUrl()
|
||||
.then(resp => url = resp)
|
||||
.then(() => personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
|
||||
.then(() => browser.get(url))
|
||||
.then(() => expect(browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES));
|
||||
});
|
||||
it('has Data Dictionary and created content - [C213241]', async () => {
|
||||
expect(await dataTable.getRowByName('Data Dictionary').isPresent()).toBe(true);
|
||||
expect(await dataTable.getRowByName(adminFolder).isPresent()).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe(`Regular user's personal files`, () => {
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('has the correct columns - [C217142]', async () => {
|
||||
const labels = [ 'Name', 'Size', 'Modified', 'Modified by' ];
|
||||
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
|
||||
|
||||
expect(await dataTable.getColumnHeaders().count()).toBe(4 + 1, 'Incorrect number of columns');
|
||||
|
||||
await elements.forEach(async (element, index) => {
|
||||
expect(await element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
});
|
||||
});
|
||||
|
||||
it('has default sorted column - [C217143]', async () => {
|
||||
expect(await dataTable.getSortedColumnHeader().getText()).toBe('Modified');
|
||||
});
|
||||
|
||||
it('has user created content - [C213242]', async () => {
|
||||
expect(await dataTable.getRowByName(userFolder).isPresent()).toBe(true);
|
||||
});
|
||||
|
||||
it('navigates to folder - [C213244]', async () => {
|
||||
const nodeId = (await apis.user.nodes.getNodeByPath(`/${userFolder}`)).entry.id;
|
||||
|
||||
await dataTable.doubleClickOnRowByName(userFolder)
|
||||
await dataTable.waitForHeader();
|
||||
|
||||
expect(await browser.getCurrentUrl()).toContain(nodeId, 'Node ID is not in the URL');
|
||||
expect(await dataTable.getRowByName(userFile).isPresent()).toBe(true, 'user file is missing');
|
||||
});
|
||||
|
||||
it('redirects to Personal Files on clicking the link from sidebar - [C213245]', async () => {
|
||||
await personalFilesPage.dataTable.doubleClickOnRowByName(userFolder);
|
||||
await personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
const url = await browser.getCurrentUrl();
|
||||
expect(url.endsWith(APP_ROUTES.PERSONAL_FILES)).toBe(true, 'incorrect url');
|
||||
});
|
||||
|
||||
it('page loads correctly after browser refresh - [C213246]', async () => {
|
||||
await personalFilesPage.refresh();
|
||||
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
|
||||
});
|
||||
|
||||
it('page load by URL - [C213247]', async () => {
|
||||
const url = await browser.getCurrentUrl();
|
||||
await personalFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||
await browser.get(url);
|
||||
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -29,113 +29,111 @@ import { Utils } from '../../utilities/utils';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
|
||||
describe('Recent Files', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const folderName = `folder-${Utils.random()}`; let folderId;
|
||||
const fileName1 = `file-${Utils.random()}.txt`;
|
||||
const fileName2 = `file-${Utils.random()}.txt`; let file2Id;
|
||||
const fileName3 = `file-${Utils.random()}.txt`;
|
||||
const folderName = `folder-${Utils.random()}`; let folderId;
|
||||
const fileName1 = `file-${Utils.random()}.txt`;
|
||||
const fileName2 = `file-${Utils.random()}.txt`; let file2Id;
|
||||
const fileName3 = `file-${Utils.random()}.txt`;
|
||||
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const folderSite = `folder2-${Utils.random()}`; let folderSiteId;
|
||||
const fileSite = `file-${Utils.random()}.txt`;
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const folderSite = `folder2-${Utils.random()}`; let folderSiteId;
|
||||
const fileSite = `file-${Utils.random()}.txt`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const recentFilesPage = new BrowsingPage();
|
||||
const { dataTable } = recentFilesPage;
|
||||
const { breadcrumb } = recentFilesPage.toolbar;
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const recentFilesPage = new BrowsingPage();
|
||||
const { dataTable, breadcrumb } = recentFilesPage;
|
||||
|
||||
beforeAll(done => {
|
||||
apis.admin.people.createUser({ username })
|
||||
.then(() => apis.user.nodes.createFolders([ folderName ])).then(resp => folderId = resp.entry.id)
|
||||
.then(() => apis.user.nodes.createFiles([ fileName1 ], folderName))
|
||||
.then(() => apis.user.nodes.createFiles([ fileName2 ])).then(resp => file2Id = resp.entry.id)
|
||||
.then(() => apis.user.nodes.createFiles([ fileName3 ]).then(resp => apis.user.nodes.deleteNodeById(resp.entry.id, false)))
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
folderId = (await apis.user.nodes.createFolders([ folderName ])).entry.id;
|
||||
await apis.user.nodes.createFiles([ fileName1 ], folderName);
|
||||
file2Id = (await apis.user.nodes.createFiles([ fileName2 ])).entry.id;
|
||||
const id = (await apis.user.nodes.createFiles([ fileName3 ])).entry.id;
|
||||
await apis.user.nodes.deleteNodeById(id, false);
|
||||
|
||||
.then(() => apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC))
|
||||
.then(() => apis.user.sites.getDocLibId(siteName))
|
||||
.then(resp => apis.user.nodes.createFolder(folderSite, resp)).then(resp => folderSiteId = resp.entry.id)
|
||||
.then(() => apis.user.nodes.createFile(fileSite, folderSiteId))
|
||||
await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
const docLibId = await apis.user.sites.getDocLibId(siteName);
|
||||
folderSiteId = (await apis.user.nodes.createFolder(folderSite, docLibId)).entry.id;
|
||||
await apis.user.nodes.createFile(fileSite, folderSiteId);
|
||||
|
||||
.then(() => apis.user.search.waitForApi(username, { expect: 3 }))
|
||||
await apis.user.search.waitForApi(username, { expect: 3 });
|
||||
|
||||
.then(() => loginPage.loginWith(username))
|
||||
.then(done);
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await recentFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodesById([ folderId, file2Id ]);
|
||||
await apis.user.sites.deleteSite(siteName);
|
||||
await apis.admin.trashcan.emptyTrash();
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('has the correct columns - [C213168]', async () => {
|
||||
const labels = [ 'Name', 'Location', 'Size', 'Modified' ];
|
||||
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
|
||||
|
||||
expect(await dataTable.getColumnHeaders().count()).toBe(4 + 1, 'Incorrect number of columns');
|
||||
|
||||
await elements.forEach(async (element, index) => {
|
||||
expect(await element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
});
|
||||
});
|
||||
|
||||
beforeEach(done => {
|
||||
recentFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
});
|
||||
it('default sorting column - [C213171]', async () => {
|
||||
expect(await dataTable.getSortedColumnHeader().getText()).toBe('Modified');
|
||||
expect(await dataTable.getSortingOrder()).toBe('desc');
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
Promise.all([
|
||||
apis.user.nodes.deleteNodesById([ folderId, file2Id ]),
|
||||
apis.user.sites.deleteSite(siteName),
|
||||
apis.admin.trashcan.emptyTrash(),
|
||||
logoutPage.load()
|
||||
])
|
||||
.then(done);
|
||||
});
|
||||
it('displays the files added by the current user in the last 30 days - [C213170]', async () => {
|
||||
expect(await dataTable.countRows()).toEqual(3, 'Incorrect number of files displayed');
|
||||
expect(await dataTable.getRowByName(fileName1).isPresent()).toBe(true, `${fileName1} not displayed`);
|
||||
expect(await dataTable.getRowByName(fileName2).isPresent()).toBe(true, `${fileName2} not displayed`);
|
||||
expect(await dataTable.getRowByName(fileSite).isPresent()).toBe(true, `${fileSite} not displayed`);
|
||||
});
|
||||
|
||||
it('has the correct columns - [C213168]', () => {
|
||||
const labels = [ 'Name', 'Location', 'Size', 'Modified' ];
|
||||
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
|
||||
it(`file not displayed if it's been deleted - [C213174]`, async () => {
|
||||
expect(await dataTable.getRowByName(fileName3).isPresent()).not.toBe(true, `${fileName3} is displayed`);
|
||||
});
|
||||
|
||||
expect(dataTable.getColumnHeaders().count()).toBe(4 + 1, 'Incorrect number of columns');
|
||||
it('Location column displays the parent folder of the file - [C213175]', async () => {
|
||||
expect(await dataTable.getItemLocation(fileName1)).toEqual(folderName);
|
||||
expect(await dataTable.getItemLocation(fileName2)).toEqual('Personal Files');
|
||||
expect(await dataTable.getItemLocation(fileSite)).toEqual(folderSite);
|
||||
});
|
||||
|
||||
elements.forEach((element, index) => {
|
||||
expect(element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
});
|
||||
});
|
||||
it('Location column displays a tooltip with the entire path of the file - [C213177]', async () => {
|
||||
expect(await dataTable.getItemLocationTileAttr(fileName1)).toEqual(`Personal Files/${folderName}`);
|
||||
expect(await dataTable.getItemLocationTileAttr(fileName2)).toEqual('Personal Files');
|
||||
expect(await dataTable.getItemLocationTileAttr(fileSite)).toEqual(`File Libraries/${siteName}/${folderSite}`);
|
||||
});
|
||||
|
||||
it('default sorting column - [C213171]', () => {
|
||||
expect(dataTable.getSortedColumnHeader().getText()).toBe('Modified');
|
||||
expect(dataTable.getSortingOrder()).toBe('desc');
|
||||
});
|
||||
it('Location column redirect - file in user Home - [C213176]', async () => {
|
||||
await dataTable.clickItemLocation(fileName2);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]);
|
||||
});
|
||||
|
||||
it('displays the files added by the current user in the last 30 days - [C213170]', () => {
|
||||
expect(dataTable.countRows()).toEqual(3, 'Incorrect number of files displayed');
|
||||
expect(dataTable.getRowByName(fileName1).isPresent()).toBe(true, `${fileName1} not displayed`);
|
||||
expect(dataTable.getRowByName(fileName2).isPresent()).toBe(true, `${fileName2} not displayed`);
|
||||
expect(dataTable.getRowByName(fileSite).isPresent()).toBe(true, `${fileSite} not displayed`);
|
||||
});
|
||||
it('Location column redirect - file in folder - [C280486]', async () => {
|
||||
await dataTable.clickItemLocation(fileName1);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files', folderName ]);
|
||||
});
|
||||
|
||||
it(`file not displayed if it's been deleted - [C213174]`, () => {
|
||||
expect(dataTable.getRowByName(fileName3).isPresent()).not.toBe(true, `${fileName3} is displayed`);
|
||||
});
|
||||
|
||||
it('Location column displays the parent folder of the file - [C213175]', () => {
|
||||
expect(dataTable.getItemLocation(fileName1).getText()).toEqual(folderName);
|
||||
expect(dataTable.getItemLocation(fileName2).getText()).toEqual('Personal Files');
|
||||
expect(dataTable.getItemLocation(fileSite).getText()).toEqual(folderSite);
|
||||
});
|
||||
|
||||
it('Location column displays a tooltip with the entire path of the file - [C213177]', () => {
|
||||
expect(dataTable.getItemLocationTileAttr(fileName1)).toEqual(`Personal Files/${folderName}`);
|
||||
expect(dataTable.getItemLocationTileAttr(fileName2)).toEqual('Personal Files');
|
||||
expect(dataTable.getItemLocationTileAttr(fileSite)).toEqual(`File Libraries/${siteName}/${folderSite}`);
|
||||
});
|
||||
|
||||
it('Location column redirect - file in user Home - [C213176]', () => {
|
||||
dataTable.clickItemLocation(fileName2)
|
||||
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]));
|
||||
});
|
||||
|
||||
it('Location column redirect - file in folder - [C280486]', () => {
|
||||
dataTable.clickItemLocation(fileName1)
|
||||
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files', folderName ]));
|
||||
});
|
||||
|
||||
it('Location column redirect - file in site - [C280487]', () => {
|
||||
dataTable.clickItemLocation(fileSite)
|
||||
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName, folderSite ]));
|
||||
});
|
||||
it('Location column redirect - file in site - [C280487]', async () => {
|
||||
await dataTable.clickItemLocation(fileSite);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName, folderSite ]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -29,126 +29,116 @@ import { Utils } from '../../utilities/utils';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
|
||||
describe('Shared Files', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const password = username;
|
||||
const username = `user-${Utils.random()}`;
|
||||
const password = username;
|
||||
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const fileAdmin = `file-${Utils.random()}.txt`;
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const fileAdmin = `fileSite-${Utils.random()}.txt`;
|
||||
|
||||
const folderUser = `folder-${Utils.random()}`;
|
||||
const file1User = `file1-${Utils.random()}.txt`; let file1Id;
|
||||
const file2User = `file2-${Utils.random()}.txt`; let file2Id;
|
||||
const file3User = `file3-${Utils.random()}.txt`; let file3Id;
|
||||
const file4User = `file4-${Utils.random()}.txt`; let file4Id;
|
||||
const folderUser = `folder-${Utils.random()}`; let folderId;
|
||||
const file1User = `file1-${Utils.random()}.txt`; let file1Id;
|
||||
const file2User = `file2-${Utils.random()}.txt`; let file2Id;
|
||||
const file3User = `file3-${Utils.random()}.txt`; let file3Id;
|
||||
const file4User = `file4-${Utils.random()}.txt`; let file4Id;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, password)
|
||||
};
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, password)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const sharedFilesPage = new BrowsingPage();
|
||||
const { dataTable } = sharedFilesPage;
|
||||
const { breadcrumb } = sharedFilesPage.toolbar;
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const sharedFilesPage = new BrowsingPage();
|
||||
const { dataTable, breadcrumb } = sharedFilesPage;
|
||||
|
||||
beforeAll(done => {
|
||||
apis.admin.people.createUser({ username })
|
||||
.then(() => apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC))
|
||||
.then(() => apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_CONSUMER))
|
||||
.then(() => apis.admin.nodes.createFiles([ fileAdmin ], `Sites/${siteName}/documentLibrary`))
|
||||
.then(resp => apis.admin.shared.shareFileById(resp.entry.id))
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
await apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_CONSUMER);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(siteName);
|
||||
const nodeId = (await apis.admin.nodes.createFile(fileAdmin, docLibId)).entry.id;
|
||||
await apis.admin.shared.shareFileById(nodeId);
|
||||
|
||||
.then(() => apis.user.nodes.createFolders([ folderUser ]))
|
||||
.then(() => apis.user.nodes.createFiles([ file1User ], folderUser)).then(resp => file1Id = resp.entry.id)
|
||||
.then(() => apis.user.nodes.createFile(file2User)).then(resp => file2Id = resp.entry.id)
|
||||
.then(() => apis.user.nodes.createFile(file3User)).then(resp => file3Id = resp.entry.id)
|
||||
.then(() => apis.user.nodes.createFile(file4User)).then(resp => file4Id = resp.entry.id)
|
||||
.then(() => apis.user.shared.shareFilesByIds([file1Id, file2Id, file3Id, file4Id]))
|
||||
folderId = (await apis.user.nodes.createFolder(folderUser)).entry.id;
|
||||
file1Id = (await apis.user.nodes.createFile(file1User, folderId)).entry.id;
|
||||
file2Id = (await apis.user.nodes.createFile(file2User)).entry.id;
|
||||
file3Id = (await apis.user.nodes.createFile(file3User)).entry.id;
|
||||
file4Id = (await apis.user.nodes.createFile(file4User)).entry.id;
|
||||
await apis.user.shared.shareFilesByIds([file1Id, file2Id, file3Id, file4Id]);
|
||||
|
||||
.then(() => apis.user.shared.waitForApi({ expect: 5 }))
|
||||
.then(() => apis.user.nodes.deleteNodeById(file2Id))
|
||||
.then(() => apis.user.shared.unshareFile(file3User))
|
||||
await apis.admin.shared.waitForApi({ expect: 5 });
|
||||
await apis.user.nodes.deleteNodeById(file2Id);
|
||||
await apis.user.shared.unshareFile(file3User);
|
||||
await apis.admin.shared.waitForApi({ expect: 3 });
|
||||
|
||||
.then(() => loginPage.loginWith(username))
|
||||
.then(done);
|
||||
});
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(done => {
|
||||
sharedFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
});
|
||||
beforeEach(async (done) => {
|
||||
await sharedFilesPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(done => {
|
||||
sharedFilesPage.refresh().then(done);
|
||||
});
|
||||
afterAll(async (done) => {
|
||||
await apis.admin.sites.deleteSite(siteName);
|
||||
await apis.user.nodes.deleteNodeById(folderId);
|
||||
await apis.user.nodes.deleteNodeById(file4Id);
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
Promise.all([
|
||||
apis.admin.sites.deleteSite(siteName),
|
||||
apis.user.nodes.deleteNodes([ folderUser ]),
|
||||
logoutPage.load()
|
||||
])
|
||||
.then(done);
|
||||
});
|
||||
it('has the correct columns - [C213113]', async () => {
|
||||
const expectedHeader = [ 'Thumbnail', 'Name', 'Location', 'Size', 'Modified', 'Modified by', 'Shared by' ];
|
||||
const headers = dataTable.getColumnHeaders();
|
||||
const count = await headers.count();
|
||||
expect(count).toBe(6 + 1, 'Incorrect number of columns');
|
||||
|
||||
it('has the correct columns - [C213113]', () => {
|
||||
const labels = [ 'Name', 'Location', 'Size', 'Modified', 'Modified by', 'Shared by' ];
|
||||
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
|
||||
expect(await dataTable.getHeaderText()).toEqual(expectedHeader);
|
||||
});
|
||||
|
||||
expect(dataTable.getColumnHeaders().count()).toBe(6 + 1, 'Incorrect number of columns');
|
||||
it('default sorting column - [C213115]', async () => {
|
||||
expect(await dataTable.getSortedColumnHeaderText()).toBe('Modified');
|
||||
expect(await dataTable.getSortingOrder()).toBe('desc');
|
||||
});
|
||||
|
||||
elements.forEach((element, index) => {
|
||||
expect(element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
});
|
||||
});
|
||||
it('displays the files shared by everyone - [C213114]', async () => {
|
||||
expect(await dataTable.getRowByName(fileAdmin).isPresent()).toBe(true, `${fileAdmin} not displayed`);
|
||||
expect(await dataTable.getRowByName(file1User).isPresent()).toBe(true, `${file1User} not displayed`);
|
||||
});
|
||||
|
||||
it('default sorting column - [C213115]', () => {
|
||||
expect(dataTable.getSortedColumnHeader().getText()).toBe('Modified');
|
||||
expect(dataTable.getSortingOrder()).toBe('desc');
|
||||
});
|
||||
it(`file not displayed if it's been deleted - [C213117]`, async () => {
|
||||
expect(await dataTable.getRowByName(file2User).isPresent()).toBe(false, `${file2User} is displayed`);
|
||||
});
|
||||
|
||||
it('displays the files shared by everyone - [C213114]', () => {
|
||||
expect(dataTable.getRowByName(fileAdmin).isPresent()).toBe(true, `${fileAdmin} not displayed`);
|
||||
expect(dataTable.getRowByName(file1User).isPresent()).toBe(true, `${file1User} not displayed`);
|
||||
});
|
||||
it('unshared file is not displayed - [C213118]', async () => {
|
||||
expect(await dataTable.getRowByName(file3User).isPresent()).toBe(false, `${file3User} is displayed`);
|
||||
});
|
||||
|
||||
it(`file not displayed if it's been deleted - [C213117]`, () => {
|
||||
expect(dataTable.getRowByName(file2User).isPresent()).toBe(false, `${file2User} is displayed`);
|
||||
});
|
||||
it('Location column displays the parent folder of the file - [C213665]', async () => {
|
||||
expect(await dataTable.getItemLocationTileAttr(file4User)).toEqual('Personal Files');
|
||||
expect(await dataTable.getItemLocation(fileAdmin)).toEqual(siteName);
|
||||
expect(await dataTable.getItemLocation(file1User)).toEqual(folderUser);
|
||||
});
|
||||
|
||||
// TODO: disabled cause the api is slow to update. Find a way to wait until the file is unshared
|
||||
xit('unshared file is not displayed - [C213118]', async () => {
|
||||
apis.user.shared.waitForApi({ expect: 4 })
|
||||
.then(() => {
|
||||
expect(dataTable.getRowByName(file3User).isPresent()).toBe(false, `${file3User} is displayed`);
|
||||
});
|
||||
});
|
||||
it('Location column redirect - file in user Home - [C213666]', async () => {
|
||||
await dataTable.clickItemLocation(file4User);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]);
|
||||
});
|
||||
|
||||
it('Location column displays the parent folder of the file - [C213665]', () => {
|
||||
expect(dataTable.getItemLocationTileAttr(file4User)).toEqual('Personal Files');
|
||||
expect(dataTable.getItemLocation(fileAdmin).getText()).toEqual(siteName);
|
||||
expect(dataTable.getItemLocation(file1User).getText()).toEqual(folderUser);
|
||||
});
|
||||
it('Location column redirect - file in folder - [C280490]', async () => {
|
||||
await dataTable.clickItemLocation(file1User);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files', folderUser ]);
|
||||
});
|
||||
|
||||
it('Location column redirect - file in user Home - [C213666]', () => {
|
||||
dataTable.clickItemLocation(file4User)
|
||||
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]));
|
||||
});
|
||||
it('Location column redirect - file in site - [C280491]', async () => {
|
||||
await dataTable.clickItemLocation(fileAdmin);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName ]);
|
||||
});
|
||||
|
||||
it('Location column redirect - file in folder - [C280490]', () => {
|
||||
dataTable.clickItemLocation(file1User)
|
||||
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files', folderUser ]));
|
||||
});
|
||||
|
||||
it('Location column redirect - file in site - [C280491]', () => {
|
||||
dataTable.clickItemLocation(fileAdmin)
|
||||
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName ]));
|
||||
});
|
||||
|
||||
it('Location column displays a tooltip with the entire path of the file - [C213667]', () => {
|
||||
expect(dataTable.getItemLocationTileAttr(fileAdmin)).toEqual(`File Libraries/${siteName}`);
|
||||
expect(dataTable.getItemLocationTileAttr(file1User)).toEqual(`Personal Files/${folderUser}`);
|
||||
});
|
||||
it('Location column displays a tooltip with the entire path of the file - [C213667]', async () => {
|
||||
expect(await dataTable.getItemLocationTileAttr(fileAdmin)).toEqual(`File Libraries/${siteName}`);
|
||||
expect(await dataTable.getItemLocationTileAttr(file1User)).toEqual(`Personal Files/${folderUser}`);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -29,305 +29,289 @@ import { Utils } from '../../utilities/utils';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
|
||||
describe('File / folder tooltips', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const parent = `parent-${Utils.random()}`;
|
||||
const parent = `parent-${Utils.random()}`;
|
||||
|
||||
const file = `file1-${Utils.random()}`;
|
||||
const fileWithDesc = `file2-${Utils.random()}`;
|
||||
const fileWithTitle = `file3-${Utils.random()}`;
|
||||
const fileWithTitleAndDesc = `file4-${Utils.random()}`;
|
||||
const fileNameEqTitleEqDesc = `file5-${Utils.random()}`;
|
||||
const fileNameEqTitleDiffDesc = `file6-${Utils.random()}`;
|
||||
const fileNameEqDescDiffTitle = `file7-${Utils.random()}`;
|
||||
const fileTitleEqDesc = `file8-${Utils.random()}`;
|
||||
let parentId, file1Id, file2Id, file3Id, file4Id, file5Id, file6Id, file7Id, file8Id;
|
||||
const file = `file1-${Utils.random()}`;
|
||||
const fileWithDesc = `file2-${Utils.random()}`;
|
||||
const fileWithTitle = `file3-${Utils.random()}`;
|
||||
const fileWithTitleAndDesc = `file4-${Utils.random()}`;
|
||||
const fileNameEqTitleEqDesc = `file5-${Utils.random()}`;
|
||||
const fileNameEqTitleDiffDesc = `file6-${Utils.random()}`;
|
||||
const fileNameEqDescDiffTitle = `file7-${Utils.random()}`;
|
||||
const fileTitleEqDesc = `file8-${Utils.random()}`;
|
||||
let parentId, file1Id, file2Id, file3Id, file4Id, file5Id, file6Id, file7Id, file8Id;
|
||||
|
||||
const fileTitle = 'file title';
|
||||
const fileDescription = 'file description';
|
||||
const fileTitle = 'file title';
|
||||
const fileDescription = 'file description';
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
|
||||
beforeAll(done => {
|
||||
apis.admin.people.createUser({ username })
|
||||
.then(() => apis.user.nodes.createFolder( parent ))
|
||||
.then(resp => parentId = resp.entry.id)
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
parentId = (await apis.user.nodes.createFolder( parent )).entry.id;
|
||||
|
||||
.then(() => Promise.all([
|
||||
apis.user.nodes.createFile(file, parentId).then(resp => file1Id = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileWithDesc, parentId, '', fileDescription).then(resp => file2Id = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileWithTitle, parentId, fileTitle).then(resp => file3Id = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileWithTitleAndDesc, parentId, fileTitle, fileDescription)
|
||||
.then(resp => file4Id = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileNameEqTitleEqDesc, parentId, fileNameEqTitleEqDesc, fileNameEqTitleEqDesc)
|
||||
.then(resp => file5Id = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileNameEqTitleDiffDesc, parentId, fileNameEqTitleDiffDesc, fileDescription)
|
||||
.then(resp => file6Id = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileNameEqDescDiffTitle, parentId, fileTitle, fileNameEqDescDiffTitle)
|
||||
.then(resp => file7Id = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileTitleEqDesc, parentId, fileTitle, fileTitle).then(resp => file8Id = resp.entry.id)
|
||||
]))
|
||||
file1Id = (await apis.user.nodes.createFile(file, parentId)).entry.id;
|
||||
file2Id = (await apis.user.nodes.createFile(fileWithDesc, parentId, '', fileDescription)).entry.id;
|
||||
file3Id = (await apis.user.nodes.createFile(fileWithTitle, parentId, fileTitle)).entry.id;
|
||||
file4Id = (await apis.user.nodes.createFile(fileWithTitleAndDesc, parentId, fileTitle, fileDescription)).entry.id;
|
||||
file5Id = (await apis.user.nodes.createFile(fileNameEqTitleEqDesc, parentId, fileNameEqTitleEqDesc, fileNameEqTitleEqDesc)).entry.id;
|
||||
file6Id = (await apis.user.nodes.createFile(fileNameEqTitleDiffDesc, parentId, fileNameEqTitleDiffDesc, fileDescription)).entry.id;
|
||||
file7Id = (await apis.user.nodes.createFile(fileNameEqDescDiffTitle, parentId, fileTitle, fileNameEqDescDiffTitle)).entry.id;
|
||||
file8Id = (await apis.user.nodes.createFile(fileTitleEqDesc, parentId, fileTitle, fileTitle)).entry.id;
|
||||
|
||||
.then(() => apis.user.shared.shareFilesByIds([ file1Id, file2Id, file3Id, file4Id, file5Id, file6Id, file7Id, file8Id ]))
|
||||
await apis.user.shared.shareFilesByIds([ file1Id, file2Id, file3Id, file4Id, file5Id, file6Id, file7Id, file8Id ]);
|
||||
|
||||
.then(() => apis.user.favorites.addFavoritesByIds('file', [
|
||||
file1Id, file2Id, file3Id, file4Id, file5Id, file6Id, file7Id, file8Id
|
||||
]))
|
||||
await apis.user.favorites.addFavoritesByIds('file', [
|
||||
file1Id, file2Id, file3Id, file4Id, file5Id, file6Id, file7Id, file8Id
|
||||
]);
|
||||
|
||||
.then(() => loginPage.loginWith(username))
|
||||
.then(done);
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.user.nodes.deleteNodes([ parent ]),
|
||||
apis.user.trashcan.emptyTrash(),
|
||||
logoutPage.load()
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
xit('');
|
||||
|
||||
describe('on Personal Files', () => {
|
||||
beforeAll(async (done) => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||
await dataTable.doubleClickOnRowByName(parent);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
Promise.all([
|
||||
apis.user.nodes.deleteNodes([ parent ]),
|
||||
apis.admin.trashcan.emptyTrash(),
|
||||
logoutPage.load()
|
||||
])
|
||||
.then(done);
|
||||
it('File with name, no title, no description - [C255871]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
});
|
||||
|
||||
xit('');
|
||||
|
||||
describe('on Personal Files', () => {
|
||||
beforeAll(done => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES)
|
||||
.then(() => dataTable.doubleClickOnRowByName(parent))
|
||||
.then(done);
|
||||
});
|
||||
|
||||
it('File with name, no title, no description - [C255871]', () => {
|
||||
expect(dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
});
|
||||
|
||||
it('File with name and description, no title - [C255872]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name and title, no description - [C255873]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
});
|
||||
|
||||
it('File with name and title and description, all different - [C255874]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name and title and description, all equal - [C255875]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
});
|
||||
|
||||
it('File with name = title, different description - [C255876]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name = description, different title - [C255877]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
});
|
||||
|
||||
it('File with title = description, different name - [C255878]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
});
|
||||
it('File with name and description, no title - [C255872]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
describe('on Recent Files', () => {
|
||||
beforeAll(done => {
|
||||
apis.user.search.waitForApi(username, { expect: 8 })
|
||||
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES))
|
||||
.then(done);
|
||||
});
|
||||
|
||||
it('File with name, no title, no description - [C280135]', () => {
|
||||
expect(dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
});
|
||||
|
||||
it('File with name and description, no title - [C280136]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name and title, no description - [C280137]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
});
|
||||
|
||||
it('File with name and title and description, all different - [C280138]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name and title and description, all equal - [C280139]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
});
|
||||
|
||||
it('File with name = title, different description - [C280140]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name = description, different title - [C280141]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
});
|
||||
|
||||
it('File with title = description, different name - [C280142]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
});
|
||||
it('File with name and title, no description - [C255873]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
});
|
||||
|
||||
// disabled until ACA-518 is done
|
||||
xdescribe('on Shared Files', () => {
|
||||
beforeAll(done => {
|
||||
apis.user.shared.waitForApi({ expect: 8 })
|
||||
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES))
|
||||
.then(done);
|
||||
});
|
||||
|
||||
xit('File with name, no title, no description - [C280143]', () => {
|
||||
expect(dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
});
|
||||
|
||||
xit('File with name and description, no title - [C280144]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
xit('File with name and title, no description - [C280145]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
});
|
||||
|
||||
xit('File with name and title and description, all different - [C280146]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
xit('File with name and title and description, all equal - [C280147]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
});
|
||||
|
||||
xit('File with name = title, different description - [C280148]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
xit('File with name = description, different title - [C280149]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
});
|
||||
|
||||
xit('File with title = description, different name - [C280150]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
});
|
||||
it('File with name and title and description, all different - [C255874]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
describe('on Favorites', () => {
|
||||
beforeAll(done => {
|
||||
page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
});
|
||||
|
||||
it('File with name, no title, no description - [C280151]', () => {
|
||||
expect(dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
});
|
||||
|
||||
it('File with name and description, no title - [C280152]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name and title, no description - [C280153]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
});
|
||||
|
||||
it('File with name and title and description, all different - [C280154]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name and title and description, all equal - [C280155]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
});
|
||||
|
||||
it('File with name = title, different description - [C280156]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name = description, different title - [C280157]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
});
|
||||
|
||||
it('File with title = description, different name - [C280158]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
});
|
||||
it('File with name and title and description, all equal - [C255875]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
});
|
||||
|
||||
describe('on Trash', () => {
|
||||
const parentForTrash = `parent-${Utils.random()}`;
|
||||
let parentForTrashId, file1TrashId, file2TrashId, file3TrashId, file4TrashId;
|
||||
let file5TrashId, file6TrashId, file7TrashId, file8TrashId;
|
||||
|
||||
beforeAll(done => {
|
||||
apis.user.nodes.createFolder( parentForTrash )
|
||||
.then(resp => parentForTrashId = resp.entry.id)
|
||||
.then(() => Promise.all([
|
||||
apis.user.nodes.createFile(file, parentForTrashId)
|
||||
.then(resp => file1TrashId = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileWithDesc, parentForTrashId, '', fileDescription)
|
||||
.then(resp => file2TrashId = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileWithTitle, parentForTrashId, fileTitle)
|
||||
.then(resp => file3TrashId = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileWithTitleAndDesc, parentForTrashId, fileTitle, fileDescription)
|
||||
.then(resp => file4TrashId = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileNameEqTitleEqDesc, parentForTrashId, fileNameEqTitleEqDesc, fileNameEqTitleEqDesc)
|
||||
.then(resp => file5TrashId = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileNameEqTitleDiffDesc, parentForTrashId, fileNameEqTitleDiffDesc, fileDescription)
|
||||
.then(resp => file6TrashId = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileNameEqDescDiffTitle, parentForTrashId, fileTitle, fileNameEqDescDiffTitle)
|
||||
.then(resp => file7TrashId = resp.entry.id),
|
||||
apis.user.nodes.createFile(fileTitleEqDesc, parentForTrashId, fileTitle, fileTitle)
|
||||
.then(resp => file8TrashId = resp.entry.id)
|
||||
]))
|
||||
|
||||
.then(() => apis.user.nodes.deleteNodesById([
|
||||
file1TrashId, file2TrashId, file3TrashId, file4TrashId, file5TrashId, file6TrashId, file7TrashId, file8TrashId
|
||||
], false))
|
||||
|
||||
.then(() => page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH))
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
apis.user.nodes.deleteNodes([ parentForTrash ]).then(done);
|
||||
});
|
||||
|
||||
it('File with name, no title, no description - [C280159]', () => {
|
||||
expect(dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
});
|
||||
|
||||
it('File with name and description, no title - [C280160]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name and title, no description - [C280161]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
});
|
||||
|
||||
it('File with name and title and description, all different - [C280162]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name and title and description, all equal - [C280163]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
});
|
||||
|
||||
it('File with name = title, different description - [C280164]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name = description, different title - [C280165]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
});
|
||||
|
||||
it('File with title = description, different name - [C280166]', () => {
|
||||
expect(dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
});
|
||||
it('File with name = title, different description - [C255876]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name = description, different title - [C255877]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
});
|
||||
|
||||
it('File with title = description, different name - [C255878]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on Recent Files', () => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.user.search.waitForApi(username, { expect: 8 });
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES);
|
||||
done();
|
||||
});
|
||||
|
||||
it('File with name, no title, no description - [C280135]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
});
|
||||
|
||||
it('File with name and description, no title - [C280136]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name and title, no description - [C280137]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
});
|
||||
|
||||
it('File with name and title and description, all different - [C280138]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name and title and description, all equal - [C280139]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
});
|
||||
|
||||
it('File with name = title, different description - [C280140]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name = description, different title - [C280141]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
});
|
||||
|
||||
it('File with title = description, different name - [C280142]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
});
|
||||
});
|
||||
|
||||
// disabled until ACA-518 is done
|
||||
xdescribe('on Shared Files', () => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.user.shared.waitForApi({ expect: 8 });
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.SHARED_FILES);
|
||||
done();
|
||||
});
|
||||
|
||||
xit('File with name, no title, no description - [C280143]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
});
|
||||
|
||||
xit('File with name and description, no title - [C280144]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
xit('File with name and title, no description - [C280145]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
});
|
||||
|
||||
xit('File with name and title and description, all different - [C280146]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
xit('File with name and title and description, all equal - [C280147]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
});
|
||||
|
||||
xit('File with name = title, different description - [C280148]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
xit('File with name = description, different title - [C280149]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
});
|
||||
|
||||
xit('File with title = description, different name - [C280150]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on Favorites', () => {
|
||||
beforeAll(async (done) => {
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITES);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
it('File with name, no title, no description - [C280151]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
});
|
||||
|
||||
it('File with name and description, no title - [C280152]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name and title, no description - [C280153]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
});
|
||||
|
||||
it('File with name and title and description, all different - [C280154]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name and title and description, all equal - [C280155]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
});
|
||||
|
||||
it('File with name = title, different description - [C280156]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name = description, different title - [C280157]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
});
|
||||
|
||||
it('File with title = description, different name - [C280158]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('on Trash', () => {
|
||||
const parentForTrash = `parent-${Utils.random()}`;
|
||||
let parentForTrashId, file1TrashId, file2TrashId, file3TrashId, file4TrashId;
|
||||
let file5TrashId, file6TrashId, file7TrashId, file8TrashId;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
parentForTrashId = (await apis.user.nodes.createFolder( parentForTrash )).entry.id;
|
||||
file1TrashId = (await apis.user.nodes.createFile(file, parentForTrashId)).entry.id;
|
||||
file2TrashId = (await apis.user.nodes.createFile(fileWithDesc, parentForTrashId, '', fileDescription)).entry.id;
|
||||
file3TrashId = (await apis.user.nodes.createFile(fileWithTitle, parentForTrashId, fileTitle)).entry.id;
|
||||
file4TrashId = (await apis.user.nodes.createFile(fileWithTitleAndDesc, parentForTrashId, fileTitle, fileDescription)).entry.id;
|
||||
file5TrashId = (await apis.user.nodes.createFile(fileNameEqTitleEqDesc, parentForTrashId, fileNameEqTitleEqDesc, fileNameEqTitleEqDesc)).entry.id;
|
||||
file6TrashId = (await apis.user.nodes.createFile(fileNameEqTitleDiffDesc, parentForTrashId, fileNameEqTitleDiffDesc, fileDescription)).entry.id;
|
||||
file7TrashId = (await apis.user.nodes.createFile(fileNameEqDescDiffTitle, parentForTrashId, fileTitle, fileNameEqDescDiffTitle)).entry.id;
|
||||
file8TrashId = (await apis.user.nodes.createFile(fileTitleEqDesc, parentForTrashId, fileTitle, fileTitle)).entry.id;
|
||||
|
||||
await apis.user.nodes.deleteNodesById([
|
||||
file1TrashId, file2TrashId, file3TrashId, file4TrashId, file5TrashId, file6TrashId, file7TrashId, file8TrashId
|
||||
], false);
|
||||
|
||||
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodes([ parentForTrash ]);
|
||||
await apis.user.trashcan.emptyTrash();
|
||||
done();
|
||||
});
|
||||
|
||||
it('File with name, no title, no description - [C280159]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(file)).toEqual(`${file}`);
|
||||
});
|
||||
|
||||
it('File with name and description, no title - [C280160]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithDesc)).toEqual(`${fileWithDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name and title, no description - [C280161]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitle)).toEqual(`${fileWithTitle}\n${fileTitle}`);
|
||||
});
|
||||
|
||||
it('File with name and title and description, all different - [C280162]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileWithTitleAndDesc)).toEqual(`${fileTitle}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name and title and description, all equal - [C280163]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleEqDesc)).toEqual(`${fileNameEqTitleEqDesc}`);
|
||||
});
|
||||
|
||||
it('File with name = title, different description - [C280164]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqTitleDiffDesc)).toEqual(`${fileNameEqTitleDiffDesc}\n${fileDescription}`);
|
||||
});
|
||||
|
||||
it('File with name = description, different title - [C280165]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileNameEqDescDiffTitle)).toEqual(`${fileTitle}\n${fileNameEqDescDiffTitle}`);
|
||||
});
|
||||
|
||||
it('File with title = description, different name - [C280166]', async () => {
|
||||
expect(await dataTable.getItemNameTooltip(fileTitleEqDesc)).toEqual(`${fileTitle}`);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
+154
-152
@@ -23,181 +23,183 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
import { SITE_VISIBILITY, SITE_ROLES, SIDEBAR_LABELS } from '../../configs';
|
||||
import { LoginPage, LogoutPage, BrowsingPage } from '../../pages/pages';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||
|
||||
describe('Trash', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const fileSite = `file-${Utils.random()}.txt`; let fileSiteId;
|
||||
const siteName = `site-${Utils.random()}`;
|
||||
const fileSite = `file-${Utils.random()}.txt`; let fileSiteId;
|
||||
|
||||
const folderAdmin = `folder-${Utils.random()}`; let folderAdminId;
|
||||
const fileAdmin = `file-${Utils.random()}.txt`; let fileAdminId;
|
||||
const folderAdmin = `folder-${Utils.random()}`; let folderAdminId;
|
||||
const fileAdmin = `file-${Utils.random()}.txt`; let fileAdminId;
|
||||
|
||||
const folderUser = `folder-${Utils.random()}`; let folderUserId;
|
||||
const fileUser = `file-${Utils.random()}.txt`; let fileUserId;
|
||||
const folderUser = `folder-${Utils.random()}`; let folderUserId;
|
||||
const fileUser = `file-${Utils.random()}.txt`; let fileUserId;
|
||||
|
||||
const folderDeleted = `folder-${Utils.random()}`; let folderDeletedId;
|
||||
const fileDeleted = `file-${Utils.random()}.txt`; let fileDeletedId;
|
||||
const folderDeleted = `folder-${Utils.random()}`; let folderDeletedId;
|
||||
const fileDeleted = `file-${Utils.random()}.txt`; let fileDeletedId;
|
||||
|
||||
const folderNotDeleted = `folder-${Utils.random()}`; let folderNotDeletedId;
|
||||
const fileInFolder = `file-${Utils.random()}.txt`; let fileInFolderId;
|
||||
const folderNotDeleted = `folder-${Utils.random()}`; let folderNotDeletedId;
|
||||
const fileInFolder = `file-${Utils.random()}.txt`; let fileInFolderId;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const trashPage = new BrowsingPage();
|
||||
const { dataTable } = trashPage;
|
||||
const { breadcrumb } = trashPage.toolbar;
|
||||
const loginPage = new LoginPage();
|
||||
const logoutPage = new LogoutPage();
|
||||
const trashPage = new BrowsingPage();
|
||||
const { dataTable, breadcrumb } = trashPage;
|
||||
|
||||
beforeAll(done => {
|
||||
apis.admin.people.createUser({ username })
|
||||
.then(() => apis.admin.nodes.createFiles([ fileAdmin ]).then(resp => fileAdminId = resp.entry.id))
|
||||
.then(() => apis.admin.nodes.createFolders([ folderAdmin ]).then(resp => folderAdminId = resp.entry.id))
|
||||
.then(() => apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC))
|
||||
.then(() => apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_MANAGER))
|
||||
.then(() => apis.admin.nodes.createFiles([ fileSite ], `Sites/${siteName}/documentLibrary`)
|
||||
.then(resp => fileSiteId = resp.entry.id))
|
||||
.then(() => apis.user.nodes.createFiles([ fileUser ]).then(resp => fileUserId = resp.entry.id))
|
||||
.then(() => apis.user.nodes.createFolders([ folderUser ]).then(resp => folderUserId = resp.entry.id))
|
||||
.then(() => apis.user.nodes.createFolder(folderDeleted).then(resp => folderDeletedId = resp.entry.id))
|
||||
.then(() => apis.user.nodes.createFiles([ fileDeleted ], folderDeleted).then(resp => fileDeletedId = resp.entry.id))
|
||||
.then(() => apis.user.nodes.createFolder(folderNotDeleted).then(resp => folderNotDeletedId = resp.entry.id))
|
||||
.then(() => apis.user.nodes.createFiles([ fileInFolder ], folderNotDeleted).then(resp => fileInFolderId = resp.entry.id))
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
fileAdminId = (await apis.admin.nodes.createFiles([ fileAdmin ])).entry.id;
|
||||
folderAdminId = (await apis.admin.nodes.createFolders([ folderAdmin ])).entry.id;
|
||||
await apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
await apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_MANAGER);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(siteName);
|
||||
fileSiteId = (await apis.admin.nodes.createFile(fileSite, docLibId)).entry.id;
|
||||
fileUserId = (await apis.user.nodes.createFiles([ fileUser ])).entry.id;
|
||||
folderUserId = (await apis.user.nodes.createFolders([ folderUser ])).entry.id;
|
||||
folderDeletedId = (await apis.user.nodes.createFolder(folderDeleted)).entry.id;
|
||||
fileDeletedId = (await apis.user.nodes.createFiles([ fileDeleted ], folderDeleted)).entry.id;
|
||||
folderNotDeletedId = (await apis.user.nodes.createFolder(folderNotDeleted)).entry.id;
|
||||
fileInFolderId = (await apis.user.nodes.createFiles([ fileInFolder ], folderNotDeleted)).entry.id;
|
||||
|
||||
.then(() => apis.admin.nodes.deleteNodesById([ fileAdminId, folderAdminId ], false))
|
||||
.then(() => apis.user.nodes.deleteNodesById([ fileSiteId, fileUserId, folderUserId, fileInFolderId ], false))
|
||||
.then(() => apis.user.nodes.deleteNodeById(fileDeletedId, false))
|
||||
.then(() => apis.user.nodes.deleteNodeById(folderDeletedId, false))
|
||||
await apis.admin.nodes.deleteNodesById([ fileAdminId, folderAdminId ], false);
|
||||
await apis.user.nodes.deleteNodesById([ fileSiteId, fileUserId, folderUserId, fileInFolderId ], false);
|
||||
await apis.user.nodes.deleteNodeById(fileDeletedId, false);
|
||||
await apis.user.nodes.deleteNodeById(folderDeletedId, false);
|
||||
|
||||
.then(done);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.sites.deleteSite(siteName),
|
||||
apis.user.nodes.deleteNodeById(folderNotDeletedId),
|
||||
apis.admin.trashcan.emptyTrash()
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
xit('');
|
||||
|
||||
describe('as admin', () => {
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.loginWithAdmin();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
Promise.all([
|
||||
apis.admin.sites.deleteSite(siteName),
|
||||
apis.user.nodes.deleteNodeById(folderNotDeletedId),
|
||||
apis.admin.trashcan.emptyTrash()
|
||||
])
|
||||
.then(done);
|
||||
beforeEach(async (done) => {
|
||||
await trashPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
xit('');
|
||||
|
||||
describe('as admin', () => {
|
||||
beforeAll(done => {
|
||||
loginPage.loginWithAdmin().then(done);
|
||||
});
|
||||
|
||||
beforeEach(done => {
|
||||
trashPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
});
|
||||
|
||||
afterAll(done => {
|
||||
logoutPage.load().then(done);
|
||||
});
|
||||
|
||||
it('has the correct columns - [C213217]', () => {
|
||||
const labels = [ 'Name', 'Location', 'Size', 'Deleted', 'Deleted by' ];
|
||||
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
|
||||
|
||||
expect(dataTable.getColumnHeaders().count()).toBe(5 + 1, 'Incorrect number of columns');
|
||||
|
||||
elements.forEach((element, index) => {
|
||||
expect(element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
});
|
||||
});
|
||||
|
||||
it('displays the files and folders deleted by everyone - [C280493]', () => {
|
||||
expect(dataTable.countRows()).toEqual(8, 'Incorrect number of deleted items displayed');
|
||||
|
||||
expect(dataTable.getRowByName(fileAdmin).isPresent()).toBe(true, `${fileAdmin} not displayed`);
|
||||
expect(dataTable.getRowByName(folderAdmin).isPresent()).toBe(true, `${folderAdmin} not displayed`);
|
||||
expect(dataTable.getRowByName(fileUser).isPresent()).toBe(true, `${fileUser} not displayed`);
|
||||
expect(dataTable.getRowByName(folderUser).isPresent()).toBe(true, `${folderUser} not displayed`);
|
||||
expect(dataTable.getRowByName(fileSite).isPresent()).toBe(true, `${fileSite} not displayed`);
|
||||
});
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
describe('as user', () => {
|
||||
beforeAll(done => {
|
||||
loginPage.loginWith(username).then(done);
|
||||
});
|
||||
it('has the correct columns - [C213217]', async () => {
|
||||
const labels = [ 'Name', 'Location', 'Size', 'Deleted', 'Deleted by' ];
|
||||
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
|
||||
|
||||
beforeEach(done => {
|
||||
trashPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH)
|
||||
.then(() => dataTable.waitForHeader())
|
||||
.then(done);
|
||||
});
|
||||
expect(await dataTable.getColumnHeaders().count()).toBe(5 + 1, 'Incorrect number of columns');
|
||||
|
||||
afterAll(done => {
|
||||
logoutPage.load().then(done);
|
||||
});
|
||||
|
||||
it('has the correct columns - [C280494]', () => {
|
||||
const labels = [ 'Name', 'Location', 'Size', 'Deleted'];
|
||||
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
|
||||
|
||||
expect(dataTable.getColumnHeaders().count()).toBe(4 + 1, 'Incorrect number of columns');
|
||||
|
||||
elements.forEach((element, index) => {
|
||||
expect(element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
});
|
||||
});
|
||||
|
||||
it('displays the files and folders deleted by the user - [C213218]', () => {
|
||||
expect(dataTable.countRows()).toEqual(6, 'Incorrect number of deleted items displayed');
|
||||
|
||||
expect(dataTable.getRowByName(fileSite).isPresent()).toBe(true, `${fileSite} not displayed`);
|
||||
expect(dataTable.getRowByName(fileUser).isPresent()).toBe(true, `${fileUser} not displayed`);
|
||||
expect(dataTable.getRowByName(folderUser).isPresent()).toBe(true, `${folderUser} not displayed`);
|
||||
expect(dataTable.getRowByName(fileAdmin).isPresent()).toBe(false, `${fileAdmin} is displayed`);
|
||||
});
|
||||
|
||||
it('default sorting column - [C213219]', () => {
|
||||
expect(dataTable.getSortedColumnHeader().getText()).toBe('Deleted');
|
||||
expect(dataTable.getSortingOrder()).toBe('desc');
|
||||
});
|
||||
|
||||
it('Location column displays the parent folder of the file - [C280498]', () => {
|
||||
expect(dataTable.getItemLocation(fileInFolder).getText()).toEqual(folderNotDeleted);
|
||||
expect(dataTable.getItemLocation(fileUser).getText()).toEqual('Personal Files');
|
||||
expect(dataTable.getItemLocation(fileSite).getText()).toEqual(siteName);
|
||||
});
|
||||
|
||||
it('Location column displays a tooltip with the entire path of the file - [C280499]', () => {
|
||||
expect(dataTable.getItemLocationTileAttr(fileInFolder)).toEqual(`Personal Files/${folderNotDeleted}`);
|
||||
expect(dataTable.getItemLocationTileAttr(fileUser)).toEqual('Personal Files');
|
||||
expect(dataTable.getItemLocationTileAttr(fileSite)).toEqual(`File Libraries/${siteName}`);
|
||||
});
|
||||
|
||||
it('Location column is empty if parent folder no longer exists - [C280500]', () => {
|
||||
expect(dataTable.getItemLocation(fileDeleted).getText()).toEqual('');
|
||||
});
|
||||
|
||||
it('Location column redirect - file in user Home - [C217144]', () => {
|
||||
dataTable.clickItemLocation(fileUser)
|
||||
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]));
|
||||
});
|
||||
|
||||
it('Location column redirect - file in folder - [C280496]', () => {
|
||||
dataTable.clickItemLocation(fileInFolder)
|
||||
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'Personal Files', folderNotDeleted ]));
|
||||
});
|
||||
|
||||
it('Location column redirect - file in site - [C280497]', () => {
|
||||
dataTable.clickItemLocation(fileSite)
|
||||
.then(() => expect(breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName ]));
|
||||
});
|
||||
await elements.forEach(async (element, index) => {
|
||||
expect(await element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
});
|
||||
});
|
||||
|
||||
it('displays the files and folders deleted by everyone - [C280493]', async () => {
|
||||
expect(await dataTable.countRows()).toEqual(8, 'Incorrect number of deleted items displayed');
|
||||
|
||||
expect(await dataTable.getRowByName(fileAdmin).isPresent()).toBe(true, `${fileAdmin} not displayed`);
|
||||
expect(await dataTable.getRowByName(folderAdmin).isPresent()).toBe(true, `${folderAdmin} not displayed`);
|
||||
expect(await dataTable.getRowByName(fileUser).isPresent()).toBe(true, `${fileUser} not displayed`);
|
||||
expect(await dataTable.getRowByName(folderUser).isPresent()).toBe(true, `${folderUser} not displayed`);
|
||||
expect(await dataTable.getRowByName(fileSite).isPresent()).toBe(true, `${fileSite} not displayed`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('as user', () => {
|
||||
beforeAll(async (done) => {
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
beforeEach(async (done) => {
|
||||
await trashPage.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.TRASH);
|
||||
await dataTable.waitForHeader();
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await logoutPage.load();
|
||||
done();
|
||||
});
|
||||
|
||||
it('has the correct columns - [C280494]', async () => {
|
||||
const labels = [ 'Name', 'Location', 'Size', 'Deleted'];
|
||||
const elements = labels.map(label => dataTable.getColumnHeaderByLabel(label));
|
||||
|
||||
expect(await dataTable.getColumnHeaders().count()).toBe(4 + 1, 'Incorrect number of columns');
|
||||
|
||||
await elements.forEach(async (element, index) => {
|
||||
expect(await element.isPresent()).toBe(true, `"${labels[index]}" is missing`);
|
||||
});
|
||||
});
|
||||
|
||||
it('displays the files and folders deleted by the user - [C213218]', async () => {
|
||||
expect(await dataTable.countRows()).toEqual(6, 'Incorrect number of deleted items displayed');
|
||||
|
||||
expect(await dataTable.getRowByName(fileSite).isPresent()).toBe(true, `${fileSite} not displayed`);
|
||||
expect(await dataTable.getRowByName(fileUser).isPresent()).toBe(true, `${fileUser} not displayed`);
|
||||
expect(await dataTable.getRowByName(folderUser).isPresent()).toBe(true, `${folderUser} not displayed`);
|
||||
expect(await dataTable.getRowByName(fileAdmin).isPresent()).toBe(false, `${fileAdmin} is displayed`);
|
||||
});
|
||||
|
||||
it('default sorting column - [C213219]', async () => {
|
||||
expect(await dataTable.getSortedColumnHeader().getText()).toBe('Deleted');
|
||||
expect(await dataTable.getSortingOrder()).toBe('desc');
|
||||
});
|
||||
|
||||
it('Location column displays the parent folder of the file - [C280498]', async () => {
|
||||
expect(await dataTable.getItemLocation(fileInFolder)).toEqual(folderNotDeleted);
|
||||
expect(await dataTable.getItemLocation(fileUser)).toEqual('Personal Files');
|
||||
expect(await dataTable.getItemLocation(fileSite)).toEqual(siteName);
|
||||
});
|
||||
|
||||
it('Location column displays a tooltip with the entire path of the file - [C280499]', async () => {
|
||||
expect(await dataTable.getItemLocationTileAttr(fileInFolder)).toEqual(`Personal Files/${folderNotDeleted}`);
|
||||
expect(await dataTable.getItemLocationTileAttr(fileUser)).toEqual('Personal Files');
|
||||
expect(await dataTable.getItemLocationTileAttr(fileSite)).toEqual(`File Libraries/${siteName}`);
|
||||
});
|
||||
|
||||
it('Location column is empty if parent folder no longer exists - [C280500]', async () => {
|
||||
expect(await dataTable.getItemLocation(fileDeleted)).toEqual('');
|
||||
});
|
||||
|
||||
it('Location column redirect - file in user Home - [C217144]', async () => {
|
||||
await dataTable.clickItemLocation(fileUser);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files' ]);
|
||||
});
|
||||
|
||||
it('Location column redirect - file in folder - [C280496]', async () => {
|
||||
await dataTable.clickItemLocation(fileInFolder);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'Personal Files', folderNotDeleted ]);
|
||||
});
|
||||
|
||||
it('Location column redirect - file in site - [C280497]', async () => {
|
||||
await dataTable.clickItemLocation(fileSite);
|
||||
expect(await breadcrumb.getAllItems()).toEqual([ 'File Libraries', siteName ]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user