From 077428124436e7123e089e1c92fff8130cd70e5c Mon Sep 17 00:00:00 2001 From: Alfresco Build <8039454+alfresco-build@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:08:39 +0200 Subject: [PATCH 1/3] GH Auto: Upstream dependencies ADF:6.4.0-6341205853 JS-API: using Tag:6.4.0-6341205853 (#3452) * [ci:force][auto-commit] Update dependencies ADF:6.4.0-6341205853 JS: * Corrected versions --------- Co-authored-by: DenysVuika Co-authored-by: Aleksander Sklorz --- package-lock.json | 52 +++++++++++++++---------------- package.json | 12 +++---- projects/aca-content/package.json | 6 ++-- projects/aca-shared/package.json | 6 ++-- 4 files changed, 38 insertions(+), 38 deletions(-) diff --git a/package-lock.json b/package-lock.json index e58ff042d1..eb1b0b59ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,10 +10,10 @@ "hasInstallScript": true, "license": "LGPL-3.0", "dependencies": { - "@alfresco/adf-content-services": "6.4.0-6336818839", - "@alfresco/adf-core": "6.4.0-6336818839", - "@alfresco/adf-extensions": "6.4.0-6336818839", - "@alfresco/eslint-plugin-eslint-angular": "6.4.0-6336818839", + "@alfresco/adf-content-services": "6.4.0-6341205853", + "@alfresco/adf-core": "6.4.0-6341205853", + "@alfresco/adf-extensions": "6.4.0-6341205853", + "@alfresco/eslint-plugin-eslint-angular": "6.4.0-6341205853", "@alfresco/js-api": "7.1.0-1349", "@angular/animations": "14.1.3", "@angular/cdk": "14.1.3", @@ -46,8 +46,8 @@ "zone.js": "0.11.8" }, "devDependencies": { - "@alfresco/adf-cli": "6.4.0-6336818839", - "@alfresco/adf-testing": "6.4.0-6336818839", + "@alfresco/adf-cli": "6.4.0-6341205853", + "@alfresco/adf-testing": "6.4.0-6341205853", "@angular-devkit/build-angular": "14.2.11", "@angular-devkit/core": "14.1.2", "@angular-devkit/schematics": "14.1.2", @@ -120,9 +120,9 @@ "dev": true }, "node_modules/@alfresco/adf-cli": { - "version": "6.4.0-6336818839", - "resolved": "https://registry.npmjs.org/@alfresco/adf-cli/-/adf-cli-6.4.0-6336818839.tgz", - "integrity": "sha512-/O/WZAooRIm7rzcyQK0Eo86Z4iijPJR7vy5+GMMB6ZKZ8aOH9XzAaSVIs3mAbd3MwCO/s/i796Uzd9pkUbtXfg==", + "version": "6.4.0-6341205853", + "resolved": "https://registry.npmjs.org/@alfresco/adf-cli/-/adf-cli-6.4.0-6341205853.tgz", + "integrity": "sha512-xzpO+E6P0QQ7B/QApvbVVV/tBYc/WLPnETf6V8XsfFGmJxYYhRKDElLggldODhPkM+C/PIMi51RhFHqvoVp1BA==", "dev": true, "dependencies": { "@alfresco/js-api": ">=7.1.0-1349", @@ -140,14 +140,14 @@ } }, "node_modules/@alfresco/adf-content-services": { - "version": "6.4.0-6336818839", - "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-6.4.0-6336818839.tgz", - "integrity": "sha512-KFDqgkRQ+flFJyS9NMf81wrtbmDP+ugczGuK7CztjQIgXKzTl8lEhyqT9VjN6JYxRJgCuhMdJQ08B2LM0ZLW6w==", + "version": "6.4.0-6341205853", + "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-6.4.0-6341205853.tgz", + "integrity": "sha512-a5HqoB5C0uJFVmDVzHZW6pkofGIxyj28+xitLBO9ikwjF//oFYDlrP5p/Zuz//SaqElwq6cc0b1SuUmYAeAurQ==", "dependencies": { "tslib": "^2.3.0" }, "peerDependencies": { - "@alfresco/adf-core": ">=6.4.0-6336818839", + "@alfresco/adf-core": ">=6.4.0-6341205853", "@alfresco/js-api": ">=7.1.0-1349", "@angular/animations": ">=14.1.3", "@angular/cdk": ">=14.1.2", @@ -164,9 +164,9 @@ } }, "node_modules/@alfresco/adf-core": { - "version": "6.4.0-6336818839", - "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-6.4.0-6336818839.tgz", - "integrity": "sha512-eKfw2GoYVnkgg/NkzHzdg/q8EPUr3CytGy6Zzg7QhZpWzcO2V0sCDRKWYLqjXkNmSV7WX1jrr2OsnxoDcjpLfA==", + "version": "6.4.0-6341205853", + "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-6.4.0-6341205853.tgz", + "integrity": "sha512-0A7wBG8uk/kQcQD9c41DEq/G6bkSgqvqQSxSie744GuP/0GogTtW9o/wFB8nthswugue2aYj1oWtLfYtBz5vdA==", "dependencies": { "angular-oauth2-oidc": "^13.0.1", "angular-oauth2-oidc-jwks": "^13.0.1", @@ -174,7 +174,7 @@ "tslib": "^2.3.0" }, "peerDependencies": { - "@alfresco/adf-extensions": ">=6.4.0-6336818839", + "@alfresco/adf-extensions": ">=6.4.0-6341205853", "@alfresco/js-api": ">=7.1.0-1349", "@angular/animations": ">=14.1.3", "@angular/cdk": ">=14.1.2", @@ -193,9 +193,9 @@ } }, "node_modules/@alfresco/adf-extensions": { - "version": "6.4.0-6336818839", - "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-6.4.0-6336818839.tgz", - "integrity": "sha512-YO+5a99urBvOuqLZ6VIT+qTtnEm+uUEOTZgLiBDV8fwl4nZlPqwFiV/hOL5AJdAa4eevJ2+s65QEdMQmRNMJrw==", + "version": "6.4.0-6341205853", + "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-6.4.0-6341205853.tgz", + "integrity": "sha512-/BLZp3WX0KY0oVxJfPAG7zHaxFe+6xVcMb8uTXAtgCcI+NBhL63GGpwxZ92IfBEYppbS5pMalebnhGL6Qrk9bA==", "dependencies": { "tslib": "^2.3.0" }, @@ -206,9 +206,9 @@ } }, "node_modules/@alfresco/adf-testing": { - "version": "6.4.0-6336818839", - "resolved": "https://registry.npmjs.org/@alfresco/adf-testing/-/adf-testing-6.4.0-6336818839.tgz", - "integrity": "sha512-Vbkqu3qbj6pgdd+AJ7ZaHk0qzrPt+Tac4UaXcwLLHrvMPX9iKM4rLtwy7wg32s0L+bOXCrxte8DsAu2YA0/O6w==", + "version": "6.4.0-6341205853", + "resolved": "https://registry.npmjs.org/@alfresco/adf-testing/-/adf-testing-6.4.0-6341205853.tgz", + "integrity": "sha512-nw7qqH/Sg8oFeOpaBQGOUQuUSRVdne3OGcvzUz2q8S2HL9Swwh/5m1vG10wm4rOTJCAHTJxPIeiIUoBfAxK4Ng==", "dev": true, "dependencies": { "@alfresco/js-api": "7.1.0-1349", @@ -223,9 +223,9 @@ } }, "node_modules/@alfresco/eslint-plugin-eslint-angular": { - "version": "6.4.0-6336818839", - "resolved": "https://registry.npmjs.org/@alfresco/eslint-plugin-eslint-angular/-/eslint-plugin-eslint-angular-6.4.0-6336818839.tgz", - "integrity": "sha512-l7k2cEIHQq5Yi6EmQ7w7wI7fTLluRcIufI0ljLdwFDIzlj06rJ2KMB3i6bACuDlcyB9wlwm7CgowDwy7zpXvHQ==" + "version": "6.4.0-6341205853", + "resolved": "https://registry.npmjs.org/@alfresco/eslint-plugin-eslint-angular/-/eslint-plugin-eslint-angular-6.4.0-6341205853.tgz", + "integrity": "sha512-3lSaKA9xMW7dgmjtJQ/pVOx5No5y5RcOsifjbAAxRg5gexZBznbMFlDrCESDPUCCEErIDC839c/cw3AxehXIaA==" }, "node_modules/@alfresco/js-api": { "version": "7.1.0-1349", diff --git a/package.json b/package.json index dd248ccad0..96a5572aed 100644 --- a/package.json +++ b/package.json @@ -33,10 +33,10 @@ }, "private": true, "dependencies": { - "@alfresco/adf-content-services": "6.4.0-6336818839", - "@alfresco/adf-core": "6.4.0-6336818839", - "@alfresco/adf-extensions": "6.4.0-6336818839", - "@alfresco/eslint-plugin-eslint-angular": "6.4.0-6336818839", + "@alfresco/adf-content-services": "6.4.0-6341205853", + "@alfresco/adf-core": "6.4.0-6341205853", + "@alfresco/adf-extensions": "6.4.0-6341205853", + "@alfresco/eslint-plugin-eslint-angular": "6.4.0-6341205853", "@alfresco/js-api": "7.1.0-1349", "@angular/animations": "14.1.3", "@angular/cdk": "14.1.3", @@ -69,8 +69,8 @@ "zone.js": "0.11.8" }, "devDependencies": { - "@alfresco/adf-cli": "6.4.0-6336818839", - "@alfresco/adf-testing": "6.4.0-6336818839", + "@alfresco/adf-cli": "6.4.0-6341205853", + "@alfresco/adf-testing": "6.4.0-6341205853", "@angular-devkit/build-angular": "14.2.11", "@angular-devkit/core": "14.1.2", "@angular-devkit/schematics": "14.1.2", diff --git a/projects/aca-content/package.json b/projects/aca-content/package.json index 5f20b2c65c..b2cedb1300 100644 --- a/projects/aca-content/package.json +++ b/projects/aca-content/package.json @@ -5,9 +5,9 @@ "peerDependencies": { "@angular/common": "^14.1.0", "@angular/core": "^14.1.0", - "@alfresco/adf-core": "^6.4.0-6336818839", - "@alfresco/adf-content-services": "^6.4.0-6336818839", - "@alfresco/adf-extensions": "^6.4.0-6336818839", + "@alfresco/adf-core": "^6.4.0-6341205853", + "@alfresco/adf-content-services": "^6.4.0-6341205853", + "@alfresco/adf-extensions": "^6.4.0-6341205853", "@alfresco/js-api": "^7.1.0-1349", "@angular/animations": "^14.1.3", "@angular/cdk": "^14.1.3", diff --git a/projects/aca-shared/package.json b/projects/aca-shared/package.json index c50874270a..abfa150f1f 100644 --- a/projects/aca-shared/package.json +++ b/projects/aca-shared/package.json @@ -5,9 +5,9 @@ "license": "LGPL-3.0", "scripts": {}, "peerDependencies": { - "@alfresco/adf-content-services": "^6.4.0-6336818839", - "@alfresco/adf-core": "^6.4.0-6336818839", - "@alfresco/adf-extensions": "^6.4.0-6336818839", + "@alfresco/adf-content-services": "^6.4.0-6341205853", + "@alfresco/adf-core": "^6.4.0-6341205853", + "@alfresco/adf-extensions": "^6.4.0-6341205853", "@alfresco/js-api": "^7.1.0-1349", "@angular/animations": "^14.1.3", "@angular/common": "^14.1.3", From 740b9b3579a66ff04a4b55b8141ff94ca28fac81 Mon Sep 17 00:00:00 2001 From: Alfresco Build <8039454+alfresco-build@users.noreply.github.com> Date: Mon, 2 Oct 2023 13:18:44 +0200 Subject: [PATCH 2/3] [ci:force][auto-commit] Update dependencies ADF:6.4.0-6377399867 JS:7.1.0-1367 (#3454) Co-authored-by: DenysVuika --- package-lock.json | 71 +++++++++++++++++++++++++++-------------------- package.json | 14 +++++----- 2 files changed, 48 insertions(+), 37 deletions(-) diff --git a/package-lock.json b/package-lock.json index eb1b0b59ab..03730947f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,11 +10,11 @@ "hasInstallScript": true, "license": "LGPL-3.0", "dependencies": { - "@alfresco/adf-content-services": "6.4.0-6341205853", - "@alfresco/adf-core": "6.4.0-6341205853", - "@alfresco/adf-extensions": "6.4.0-6341205853", - "@alfresco/eslint-plugin-eslint-angular": "6.4.0-6341205853", - "@alfresco/js-api": "7.1.0-1349", + "@alfresco/adf-content-services": "6.4.0-6377399867", + "@alfresco/adf-core": "6.4.0-6377399867", + "@alfresco/adf-extensions": "6.4.0-6377399867", + "@alfresco/eslint-plugin-eslint-angular": "6.4.0-6377399867", + "@alfresco/js-api": "7.1.0-1367", "@angular/animations": "14.1.3", "@angular/cdk": "14.1.3", "@angular/common": "14.1.3", @@ -46,8 +46,8 @@ "zone.js": "0.11.8" }, "devDependencies": { - "@alfresco/adf-cli": "6.4.0-6341205853", - "@alfresco/adf-testing": "6.4.0-6341205853", + "@alfresco/adf-cli": "6.4.0-6377399867", + "@alfresco/adf-testing": "6.4.0-6377399867", "@angular-devkit/build-angular": "14.2.11", "@angular-devkit/core": "14.1.2", "@angular-devkit/schematics": "14.1.2", @@ -120,9 +120,9 @@ "dev": true }, "node_modules/@alfresco/adf-cli": { - "version": "6.4.0-6341205853", - "resolved": "https://registry.npmjs.org/@alfresco/adf-cli/-/adf-cli-6.4.0-6341205853.tgz", - "integrity": "sha512-xzpO+E6P0QQ7B/QApvbVVV/tBYc/WLPnETf6V8XsfFGmJxYYhRKDElLggldODhPkM+C/PIMi51RhFHqvoVp1BA==", + "version": "6.4.0-6377399867", + "resolved": "https://registry.npmjs.org/@alfresco/adf-cli/-/adf-cli-6.4.0-6377399867.tgz", + "integrity": "sha512-PtPtUdP1p3r7QH3iNA6s+haCfYHt60afKZ9HQ5ka1xVt5XvQ0MLSuVn/YCOD2YfVxbpAdJ43lLzhvWkurh7FPA==", "dev": true, "dependencies": { "@alfresco/js-api": ">=7.1.0-1349", @@ -140,14 +140,14 @@ } }, "node_modules/@alfresco/adf-content-services": { - "version": "6.4.0-6341205853", - "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-6.4.0-6341205853.tgz", - "integrity": "sha512-a5HqoB5C0uJFVmDVzHZW6pkofGIxyj28+xitLBO9ikwjF//oFYDlrP5p/Zuz//SaqElwq6cc0b1SuUmYAeAurQ==", + "version": "6.4.0-6377399867", + "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-6.4.0-6377399867.tgz", + "integrity": "sha512-MssW0eKSh0Af0/oldEijw96CswqhQZRXpoK45vWdRueBncoTE976mYlk//sjHKjo+p4tehVHSv0I+ihE/Q9N/Q==", "dependencies": { "tslib": "^2.3.0" }, "peerDependencies": { - "@alfresco/adf-core": ">=6.4.0-6341205853", + "@alfresco/adf-core": ">=6.4.0-6377399867", "@alfresco/js-api": ">=7.1.0-1349", "@angular/animations": ">=14.1.3", "@angular/cdk": ">=14.1.2", @@ -164,9 +164,9 @@ } }, "node_modules/@alfresco/adf-core": { - "version": "6.4.0-6341205853", - "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-6.4.0-6341205853.tgz", - "integrity": "sha512-0A7wBG8uk/kQcQD9c41DEq/G6bkSgqvqQSxSie744GuP/0GogTtW9o/wFB8nthswugue2aYj1oWtLfYtBz5vdA==", + "version": "6.4.0-6377399867", + "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-6.4.0-6377399867.tgz", + "integrity": "sha512-SJw7Yk4vGXXQeol15jpkhrSgHhsOHOpgtng/qyzn/4C5B5BjylqZtlctSqdQ5cu/2VbGQetrOyqNACwWXTWvzA==", "dependencies": { "angular-oauth2-oidc": "^13.0.1", "angular-oauth2-oidc-jwks": "^13.0.1", @@ -174,7 +174,7 @@ "tslib": "^2.3.0" }, "peerDependencies": { - "@alfresco/adf-extensions": ">=6.4.0-6341205853", + "@alfresco/adf-extensions": ">=6.4.0-6377399867", "@alfresco/js-api": ">=7.1.0-1349", "@angular/animations": ">=14.1.3", "@angular/cdk": ">=14.1.2", @@ -193,9 +193,9 @@ } }, "node_modules/@alfresco/adf-extensions": { - "version": "6.4.0-6341205853", - "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-6.4.0-6341205853.tgz", - "integrity": "sha512-/BLZp3WX0KY0oVxJfPAG7zHaxFe+6xVcMb8uTXAtgCcI+NBhL63GGpwxZ92IfBEYppbS5pMalebnhGL6Qrk9bA==", + "version": "6.4.0-6377399867", + "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-6.4.0-6377399867.tgz", + "integrity": "sha512-qx2+3QuVuYNnO9cKNTzHl9IQeLJGLJqXX3i61tm4U07l5SppxubQ3eSvXhcJebN3sXcE0KbbtA9aDH82Isd4DQ==", "dependencies": { "tslib": "^2.3.0" }, @@ -206,9 +206,9 @@ } }, "node_modules/@alfresco/adf-testing": { - "version": "6.4.0-6341205853", - "resolved": "https://registry.npmjs.org/@alfresco/adf-testing/-/adf-testing-6.4.0-6341205853.tgz", - "integrity": "sha512-nw7qqH/Sg8oFeOpaBQGOUQuUSRVdne3OGcvzUz2q8S2HL9Swwh/5m1vG10wm4rOTJCAHTJxPIeiIUoBfAxK4Ng==", + "version": "6.4.0-6377399867", + "resolved": "https://registry.npmjs.org/@alfresco/adf-testing/-/adf-testing-6.4.0-6377399867.tgz", + "integrity": "sha512-7x02FfsQAzpkfTRr/Eg98K20YpchAlPxhEvtiF8uDT9IlbeDzqwROcRt9l78+Fmf1inrryrO4HKKQEwoVCLZQg==", "dev": true, "dependencies": { "@alfresco/js-api": "7.1.0-1349", @@ -222,15 +222,26 @@ "@alfresco/js-api": ">=7.1.0-1349" } }, - "node_modules/@alfresco/eslint-plugin-eslint-angular": { - "version": "6.4.0-6341205853", - "resolved": "https://registry.npmjs.org/@alfresco/eslint-plugin-eslint-angular/-/eslint-plugin-eslint-angular-6.4.0-6341205853.tgz", - "integrity": "sha512-3lSaKA9xMW7dgmjtJQ/pVOx5No5y5RcOsifjbAAxRg5gexZBznbMFlDrCESDPUCCEErIDC839c/cw3AxehXIaA==" - }, - "node_modules/@alfresco/js-api": { + "node_modules/@alfresco/adf-testing/node_modules/@alfresco/js-api": { "version": "7.1.0-1349", "resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-7.1.0-1349.tgz", "integrity": "sha512-p0qfoF8mTmaj8BCJ2EhNedOv60uqc2kOFEVByX/VxxTCYrMbG/OHRRNorYWoybI896AqJI5ytqJaKAtGqBKeuQ==", + "dev": true, + "dependencies": { + "event-emitter": "^0.3.5", + "superagent": "^8.0.9", + "tslib": "^2.6.1" + } + }, + "node_modules/@alfresco/eslint-plugin-eslint-angular": { + "version": "6.4.0-6377399867", + "resolved": "https://registry.npmjs.org/@alfresco/eslint-plugin-eslint-angular/-/eslint-plugin-eslint-angular-6.4.0-6377399867.tgz", + "integrity": "sha512-ZKiinjfISK1C4g3cBn+w0HH04DrAzEuSapT03VdHcNtHk4LLjhOeKPrnMoYr3ozWtUwJtXBVa+R31FxNfiP9oA==" + }, + "node_modules/@alfresco/js-api": { + "version": "7.1.0-1367", + "resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-7.1.0-1367.tgz", + "integrity": "sha512-GfgKwQdQggjcK9Bp8Kr5t55XVRGF26PS6VDtU12K+/PlTrQChotICUS8UEC37GGRYE5zMp+uQhcARs7yBzaRjA==", "dependencies": { "event-emitter": "^0.3.5", "superagent": "^8.0.9", diff --git a/package.json b/package.json index 96a5572aed..a582c78f96 100644 --- a/package.json +++ b/package.json @@ -33,11 +33,11 @@ }, "private": true, "dependencies": { - "@alfresco/adf-content-services": "6.4.0-6341205853", - "@alfresco/adf-core": "6.4.0-6341205853", - "@alfresco/adf-extensions": "6.4.0-6341205853", - "@alfresco/eslint-plugin-eslint-angular": "6.4.0-6341205853", - "@alfresco/js-api": "7.1.0-1349", + "@alfresco/adf-content-services": "6.4.0-6377399867", + "@alfresco/adf-core": "6.4.0-6377399867", + "@alfresco/adf-extensions": "6.4.0-6377399867", + "@alfresco/eslint-plugin-eslint-angular": "6.4.0-6377399867", + "@alfresco/js-api": "7.1.0-1367", "@angular/animations": "14.1.3", "@angular/cdk": "14.1.3", "@angular/common": "14.1.3", @@ -69,8 +69,8 @@ "zone.js": "0.11.8" }, "devDependencies": { - "@alfresco/adf-cli": "6.4.0-6341205853", - "@alfresco/adf-testing": "6.4.0-6341205853", + "@alfresco/adf-cli": "6.4.0-6377399867", + "@alfresco/adf-testing": "6.4.0-6377399867", "@angular-devkit/build-angular": "14.2.11", "@angular-devkit/core": "14.1.2", "@angular-devkit/schematics": "14.1.2", From 33c50bdd68e39931a2cd5f2edd783f6d2db4c0a3 Mon Sep 17 00:00:00 2001 From: Adam Zakrzewski <122363592+azakrzewski-hy@users.noreply.github.com> Date: Mon, 2 Oct 2023 17:03:29 +0200 Subject: [PATCH 3/3] [ACS-5678] create folder from template tests (#3456) * [ACS-5678] create folder from template tests * taking out only flag * fixes for linter, import, method name and locator * fix import and utils strings --- .../tests/create-folder-from-template.spec.ts | 416 ++++++++++++++++++ e2e/protractor/protractor.excludes.json | 24 +- .../create-from-template.dialog.html | 3 +- .../src/api/nodes-api.ts | 82 ++++ .../components/aca-header.component.ts | 9 +- .../page-objects/components/base.component.ts | 2 +- .../dataTable/data-table.component.ts | 4 + .../dataTable/mat-menu.component.ts | 1 + .../dialogs/content-node-selector-dialog.ts | 12 +- .../create-from-template-dialog-component.ts | 57 +++ .../page-objects/components/dialogs/index.ts | 1 + .../src/page-objects/components/index.ts | 1 + .../page-objects/pages/my-libraries.page.ts | 7 +- .../page-objects/pages/personal-files.page.ts | 18 +- .../src/utils/error-strings.ts | 36 ++ .../aca-playwright-shared/src/utils/index.ts | 1 + .../aca-playwright-shared/src/utils/utils.ts | 4 + 17 files changed, 665 insertions(+), 13 deletions(-) create mode 100644 e2e/playwright/actions/src/tests/create-folder-from-template.spec.ts create mode 100644 projects/aca-playwright-shared/src/page-objects/components/dialogs/create-from-template-dialog-component.ts create mode 100644 projects/aca-playwright-shared/src/utils/error-strings.ts diff --git a/e2e/playwright/actions/src/tests/create-folder-from-template.spec.ts b/e2e/playwright/actions/src/tests/create-folder-from-template.spec.ts new file mode 100644 index 0000000000..67c792f948 --- /dev/null +++ b/e2e/playwright/actions/src/tests/create-folder-from-template.spec.ts @@ -0,0 +1,416 @@ +/*! + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Alfresco Example Content Application + * + * 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 + * from Hyland Software. If not, see . + */ + +import { expect } from '@playwright/test'; +import { + AcaHeader, + ContentNodeSelectorDialog, + CreateFromTemplateDialogComponent, + DataTableComponent, + NodeContentTree, + NodesApi, + Utils, + errorStrings, + getUserState, + test +} from '@alfresco/playwright-shared'; + +test.use({ storageState: getUserState('hruser') }); +test.describe('Create folder from template', () => { + let selectFolderTemplateDialog: ContentNodeSelectorDialog; + let createFolderFromTemplateDialog: CreateFromTemplateDialogComponent; + let dataTable: DataTableComponent; + let toolbar: AcaHeader; + let randomFolderName: string; + let randomFolderTitle: string; + let randomFolderDescription: string; + let folderLink: string; + let folderId: string; + const selectDialogTitle = 'Select a folder template'; + const dialogBreadcrumb = 'Space Templates'; + const nameLabel = 'Name *'; + const titleLabel = 'Title'; + const descriptionLabel = 'Description'; + const emptyString = ''; + const tabKeyString = 'Tab'; + const dotString = '.'; + const spaceString = ' '; + const commandKey = 'Meta'; + const random = Utils.random(); + + const fileInRootFolder = `file-in-root-${random}.txt`; + const folderInRootFolder = `folder-in-root-${random}`; + + const templateFolder1 = `template-folder1-${random}`; + const fileInFolder1 = `file-1-${random}.txt`; + const templateSubFolder = `template-sub-folder-${random}`; + + const templateFolder2 = `template-folder2-${random}`; + const fileInFolder2 = `file-2-${random}.txt`; + + const restrictedTemplateFolder = `restricted-folder-${random}`; + const fileInRestrictedFolder = `restricted-file-${random}.txt`; + + const createDialogTitle = `Create new folder from '${templateFolder1}'`; + const commonFolderName = `playwright-folder-${Utils.random()}`; + + const templates: NodeContentTree = { + folders: [ + { + name: folderInRootFolder + }, + { + name: templateFolder1, + folders: [ + { + name: templateSubFolder + } + ], + files: [fileInFolder1] + }, + { + name: templateFolder2, + files: [fileInFolder2] + }, + { + name: restrictedTemplateFolder, + files: [fileInRestrictedFolder] + } + ], + files: [fileInRootFolder] + }; + + test.beforeAll(async ({ nodesApiAction }) => { + await nodesApiAction.createContent(templates, `Data Dictionary/Space Templates`); + await nodesApiAction.removeUserAccessOnSpaceTemplate(restrictedTemplateFolder); + folderLink = (await nodesApiAction.createLinkToFolderName(folderInRootFolder, await nodesApiAction.getSpaceTemplatesFolderId())).entry.name; + }); + + test.beforeEach(async ({ personalFiles }) => { + await personalFiles.navigate(); + }); + + test.afterAll(async ({ nodesApiAction }) => { + await nodesApiAction.cleanupSpaceTemplatesItems([ + folderInRootFolder, + templateFolder1, + templateFolder2, + restrictedTemplateFolder, + fileInRootFolder + ]); + }); + + test.describe('Personal Files page', () => { + test.beforeEach(async ({ personalFiles }) => { + selectFolderTemplateDialog = personalFiles.contentNodeSelector; + dataTable = personalFiles.dataTable; + toolbar = personalFiles.acaHeader; + await toolbar.clickCreateFolderFromTemplate(); + }); + + test.describe('Select Template dialog', () => { + test('[C325147] Select template - dialog UI - with existing templates', async () => { + await expect.soft(selectFolderTemplateDialog.getDialogTitle(selectDialogTitle)).toBeVisible(); + await expect.soft(selectFolderTemplateDialog.getBreadcrumb(dialogBreadcrumb)).toBeVisible(); + await expect.soft(dataTable.getRowByName(templateFolder1)).not.toBeEmpty(); + await expect.soft(dataTable.getRowByName(templateFolder1)).toBeVisible(); + await expect.soft(dataTable.getRowByName(templateFolder2)).toBeVisible(); + await expect.soft(dataTable.getRowByName(folderInRootFolder)).toBeVisible(); + await expect.soft(selectFolderTemplateDialog.cancelButton).toBeEnabled(); + await expect(selectFolderTemplateDialog.actionButton).toBeDisabled(); + }); + + test(`[C325148] Templates don't appear if user doesn't have permissions to see them`, async () => { + await expect(selectFolderTemplateDialog.getDialogTitle(selectDialogTitle)).toBeVisible(); + await expect(dataTable.getRowByName(restrictedTemplateFolder)).not.toBeVisible(); + }); + + test(`[C325149] Navigate through the templates list with folder hierarchy`, async () => { + await expect(selectFolderTemplateDialog.getBreadcrumb(dialogBreadcrumb)).toBeVisible(); + await expect(dataTable.getRowByName(templateFolder1)).toBeVisible(); + + await dataTable.getRowByName(templateFolder1).dblclick(); + await expect(selectFolderTemplateDialog.getBreadcrumb(templateFolder1)).toBeVisible(); + await expect(dataTable.getRowByName(templateSubFolder)).toBeVisible(); + await expect(dataTable.getRowByName(fileInFolder1)).toBeVisible(); + + await dataTable.getRowByName(templateSubFolder).dblclick(); + await expect(selectFolderTemplateDialog.getBreadcrumb(templateSubFolder)).toBeVisible(); + await expect(dataTable.getNoResultsFoundMessage).toBeVisible(); + + await selectFolderTemplateDialog.getFolderIcon.click(); + await expect(selectFolderTemplateDialog.getOptionLocator(templateFolder1)).toBeVisible(); + await expect(selectFolderTemplateDialog.getOptionLocator(dialogBreadcrumb)).toBeVisible(); + }); + + test(`[C325150] Templates list doesn't allow multiple selection`, async () => { + await expect(dataTable.getSelectedRow).toHaveCount(0); + + await dataTable.getRowByName(templateFolder1).click({ modifiers: [commandKey] }); + await expect(dataTable.getSelectedRow).toHaveCount(1); + await expect(dataTable.getSelectedRow).toContainText(templateFolder1); + + await dataTable.getRowByName(templateFolder2).click({ modifiers: [commandKey] }); + await expect(dataTable.getSelectedRow).not.toHaveCount(2); + await expect(dataTable.getSelectedRow).toHaveCount(1); + await expect(dataTable.getSelectedRow).toContainText(templateFolder2); + }); + + test('[C325153] Links to folders are not displayed', async () => { + await expect(dataTable.getRowByName(templateFolder1)).toBeVisible(); + await expect(dataTable.getRowByName(folderLink)).not.toBeVisible(); + }); + + test('[C325151] Cancel the Select template dialog', async () => { + await expect(selectFolderTemplateDialog.getDialogTitle(selectDialogTitle)).toBeVisible(); + + await selectFolderTemplateDialog.cancelButton.click(); + await expect(selectFolderTemplateDialog.getDialogTitle(selectDialogTitle)).toBeHidden(); + }); + + test('[C325139] Next button is disabled when selecting a file', async () => { + await expect(dataTable.getRowByName(fileInRootFolder)).toBeVisible(); + await expect(selectFolderTemplateDialog.actionButton).toBeDisabled(); + + await dataTable.getRowByName(fileInRootFolder).click(); + await expect(selectFolderTemplateDialog.actionButton).toBeDisabled(); + }); + }); + + test.describe('Create from template dialog', () => { + test.beforeAll(async () => { + const nodesApi = await NodesApi.initialize('hruser'); + folderId = (await nodesApi.createFolder(commonFolderName)).entry.id; + }); + + test.beforeEach(async ({ personalFiles }) => { + createFolderFromTemplateDialog = personalFiles.createFromTemplateDialogComponent; + await dataTable.getRowByName(templateFolder1).click(); + await selectFolderTemplateDialog.actionButton.click(); + }); + + test.afterAll(async ({ nodesApiAction }) => { + await nodesApiAction.deleteNodeById(folderId); + }); + + test('[C325142] Create folder from template - dialog UI', async () => { + await expect.soft(createFolderFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeVisible(); + await expect.soft(createFolderFromTemplateDialog.getDialogLabel(nameLabel)).toBeVisible(); + await expect.soft(createFolderFromTemplateDialog.getDialogLabel(nameLabel)).toHaveValue(templateFolder1); + await expect.soft(createFolderFromTemplateDialog.getDialogLabel(titleLabel)).toBeVisible(); + await expect.soft(createFolderFromTemplateDialog.getDialogLabel(titleLabel)).toHaveValue(emptyString); + await expect.soft(createFolderFromTemplateDialog.getDialogLabel(descriptionLabel)).toBeVisible(); + await expect.soft(createFolderFromTemplateDialog.getDialogLabel(descriptionLabel)).toHaveValue(emptyString); + await expect.soft(createFolderFromTemplateDialog.cancelButton).toBeEnabled(); + await expect(createFolderFromTemplateDialog.createButton).toBeEnabled(); + }); + + test('[C325143] Folder name is required', async () => { + await expect(createFolderFromTemplateDialog.getDialogLabel(nameLabel)).toHaveValue(templateFolder1); + + await createFolderFromTemplateDialog.getDialogLabel(nameLabel).clear(); + await createFolderFromTemplateDialog.page.keyboard.press(tabKeyString); + await expect(createFolderFromTemplateDialog.getDialogLabel(nameLabel)).toHaveValue(emptyString); + expect + .soft(await createFolderFromTemplateDialog.isErrorMessageDisplayed(errorStrings.nameIsRequiredError), errorStrings.errorMessageNotPresent) + .toBe(true); + await expect(createFolderFromTemplateDialog.createButton).toBeDisabled(); + }); + + test('[C325144] Special characters in folder name', async () => { + const nameWithSpecialChars = ['a*a', 'a"a', 'aa', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a']; + + for (const specialFolderName of nameWithSpecialChars) { + await createFolderFromTemplateDialog.getDialogLabel(nameLabel).fill(specialFolderName); + await createFolderFromTemplateDialog.page.keyboard.press(tabKeyString); + await expect(createFolderFromTemplateDialog.getDialogLabel(nameLabel)).toHaveValue(specialFolderName); + expect + .soft( + await createFolderFromTemplateDialog.isErrorMessageDisplayed(errorStrings.nameWithSpecialCharactersError), + errorStrings.errorMessageNotPresent + ) + .toBe(true); + await expect(createFolderFromTemplateDialog.createButton).toBeDisabled(); + } + }); + + test('[C325145] Folder name ending with a dot', async () => { + await createFolderFromTemplateDialog.getDialogLabel(nameLabel).type(dotString); + await createFolderFromTemplateDialog.page.keyboard.press(tabKeyString); + await expect(createFolderFromTemplateDialog.getDialogLabel(nameLabel)).toHaveValue(templateFolder1 + dotString); + expect + .soft(await createFolderFromTemplateDialog.isErrorMessageDisplayed(errorStrings.nameEndWithDotError), errorStrings.errorMessageNotPresent) + .toBe(true); + await expect(createFolderFromTemplateDialog.createButton).toBeDisabled(); + }); + + test('[C325146] Folder name containing only spaces', async () => { + await createFolderFromTemplateDialog.getDialogLabel(nameLabel).clear(); + await createFolderFromTemplateDialog.getDialogLabel(nameLabel).fill(spaceString); + await createFolderFromTemplateDialog.page.keyboard.press(tabKeyString); + await expect(createFolderFromTemplateDialog.getDialogLabel(nameLabel)).toHaveValue(spaceString); + expect + .soft( + await createFolderFromTemplateDialog.isErrorMessageDisplayed(errorStrings.nameContainOnlySpacesError), + errorStrings.errorMessageNotPresent + ) + .toBe(true); + await expect(createFolderFromTemplateDialog.createButton).toBeDisabled(); + }); + + test('[C325141] Title too long', async () => { + await createFolderFromTemplateDialog.getDialogLabel(titleLabel).fill(Utils.string257Long); + await createFolderFromTemplateDialog.page.keyboard.press(tabKeyString); + await expect(createFolderFromTemplateDialog.getDialogLabel(titleLabel)).toHaveValue(Utils.string257Long); + expect + .soft(await createFolderFromTemplateDialog.isErrorMessageDisplayed(errorStrings.titleLengthLimitError), errorStrings.errorMessageNotPresent) + .toBe(true); + await expect(createFolderFromTemplateDialog.createButton).toBeDisabled(); + }); + + test('[C325140] Description too long', async () => { + await createFolderFromTemplateDialog.getDialogLabel(descriptionLabel).fill(Utils.string513Long); + await createFolderFromTemplateDialog.page.keyboard.press(tabKeyString); + await expect(createFolderFromTemplateDialog.getDialogLabel(descriptionLabel)).toHaveValue(Utils.string513Long); + expect + .soft( + await createFolderFromTemplateDialog.isErrorMessageDisplayed(errorStrings.descriptionLengthLimitError), + errorStrings.errorMessageNotPresent + ) + .toBe(true); + await expect(createFolderFromTemplateDialog.createButton).toBeDisabled(); + }); + + test('[C325156] Create a folder with a duplicate name', async ({ personalFiles }) => { + const snackBar = personalFiles.snackBar; + + await createFolderFromTemplateDialog.createNewFolderFromTemplate(commonFolderName); + await expect(snackBar.getByMessageLocator(errorStrings.nameAlreadyUsedError)).toBeVisible(); + await expect(createFolderFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeVisible(); + }); + + test('[C325155] Cancel folder creation', async () => { + await expect(createFolderFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeVisible(); + await createFolderFromTemplateDialog.cancelButton.click(); + await expect(createFolderFromTemplateDialog.getDialogTitle(createDialogTitle)).not.toBeVisible(); + }); + }); + + test.describe('Folder created from template on Personal Files', () => { + test.beforeEach(async ({ personalFiles }) => { + randomFolderName = `playwright-folder-${Utils.random()}`; + randomFolderTitle = `folder-title-${Utils.random()}`; + randomFolderDescription = `folder-description-${Utils.random()}`; + createFolderFromTemplateDialog = personalFiles.createFromTemplateDialogComponent; + await dataTable.getRowByName(templateFolder1).click(); + await selectFolderTemplateDialog.actionButton.click(); + }); + + test.afterEach(async () => { + const nodesApi = await NodesApi.initialize('hruser'); + folderId = await nodesApi.getNodeIdFromParent(randomFolderName, '-my-'); + await nodesApi.deleteNodeById(folderId); + }); + + test('[C325157] Create a folder from a template - with a new Name', async () => { + await createFolderFromTemplateDialog.createNewFolderFromTemplate(randomFolderName); + await dataTable.goThroughPagesLookingForRowWithName(randomFolderName); + await expect(dataTable.getRowByName(randomFolderName)).toBeVisible(); + + await dataTable.getRowByName(randomFolderName).dblclick(); + await expect(dataTable.getRowByName(templateSubFolder)).toBeVisible(); + await expect(dataTable.getRowByName(fileInFolder1)).toBeVisible(); + }); + + test('[C325154] Create a folder from a template - with a Name, Title and Description', async () => { + await createFolderFromTemplateDialog.createNewFolderFromTemplate(randomFolderName, randomFolderTitle, randomFolderDescription); + await dataTable.goThroughPagesLookingForRowWithName(randomFolderName); + await expect(dataTable.getCellLinkByName(randomFolderName)).toHaveAttribute(titleLabel, randomFolderTitle + `\n` + randomFolderDescription); + }); + + test('[C325158] Trim spaces from folder Name', async () => { + await createFolderFromTemplateDialog.createNewFolderFromTemplate(' ' + randomFolderName + ' '); + await dataTable.goThroughPagesLookingForRowWithName(randomFolderName); + await expect(dataTable.getRowByName(randomFolderName)).toBeVisible(); + }); + }); + }); + + test.describe('Folder created from template on Personal Files Libraries', () => { + const randomLibraryName = `playwright-library-${Utils.random()}`; + + test.beforeAll(async ({ sitesApiAction, nodesApiAction }) => { + await sitesApiAction.createSite(randomLibraryName); + const libraryGuId = await sitesApiAction.getDocLibId(randomLibraryName); + await nodesApiAction.createFolder(commonFolderName, libraryGuId); + }); + + test.beforeEach(async ({ myLibrariesPage }) => { + randomFolderName = `playwright-folder-${Utils.random()}`; + randomFolderTitle = `folder-title-${Utils.random()}`; + randomFolderDescription = `folder-description-${Utils.random()}`; + await myLibrariesPage.navigate(); + selectFolderTemplateDialog = myLibrariesPage.contentNodeSelector; + createFolderFromTemplateDialog = myLibrariesPage.createFromTemplateDialogComponent; + dataTable = myLibrariesPage.dataTable; + toolbar = myLibrariesPage.acaHeader; + await dataTable.goThroughPagesLookingForRowWithName(randomLibraryName); + await dataTable.getRowByName(randomLibraryName).dblclick(); + await dataTable.spinnerWaitForReload(); + await toolbar.clickCreateFolderFromTemplate(); + await dataTable.getRowByName(templateFolder1).click(); + await selectFolderTemplateDialog.actionButton.click(); + }); + + test.afterAll(async ({ sitesApiAction }) => { + await sitesApiAction.deleteSites([randomLibraryName]); + }); + + test('[C325161] Create a folder from a template from library - with Name, Title and Description', async () => { + await createFolderFromTemplateDialog.createNewFolderFromTemplate(randomFolderName, randomFolderTitle, randomFolderDescription); + await expect + .soft(dataTable.getCellLinkByName(randomFolderName)) + .toHaveAttribute(titleLabel, randomFolderTitle + `\n` + randomFolderDescription); + + await dataTable.getRowByName(randomFolderName).dblclick(); + await expect(dataTable.getRowByName(templateSubFolder)).toBeVisible(); + await expect(dataTable.getRowByName(fileInFolder1)).toBeVisible(); + }); + + test('[C325162] Cancel folder creation in a library', async () => { + await expect(createFolderFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeVisible(); + await createFolderFromTemplateDialog.cancelButton.click(); + await expect(createFolderFromTemplateDialog.getDialogTitle(createDialogTitle)).not.toBeVisible(); + await expect(dataTable.getRowByName(randomFolderName)).not.toBeVisible(); + }); + + test('[C325163] Create a folder with a duplicate name in a library', async ({ myLibrariesPage }) => { + const snackBar = myLibrariesPage.snackBar; + + await createFolderFromTemplateDialog.createNewFolderFromTemplate(commonFolderName); + await expect(snackBar.getByMessageLocator(errorStrings.nameAlreadyUsedError)).toBeVisible(); + await expect(createFolderFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeVisible(); + }); + }); +}); diff --git a/e2e/protractor/protractor.excludes.json b/e2e/protractor/protractor.excludes.json index effe33632b..62a5082678 100644 --- a/e2e/protractor/protractor.excludes.json +++ b/e2e/protractor/protractor.excludes.json @@ -17,5 +17,27 @@ "C279220": "will be fixed after protractor to playwright migration, see https://alfresco.atlassian.net/browse/ACS-5007", "C279221": "will be fixed after protractor to playwright migration, see https://alfresco.atlassian.net/browse/ACS-5007", "C325006": "will be fixed after protractor to playwright migration, see https://alfresco.atlassiana.net/browse/ACS-5007", - "C213097": "https://alfresco.atlassian.net/browse/ACS-5479" + "C213097": "https://alfresco.atlassian.net/browse/ACS-5479", + "C325147" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678", + "C325148" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678", + "C325149" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678", + "C325150" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678", + "C325153" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678", + "C325151" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678", + "C325139" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678", + "C325142" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678", + "C325143" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678", + "C325144" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678", + "C325145" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678", + "C325146" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678", + "C325141" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678", + "C325140" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678", + "C325157" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678", + "C325154" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678", + "C325156" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678", + "C325155" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678", + "C325158" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678", + "C325161" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678", + "C325162" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678", + "C325163" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678" } diff --git a/projects/aca-content/src/lib/dialogs/node-template/create-from-template.dialog.html b/projects/aca-content/src/lib/dialogs/node-template/create-from-template.dialog.html index 993f504035..f05cda4add 100644 --- a/projects/aca-content/src/lib/dialogs/node-template/create-from-template.dialog.html +++ b/projects/aca-content/src/lib/dialogs/node-template/create-from-template.dialog.html @@ -42,7 +42,7 @@

- diff --git a/projects/aca-playwright-shared/src/api/nodes-api.ts b/projects/aca-playwright-shared/src/api/nodes-api.ts index 090e27d724..6fb68f96f6 100755 --- a/projects/aca-playwright-shared/src/api/nodes-api.ts +++ b/projects/aca-playwright-shared/src/api/nodes-api.ts @@ -154,6 +154,15 @@ export class NodesApi { } } + async getNodeById(id: string): Promise { + try { + return await this.apiService.nodes.getNode(id); + } catch (error) { + logger.error(`${this.constructor.name} ${this.getNodeById.name}`, error); + return null; + } + } + async getNodeIdFromParent(name: string, parentId: string): Promise { try { const children = (await this.getNodeChildren(parentId)).list.entries; @@ -214,4 +223,77 @@ export class NodesApi { } } + async removeUserAccessOnSpaceTemplate(nodeName: string): Promise { + try { + const templatesRootFolderId = await this.getSpaceTemplatesFolderId(); + const nodeId: string = await this.getNodeIdFromParent(nodeName, templatesRootFolderId); + + return this.setInheritPermissions(nodeId, false); + } catch (error) { + logger.error('Admin Actions - removeUserAccessOnSpaceTemplate failed : ', error); + return null; + } + } + + async setInheritPermissions(nodeId: string, inheritPermissions: boolean): Promise { + const data = { + permissions: { + isInheritanceEnabled: inheritPermissions + } + }; + + try { + return await this.apiService.nodes.updateNode(nodeId, data); + } catch (error) { + logger.error(`${this.constructor.name} ${this.setInheritPermissions.name}`, error); + return null; + } + } + + private async addAspects(nodeId: string, aspectNames: string[]): Promise { + try { + return this.apiService.nodes.updateNode(nodeId, { aspectNames }); + } catch (error) { + logger.error(`${this.constructor.name} ${this.addAspects.name}`, error); + return null; + } + } + + async createFolderLink(originalNodeId: string, destinationId: string): Promise { + const name = (await this.getNodeById(originalNodeId)).entry.name; + const nodeBody = { + name: `Link to ${name}.url`, + nodeType: 'app:folderlink', + properties: { + 'cm:title': `Link to ${name}.url`, + 'cm:destination': originalNodeId, + 'cm:description': `Link to ${name}.url`, + 'app:icon': 'space-icon-link' + } + }; + + try { + const link = await this.apiService.nodes.createNode(destinationId, nodeBody); + await this.addAspects(originalNodeId, ['app:linked']); + return link; + } catch (error) { + logger.error(`${this.constructor.name} ${this.createFolderLink.name}`, error); + return null; + } + } + + async createLinkToFolderName(originalFolderName: string, originalFolderParentId: string, destinationParentId?: string): Promise { + if (!destinationParentId) { + destinationParentId = originalFolderParentId; + } + + try { + const nodeId = await this.getNodeIdFromParent(originalFolderName, originalFolderParentId); + return this.createFolderLink(nodeId, destinationParentId); + } catch (error) { + logger.error('Admin Actions - createLinkToFolderName failed : ', error); + return null; + } + } + } diff --git a/projects/aca-playwright-shared/src/page-objects/components/aca-header.component.ts b/projects/aca-playwright-shared/src/page-objects/components/aca-header.component.ts index bbb1d9355c..f8b791d485 100644 --- a/projects/aca-playwright-shared/src/page-objects/components/aca-header.component.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/aca-header.component.ts @@ -22,8 +22,9 @@ * from Hyland Software. If not, see . */ -import { BaseComponent } from './base.component'; import { Page } from '@playwright/test'; +import { MatMenuComponent } from './dataTable'; +import { BaseComponent } from './base.component'; export class AcaHeader extends BaseComponent { private static rootElement = 'aca-toolbar'; private moreActionsButton = this.getChild('button[id="app.viewer.toolbar.more"]'); @@ -38,9 +39,15 @@ export class AcaHeader extends BaseComponent { constructor(page: Page) { super(page, AcaHeader.rootElement); } + public matMenu = new MatMenuComponent(this.page); async clickViewerMoreActions(): Promise { await this.moreActionsButton.waitFor({ state: 'attached' }); await this.moreActionsButton.click(); } + + async clickCreateFolderFromTemplate(): Promise { + await this.createButton.click(); + await this.matMenu.createFolderFromTemplate.click(); + } } diff --git a/projects/aca-playwright-shared/src/page-objects/components/base.component.ts b/projects/aca-playwright-shared/src/page-objects/components/base.component.ts index 11910754b1..4b16fe012d 100644 --- a/projects/aca-playwright-shared/src/page-objects/components/base.component.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/base.component.ts @@ -56,7 +56,7 @@ export abstract class BaseComponent extends PlaywrightBase { async spinnerWaitForReload(): Promise { try { - await this.page.locator('mat-progress-spinner').waitFor({ state: 'attached', timeout: timeouts.normal }); + await this.page.locator('mat-progress-spinner').waitFor({ state: 'attached', timeout: timeouts.medium }); await this.page.locator('mat-progress-spinner').waitFor({ state: 'detached', timeout: timeouts.normal }); } catch (e) { this.logger.info('Spinner was not present'); diff --git a/projects/aca-playwright-shared/src/page-objects/components/dataTable/data-table.component.ts b/projects/aca-playwright-shared/src/page-objects/components/dataTable/data-table.component.ts index eb66e89699..51139cc0a9 100644 --- a/projects/aca-playwright-shared/src/page-objects/components/dataTable/data-table.component.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/dataTable/data-table.component.ts @@ -39,10 +39,14 @@ export class DataTableComponent extends BaseComponent { getEmptyFolderLocator = this.getChild('.adf-empty-folder'); getEmptyContentTitleLocator = this.getChild('adf-empty-content .adf-empty-content__title'); getEmptyContentSubTitleLocator = this.getChild('adf-empty-content .adf-empty-content__subtitle'); + getSelectedRow = this.getChild('.adf-datatable-row.adf-is-selected'); /** Locator for row (or rows) */ getRowLocator = this.getChild(`adf-datatable-row`); + /** Locator to get "No results found" message */ + getNoResultsFoundMessage = this.getChild('adf-custom-empty-content-template', { hasText: "No results found" }); + /** * Method used in cases where we want to check that some record is visible in the datatable. It will consider whole row * diff --git a/projects/aca-playwright-shared/src/page-objects/components/dataTable/mat-menu.component.ts b/projects/aca-playwright-shared/src/page-objects/components/dataTable/mat-menu.component.ts index 1f48038a6c..46bbe2d9b8 100644 --- a/projects/aca-playwright-shared/src/page-objects/components/dataTable/mat-menu.component.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/dataTable/mat-menu.component.ts @@ -35,6 +35,7 @@ export class MatMenuComponent extends BaseComponent { public getMenuItemsLocator = this.getChild('button'); public getMenuItemTextLocator = this.getChild('[data-automation-id="menu-item-title"]'); public createFolder = this.getChild('[id="app.create.folder"]'); + public createFolderFromTemplate = this.getChild('[id="app.create.folderFromTemplate"]'); public createLibrary = this.getChild('[id="app.create.library"]'); public getButtonByText = (text: string) => this.getChild('button', { hasText: text }); diff --git a/projects/aca-playwright-shared/src/page-objects/components/dialogs/content-node-selector-dialog.ts b/projects/aca-playwright-shared/src/page-objects/components/dialogs/content-node-selector-dialog.ts index 870d3b2f2c..cd29aff11f 100755 --- a/projects/aca-playwright-shared/src/page-objects/components/dialogs/content-node-selector-dialog.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/dialogs/content-node-selector-dialog.ts @@ -28,16 +28,20 @@ import { BaseComponent } from '../base.component'; export class ContentNodeSelectorDialog extends BaseComponent { private static rootElement = 'adf-content-node-selector'; + constructor(page: Page) { + super(page, ContentNodeSelectorDialog.rootElement); + } + public cancelButton = this.getChild('[data-automation-id="content-node-selector-actions-cancel"]'); public actionButton = this.getChild('[data-automation-id="content-node-selector-actions-choose"]'); public locationDropDown = this.getChild('[id="site-dropdown-container"]'); private selectedRow = this.getChild('.adf-is-selected'); - private getOptionLocator = (optionName: string): Locator => this.page.locator('.mat-select-panel .mat-option-text', { hasText: optionName }); + getOptionLocator = (optionName: string): Locator => this.page.locator('.mat-select-panel .mat-option-text', { hasText: optionName }); private getRowByName = (name: string | number): Locator => this.getChild(`adf-datatable-row`, { hasText: name.toString() }); + getDialogTitle = (text: string) => this.getChild('.mat-dialog-title', { hasText: text }); + getBreadcrumb = (text: string) => this.getChild('[data-automation-id="current-folder"]', { hasText: text }); + getFolderIcon = this.getChild('mat-icon[role="img"]', { hasText: "folder" }); - constructor(page: Page) { - super(page, ContentNodeSelectorDialog.rootElement); - } async selectLocation(location: string): Promise { await this.locationDropDown.click(); diff --git a/projects/aca-playwright-shared/src/page-objects/components/dialogs/create-from-template-dialog-component.ts b/projects/aca-playwright-shared/src/page-objects/components/dialogs/create-from-template-dialog-component.ts new file mode 100644 index 0000000000..f92df80493 --- /dev/null +++ b/projects/aca-playwright-shared/src/page-objects/components/dialogs/create-from-template-dialog-component.ts @@ -0,0 +1,57 @@ +/*! + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Alfresco Example Content Application + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { Locator, Page } from '@playwright/test'; +import { BaseComponent } from '../base.component'; +import { timeouts } from '../../../utils'; + +export class CreateFromTemplateDialogComponent extends BaseComponent { + private static rootElement = 'ng-component'; + + constructor(page: Page) { + super(page, CreateFromTemplateDialogComponent.rootElement); + } + + cancelButton = this.getChild('[data-automation-id="cancel-folder-template-button"]'); + createButton = this.getChild('[data-automation-id="create-folder-template-button"]'); + getDialogTitle = (text: string) => this.getChild('.mat-dialog-title', { hasText: text }); + getDialogLabel = (text: string) => this.getChild('label', { hasText: text }); + getErrorByText = (text: string): Locator => this.page.locator('mat-error', {hasText: text}); + + + async isErrorMessageDisplayed(errorText: string): Promise { + await this.getErrorByText(errorText).waitFor({ state: 'visible', timeout: timeouts.large }); + return await this.getErrorByText(errorText).isVisible(); + } + + /** + * This method is used when we want to fill in Create new folder from template dialog and choose Create button + */ + async createNewFolderFromTemplate( nameInput: string, titleInput?: string, descriptionInput?: string): Promise { + await this.getDialogLabel('Name *').fill(nameInput); + if (titleInput) { await this.getDialogLabel('Title').fill(titleInput); } + if (descriptionInput) { await this.getDialogLabel('Description').fill(descriptionInput); } + await this.createButton.click(); + } +} diff --git a/projects/aca-playwright-shared/src/page-objects/components/dialogs/index.ts b/projects/aca-playwright-shared/src/page-objects/components/dialogs/index.ts index 93e39fa9fe..c1504a172b 100644 --- a/projects/aca-playwright-shared/src/page-objects/components/dialogs/index.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/dialogs/index.ts @@ -27,3 +27,4 @@ export * from './adf-library-dialog.component'; export * from './password-overlay-dialog.component'; export * from './viewer-overlay-dialog.component'; export * from './content-node-selector-dialog'; +export * from './create-from-template-dialog-component'; diff --git a/projects/aca-playwright-shared/src/page-objects/components/index.ts b/projects/aca-playwright-shared/src/page-objects/components/index.ts index 567c0403f3..3083c6a25c 100644 --- a/projects/aca-playwright-shared/src/page-objects/components/index.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/index.ts @@ -37,3 +37,4 @@ export * from './search/search-input.component'; export * from './search/search-overlay.components'; export * from './breadcrumb/breadcrumb.component'; export * from './sidenav.component'; +export * from './aca-header.component'; diff --git a/projects/aca-playwright-shared/src/page-objects/pages/my-libraries.page.ts b/projects/aca-playwright-shared/src/page-objects/pages/my-libraries.page.ts index b051482080..8fe5e44ba7 100644 --- a/projects/aca-playwright-shared/src/page-objects/pages/my-libraries.page.ts +++ b/projects/aca-playwright-shared/src/page-objects/pages/my-libraries.page.ts @@ -24,8 +24,8 @@ import { Page } from '@playwright/test'; import { BasePage } from './base.page'; -import { AcaHeader } from '../components/aca-header.component'; import { + AcaHeader, AdfInfoDrawerComponent, AdfLibraryDialogComponent, DataTableComponent, @@ -34,7 +34,8 @@ import { ViewerOverlayDialogComponent, ContentNodeSelectorDialog, Breadcrumb, - SidenavComponent + SidenavComponent, + CreateFromTemplateDialogComponent } from '../components'; export class MyLibrariesPage extends BasePage { @@ -53,6 +54,8 @@ export class MyLibrariesPage extends BasePage { public copyMoveDialog = new ContentNodeSelectorDialog(this.page); public breadcrumb = new Breadcrumb(this.page); public sidenav = new SidenavComponent(this.page); + public contentNodeSelector = new ContentNodeSelectorDialog(this.page); + public createFromTemplateDialogComponent = new CreateFromTemplateDialogComponent(this.page); async selectCreateLibrary(): Promise { await this.acaHeader.createButton.click(); diff --git a/projects/aca-playwright-shared/src/page-objects/pages/personal-files.page.ts b/projects/aca-playwright-shared/src/page-objects/pages/personal-files.page.ts index 9bae8882ba..4baaef79a7 100644 --- a/projects/aca-playwright-shared/src/page-objects/pages/personal-files.page.ts +++ b/projects/aca-playwright-shared/src/page-objects/pages/personal-files.page.ts @@ -24,9 +24,19 @@ import { Page } from '@playwright/test'; import { BasePage } from './base.page'; -import { Breadcrumb, DataTableComponent, MatMenuComponent, ViewerComponent, SidenavComponent } from '../components'; -import { AcaHeader } from '../components/aca-header.component'; -import { AdfFolderDialogComponent, PasswordOverlayDialogComponent, ViewerOverlayDialogComponent } from '../components/dialogs'; +import { + AcaHeader, + AdfFolderDialogComponent, + ContentNodeSelectorDialog, + CreateFromTemplateDialogComponent, + PasswordOverlayDialogComponent, + ViewerOverlayDialogComponent, + Breadcrumb, + DataTableComponent, + MatMenuComponent, + ViewerComponent, + SidenavComponent +} from '../components'; export class PersonalFilesPage extends BasePage { private static pageUrl = 'personal-files'; @@ -38,12 +48,14 @@ export class PersonalFilesPage extends BasePage { public acaHeader = new AcaHeader(this.page); public matMenu = new MatMenuComponent(this.page); public folderDialog = new AdfFolderDialogComponent(this.page); + public contentNodeSelector = new ContentNodeSelectorDialog(this.page); public dataTable = new DataTableComponent(this.page); public viewer = new ViewerComponent(this.page); public passwordDialog = new PasswordOverlayDialogComponent(this.page); public viewerDialog = new ViewerOverlayDialogComponent(this.page); public breadcrumb = new Breadcrumb(this.page); public sidenav = new SidenavComponent(this.page); + public createFromTemplateDialogComponent = new CreateFromTemplateDialogComponent(this.page); async selectCreateFolder(): Promise { await this.acaHeader.createButton.click(); diff --git a/projects/aca-playwright-shared/src/utils/error-strings.ts b/projects/aca-playwright-shared/src/utils/error-strings.ts new file mode 100644 index 0000000000..47b247762e --- /dev/null +++ b/projects/aca-playwright-shared/src/utils/error-strings.ts @@ -0,0 +1,36 @@ +/*! + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Alfresco Example Content Application + * + * 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 + * from Hyland Software. If not, see . + */ + +export const errorStrings = { + + errorMessageNotPresent: 'Error message is not displayed', + nameIsRequiredError: 'Name is required', + nameWithSpecialCharactersError: `Name can't contain these characters * " < > \\ / ? : |`, + nameEndWithDotError: `Name can't end with a period .`, + nameContainOnlySpacesError: `Name can't contain only spaces`, + titleLengthLimitError: 'Use 256 characters or less for title', + descriptionLengthLimitError: 'Use 512 characters or less for description', + nameAlreadyUsedError: 'This name is already in use, try a different name.' + +} diff --git a/projects/aca-playwright-shared/src/utils/index.ts b/projects/aca-playwright-shared/src/utils/index.ts index 0178ddfe69..9cfead78e9 100644 --- a/projects/aca-playwright-shared/src/utils/index.ts +++ b/projects/aca-playwright-shared/src/utils/index.ts @@ -30,3 +30,4 @@ export * from './folder-errors'; export * from './utils'; export * from './library-errors'; export * from './config'; +export * from './error-strings'; diff --git a/projects/aca-playwright-shared/src/utils/utils.ts b/projects/aca-playwright-shared/src/utils/utils.ts index c23779b4c5..d11ba3ed3f 100644 --- a/projects/aca-playwright-shared/src/utils/utils.ts +++ b/projects/aca-playwright-shared/src/utils/utils.ts @@ -25,6 +25,10 @@ const crypto = require('crypto'); export class Utils { + + static string257Long = 'x'.repeat(257); + static string513Long = 'x'.repeat(513); + static random(): string { return crypto.getRandomValues(new Uint32Array(1))[0].toString(36).substring(0, 5).toLowerCase(); }