diff --git a/.gitignore b/.gitignore index 8b111b7fa..5760f05cf 100644 --- a/.gitignore +++ b/.gitignore @@ -54,4 +54,7 @@ apps/consolidator/src/assets/config/instanceFavicon.ico apps/linker/src/assets/config/instanceConfig.json apps/linker/src/assets/config/instanceFavicon.ico +#e2e dist files +apps/admin-gui-e2e/dist + .angular diff --git a/angular.json b/angular.json index d021ca2c4..be73f7ccc 100644 --- a/angular.json +++ b/angular.json @@ -2,6 +2,7 @@ "version": 1, "projects": { "admin-gui": { + "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "schematics": { "@nrwl/angular:component": { @@ -122,7 +123,7 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "apps/admin-gui/jest.config.js", + "jestConfig": "apps/admin-gui/jest.config.ts", "passWithNoTests": true }, "outputs": ["coverage/apps/admin-gui"] @@ -131,6 +132,7 @@ "tags": [] }, "admin-gui-e2e": { + "$schema": "../../node_modules/nx/schemas/project-schema.json", "root": "apps/admin-gui-e2e", "sourceRoot": "apps/admin-gui-e2e/src", "projectType": "application", @@ -138,9 +140,10 @@ "e2e": { "builder": "@nrwl/cypress:cypress", "options": { - "cypressConfig": "apps/admin-gui-e2e/cypress.json", + "cypressConfig": "apps/admin-gui-e2e/cypress.config.ts", "tsConfig": "apps/admin-gui-e2e/tsconfig.e2e.json", - "devServerTarget": "admin-gui:serve" + "devServerTarget": "admin-gui:serve", + "testingType": "e2e" }, "configurations": { "production": { @@ -160,6 +163,7 @@ "implicitDependencies": ["admin-gui"] }, "config": { + "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "root": "libs/config", "sourceRoot": "libs/config/src", @@ -175,7 +179,7 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "libs/config/jest.config.js", + "jestConfig": "libs/config/jest.config.ts", "passWithNoTests": true }, "outputs": ["coverage/libs/config"] @@ -189,6 +193,7 @@ "tags": [] }, "config-table-config": { + "$schema": "../../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "root": "libs/config/table-config", "sourceRoot": "libs/config/table-config/src", @@ -207,7 +212,7 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "libs/config/table-config/jest.config.js", + "jestConfig": "libs/config/table-config/jest.config.ts", "passWithNoTests": true }, "outputs": ["coverage/libs/config/table-config"] @@ -221,122 +226,7 @@ "tags": [] }, "consolidator": { - "projectType": "application", - "root": "apps/consolidator", - "sourceRoot": "apps/consolidator/src", - "prefix": "perun-web-apps", - "architect": { - "build": { - "builder": "@angular-devkit/build-angular:browser", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/apps/consolidator", - "index": "apps/consolidator/src/index.html", - "main": "apps/consolidator/src/main.ts", - "polyfills": "apps/consolidator/src/polyfills.ts", - "tsConfig": "apps/consolidator/tsconfig.app.json", - "inlineStyleLanguage": "scss", - "assets": ["apps/consolidator/src/favicon.ico", "apps/consolidator/src/assets"], - "styles": ["apps/consolidator/src/styles.scss"], - "scripts": [] - }, - "configurations": { - "production": { - "budgets": [ - { - "type": "initial", - "maximumWarning": "500kb", - "maximumError": "1mb" - }, - { - "type": "anyComponentStyle", - "maximumWarning": "2kb", - "maximumError": "4kb" - } - ], - "fileReplacements": [ - { - "replace": "apps/consolidator/src/environments/environment.ts", - "with": "apps/consolidator/src/environments/environment.prod.ts" - } - ], - "outputHashing": "all" - }, - "development": { - "buildOptimizer": false, - "optimization": false, - "vendorChunk": true, - "extractLicenses": false, - "sourceMap": true, - "namedChunks": true - } - }, - "defaultConfiguration": "production" - }, - "serve": { - "builder": "@angular-devkit/build-angular:dev-server", - "configurations": { - "production": { - "browserTarget": "consolidator:build:production" - }, - "development": { - "browserTarget": "consolidator:build:development" - } - }, - "defaultConfiguration": "development" - }, - "extract-i18n": { - "builder": "@angular-devkit/build-angular:extract-i18n", - "options": { - "browserTarget": "consolidator:build" - } - }, - "lint": { - "builder": "@nrwl/linter:eslint", - "options": { - "lintFilePatterns": ["apps/consolidator/src/**/*.ts", "apps/consolidator/src/**/*.html"] - } - }, - "test": { - "builder": "@nrwl/jest:jest", - "outputs": ["coverage/apps/consolidator"], - "options": { - "jestConfig": "apps/consolidator/jest.config.js", - "passWithNoTests": true - } - } - }, - "tags": [] - }, - "consolidator-e2e": { - "root": "apps/consolidator-e2e", - "sourceRoot": "apps/consolidator-e2e/src", - "projectType": "application", - "architect": { - "e2e": { - "builder": "@nrwl/cypress:cypress", - "options": { - "cypressConfig": "apps/consolidator-e2e/cypress.json", - "devServerTarget": "consolidator:serve:development" - }, - "configurations": { - "production": { - "devServerTarget": "consolidator:serve:production" - } - } - }, - "lint": { - "builder": "@nrwl/linter:eslint", - "outputs": ["{options.outputFile}"], - "options": { - "lintFilePatterns": ["apps/consolidator-e2e/**/*.{js,ts}"] - } - } - }, - "tags": [], - "implicitDependencies": ["consolidator"] - }, - "consolidator": { + "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "schematics": { "@nrwl/angular:component": { @@ -357,10 +247,7 @@ "polyfills": "apps/consolidator/src/polyfills.ts", "tsConfig": "apps/consolidator/tsconfig.app.json", "aot": true, - "assets": [ - "apps/consolidator/src/favicon.ico", - "apps/consolidator/src/assets" - ], + "assets": ["apps/consolidator/src/favicon.ico", "apps/consolidator/src/assets"], "styles": [ "apps/consolidator/src/styles.scss", "./node_modules/bootstrap/dist/css/bootstrap.css" @@ -449,23 +336,21 @@ "lint": { "builder": "@nrwl/linter:eslint", "options": { - "lintFilePatterns": [ - "apps/consolidator/src/**/*.ts", - "apps/consolidator/src/**/*.html" - ] + "lintFilePatterns": ["apps/consolidator/src/**/*.ts", "apps/consolidator/src/**/*.html"] } }, "test": { "builder": "@nrwl/jest:jest", "outputs": ["coverage/apps/consolidator"], "options": { - "jestConfig": "apps/consolidator/jest.config.js", + "jestConfig": "apps/consolidator/jest.config.ts", "passWithNoTests": true } } } }, "consolidator-e2e": { + "$schema": "../../node_modules/nx/schemas/project-schema.json", "root": "apps/consolidator-e2e", "sourceRoot": "apps/consolidator-e2e/src", "projectType": "application", @@ -473,9 +358,10 @@ "e2e": { "builder": "@nrwl/cypress:cypress", "options": { - "cypressConfig": "apps/consolidator-e2e/cypress.json", + "cypressConfig": "apps/consolidator-e2e/cypress.config.ts", "tsConfig": "apps/consolidator-e2e/tsconfig.e2e.json", - "devServerTarget": "consolidator:serve:development" + "devServerTarget": "consolidator:serve:development", + "testingType": "e2e" }, "configurations": { "production": { @@ -492,6 +378,7 @@ } }, "general": { + "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "root": "libs/general", "sourceRoot": "libs/general/src", @@ -507,7 +394,7 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "libs/general/jest.config.js", + "jestConfig": "libs/general/jest.config.ts", "passWithNoTests": true }, "outputs": ["coverage/libs/general"] @@ -520,123 +407,8 @@ }, "tags": [] }, - "linker": { - "projectType": "application", - "root": "apps/linker", - "sourceRoot": "apps/linker/src", - "prefix": "perun-web-apps", - "architect": { - "build": { - "builder": "@angular-devkit/build-angular:browser", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/apps/linker", - "index": "apps/linker/src/index.html", - "main": "apps/linker/src/main.ts", - "polyfills": "apps/linker/src/polyfills.ts", - "tsConfig": "apps/linker/tsconfig.app.json", - "inlineStyleLanguage": "scss", - "assets": ["apps/linker/src/favicon.ico", "apps/linker/src/assets"], - "styles": ["apps/linker/src/styles.scss"], - "scripts": [] - }, - "configurations": { - "production": { - "budgets": [ - { - "type": "initial", - "maximumWarning": "500kb", - "maximumError": "1mb" - }, - { - "type": "anyComponentStyle", - "maximumWarning": "2kb", - "maximumError": "4kb" - } - ], - "fileReplacements": [ - { - "replace": "apps/linker/src/environments/environment.ts", - "with": "apps/linker/src/environments/environment.prod.ts" - } - ], - "outputHashing": "all" - }, - "development": { - "buildOptimizer": false, - "optimization": false, - "vendorChunk": true, - "extractLicenses": false, - "sourceMap": true, - "namedChunks": true - } - }, - "defaultConfiguration": "production" - }, - "serve": { - "builder": "@angular-devkit/build-angular:dev-server", - "configurations": { - "production": { - "browserTarget": "linker:build:production" - }, - "development": { - "browserTarget": "linker:build:development" - } - }, - "defaultConfiguration": "development" - }, - "extract-i18n": { - "builder": "@angular-devkit/build-angular:extract-i18n", - "options": { - "browserTarget": "linker:build" - } - }, - "lint": { - "builder": "@nrwl/linter:eslint", - "options": { - "lintFilePatterns": ["apps/linker/src/**/*.ts", "apps/linker/src/**/*.html"] - } - }, - "test": { - "builder": "@nrwl/jest:jest", - "outputs": ["coverage/apps/linker"], - "options": { - "jestConfig": "apps/linker/jest.config.js", - "passWithNoTests": true - } - } - }, - "tags": [] - }, - "linker-e2e": { - "root": "apps/linker-e2e", - "sourceRoot": "apps/linker-e2e/src", - "projectType": "application", - "architect": { - "e2e": { - "builder": "@nrwl/cypress:cypress", - "options": { - "cypressConfig": "apps/linker-e2e/cypress.json", - "devServerTarget": "linker:serve:development" - }, - "configurations": { - "production": { - "devServerTarget": "linker:serve:production" - } - } - }, - "lint": { - "builder": "@nrwl/linter:eslint", - "outputs": ["{options.outputFile}"], - "options": { - "lintFilePatterns": ["apps/linker-e2e/**/*.{js,ts}"] - } - } - }, - "tags": [], - "implicitDependencies": ["linker"] - }, "lib-linker": { + "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "root": "libs/lib-linker", "sourceRoot": "libs/lib-linker/src", @@ -646,22 +418,20 @@ "builder": "@nrwl/jest:jest", "outputs": ["coverage/libs/lib-linker"], "options": { - "jestConfig": "libs/lib-linker/jest.config.js", + "jestConfig": "libs/lib-linker/jest.config.ts", "passWithNoTests": true } }, "lint": { "builder": "@nrwl/linter:eslint", "options": { - "lintFilePatterns": [ - "libs/lib-linker/src/**/*.ts", - "libs/lib-linker/src/**/*.html" - ] + "lintFilePatterns": ["libs/lib-linker/src/**/*.ts", "libs/lib-linker/src/**/*.html"] } } } }, "linker": { + "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "root": "apps/linker", "sourceRoot": "apps/linker/src", @@ -764,23 +534,21 @@ "lint": { "builder": "@nrwl/linter:eslint", "options": { - "lintFilePatterns": [ - "apps/linker/src/**/*.ts", - "apps/linker/src/**/*.html" - ] + "lintFilePatterns": ["apps/linker/src/**/*.ts", "apps/linker/src/**/*.html"] } }, "test": { "builder": "@nrwl/jest:jest", "outputs": ["coverage/apps/linker"], "options": { - "jestConfig": "apps/linker/jest.config.js", + "jestConfig": "apps/linker/jest.config.ts", "passWithNoTests": true } } } }, "linker-e2e": { + "$schema": "../../node_modules/nx/schemas/project-schema.json", "root": "apps/linker-e2e", "sourceRoot": "apps/linker-e2e/src", "projectType": "application", @@ -788,9 +556,10 @@ "e2e": { "builder": "@nrwl/cypress:cypress", "options": { - "cypressConfig": "apps/linker-e2e/cypress.json", + "cypressConfig": "apps/linker-e2e/cypress.config.ts", "tsConfig": "apps/linker-e2e/tsconfig.e2e.json", - "devServerTarget": "linker:serve:development" + "devServerTarget": "linker:serve:development", + "testingType": "e2e" }, "configurations": { "production": { @@ -807,6 +576,7 @@ } }, "password-reset": { + "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "schematics": { "@schematics/angular:component": { @@ -925,7 +695,7 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "apps/password-reset/jest.config.js", + "jestConfig": "apps/password-reset/jest.config.ts", "passWithNoTests": true }, "outputs": ["coverage/apps/password-reset"] @@ -934,6 +704,7 @@ "tags": [] }, "password-reset-e2e": { + "$schema": "../../node_modules/nx/schemas/project-schema.json", "root": "apps/password-reset-e2e", "sourceRoot": "apps/password-reset-e2e/src", "projectType": "application", @@ -941,9 +712,10 @@ "e2e": { "builder": "@nrwl/cypress:cypress", "options": { - "cypressConfig": "apps/password-reset-e2e/cypress.json", + "cypressConfig": "apps/password-reset-e2e/cypress.config.ts", "tsConfig": "apps/password-reset-e2e/tsconfig.e2e.json", - "devServerTarget": "password-reset:serve" + "devServerTarget": "password-reset:serve", + "testingType": "e2e" }, "configurations": { "production": { @@ -963,6 +735,7 @@ "implicitDependencies": ["password-reset"] }, "perun-animations": { + "$schema": "../../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "root": "libs/perun/animations", "sourceRoot": "libs/perun/animations/src", @@ -981,7 +754,7 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "libs/perun/animations/jest.config.js", + "jestConfig": "libs/perun/animations/jest.config.ts", "passWithNoTests": true }, "outputs": ["coverage/libs/perun/animations"] @@ -995,6 +768,7 @@ "tags": [] }, "perun-components": { + "$schema": "../../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "root": "libs/perun/components", "sourceRoot": "libs/perun/components/src", @@ -1013,19 +787,19 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "libs/perun/components/jest.config.js", + "jestConfig": "libs/perun/components/jest.config.ts", "passWithNoTests": true }, "outputs": ["coverage/libs/perun/components"] } }, "schematics": { - "@nrwl/angular:component": { - } + "@nrwl/angular:component": {} }, "tags": [] }, "perun-dialogs": { + "$schema": "../../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "root": "libs/perun/dialogs", "sourceRoot": "libs/perun/dialogs/src", @@ -1044,7 +818,7 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "libs/perun/dialogs/jest.config.js", + "jestConfig": "libs/perun/dialogs/jest.config.ts", "passWithNoTests": true }, "outputs": ["coverage/libs/perun/dialogs"] @@ -1058,6 +832,7 @@ "tags": [] }, "perun-directives": { + "$schema": "../../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "root": "libs/perun/directives", "sourceRoot": "libs/perun/directives/src", @@ -1076,7 +851,7 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "libs/perun/directives/jest.config.js", + "jestConfig": "libs/perun/directives/jest.config.ts", "passWithNoTests": true }, "outputs": ["coverage/libs/perun/directives"] @@ -1090,6 +865,7 @@ "tags": [] }, "perun-facility-services-config": { + "$schema": "../../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "root": "libs/perun/facility-services-config", "sourceRoot": "libs/perun/facility-services-config/src", @@ -1108,7 +884,7 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "libs/perun/facility-services-config/jest.config.js", + "jestConfig": "libs/perun/facility-services-config/jest.config.ts", "passWithNoTests": true }, "outputs": ["coverage/libs/perun/facility-services-config"] @@ -1122,6 +898,7 @@ "tags": [] }, "perun-login": { + "$schema": "../../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "root": "libs/perun/login", "sourceRoot": "libs/perun/login/src", @@ -1137,7 +914,7 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "libs/perun/login/jest.config.js", + "jestConfig": "libs/perun/login/jest.config.ts", "passWithNoTests": true }, "outputs": ["coverage/libs/perun/login"] @@ -1151,6 +928,7 @@ "tags": [] }, "perun-models": { + "$schema": "../../../node_modules/nx/schemas/project-schema.json", "root": "libs/perun/models", "sourceRoot": "libs/perun/models/src", "projectType": "library", @@ -1166,7 +944,7 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "libs/perun/models/jest.config.js", + "jestConfig": "libs/perun/models/jest.config.ts", "passWithNoTests": true }, "outputs": ["coverage/libs/perun/models"] @@ -1175,6 +953,7 @@ "tags": [] }, "perun-namespace-password-form": { + "$schema": "../../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "root": "libs/perun/namespace-password-form", "sourceRoot": "libs/perun/namespace-password-form/src", @@ -1184,7 +963,7 @@ "builder": "@nrwl/jest:jest", "outputs": ["coverage/libs/perun/namespace-password-form"], "options": { - "jestConfig": "libs/perun/namespace-password-form/jest.config.js", + "jestConfig": "libs/perun/namespace-password-form/jest.config.ts", "passWithNoTests": true } }, @@ -1202,6 +981,7 @@ "tags": [] }, "perun-openapi": { + "$schema": "../../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "root": "libs/perun/openapi", "sourceRoot": "libs/perun/openapi/src", @@ -1220,7 +1000,7 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "libs/perun/openapi/jest.config.js", + "jestConfig": "libs/perun/openapi/jest.config.ts", "passWithNoTests": true }, "outputs": ["coverage/libs/perun/openapi"] @@ -1230,6 +1010,7 @@ "tags": [] }, "perun-pipes": { + "$schema": "../../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "root": "libs/perun/pipes", "sourceRoot": "libs/perun/pipes/src", @@ -1245,7 +1026,7 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "libs/perun/pipes/jest.config.js", + "jestConfig": "libs/perun/pipes/jest.config.ts", "passWithNoTests": true }, "outputs": ["coverage/libs/perun/pipes"] @@ -1259,6 +1040,7 @@ "tags": [] }, "perun-services": { + "$schema": "../../../node_modules/nx/schemas/project-schema.json", "root": "libs/perun/services", "sourceRoot": "libs/perun/services/src", "projectType": "library", @@ -1277,7 +1059,7 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "libs/perun/services/jest.config.js", + "jestConfig": "libs/perun/services/jest.config.ts", "passWithNoTests": true }, "outputs": ["coverage/libs/perun/services"] @@ -1286,6 +1068,7 @@ "tags": [] }, "perun-session-expiration": { + "$schema": "../../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "root": "libs/perun/session-expiration", "sourceRoot": "libs/perun/session-expiration/src", @@ -1304,7 +1087,7 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "libs/perun/session-expiration/jest.config.js", + "jestConfig": "libs/perun/session-expiration/jest.config.ts", "passWithNoTests": true }, "outputs": ["coverage/libs/perun/session-expiration"] @@ -1318,6 +1101,7 @@ "tags": [] }, "perun-tokens": { + "$schema": "../../../node_modules/nx/schemas/project-schema.json", "root": "libs/perun/tokens", "sourceRoot": "libs/perun/tokens/src", "projectType": "library", @@ -1333,7 +1117,7 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "libs/perun/tokens/jest.config.js", + "jestConfig": "libs/perun/tokens/jest.config.ts", "passWithNoTests": true }, "outputs": ["coverage/libs/perun/tokens"] @@ -1342,6 +1126,7 @@ "tags": [] }, "perun-urns": { + "$schema": "../../../node_modules/nx/schemas/project-schema.json", "root": "libs/perun/urns", "sourceRoot": "libs/perun/urns/src", "projectType": "library", @@ -1357,7 +1142,7 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "libs/perun/urns/jest.config.js", + "jestConfig": "libs/perun/urns/jest.config.ts", "passWithNoTests": true }, "outputs": ["coverage/libs/perun/urns"] @@ -1366,6 +1151,7 @@ "tags": [] }, "perun-utils": { + "$schema": "../../../node_modules/nx/schemas/project-schema.json", "root": "libs/perun/utils", "sourceRoot": "libs/perun/utils/src", "projectType": "library", @@ -1381,7 +1167,7 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "libs/perun/utils/jest.config.js", + "jestConfig": "libs/perun/utils/jest.config.ts", "passWithNoTests": true }, "outputs": ["coverage/libs/perun/utils"] @@ -1390,6 +1176,7 @@ "tags": [] }, "publications": { + "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "schematics": { "@schematics/angular:component": { @@ -1527,7 +1314,7 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "apps/publications/jest.config.js", + "jestConfig": "apps/publications/jest.config.ts", "passWithNoTests": true }, "outputs": ["coverage/apps/publications"] @@ -1536,6 +1323,7 @@ "tags": [] }, "publications-e2e": { + "$schema": "../../node_modules/nx/schemas/project-schema.json", "root": "apps/publications-e2e", "sourceRoot": "apps/publications-e2e/src", "projectType": "application", @@ -1543,9 +1331,10 @@ "e2e": { "builder": "@nrwl/cypress:cypress", "options": { - "cypressConfig": "apps/publications-e2e/cypress.json", + "cypressConfig": "apps/publications-e2e/cypress.config.ts", "tsConfig": "apps/publications-e2e/tsconfig.e2e.json", - "devServerTarget": "publications:serve" + "devServerTarget": "publications:serve", + "testingType": "e2e" }, "configurations": { "production": { @@ -1565,6 +1354,7 @@ "implicitDependencies": ["publications"] }, "ui": { + "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "root": "libs/ui", "sourceRoot": "libs/ui/src", @@ -1580,7 +1370,7 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "libs/ui/jest.config.js", + "jestConfig": "libs/ui/jest.config.ts", "passWithNoTests": true }, "outputs": ["coverage/libs/ui"] @@ -1594,6 +1384,7 @@ "tags": [] }, "ui-alerts": { + "$schema": "../../../node_modules/nx/schemas/project-schema.json", "root": "libs/ui/alerts", "sourceRoot": "libs/ui/alerts/src", "projectType": "library", @@ -1609,7 +1400,7 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "libs/ui/alerts/jest.config.js", + "jestConfig": "libs/ui/alerts/jest.config.ts", "passWithNoTests": true }, "outputs": ["coverage/libs/ui/alerts"] @@ -1618,6 +1409,7 @@ "tags": [] }, "ui-material": { + "$schema": "../../../node_modules/nx/schemas/project-schema.json", "projectType": "library", "root": "libs/ui/material", "sourceRoot": "libs/ui/material/src", @@ -1633,7 +1425,7 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "libs/ui/material/jest.config.js", + "jestConfig": "libs/ui/material/jest.config.ts", "passWithNoTests": true }, "outputs": ["coverage/libs/ui/material"] @@ -1647,6 +1439,7 @@ "tags": [] }, "user-profile": { + "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", "schematics": { "@nrwl/angular:component": { @@ -1763,7 +1556,7 @@ "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "apps/user-profile/jest.config.js" + "jestConfig": "apps/user-profile/jest.config.ts" }, "outputs": ["coverage/apps/user-profile"] } @@ -1771,6 +1564,7 @@ "tags": [] }, "user-profile-e2e": { + "$schema": "../../node_modules/nx/schemas/project-schema.json", "root": "apps/user-profile-e2e", "sourceRoot": "apps/user-profile-e2e/src", "projectType": "application", @@ -1778,9 +1572,10 @@ "e2e": { "builder": "@nrwl/cypress:cypress", "options": { - "cypressConfig": "apps/user-profile-e2e/cypress.json", + "cypressConfig": "apps/user-profile-e2e/cypress.config.ts", "tsConfig": "apps/user-profile-e2e/tsconfig.e2e.json", - "devServerTarget": "user-profile:serve" + "devServerTarget": "user-profile:serve", + "testingType": "e2e" }, "configurations": { "production": { diff --git a/apps/admin-gui-e2e/cypress.config.ts b/apps/admin-gui-e2e/cypress.config.ts new file mode 100644 index 000000000..f7c13f457 --- /dev/null +++ b/apps/admin-gui-e2e/cypress.config.ts @@ -0,0 +1,30 @@ +import { defineConfig } from 'cypress'; +import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; + +export default defineConfig({ + e2e: { + ...nxE2EPreset(__dirname), + fileServerFolder: '.', + fixturesFolder: './src/fixtures', + video: true, + videosFolder: '../../dist/cypress/apps/admin-gui-e2e/videos', + screenshotsFolder: '../../dist/cypress/apps/admin-gui-e2e/screenshots', + chromeWebSecurity: false, + baseUrl: 'http://localhost:4200', + env: { + BA_USERNAME: 'perun', + BA_PASSWORD: 'test', + BA_USERNAME_VO_MANAGER: 'voManager', + BA_PASSWORD_VO_MANAGER: 'test', + BA_USERNAME_GROUP_MANAGER: 'groupManager', + BA_PASSWORD_GROUP_MANAGER: 'test', + BA_USERNAME_FACILITY_MANAGER: 'facilityManager', + BA_PASSWORD_FACILITY_MANAGER: 'test', + BA_USERNAME_RESOURCE_MANAGER: 'resourceManager', + BA_PASSWORD_RESOURCE_MANAGER: 'test', + BA_PASSWORD_TOP_GROUP_CREATOR: 'topGroupCreator', + }, + specPattern: 'src/e2e/**/*.cy.{js,jsx,ts,tsx}', + supportFile: false, + }, +}); diff --git a/apps/admin-gui-e2e/cypress.json b/apps/admin-gui-e2e/cypress.json deleted file mode 100644 index 176a4b4d7..000000000 --- a/apps/admin-gui-e2e/cypress.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "fileServerFolder": ".", - "fixturesFolder": "./src/fixtures", - "integrationFolder": "./src/integration", - "pluginsFile": false, - "supportFile": false, - "video": true, - "videosFolder": "../../dist/cypress/apps/admin-gui-e2e/videos", - "screenshotsFolder": "../../dist/cypress/apps/admin-gui-e2e/screenshots", - "chromeWebSecurity": false, - "baseUrl": "http://localhost:4200", - "env": { - "BA_USERNAME": "perun", - "BA_PASSWORD": "test", - "BA_USERNAME_VO_MANAGER": "voManager", - "BA_PASSWORD_VO_MANAGER": "test", - "BA_USERNAME_GROUP_MANAGER": "groupManager", - "BA_PASSWORD_GROUP_MANAGER": "test", - "BA_USERNAME_FACILITY_MANAGER": "facilityManager", - "BA_PASSWORD_FACILITY_MANAGER": "test", - "BA_USERNAME_RESOURCE_MANAGER": "resourceManager", - "BA_PASSWORD_RESOURCE_MANAGER": "test" - } -} diff --git a/apps/admin-gui-e2e/src/integration/facility-management-perun_admin.spec.js b/apps/admin-gui-e2e/src/e2e/facility-management-perun_admin.cy.js similarity index 77% rename from apps/admin-gui-e2e/src/integration/facility-management-perun_admin.spec.js rename to apps/admin-gui-e2e/src/e2e/facility-management-perun_admin.cy.js index 0586122a9..9066d22fd 100644 --- a/apps/admin-gui-e2e/src/integration/facility-management-perun_admin.spec.js +++ b/apps/admin-gui-e2e/src/e2e/facility-management-perun_admin.cy.js @@ -16,17 +16,17 @@ context('Actions', () => { sessionStorage.setItem('basicPassword', Cypress.env('BA_PASSWORD_FACILITY_MANAGER')); cy.visit('service-access'); } - }) + }); beforeEach(() => { // save route for correct authorization localStorage.setItem('routeAuthGuard', '/facilities'); cy.visit('facilities'); - }) + }); it('test create facility', () => { - - cy.intercept('**/facilitiesManager/getFacilities').as('getFacilities') + cy.intercept('**/facilitiesManager/getFacilities') + .as('getFacilities') .get('[data-cy=new-facility-button]') .click() .wait('@getFacilities') @@ -36,18 +36,19 @@ context('Actions', () => { .type('test-e2e-facility-description') .get('[data-cy=create-facility-button]') .click() - .intercept('**/facilitiesManager/getEnrichedFacilities').as('getEnrichedFacilities') + .intercept('**/facilitiesManager/getEnrichedFacilities') + .as('getEnrichedFacilities') .wait('@getEnrichedFacilities') // assert that the facility was created .get('[data-cy=auto-focused-filter]') .type('test-e2e-facility') .get('[data-cy=test-e2e-facility-checkbox]') - .should('exist') + .should('exist'); }); it('test delete facility', () => { - - cy.intercept('**/facilitiesManager/getEnrichedFacilities').as('getEnrichedFacilities') + cy.intercept('**/facilitiesManager/getEnrichedFacilities') + .as('getEnrichedFacilities') .wait('@getEnrichedFacilities') .get(`[data-cy=${dbFacilityName1}-checkbox]`) .click() @@ -57,13 +58,14 @@ context('Actions', () => { .click() .wait('@getEnrichedFacilities') .get(`[data-cy=${dbFacilityName1}-checkbox]`) - .should('not.exist') + .should('not.exist'); }); it('test create resource', () => { - - cy.intercept('**/facilitiesManager/getEnrichedFacilities').as('getEnrichedFacilities') - .intercept('**/vosManager/getAllVos').as('getAllVos') + cy.intercept('**/facilitiesManager/getEnrichedFacilities') + .as('getEnrichedFacilities') + .intercept('**/vosManager/getAllVos') + .as('getAllVos') .wait('@getEnrichedFacilities') .get(`[data-cy=${dbFacilityName2}]`) .click() @@ -81,16 +83,18 @@ context('Actions', () => { .type('test-e2e-resource') .get('[data-cy=create-resource-dialog-button]') .click() - .intercept('**/facilitiesManager/getAssignedRichResources?**').as('getAssignedResources') + .intercept('**/facilitiesManager/getAssignedRichResources?**') + .as('getAssignedResources') .wait('@getAssignedResources') .get('[data-cy=test-e2e-resource-checkbox]') - .should('exist') + .should('exist'); }); it('test delete resource', () => { - - cy.intercept('**/facilitiesManager/getEnrichedFacilities').as('getEnrichedFacilities') - .intercept('**/facilitiesManager/getAssignedRichResources?**').as('getAssignedResources') + cy.intercept('**/facilitiesManager/getEnrichedFacilities') + .as('getEnrichedFacilities') + .intercept('**/facilitiesManager/getAssignedRichResources?**') + .as('getAssignedResources') .wait('@getEnrichedFacilities') .get(`[data-cy=${dbFacilityName2}]`) .click() @@ -105,12 +109,12 @@ context('Actions', () => { .click() .wait('@getAssignedResources') .get(`[data-cy=${dbResourceName}-checkbox]`) - .should('not.exist') + .should('not.exist'); }); it('test add attribute', () => { - - cy.intercept('**/facilitiesManager/getEnrichedFacilities').as('getEnrichedFacilities') + cy.intercept('**/facilitiesManager/getEnrichedFacilities') + .as('getEnrichedFacilities') .wait('@getEnrichedFacilities') .get(`[data-cy=${dbFacilityName2}]`) .click() @@ -124,16 +128,17 @@ context('Actions', () => { .type('einfra') .get('[data-cy=save-selected-attributes]') .click() - .intercept('**/attributesManager/getAttributes/**').as('getAttributes') + .intercept('**/attributesManager/getAttributes/**') + .as('getAttributes') .wait('@getAttributes') // assert that attribute exists .get(`[data-cy=${addedAttribute}-value]`) - .should('exist') + .should('exist'); }); it('test delete attribute', () => { - - cy.intercept('**/facilitiesManager/getEnrichedFacilities').as('getEnrichedFacilities') + cy.intercept('**/facilitiesManager/getEnrichedFacilities') + .as('getEnrichedFacilities') .wait('@getEnrichedFacilities') .get(`[data-cy=${dbFacilityName2}]`) .click() @@ -145,17 +150,19 @@ context('Actions', () => { .click() .get('[data-cy=delete-attributes]') .click() - .intercept('**/attributesManager/getAttributes/**').as('getAttributes') + .intercept('**/attributesManager/getAttributes/**') + .as('getAttributes') .wait('@getAttributes') // assert that attribute exists .get(`[data-cy=${deleteAttribute}-checkbox]`) - .should('not.exist') + .should('not.exist'); }); it('test add facility manager', () => { - - cy.intercept('**/facilitiesManager/getEnrichedFacilities').as('getEnrichedFacilities') - .intercept('**/usersManager/findRichUsersWithAttributes?**').as('findRichUsers') + cy.intercept('**/facilitiesManager/getEnrichedFacilities') + .as('getEnrichedFacilities') + .intercept('**/usersManager/findRichUsersWithAttributes?**') + .as('findRichUsers') .wait('@getEnrichedFacilities') .get(`[data-cy=${dbFacilityName2}]`) .click() @@ -174,16 +181,17 @@ context('Actions', () => { .click() .get('[data-cy=add-manager-button-dialog]') .click() - .intercept('**/authzResolver/getRichAdmins?**').as('getRichAdmins') + .intercept('**/authzResolver/getRichAdmins?**') + .as('getRichAdmins') .wait('@getRichAdmins') // assert that manager was added .get(`[data-cy=${addManagerUser}-checkbox]`) - .should('exist') + .should('exist'); }); it('test remove facility manager', () => { - - cy.intercept('**/facilitiesManager/getEnrichedFacilities').as('getEnrichedFacilities') + cy.intercept('**/facilitiesManager/getEnrichedFacilities') + .as('getEnrichedFacilities') .wait('@getEnrichedFacilities') .get(`[data-cy=${dbFacilityName2}]`) .click() @@ -197,10 +205,11 @@ context('Actions', () => { .click() .get('[data-cy=remove-manager-button-dialog]') .click() - .intercept('**/authzResolver/getRichAdmins?**').as('getRichAdmins') + .intercept('**/authzResolver/getRichAdmins?**') + .as('getRichAdmins') .wait('@getRichAdmins') // assert that manager doesn't exist .get(`[data-cy=${removeManagerUser}-checkbox]`) - .should('not.exist') + .should('not.exist'); }); -}) +}); diff --git a/apps/admin-gui-e2e/src/integration/group-management-perun_admin.spec.js b/apps/admin-gui-e2e/src/e2e/group-management-perun_admin.cy.js similarity index 76% rename from apps/admin-gui-e2e/src/integration/group-management-perun_admin.spec.js rename to apps/admin-gui-e2e/src/e2e/group-management-perun_admin.cy.js index 239950d68..4ab45396b 100644 --- a/apps/admin-gui-e2e/src/integration/group-management-perun_admin.spec.js +++ b/apps/admin-gui-e2e/src/e2e/group-management-perun_admin.cy.js @@ -19,14 +19,12 @@ context('Actions', () => { }); beforeEach(() => { - cy.visit('home') - .get(`[data-cy=${dbGroupName}]`) - .click(); + cy.visit('home').get(`[data-cy=${dbGroupName}]`).click(); }); it('test create subgroup', () => { - - cy.intercept('**/groupsManager/createGroup/**').as('createGroup') + cy.intercept('**/groupsManager/createGroup/**') + .as('createGroup') .get(`[data-cy=subgroups]`) .click() .get('[data-cy=new-subgroup-button]') @@ -35,19 +33,20 @@ context('Actions', () => { .type('test-group') .get('[data-cy=group-description]') .type('test-group-description') - .intercept('**/groupsManager/getAllRichSubGroupsWithAttributesByNames**').as('getRichSubGroups') + .intercept('**/groupsManager/getAllRichSubGroupsWithAttributesByNames**') + .as('getRichSubGroups') .get('[data-cy=create-group-button-dialog]') .click() .wait('@createGroup') .wait('@getRichSubGroups') // assert that group was created .get('[data-cy=test-group-checkbox]') - .should('exist') - }); + .should('exist'); + }); it('test remove subgroup', () => { - - cy.intercept('**/groupsManager/deleteGroups').as('deleteGroups') + cy.intercept('**/groupsManager/deleteGroups') + .as('deleteGroups') .get('[data-cy=subgroups]') .click() .get(`[data-cy=${dbSubGroupName}-checkbox]`) @@ -57,16 +56,17 @@ context('Actions', () => { .get('[data-cy=delete-button-dialog]') .click() .wait('@deleteGroups') - .intercept('**/groupsManager/getAllRichSubGroupsWithAttributesByNames**').as('getRichSubGroups') + .intercept('**/groupsManager/getAllRichSubGroupsWithAttributesByNames**') + .as('getRichSubGroups') .wait('@getRichSubGroups') // assert that group was deleted .get(`[data-cy=${dbSubGroupName}-checkbox]`) - .should('not.exist') + .should('not.exist'); }); it('test add attribute', () => { - - cy.intercept('**/attributesManager/setAttributes/**').as('setAttributes') + cy.intercept('**/attributesManager/setAttributes/**') + .as('setAttributes') .get('[data-cy=attributes]') .click() .get('[data-cy=add-attributes]') @@ -78,35 +78,37 @@ context('Actions', () => { .get('[data-cy=save-selected-attributes]') .click() .wait('@setAttributes') - .intercept('**/attributesManager/getAttributes/g**').as('getAttributes') + .intercept('**/attributesManager/getAttributes/g**') + .as('getAttributes') .wait('@getAttributes') // assert that attribute exists .get(`[data-cy=${addedAttribute}-value]`) - .should('exist') + .should('exist'); }); it('test delete attribute', () => { - - cy.intercept('**/attributesManager/removeAttributes/**').as('removeAttributes') + cy.intercept('**/attributesManager/removeAttributes/**') + .as('removeAttributes') .get('[data-cy=attributes]') .click() .get(`[data-cy=${dbGroupAttribute}-checkbox]`) .click() .get('[data-cy=remove-attributes]') .click() - .intercept('**/attributesManager/getAttributes/g**').as('getAttributes') + .intercept('**/attributesManager/getAttributes/g**') + .as('getAttributes') .get('[data-cy=delete-attributes]') .click() .wait('@removeAttributes') .wait('@getAttributes') // assert that attribute exists .get(`[data-cy=${dbGroupAttribute}-checkbox]`) - .should('not.exist') + .should('not.exist'); }); it('test add group member', () => { - - cy.intercept('**/groupsManager/addMember**').as('addMember') + cy.intercept('**/groupsManager/addMember**') + .as('addMember') .get('[data-cy=members]') .click() .get('[data-cy=add-members]') @@ -118,16 +120,17 @@ context('Actions', () => { .get('[data-cy=add-button]') .click() .wait('@addMember') - .intercept('**/membersManager/getMembersPage').as('getMembers') + .intercept('**/membersManager/getMembersPage') + .as('getMembers') .wait('@getMembers') // assert that member was created .get(`[data-cy=${dbUser}-checkbox]`) - .should('exist') + .should('exist'); }); it('test remove group member', () => { - - cy.intercept('**/groupsManager/removeMember**').as('removeMember') + cy.intercept('**/groupsManager/removeMember**') + .as('removeMember') .get('[data-cy=members]') .click() .get(`[data-cy=${dbGroupManager}-checkbox]`) @@ -137,16 +140,17 @@ context('Actions', () => { .get('[data-cy=remove-members-dialog]') .click() .wait('@removeMember') - .intercept('**/membersManager/getMembersPage').as('getMembers') + .intercept('**/membersManager/getMembersPage') + .as('getMembers') .wait('@getMembers') // assert that member was removed .get(`[data-cy=${dbGroupManager}-checkbox]`) - .should('not.exist') + .should('not.exist'); }); it('test create group application form item', () => { - - cy.intercept('**/registrarManager/updateFormItems/**').as('addFormItem') + cy.intercept('**/registrarManager/updateFormItems/**') + .as('addFormItem') .get('[data-cy=advanced-settings]') .click() .get('[data-cy=application-form]') @@ -159,7 +163,8 @@ context('Actions', () => { .click() .get('[data-cy=edit-form-item-button-dialog]') .click() - .intercept('**/registrarManager/getFormItems/group**').as('getAttributes') + .intercept('**/registrarManager/getFormItems/group**') + .as('getAttributes') .get('[data-cy=save-application-form]') .click() .wait('@getAttributes') @@ -169,18 +174,20 @@ context('Actions', () => { // assert that form item exists .wait('@getAttributes') .get('[data-cy=header-delete]') - .should('exist') - }); + .should('exist'); + }); it('test delete group application form item', () => { - cy.intercept('**/registrarManager/updateFormItems/**').as('deleteFormItem') + cy.intercept('**/registrarManager/updateFormItems/**') + .as('deleteFormItem') .get('[data-cy=advanced-settings]') .click() .get('[data-cy=application-form]') .click() .get(`[data-cy=${dbApplicationItemTextFieldName}-delete]`) .click() - .intercept('**/registrarManager/getFormItems/group**').as('getGroupFormItems') + .intercept('**/registrarManager/getFormItems/group**') + .as('getGroupFormItems') .get('[data-cy=delete-application-form-item-dialog]') .click() .get('[data-cy=save-application-form]') @@ -192,12 +199,12 @@ context('Actions', () => { .wait('@getGroupFormItems') // assert that form item doesn't exist .get(`[data-cy=${dbApplicationItemTextFieldName}-delete]`) - .should('not.exist') + .should('not.exist'); }); it('test add group manager', () => { - - cy.intercept('**/authzResolver/setRole/**').as('setRole') + cy.intercept('**/authzResolver/setRole/**') + .as('setRole') .get('[data-cy=advanced-settings]') .click() .get('[data-cy=managers]') @@ -210,19 +217,20 @@ context('Actions', () => { .click() .get(`[data-cy=${dbUser}-checkbox]`) .click() - .intercept('**/authzResolver/getRichAdmins**').as('getRichAdmins') + .intercept('**/authzResolver/getRichAdmins**') + .as('getRichAdmins') .get('[data-cy=add-manager-button-dialog]') .click() .wait('@setRole') .wait('@getRichAdmins') // assert that manager was added .get(`[data-cy=${dbUser}-checkbox]`) - .should('exist') + .should('exist'); }); it('test remove group manager', () => { - - cy.intercept('**/authzResolver/unsetRole/**').as('unsetRole') + cy.intercept('**/authzResolver/unsetRole/**') + .as('unsetRole') .get('[data-cy=advanced-settings]') .click() .get('[data-cy=managers]') @@ -231,13 +239,14 @@ context('Actions', () => { .click() .get('[data-cy=remove-manager-button]') .click() - .intercept('**/authzResolver/getRichAdmins**').as('getRichAdmins') + .intercept('**/authzResolver/getRichAdmins**') + .as('getRichAdmins') .get('[data-cy=remove-manager-button-dialog]') .click() .wait('@unsetRole') .wait('@getRichAdmins') // assert that manager doesn't exist .get(`[data-cy=${dbGroupManager}-checkbox]`) - .should('not.exist') + .should('not.exist'); }); }); diff --git a/apps/admin-gui-e2e/src/integration/perun-admin-management-perun_admin.spec.js b/apps/admin-gui-e2e/src/e2e/perun-admin-management-perun_admin.cy.js similarity index 79% rename from apps/admin-gui-e2e/src/integration/perun-admin-management-perun_admin.spec.js rename to apps/admin-gui-e2e/src/e2e/perun-admin-management-perun_admin.cy.js index 1fc011ec5..3864b73da 100644 --- a/apps/admin-gui-e2e/src/integration/perun-admin-management-perun_admin.spec.js +++ b/apps/admin-gui-e2e/src/e2e/perun-admin-management-perun_admin.cy.js @@ -17,18 +17,19 @@ context('Actions', () => { sessionStorage.setItem('basicPassword', Cypress.env('BA_PASSWORD')); cy.visit('service-access'); } - }) + }); beforeEach(() => { // save route for correct authorization localStorage.setItem('routeAuthGuard', '/admin'); cy.visit('admin'); - }) + }); it('test create attribute', () => { - - cy.intercept('**/attributesManager/createAttribute**').as('createAttribute') - .intercept('**/attributesManager/getAttributesDefinition**').as('getAttributesDefinition') + cy.intercept('**/attributesManager/createAttribute**') + .as('createAttribute') + .intercept('**/attributesManager/getAttributesDefinition**') + .as('getAttributesDefinition') .get('[data-cy=attribute-definitions]') .click() .get('[data-cy=new-attr-definition-button]') @@ -62,13 +63,14 @@ context('Actions', () => { .get('[data-cy=unfocused-filter]') .type('testAttrE2E') .get('[data-cy=testattre2e-checkbox]') - .should('exist') + .should('exist'); }); it('test delete attribute', () => { - - cy.intercept('**/attributesManager/deleteAttributes**').as('deleteAttributes') - .intercept('**/attributesManager/getAttributesDefinition**').as('getAttributesDefinition') + cy.intercept('**/attributesManager/deleteAttributes**') + .as('deleteAttributes') + .intercept('**/attributesManager/getAttributesDefinition**') + .as('getAttributesDefinition') .get('[data-cy=attribute-definitions]') .click() .get('[data-cy=e2e-test-attr-from-db-checkbox]') @@ -81,13 +83,14 @@ context('Actions', () => { .wait('@getAttributesDefinition') // assert that attribute doesn't exist .get(`[data-cy=e2e-test-attr-from-db-checkbox]`) - .should('not.exist') + .should('not.exist'); }); it('test change users name', () => { - - cy.intercept('**/usersManager/updateUser**').as('updateUser') - .intercept('**/usersManager/getUserById**').as('getUserById') + cy.intercept('**/usersManager/updateUser**') + .as('updateUser') + .intercept('**/usersManager/getUserById**') + .as('getUserById') .get('[data-cy=users]') .click() .get('[data-cy=test5-td]') @@ -96,41 +99,43 @@ context('Actions', () => { .click() .get('[data-cy=user-first-name-input]') .clear() - .type("Test555") + .type('Test555') .get('[data-cy=user-save-button]') .click() .wait('@updateUser') .wait('@getUserById') // assert that the name changed .get('[data-cy=user-name-link]') - .contains('Test555 User14') + .contains('Test555 User14'); }); it('test create service', () => { - - cy.intercept('**/servicesManager/createService**').as('createService') - .intercept('**/servicesManager/getServices**').as('getServices') + cy.intercept('**/servicesManager/createService**') + .as('createService') + .intercept('**/servicesManager/getServices**') + .as('getServices') .get('[data-cy=services]') .click() .get('[data-cy=service-create-button]') .click() .get('[data-cy=service-name-input]') - .type("e2e_test_service") + .type('e2e_test_service') .get('[data-cy=service-description-input]') - .type("testing service") + .type('testing service') .get('[data-cy=service-create-edit-dialog-button]') .click() .wait('@createService') .wait('@getServices') // assert that service exists .get('[data-cy=e2e_test_service-checkbox]') - .should('exist') + .should('exist'); }); it('test delete service', () => { - - cy.intercept('**/servicesManager/deleteService**').as('deleteService') - .intercept('**/servicesManager/getServices**').as('getServices') + cy.intercept('**/servicesManager/deleteService**') + .as('deleteService') + .intercept('**/servicesManager/getServices**') + .as('getServices') .get('[data-cy=services]') .click() .get(`[data-cy=${dbServiceName.toLowerCase()}-checkbox]`) @@ -143,13 +148,14 @@ context('Actions', () => { .wait('@getServices') // assert that service doesn't exist .get(`[data-cy=${dbServiceName.toLowerCase()}-checkbox]`) - .should('not.exist') + .should('not.exist'); }); it('test rename service', () => { - - cy.intercept('**/servicesManager/updateService**').as('updateService') - .intercept('**/servicesManager/getServiceById**').as('getServiceById') + cy.intercept('**/servicesManager/updateService**') + .as('updateService') + .intercept('**/servicesManager/getServiceById**') + .as('getServiceById') .get('[data-cy=services]') .click() .get(`[data-cy=${dbServiceName2.toLowerCase()}-name-td]`) @@ -165,35 +171,28 @@ context('Actions', () => { .wait('@getServiceById') // assert that service is renamed .get(`[data-cy=service-name-link]`) - .contains(dbServiceName2 + 'edit') + .contains(dbServiceName2 + 'edit'); }); it('test list ext sources', () => { - cy.get('[data-cy=external-sources]') .click() .get(`[data-cy=${dbExtSourceName.toLowerCase()}-name-td]`) - .should('exist') + .should('exist'); }); it('test list audit messages', () => { - - cy.get('[data-cy=audit-log]') - .click() - .get(`[data-cy=audit-message-td]`) - .should('exist') + cy.get('[data-cy=audit-log]').click().get(`[data-cy=audit-message-td]`).should('exist'); }); it('test list consent hubs', () => { - cy.get('[data-cy=consent-hubs]') .click() .get(`[data-cy=${dbConsentHubName.toLowerCase()}-name-td]`) - .should('exist') + .should('exist'); }); it('test search attribute', () => { - cy.get('[data-cy=searcher]') .click() .get(`[data-cy=filter-input]`) @@ -206,6 +205,6 @@ context('Actions', () => { .get('[data-cy=searcher-search-button]') .click() .get(`[data-cy=${dbSearcherUserFirstName.toLowerCase()}-firstName-td]`) - .should('exist') + .should('exist'); }); -}) +}); diff --git a/apps/admin-gui-e2e/src/integration/resource-management-perun_admin.spec.js b/apps/admin-gui-e2e/src/e2e/resource-management-perun_admin.cy.js similarity index 81% rename from apps/admin-gui-e2e/src/integration/resource-management-perun_admin.spec.js rename to apps/admin-gui-e2e/src/e2e/resource-management-perun_admin.cy.js index f902a3c1d..3f5b17236 100644 --- a/apps/admin-gui-e2e/src/integration/resource-management-perun_admin.spec.js +++ b/apps/admin-gui-e2e/src/e2e/resource-management-perun_admin.cy.js @@ -29,47 +29,46 @@ context('Actions', () => { .get('[data-cy=resource-list]') .click() .get(`[data-cy=${dbResourceName}]`) - .click() - }) + .click(); + }); it('test add attribute', () => { - cy.get('[data-cy=attributes]') .click() .get('[data-cy=add-attributes]') .click() .get(`[data-cy=${dbAttributeToAdd}-value]`) .type('test') - .intercept('**/attributesManager/getAttributes/r**').as('getAttributes') + .intercept('**/attributesManager/getAttributes/r**') + .as('getAttributes') .get('[data-cy=save-selected-attributes]') .click() .wait('@getAttributes') // check that attribute was added .get(`[data-cy=${dbAttributeToAdd}-value]`) - .should('exist') + .should('exist'); }); it('test delete attribute', () => { - cy.get('[data-cy=attributes]') .click() .get(`[data-cy=${dbAttributeToDelete}-checkbox]`) .click() .get('[data-cy=remove-attributes]') .click() - .intercept('**/attributesManager/getAttributes/r**').as('getAttributes') + .intercept('**/attributesManager/getAttributes/r**') + .as('getAttributes') .get('[data-cy=delete-attributes]') .click() .wait('@getAttributes') // check that attribute was deleted .get(`[data-cy=${dbAttributeToDelete}-checkbox]`) - .should('not.exist') + .should('not.exist'); }); it('test add resource manager', () => { - cy.get('[data-cy=advanced-settings]') .click() .get('[data-cy=managers]') @@ -82,18 +81,18 @@ context('Actions', () => { .click() .get(`[data-cy=${dbAddManager}-checkbox]`) .click() - .intercept('**/authzResolver/getRichAdmins**').as('getRichAdmins') + .intercept('**/authzResolver/getRichAdmins**') + .as('getRichAdmins') .get('[data-cy=add-manager-button-dialog]') .click() .wait('@getRichAdmins') // assert that manager was added .get(`[data-cy=${dbAddManager}-checkbox]`) - .should('exist') + .should('exist'); }); it('test remove resource manager', () => { - cy.get('[data-cy=advanced-settings]') .click() .get('[data-cy=managers]') @@ -102,18 +101,18 @@ context('Actions', () => { .click() .get('[data-cy=remove-manager-button]') .click() - .intercept('**/authzResolver/getRichAdmins**').as('getRichAdmins') + .intercept('**/authzResolver/getRichAdmins**') + .as('getRichAdmins') .get('[data-cy=remove-manager-button-dialog]') .click() .wait('@getRichAdmins') // assert that manager was removed .get(`[data-cy=${dbRemoveManager}-checkbox]`) - .should('not.exist') + .should('not.exist'); }); - it( 'test assign group to resource', () => { - + it('test assign group to resource', () => { cy.get('[data-cy=assigned-groups]') .click() .get('[data-cy=add-group-button]') @@ -122,31 +121,32 @@ context('Actions', () => { .click() .get('[data-cy=next-button]') .click() - .intercept('**/resourcesManager/getGroupAssignments**').as('getGroupAssignments') + .intercept('**/resourcesManager/getGroupAssignments**') + .as('getGroupAssignments') .get('[data-cy=assign-button]') .click() .wait('@getGroupAssignments') - // assert that group was added + // assert that group was added .get(`[data-cy=${dbGroupToAssign}-checkbox]`) - .should('exist') - }) - - it( 'test remove group from resource', () => { + .should('exist'); + }); + it('test remove group from resource', () => { cy.get('[data-cy=assigned-groups]') .click() .get(`[data-cy=${dbGroupToRemove}-checkbox]`) .click() .get('[data-cy=remove-group-button]') .click() - .intercept('**/resourcesManager/getGroupAssignments**').as('getGroupAssignments') + .intercept('**/resourcesManager/getGroupAssignments**') + .as('getGroupAssignments') .get('[data-cy=delete-button]') .click() .wait('@getGroupAssignments') // assert that group was removed .get(`[data-cy=${dbGroupToRemove}-checkbox]`) - .should('not.exist') - }) -}) + .should('not.exist'); + }); +}); diff --git a/apps/admin-gui-e2e/src/e2e/top-group-creator-perun_admin.cy.js b/apps/admin-gui-e2e/src/e2e/top-group-creator-perun_admin.cy.js new file mode 100644 index 000000000..2aba20b52 --- /dev/null +++ b/apps/admin-gui-e2e/src/e2e/top-group-creator-perun_admin.cy.js @@ -0,0 +1,38 @@ +context('Actions', () => { + const dbVoName = 'test-e2e-vo-from-db-4'; + const groupName = 'test'; + + before(() => { + if (Cypress.env('BA_PASSWORD_TOP_GROUP_CREATOR')) { + sessionStorage.setItem('baPrincipal', '{"name": "topGroupCreator"}'); + sessionStorage.setItem('basicUsername', Cypress.env('BA_PASSWORD_TOP_GROUP_CREATOR')); + sessionStorage.setItem('basicPassword', Cypress.env('BA_PASSWORD_TOP_GROUP_CREATOR')); + cy.visit('service-access'); + } + }); + + beforeEach(() => { + cy.visit('organizations') + .get(`[data-cy=${dbVoName}]`) + .click() + .get('[data-cy=groups]') + .click() + }) + + it( 'test create top group', () => { + cy.intercept('**/groupsManager/createGroup/**').as('createGroup') + .get('[data-cy=create-group-button]') + .click() + .get('[data-cy=group-name]') + .type(groupName) + .get('[data-cy=create-group-button-dialog]') + .click() + .wait('@createGroup') + .intercept('**/groupsManager/getAllRichGroupsWithAttributesByNames**').as('getRichGroups') + .wait('@getRichGroups') + // assert that top group was created + .get(`[data-cy=${groupName}-checkbox]`) + .should('exist'); + }); + +}) diff --git a/apps/admin-gui-e2e/src/integration/vo-management-perun_admin.spec.js b/apps/admin-gui-e2e/src/e2e/vo-management-perun_admin.cy.js similarity index 78% rename from apps/admin-gui-e2e/src/integration/vo-management-perun_admin.spec.js rename to apps/admin-gui-e2e/src/e2e/vo-management-perun_admin.cy.js index 372dbf465..895f43882 100644 --- a/apps/admin-gui-e2e/src/integration/vo-management-perun_admin.spec.js +++ b/apps/admin-gui-e2e/src/e2e/vo-management-perun_admin.cy.js @@ -16,16 +16,17 @@ context('Actions', () => { sessionStorage.setItem('basicPassword', Cypress.env('BA_PASSWORD_VO_MANAGER')); cy.visit('service-access'); } - }) + }); beforeEach(() => { cy.visit('organizations'); - }) + }); it('test create vo', () => { - - cy.intercept('**/vosManager/createVo/**').as('createVo') - .intercept('**/vosManager/getEnrichedVoById**').as('getVoById') + cy.intercept('**/vosManager/createVo/**') + .as('createVo') + .intercept('**/vosManager/getEnrichedVoById**') + .as('getVoById') .get('[data-cy=new-vo-button]') .click() .get('[data-cy=vo-name-input]') @@ -40,13 +41,13 @@ context('Actions', () => { .get('[data-cy=vo-name-link]') .contains('test-e2e-vo') .invoke('text') - .then((text) => text === "test-e2e-vo") - .should('exist') + .then((text) => text === 'test-e2e-vo') + .should('exist'); }); it('test add attribute', () => { - - cy.intercept('**/attributesManager/setAttributes/vo').as('setAttributes') + cy.intercept('**/attributesManager/setAttributes/vo') + .as('setAttributes') .get(`[data-cy=${dbVoName}]`) .click() .get('[data-cy=attributes]') @@ -56,19 +57,20 @@ context('Actions', () => { // get attribute Notification default language .get(`[data-cy=${addedAttribute}-value]`) .type('en') - .intercept('**/attributesManager/getAttributes/vo**').as('getAttributes') + .intercept('**/attributesManager/getAttributes/vo**') + .as('getAttributes') .get('[data-cy=save-selected-attributes]') .click() .wait('@setAttributes') .wait('@getAttributes') // assert that attribute exists .get(`[data-cy=${addedAttribute}-value]`) - .should('exist') + .should('exist'); }); it('test delete attribute', () => { - - cy.intercept('**/attributesManager/removeAttributes/**').as('removeAttributes') + cy.intercept('**/attributesManager/removeAttributes/**') + .as('removeAttributes') .get(`[data-cy=${dbVoName}]`) .click() .get('[data-cy=attributes]') @@ -78,19 +80,20 @@ context('Actions', () => { .click() .get('[data-cy=remove-attributes]') .click() - .intercept('**/attributesManager/getAttributes/vo**').as('getAttributes') + .intercept('**/attributesManager/getAttributes/vo**') + .as('getAttributes') .get('[data-cy=delete-attributes]') .click() .wait('@removeAttributes') .wait('@getAttributes') // assert that attribute exists .get('[data-cy=link-to-aup-checkbox]') - .should('not.exist') + .should('not.exist'); }); it('test add vo member', () => { - - cy.intercept('**/membersManager/createMember/u').as('createMember') + cy.intercept('**/membersManager/createMember/u') + .as('createMember') .get(`[data-cy=${dbVoName}]`) .click() .get('[data-cy=members]') @@ -103,17 +106,18 @@ context('Actions', () => { .click() .get('[data-cy=add-button]') .click() - .intercept('**/membersManager/getMembersPage').as('getMembers') + .intercept('**/membersManager/getMembersPage') + .as('getMembers') .wait('@createMember') .wait('@getMembers') // assert that member was created .get(`[data-cy=${dbUser}-checkbox]`) - .should('exist') + .should('exist'); }); it('test remove vo member', () => { - - cy.intercept('**/membersManager/deleteMembers**').as('deleteMembers') + cy.intercept('**/membersManager/deleteMembers**') + .as('deleteMembers') .get(`[data-cy=${dbVoName}]`) .click() .get('[data-cy=members]') @@ -124,17 +128,18 @@ context('Actions', () => { .click() .get('[data-cy=remove-members-dialog]') .click() - .intercept('**/membersManager/getMembersPage').as('getMembers') + .intercept('**/membersManager/getMembersPage') + .as('getMembers') .wait('@deleteMembers') .wait('@getMembers') // assert that member was removed .get(`[data-cy=${dbVoManager}-checkbox]`) - .should('not.exist') + .should('not.exist'); }); it('test add group', () => { - - cy.intercept('**/groupsManager/createGroup/**').as('createGroup') + cy.intercept('**/groupsManager/createGroup/**') + .as('createGroup') .get(`[data-cy=${dbVoName}]`) .click() .get('[data-cy=groups]') @@ -148,16 +153,17 @@ context('Actions', () => { .get('[data-cy=create-group-button-dialog]') .click() .wait('@createGroup') - .intercept('**/groupsManager/getAllRichGroupsWithAttributesByNames**').as('getGroups') + .intercept('**/groupsManager/getAllRichGroupsWithAttributesByNames**') + .as('getGroups') .wait('@getGroups') // assert that group was created .get('[data-cy=test-group-checkbox]') - .should('exist') + .should('exist'); }); it('test remove group', () => { - - cy.intercept('**/groupsManager/deleteGroups').as('deleteGroups') + cy.intercept('**/groupsManager/deleteGroups') + .as('deleteGroups') .get(`[data-cy=${dbVoName}]`) .click() .get('[data-cy=groups]') @@ -169,16 +175,17 @@ context('Actions', () => { .get('[data-cy=delete-button-dialog]') .click() .wait('@deleteGroups') - .intercept('**/groupsManager/getAllRichGroupsWithAttributesByNames**').as('getGroups') + .intercept('**/groupsManager/getAllRichGroupsWithAttributesByNames**') + .as('getGroups') .wait('@getGroups') // assert that group was deleted .get(`[data-cy=${dbGroupName}-checkbox]`) - .should('not.exist') + .should('not.exist'); }); it('test create vo application form item', () => { - - cy.intercept('**/registrarManager/updateFormItems/**').as('addFormItem') + cy.intercept('**/registrarManager/updateFormItems/**') + .as('addFormItem') .get(`[data-cy=${dbVoName}]`) .click() .get('[data-cy=advanced-settings]') @@ -193,7 +200,8 @@ context('Actions', () => { .click() .get('[data-cy=edit-form-item-button-dialog]') .click() - .intercept('**/registrarManager/getFormItems/vo**').as('getFormItems') + .intercept('**/registrarManager/getFormItems/vo**') + .as('getFormItems') .get('[data-cy=save-application-form]') .click() .wait('@addFormItem') @@ -203,13 +211,14 @@ context('Actions', () => { .wait('@getFormItems') // assert that form item exists .get('[data-cy=header-delete]') - .should('exist') + .should('exist'); }); it('test delete vo application form item', () => { - - cy.intercept('**/registrarManager/updateFormItems/**').as('deleteFormItem') - .intercept('**/registrarManager/getFormItems/vo**').as('getFormItems') + cy.intercept('**/registrarManager/updateFormItems/**') + .as('deleteFormItem') + .intercept('**/registrarManager/getFormItems/vo**') + .as('getFormItems') .get(`[data-cy=${dbVoName}]`) .click() .get('[data-cy=advanced-settings]') @@ -228,12 +237,12 @@ context('Actions', () => { .click() // assert that form item doesn't exist .get(`[data-cy=${dbApplicationItemTextFieldName}-delete]`) - .should('not.exist') + .should('not.exist'); }); it('test add vo manager', () => { - - cy.intercept('**/authzResolver/setRole/**').as('setRole') + cy.intercept('**/authzResolver/setRole/**') + .as('setRole') .get(`[data-cy=${dbVoName}]`) .click() .get('[data-cy=advanced-settings]') @@ -250,17 +259,18 @@ context('Actions', () => { .click() .get('[data-cy=add-manager-button-dialog]') .click() - .intercept('**/authzResolver/getRichAdmins**').as('getRichAdmins') + .intercept('**/authzResolver/getRichAdmins**') + .as('getRichAdmins') .wait('@setRole') .wait('@getRichAdmins') // assert that manager was added .get(`[data-cy=${dbUser}-checkbox]`) - .should('exist') + .should('exist'); }); it('test remove vo manager', () => { - - cy.intercept('**/authzResolver/unsetRole/**').as('unsetRole') + cy.intercept('**/authzResolver/unsetRole/**') + .as('unsetRole') .get(`[data-cy=${dbVoName}]`) .click() .get('[data-cy=advanced-settings]') @@ -271,25 +281,26 @@ context('Actions', () => { .click() .get('[data-cy=remove-manager-button]') .click() - .intercept('**/authzResolver/getRichAdmins**').as('getRichAdmins') + .intercept('**/authzResolver/getRichAdmins**') + .as('getRichAdmins') .get('[data-cy=remove-manager-button-dialog]') .click() .wait('@unsetRole') .wait('@getRichAdmins') // assert that manager doesn't exist .get(`[data-cy=${dbVoManager}-checkbox]`) - .should('not.exist') + .should('not.exist'); }); it('test delete vo (perun admin)', () => { - // change role to perun admin sessionStorage.setItem('baPrincipal', '{"name": "perun"}'); sessionStorage.setItem('basicUsername', Cypress.env('BA_USERNAME')); sessionStorage.setItem('basicPassword', Cypress.env('BA_PASSWORD')); cy.reload(); - cy.intercept('**/vosManager/deleteVo**').as('deleteVo') + cy.intercept('**/vosManager/deleteVo**') + .as('deleteVo') .get('[data-cy=auto-focused-filter]') .type(`${dbVoName}`) .get(`[data-cy=${dbVoName}]`) @@ -308,6 +319,6 @@ context('Actions', () => { .get('[data-cy=auto-focused-filter]') .type(`${dbVoName}`) .get(`[data-cy=${dbVoName}]`) - .should('not.exist') + .should('not.exist'); }); -}) +}); diff --git a/apps/admin-gui-e2e/src/support/index.ts b/apps/admin-gui-e2e/src/support/e2e.ts similarity index 100% rename from apps/admin-gui-e2e/src/support/index.ts rename to apps/admin-gui-e2e/src/support/e2e.ts diff --git a/apps/admin-gui-e2e/tsconfig.e2e.json b/apps/admin-gui-e2e/tsconfig.e2e.json index 25a1192c9..a15dd6735 100644 --- a/apps/admin-gui-e2e/tsconfig.e2e.json +++ b/apps/admin-gui-e2e/tsconfig.e2e.json @@ -4,5 +4,5 @@ "sourceMap": false, "outDir": "../../dist/out-tsc" }, - "include": ["src/**/*.ts", "src/**/*.js", "src/plugins/index.js"] + "include": ["src/**/*.ts", "src/**/*.js", "src/plugins/index.js", "cypress.config.ts"] } diff --git a/apps/admin-gui/jest.config.js b/apps/admin-gui/jest.config.ts similarity index 79% rename from apps/admin-gui/jest.config.js rename to apps/admin-gui/jest.config.ts index 946f1ef68..4fe818967 100644 --- a/apps/admin-gui/jest.config.js +++ b/apps/admin-gui/jest.config.ts @@ -1,4 +1,5 @@ -module.exports = { +/* eslint-disable */ +export default { preset: '../../jest.preset.js', coverageDirectory: '../../coverage/apps/admin-gui', @@ -8,6 +9,6 @@ module.exports = { snapshotSerializers: [ 'jest-preset-angular/build/serializers/no-ng-attributes', 'jest-preset-angular/build/serializers/ng-snapshot', - 'jest-preset-angular/build/serializers/html-comment' - ] + 'jest-preset-angular/build/serializers/html-comment', + ], }; diff --git a/apps/admin-gui/src/app/admin/pages/admin-page/admin-consent-hubs/admin-consent-hubs.component.html b/apps/admin-gui/src/app/admin/pages/admin-page/admin-consent-hubs/admin-consent-hubs.component.html index 448a2b720..80b568e47 100644 --- a/apps/admin-gui/src/app/admin/pages/admin-page/admin-consent-hubs/admin-consent-hubs.component.html +++ b/apps/admin-gui/src/app/admin/pages/admin-page/admin-consent-hubs/admin-consent-hubs.component.html @@ -1,16 +1,22 @@