diff --git a/README.md b/README.md index aea7dbd..8df7142 100644 --- a/README.md +++ b/README.md @@ -2,18 +2,18 @@ # Oft verwendetet Konsolenbefehle -## Einen bestimmten Test ausführen: -USER="xxx" PW="xxx" npx playwright test TF0001.spec.ts +## Eine bestimmte Testfall-Datei ausführen: +USER="xxx" PW="xxx" npx playwright test login.spec.ts + +## Einen bestimmten Testfall innerhalb einer Datei ausführen: + USER='xxx' PW='xxx' npx playwright test -g "SPSH-122 Angebote" --headed ## Alle Tests ausführen: USER="xxx" PW="xxx" npx playwright test -## Umgebungsvariablen überschreiben -gitbash: USER='xxx' PW='xxx' npx playwright test TF0001.spec.ts --headed - powershell: $env:USER="xxx" -npx playwright test 00_Authentifizierung.spec.ts --headed +npx playwright test login.spec.ts --headed ## Einen Report von der Testausführung öffnen: npx playwright show-report results\results-2023-10-06T13_49_14_593 @@ -22,11 +22,11 @@ npx playwright show-report results\results-2023-10-06T13_49_14_593 npx playwright codegen https://test.dev.spsh.dbildungsplattform.de ## debug-mode: -git bash: PWDEBUG=1 npx playwright test 00_Authentifizierung.spec.ts --headed +git bash: PWDEBUG=1 npx playwright test login.spec.ts --headed powershell: PWDEBUG=1 -npx playwright test 00_Authentifizierung.spec.ts --headed +npx playwright test login.spec.ts --headed ## ESLint ausführen `npm run lint` diff --git a/package-lock.json b/package-lock.json index f9149e3..028a1b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,10 +11,12 @@ "dependencies": { "@fast-csv/format": "^4.3.5", "@fast-csv/parse": "^4.3.6", - "fast-csv": "^4.3.6" + "fast-csv": "^4.3.6", + "generate-password-ts": "^1.6.5" }, "devDependencies": { "@playwright/test": "^1.37.1", + "@types/node": "^20.11.5", "@typescript-eslint/eslint-plugin": "^6.13.0", "@typescript-eslint/parser": "^6.13.0", "dotenv": "^16.3.1", @@ -57,9 +59,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.3.tgz", - "integrity": "sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "dependencies": { "ajv": "^6.12.4", @@ -79,10 +81,32 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/@eslint/js": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.54.0.tgz", - "integrity": "sha512-ut5V+D+fOoWPgGGNj83GGjnntO39xDy6DWxO0wb7Jp3DcMX0TfIqdzHF85VTQkerdyGmuuMD9AKAo5KiNlf/AQ==", + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", + "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -90,7 +114,8 @@ }, "node_modules/@fast-csv/format": { "version": "4.3.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@fast-csv/format/-/format-4.3.5.tgz", + "integrity": "sha512-8iRn6QF3I8Ak78lNAa+Gdl5MJJBM5vRHivFtMRUWINdevNo00K7OXxS2PshawLKTejVwieIlPmK5YlLu6w4u8A==", "dependencies": { "@types/node": "^14.0.1", "lodash.escaperegexp": "^4.1.2", @@ -101,12 +126,14 @@ } }, "node_modules/@fast-csv/format/node_modules/@types/node": { - "version": "14.18.54", - "license": "MIT" + "version": "14.18.63", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz", + "integrity": "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==" }, "node_modules/@fast-csv/parse": { "version": "4.3.6", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@fast-csv/parse/-/parse-4.3.6.tgz", + "integrity": "sha512-uRsLYksqpbDmWaSmzvJcuApSEe38+6NQZBUsuAyMZKqHxH0g1wcJgsKUvN3WC8tewaqFjBMMGrkHmC+T7k8LvA==", "dependencies": { "@types/node": "^14.0.1", "lodash.escaperegexp": "^4.1.2", @@ -118,23 +145,46 @@ } }, "node_modules/@fast-csv/parse/node_modules/@types/node": { - "version": "14.18.54", - "license": "MIT" + "version": "14.18.63", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz", + "integrity": "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==" }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.13", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", - "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^2.0.1", - "debug": "^4.1.1", + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", "minimatch": "^3.0.5" }, "engines": { "node": ">=10.10.0" } }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -149,9 +199,9 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", - "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", "dev": true }, "node_modules/@nodelib/fs.scandir": { @@ -190,22 +240,18 @@ } }, "node_modules/@playwright/test": { - "version": "1.37.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.37.1.tgz", - "integrity": "sha512-bq9zTli3vWJo8S3LwB91U0qDNQDpEXnw7knhxLM0nwDvexQAwx9tO8iKDZSqqneVq+URd/WIoz+BALMqUTgdSg==", + "version": "1.41.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.41.1.tgz", + "integrity": "sha512-9g8EWTjiQ9yFBXc6HjCWe41msLpxEX0KhmfmPl9RPLJdfzL4F0lg2BdJ91O9azFdl11y1pmpwdjBiSxvqc+btw==", "dev": true, "dependencies": { - "@types/node": "*", - "playwright-core": "1.37.1" + "playwright": "1.41.1" }, "bin": { "playwright": "cli.js" }, "engines": { "node": ">=16" - }, - "optionalDependencies": { - "fsevents": "2.3.2" } }, "node_modules/@types/json-schema": { @@ -215,10 +261,13 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.6.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.0.tgz", - "integrity": "sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg==", - "dev": true + "version": "20.11.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.5.tgz", + "integrity": "sha512-g557vgQjUUfN76MZAN/dt1z3dzcUsimuysco0KeluHgrPdJXkP/XdAURgyO2W9fZWHRtRBiVKzKn8vyOAwlG+w==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } }, "node_modules/@types/semver": { "version": "7.5.6", @@ -227,16 +276,16 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.13.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.13.1.tgz", - "integrity": "sha512-5bQDGkXaxD46bPvQt08BUz9YSaO4S0fB1LB5JHQuXTfkGPI3+UUeS387C/e9jRie5GqT8u5kFTrMvAjtX4O5kA==", + "version": "6.19.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.19.1.tgz", + "integrity": "sha512-roQScUGFruWod9CEyoV5KlCYrubC/fvG8/1zXuT0WTcxX87GnMMmnksMwSg99lo1xiKrBzw2icsJPMAw1OtKxg==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.13.1", - "@typescript-eslint/type-utils": "6.13.1", - "@typescript-eslint/utils": "6.13.1", - "@typescript-eslint/visitor-keys": "6.13.1", + "@typescript-eslint/scope-manager": "6.19.1", + "@typescript-eslint/type-utils": "6.19.1", + "@typescript-eslint/utils": "6.19.1", + "@typescript-eslint/visitor-keys": "6.19.1", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -262,15 +311,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.13.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.13.1.tgz", - "integrity": "sha512-fs2XOhWCzRhqMmQf0eicLa/CWSaYss2feXsy7xBD/pLyWke/jCIVc2s1ikEAtSW7ina1HNhv7kONoEfVNEcdDQ==", + "version": "6.19.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.19.1.tgz", + "integrity": "sha512-WEfX22ziAh6pRE9jnbkkLGp/4RhTpffr2ZK5bJ18M8mIfA8A+k97U9ZyaXCEJRlmMHh7R9MJZWXp/r73DzINVQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.13.1", - "@typescript-eslint/types": "6.13.1", - "@typescript-eslint/typescript-estree": "6.13.1", - "@typescript-eslint/visitor-keys": "6.13.1", + "@typescript-eslint/scope-manager": "6.19.1", + "@typescript-eslint/types": "6.19.1", + "@typescript-eslint/typescript-estree": "6.19.1", + "@typescript-eslint/visitor-keys": "6.19.1", "debug": "^4.3.4" }, "engines": { @@ -290,13 +339,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.13.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.13.1.tgz", - "integrity": "sha512-BW0kJ7ceiKi56GbT2KKzZzN+nDxzQK2DS6x0PiSMPjciPgd/JRQGMibyaN2cPt2cAvuoH0oNvn2fwonHI+4QUQ==", + "version": "6.19.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.19.1.tgz", + "integrity": "sha512-4CdXYjKf6/6aKNMSly/BP4iCSOpvMmqtDzRtqFyyAae3z5kkqEjKndR5vDHL8rSuMIIWP8u4Mw4VxLyxZW6D5w==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.13.1", - "@typescript-eslint/visitor-keys": "6.13.1" + "@typescript-eslint/types": "6.19.1", + "@typescript-eslint/visitor-keys": "6.19.1" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -307,13 +356,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.13.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.13.1.tgz", - "integrity": "sha512-A2qPlgpxx2v//3meMqQyB1qqTg1h1dJvzca7TugM3Yc2USDY+fsRBiojAEo92HO7f5hW5mjAUF6qobOPzlBCBQ==", + "version": "6.19.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.19.1.tgz", + "integrity": "sha512-0vdyld3ecfxJuddDjACUvlAeYNrHP/pDeQk2pWBR2ESeEzQhg52DF53AbI9QCBkYE23lgkhLCZNkHn2hEXXYIg==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.13.1", - "@typescript-eslint/utils": "6.13.1", + "@typescript-eslint/typescript-estree": "6.19.1", + "@typescript-eslint/utils": "6.19.1", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -334,9 +383,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.13.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.13.1.tgz", - "integrity": "sha512-gjeEskSmiEKKFIbnhDXUyiqVma1gRCQNbVZ1C8q7Zjcxh3WZMbzWVfGE9rHfWd1msQtPS0BVD9Jz9jded44eKg==", + "version": "6.19.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.19.1.tgz", + "integrity": "sha512-6+bk6FEtBhvfYvpHsDgAL3uo4BfvnTnoge5LrrCj2eJN8g3IJdLTD4B/jK3Q6vo4Ql/Hoip9I8aB6fF+6RfDqg==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -347,16 +396,17 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.13.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.13.1.tgz", - "integrity": "sha512-sBLQsvOC0Q7LGcUHO5qpG1HxRgePbT6wwqOiGLpR8uOJvPJbfs0mW3jPA3ujsDvfiVwVlWUDESNXv44KtINkUQ==", + "version": "6.19.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.19.1.tgz", + "integrity": "sha512-aFdAxuhzBFRWhy+H20nYu19+Km+gFfwNO4TEqyszkMcgBDYQjmPJ61erHxuT2ESJXhlhrO7I5EFIlZ+qGR8oVA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.13.1", - "@typescript-eslint/visitor-keys": "6.13.1", + "@typescript-eslint/types": "6.19.1", + "@typescript-eslint/visitor-keys": "6.19.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", + "minimatch": "9.0.3", "semver": "^7.5.4", "ts-api-utils": "^1.0.1" }, @@ -374,17 +424,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.13.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.13.1.tgz", - "integrity": "sha512-ouPn/zVoan92JgAegesTXDB/oUp6BP1v8WpfYcqh649ejNc9Qv+B4FF2Ff626kO1xg0wWwwG48lAJ4JuesgdOw==", + "version": "6.19.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.19.1.tgz", + "integrity": "sha512-JvjfEZuP5WoMqwh9SPAPDSHSg9FBHHGhjPugSRxu5jMfjvBpq5/sGTD+9M9aQ5sh6iJ8AY/Kk/oUYVEMAPwi7w==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.13.1", - "@typescript-eslint/types": "6.13.1", - "@typescript-eslint/typescript-estree": "6.13.1", + "@typescript-eslint/scope-manager": "6.19.1", + "@typescript-eslint/types": "6.19.1", + "@typescript-eslint/typescript-estree": "6.19.1", "semver": "^7.5.4" }, "engines": { @@ -399,12 +449,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.13.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.13.1.tgz", - "integrity": "sha512-NDhQUy2tg6XGNBGDRm1XybOHSia8mcXmlbKWoQP+nm1BIIMxa55shyJfZkHpEBN62KNPLrocSM2PdPcaLgDKMQ==", + "version": "6.19.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.19.1.tgz", + "integrity": "sha512-gkdtIO+xSO/SmI0W68DBg4u1KElmIUo3vXzgHyGPs6cxgB0sa3TlptRAAE0hUY1hM6FcDKEv7aIwiTGm76cXfQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.13.1", + "@typescript-eslint/types": "6.19.1", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -422,9 +472,9 @@ "dev": true }, "node_modules/acorn": { - "version": "8.11.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", - "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -504,13 +554,12 @@ "dev": true }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "node_modules/braces": { @@ -636,9 +685,9 @@ } }, "node_modules/dotenv": { - "version": "16.3.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", - "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "version": "16.3.2", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.2.tgz", + "integrity": "sha512-HTlk5nmhkm8F6JcdXvHIzaorzCoziNQT9mGxLPVXW8wJF1TiGSL60ZGB4gHWabHOaMmWmhvk2/lPHfnBiT78AQ==", "dev": true, "engines": { "node": ">=12" @@ -660,15 +709,15 @@ } }, "node_modules/eslint": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.54.0.tgz", - "integrity": "sha512-NY0DfAkM8BIZDVl6PgSa1ttZbx3xHgJzSNJKYcQglem6CppHyMhRIQkBVSSMaSRnLhig3jsDbEzOjwCVt4AmmA==", + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", + "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.3", - "@eslint/js": "8.54.0", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.56.0", "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -760,6 +809,28 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/espree": { "version": "9.6.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", @@ -821,7 +892,8 @@ }, "node_modules/fast-csv": { "version": "4.3.6", - "license": "MIT", + "resolved": "https://registry.npmjs.org/fast-csv/-/fast-csv-4.3.6.tgz", + "integrity": "sha512-2RNSpuwwsJGP0frGsOmTb9oUF+VkFSM4SyLTDgwf2ciHWTarN0lQTC+F2f/t5J9QjW+c65VFIAAu85GsvMIusw==", "dependencies": { "@fast-csv/format": "4.3.5", "@fast-csv/parse": "4.3.6" @@ -877,9 +949,9 @@ "dev": true }, "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.16.0.tgz", + "integrity": "sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA==", "dev": true, "dependencies": { "reusify": "^1.0.4" @@ -951,6 +1023,28 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/generate-password-ts": { + "version": "1.6.5", + "resolved": "https://registry.npmjs.org/generate-password-ts/-/generate-password-ts-1.6.5.tgz", + "integrity": "sha512-MTvcuBZWQChMlqRVK3PGBmF/QdYkSL3YuTfoxbLy8GExa+VDkB0vybQhXBiT0TsBLvDvTC+7OIT1ptsYFpXpGA==", + "dependencies": { + "js-crypto-random": "1.0.4" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -983,10 +1077,32 @@ "node": ">=10.13.0" } }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/globals": { - "version": "13.23.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", - "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -1128,6 +1244,19 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, + "node_modules/js-crypto-env": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/js-crypto-env/-/js-crypto-env-1.0.5.tgz", + "integrity": "sha512-8/UNN3sG8J+yMzqwSNVaobaWhIz4MqZFoOg5OB0DFXqS8eFjj2YvdmLJqIWXPl57Yw10SvYx0DQOtkfsWIV9Aw==" + }, + "node_modules/js-crypto-random": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/js-crypto-random/-/js-crypto-random-1.0.4.tgz", + "integrity": "sha512-ldTK4y+ymaXWFL13EUh+Kvl3/UQ2GdfqDbI4ScNYS0/T2knijM9duOXO8qd9e6RYwdrOupyiAu4o538VQnktuw==", + "dependencies": { + "js-crypto-env": "^1.0.4" + } + }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -1197,31 +1326,38 @@ }, "node_modules/lodash.escaperegexp": { "version": "4.1.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", + "integrity": "sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==" }, "node_modules/lodash.groupby": { "version": "4.6.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.groupby/-/lodash.groupby-4.6.0.tgz", + "integrity": "sha512-5dcWxm23+VAoz+awKmBaiBvzox8+RqMgFhi7UvX9DHZr2HdxHXM/Wrf8cfKpsW37RNrvtPn6hSwNqurSILbmJw==" }, "node_modules/lodash.isboolean": { "version": "3.0.3", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" }, "node_modules/lodash.isequal": { "version": "4.5.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" }, "node_modules/lodash.isfunction": { "version": "3.0.9", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isfunction/-/lodash.isfunction-3.0.9.tgz", + "integrity": "sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==" }, "node_modules/lodash.isnil": { "version": "4.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isnil/-/lodash.isnil-4.0.0.tgz", + "integrity": "sha512-up2Mzq3545mwVnMhTDMdfoG1OurpA/s5t88JmQX809eH3C8491iu2sfKhTfhQtKY78oPNhiaHJUpT/dUDAAtng==" }, "node_modules/lodash.isundefined": { "version": "3.0.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isundefined/-/lodash.isundefined-3.0.1.tgz", + "integrity": "sha512-MXB1is3s899/cD8jheYYE2V9qTHwKvt+npCwpD+1Sxm3Q3cECXCiYHjeHWXNwr6Q0SOBPrYUDxendrO6goVTEA==" }, "node_modules/lodash.merge": { "version": "4.6.2", @@ -1231,7 +1367,8 @@ }, "node_modules/lodash.uniq": { "version": "4.5.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==" }, "node_modules/lru-cache": { "version": "6.0.0", @@ -1268,15 +1405,18 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/ms": { @@ -1407,10 +1547,28 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/playwright": { + "version": "1.41.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.41.1.tgz", + "integrity": "sha512-gdZAWG97oUnbBdRL3GuBvX3nDDmUOuqzV/D24dytqlKt+eI5KbwusluZRGljx1YoJKZ2NRPaeWiFTeGZO7SosQ==", + "dev": true, + "dependencies": { + "playwright-core": "1.41.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, "node_modules/playwright-core": { - "version": "1.37.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.37.1.tgz", - "integrity": "sha512-17EuQxlSIYCmEMwzMqusJ2ztDgJePjrbttaefgdsiqeLWidjYz9BxXaTaZWxH1J95SHGk6tjE+dwgWILJoUZfA==", + "version": "1.41.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.41.1.tgz", + "integrity": "sha512-/KPO5DzXSMlxSX77wy+HihKGOunh3hqndhqeo/nMxfigiKzogn8kfL0ZBDu0L1RKgan5XHCPmn6zXd2NUJgjhg==", "dev": true, "bin": { "playwright-core": "cli.js" @@ -1650,9 +1808,9 @@ } }, "node_modules/typescript": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz", - "integrity": "sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -1662,6 +1820,12 @@ "node": ">=14.17" } }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", diff --git a/package.json b/package.json index d314400..9566851 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "devDependencies": { "@playwright/test": "^1.37.1", + "@types/node": "^20.11.5", "@typescript-eslint/eslint-plugin": "^6.13.0", "@typescript-eslint/parser": "^6.13.0", "dotenv": "^16.3.1", @@ -14,7 +15,8 @@ "dependencies": { "@fast-csv/format": "^4.3.5", "@fast-csv/parse": "^4.3.6", - "fast-csv": "^4.3.6" + "fast-csv": "^4.3.6", + "generate-password-ts": "^1.6.5" }, "name": "schulportal-testautomatisierung", "description": "", diff --git a/pages/header.page.ts b/pages/header.page.ts new file mode 100644 index 0000000..100205c --- /dev/null +++ b/pages/header.page.ts @@ -0,0 +1,11 @@ +import { type Locator, Page } from '@playwright/test'; + +export class HeaderPage{ + readonly page: Page; + readonly button_logout: Locator; + + constructor(page){ + this.page = page; + this.button_logout = page.getByTestId('nav-logout-button'); + } +} \ No newline at end of file diff --git a/pages/landing.page.ts b/pages/landing.page.ts index e852851..51ab9d3 100644 --- a/pages/landing.page.ts +++ b/pages/landing.page.ts @@ -3,9 +3,12 @@ import { type Locator, Page } from '@playwright/test'; export class LandingPage{ readonly page: Page; readonly text_h1_UeberschriftStartseite: Locator; + readonly text_Willkommen: Locator; + readonly button_Anmelden: Locator; constructor(page){ this.page = page; - this.text_h1_UeberschriftStartseite = page.getByRole('heading', { name: 'This is gonna be a landing page' }); + this.text_Willkommen = page.getByText('Willkommen im Schulportal SH.'); + this.button_Anmelden = page.getByTestId('login-button'); } } \ No newline at end of file diff --git a/pages/login.page.ts b/pages/login.page.ts index ac695dd..677c336 100644 --- a/pages/login.page.ts +++ b/pages/login.page.ts @@ -1,20 +1,28 @@ import { expect, type Locator, Page } from '@playwright/test'; +import generator from 'generate-password-ts'; export class LoginPage{ readonly page: Page; readonly input_username: Locator; readonly input_password: Locator; + readonly input_NewPassword: Locator; + readonly input_ConfirmPW: Locator; readonly button_login: Locator; - readonly button_logoff: Locator; + readonly button_submitPWChange: Locator; readonly text_h1: Locator; + readonly text_h1_updatePW: Locator; readonly text_span_inputerror: Locator; constructor(page){ this.page = page; this.text_h1 = page.getByRole('heading', { name: 'Sign in to your account' }); - this.input_username = page.getByLabel('Username or email'); - this.input_password = page.getByLabel('Password'); + this.text_h1_updatePW = page.getByText('You need to change your password to activate your account.') + this.input_username = page.locator('#username'); + this.input_password = page.locator('#password'); + this.input_NewPassword = page.getByLabel('New Password'); + this.input_ConfirmPW = page.getByLabel('Confirm password'); this.button_login = page.getByRole('button', { name: 'Sign In' }); + this.button_submitPWChange = page.getByRole('button', { name: 'Submit' }); this.text_span_inputerror = page.getByText('Invalid username or password.'); } @@ -26,4 +34,15 @@ export class LoginPage{ await this.input_password.fill(password); await this.button_login.click(); } + + async UpdatePW(){ + let new_Password = ''; + new_Password = generator.generate({ length: 10, numbers: true }); + await expect(this.text_h1_updatePW).toBeVisible(); + await this.input_NewPassword.click(); + await this.input_NewPassword.fill(new_Password); + await this.input_ConfirmPW.click(); + await this.input_ConfirmPW.fill(new_Password); + await this.button_submitPWChange.click(); + } } \ No newline at end of file diff --git a/pages/menue.page.ts b/pages/menue.page.ts deleted file mode 100644 index 4cc78e4..0000000 --- a/pages/menue.page.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { type Locator, Page } from '@playwright/test'; - -export class MenuePage{ - readonly page: Page; - readonly button_Anmelden: Locator; - readonly button_Abmelden: Locator; - readonly button_Startseite: Locator; - - constructor(page){ - this.page = page; - this.button_Anmelden = page.getByRole('link', { name: 'Anmelden' }); - this.button_Abmelden = page.getByRole('link', { name: 'Abmelden' }); - this.button_Startseite = page.getByRole('link', { name: 'Home' }); - } -} \ No newline at end of file diff --git a/pages/start.page.ts b/pages/start.page.ts index ab57f3d..029dc6c 100644 --- a/pages/start.page.ts +++ b/pages/start.page.ts @@ -5,11 +5,13 @@ export class StartPage{ readonly text_h2_Ueberschrift: Locator; readonly card_item_email: Locator; readonly card_item_itslearning: Locator; + readonly card_item_schulportal_administration: Locator; constructor(page){ this.page = page; this.text_h2_Ueberschrift = page.getByRole('heading', { name: 'Alle Angebote' }); this.card_item_email = page.getByTestId('provider-card-1'); this.card_item_itslearning = page.getByTestId('provider-card-2'); + this.card_item_schulportal_administration = page.getByTestId('provider-card-admin'); } } \ No newline at end of file diff --git a/pages/user_management.page.ts b/pages/user_management.page.ts new file mode 100644 index 0000000..8196ef8 --- /dev/null +++ b/pages/user_management.page.ts @@ -0,0 +1,11 @@ +import { type Locator, Page } from '@playwright/test'; + +export class UserManagementPage{ + readonly page: Page; + readonly text_h2: Locator; + + constructor(page){ + this.page = page; + this.text_h2 = page.getByRole('heading', { name: "Benutzerverwaltung" }); + } +} \ No newline at end of file diff --git a/pages/user_management_detail.page.ts b/pages/user_management_detail.page.ts new file mode 100644 index 0000000..ff5e5f0 --- /dev/null +++ b/pages/user_management_detail.page.ts @@ -0,0 +1,23 @@ +import { type Locator, Page } from '@playwright/test'; + +export class UserManagementDetailPage{ + readonly page: Page; + readonly text_h2: Locator; + readonly button_pwChange: Locator; + readonly button_pwReset: Locator; + readonly text_pwResetInfo: Locator; + readonly icon_pwVisible: Locator; + readonly input_pw: Locator; + readonly button_close_pwreset: Locator; + + constructor(page){ + this.page = page; + this.text_h2 = page.getByRole('heading', { name: 'Benutzer bearbeiten' }); + this.button_pwChange = page.getByTestId('open-password-reset-dialog-icon'); + this.button_pwReset = page.getByTestId('password-reset-button'); + this.text_pwResetInfo = page.getByTestId('password-reset-info-text'); + this.icon_pwVisible = page.getByTestId('show-password-icon'); + this.input_pw = page.locator('[data-testid="password-output-field"] input'); + this.button_close_pwreset = page.getByTestId('close-password-reset-dialog-button'); + } +} diff --git a/tests/login.spec.ts b/tests/login.spec.ts index fcf436a..97c0842 100644 --- a/tests/login.spec.ts +++ b/tests/login.spec.ts @@ -1,7 +1,6 @@ import { test, expect } from '@playwright/test'; import { LoginPage } from '../pages/login.page'; import { LandingPage } from '../pages/landing.page'; -import { MenuePage } from '../pages/menue.page'; import { StartPage } from '../pages/start.page'; const PW = process.env.PW; @@ -9,32 +8,27 @@ const USER = process.env.USER; const URL_PORTAL = process.env.URL_PORTAL; test.describe(`Testfälle für die Authentifizierung: Umgebung: ${process.env.UMGEBUNG}: URL: ${process.env.URL_PORTAL}:`, () => { - test('Erfolgreicher Standard Login ohne Rolle', async ({ page }) => { + test('SPSH-63 Erfolgreicher Standard Login ohne Rolle', async ({ page }) => { const Login = new LoginPage(page); const Landing = new LandingPage(page); - const Menue = new MenuePage(page); const Start = new StartPage(page); - await test.step(`Anmelden mit Benutzer ${USER}`, async () => { await page.goto(URL_PORTAL); - await expect(Landing.text_h1_UeberschriftStartseite).toBeVisible(); - await Menue.button_Anmelden.click(); + await expect(Landing.text_Willkommen).toBeVisible(); + await Landing.button_Anmelden.click(); await Login.login(USER, PW); - await expect(Landing.text_h1_UeberschriftStartseite).toBeVisible(); - await Menue.button_Startseite.click(); await expect(Start.text_h2_Ueberschrift).toBeVisible(); }) }) - - test('Erfolgloser Login mit falschem Passwort', async ({ page }) => { + + test('SPSH-109 Erfolgloser Login mit falschem Passwort', async ({ page }) => { const Login = new LoginPage(page); const Landing = new LandingPage(page); - const Menue = new MenuePage(page); await test.step(`Anmelden mit Benutzer ${USER}`, async () => { await page.goto(URL_PORTAL); - await expect(Landing.text_h1_UeberschriftStartseite).toBeVisible(); - await Menue.button_Anmelden.click(); + await expect(Landing.text_Willkommen).toBeVisible(); + await Landing.button_Anmelden.click(); await Login.login(USER, 'Mickeymouse'); await expect(Login.text_span_inputerror).toBeVisible(); await expect(Login.text_h1).toBeVisible(); diff --git a/tests/logoff.spec.ts b/tests/logoff.spec.ts index 14d079d..bf862da 100644 --- a/tests/logoff.spec.ts +++ b/tests/logoff.spec.ts @@ -1,26 +1,30 @@ import { test, expect } from '@playwright/test'; +import { LandingPage } from '../pages/landing.page'; +import { StartPage } from '../pages/start.page'; import { LoginPage } from '../pages/login.page'; -import { MenuePage } from '../pages/menue.page'; +import { HeaderPage } from '../pages/header.page'; const PW = process.env.PW; const USER = process.env.USER; const URL_PORTAL = process.env.URL_PORTAL; test.describe(`Testfälle für die Authentifizierung: Umgebung: ${process.env.UMGEBUNG}: URL: ${process.env.URL_PORTAL}:`, () => { - test('Erfolgreicher Standard Logoff', async ({ page }) => { + test('SPSH-185 Erfolgreicher Standard Logoff', async ({ page }) => { + const Landing = new LandingPage(page); + const Startseite = new StartPage(page) const Login = new LoginPage(page); - const Menue = new MenuePage(page); + const Header = new HeaderPage(page); await test.step(`Annmelden mit Benutzer ${USER}`, async () => { await page.goto(URL_PORTAL); - await Menue.button_Anmelden.click(); + await Landing.button_Anmelden.click(); await Login.login(USER, PW); - await expect(Menue.button_Abmelden).toBeVisible(); + await expect(Startseite.text_h2_Ueberschrift).toBeVisible(); }) await test.step(`Abmelden Benutzer ${USER}`, async () => { - await Menue.button_Abmelden.click(); - await expect(Menue.button_Anmelden).toBeEnabled(); + await Header.button_logout.click(); + await expect(Landing.text_Willkommen).toBeEnabled(); }) }) }) \ No newline at end of file diff --git a/tests/workflow.spec.ts b/tests/workflow.spec.ts index 90a86ef..860914b 100644 --- a/tests/workflow.spec.ts +++ b/tests/workflow.spec.ts @@ -1,9 +1,12 @@ import { test, expect } from '@playwright/test'; +import { LandingPage } from '../pages/landing.page'; import { LoginPage } from '../pages/login.page'; -import { MenuePage } from '../pages/menue.page'; import { StartPage } from '../pages/start.page'; import { Email4TeacherPage } from '../pages/email4teacher.page'; import { ItsLearningPage } from '../pages/itslearning.page'; +import { UserManagementPage } from '../pages/user_management.page'; +import { UserManagementDetailPage } from '../pages/user_management_detail.page'; +import { HeaderPage } from '../pages/header.page'; const PW = process.env.PW; const USER = process.env.USER; @@ -11,8 +14,8 @@ const URL_PORTAL = process.env.URL_PORTAL; test.describe(`Testfälle für den Test von workflows: Umgebung: ${process.env.UMGEBUNG}: URL: ${process.env.URL_PORTAL}:`, () => { test('SPSH-122 Angebote per Link öffnen', async ({ page}) => { + const Landing = new LandingPage(page); const Login = new LoginPage(page); - const Menue = new MenuePage(page); const Startseite = new StartPage(page); await test.step(`Portal öffnen ${URL_PORTAL}`, async () => { @@ -20,14 +23,9 @@ test.describe(`Testfälle für den Test von workflows: Umgebung: ${process.env.U }) await test.step(`Annmelden mit Benutzer ${USER}`, async () => { - await Menue.button_Anmelden.click(); + await Landing.button_Anmelden.click(); await Login.login(USER, PW); - await expect(Menue.button_Abmelden).toBeVisible(); - }) - - await test.step(`Startseite öffnen`, async () => { - await Menue.button_Startseite.click(); - await Startseite.text_h2_Ueberschrift.click(); + await expect(Startseite.text_h2_Ueberschrift).toBeVisible(); }) await test.step(`Kacheln Email für Lehrkräfte und Itslearning öffnen, danach beide Kacheln wieder schließen`, async () => { @@ -48,7 +46,61 @@ test.describe(`Testfälle für den Test von workflows: Umgebung: ${process.env.U }) await test.step(`Prüfen, dass die Startseite noch geöffnet ist`, async () => { - await Startseite.text_h2_Ueberschrift.click(); + await expect(Startseite.text_h2_Ueberschrift).toBeVisible(); }) }) + + test('SPSH-215 Passwort Reset', async ({ page}) => { + const Landing = new LandingPage(page); + const Login = new LoginPage(page); + const Startseite = new StartPage(page); + const UserManagement = new UserManagementPage(page); + const UserManagementDetail = new UserManagementDetailPage(page); + const Header = new HeaderPage(page); + const username_lastname = 'Max'; + let new_password = ''; + + await test.step(`Portal öffnen ${URL_PORTAL}`, async () => { + await page.goto(URL_PORTAL); + }) + + await test.step(`Annmelden mit Administrator ${USER}`, async () => { + await Landing.button_Anmelden.click(); + await Login.login(USER, PW); + await expect(Startseite.text_h2_Ueberschrift).toBeVisible(); + }) + + await test.step(`Benutzerverwaltung öffnen`, async () => { + await Startseite.card_item_schulportal_administration.click(); + }) + + await test.step(`In der Benutzerverwaltung die Zeile für Benutzer ${username_lastname} anklicken und User-Details öffnen`, async () => { + await expect(UserManagement.text_h2).toBeVisible(); + await page.getByRole('cell', { name: 'Max' }).click(); + }) + + await test.step(`In den User-Details PW-Reset Dialog starten`, async () => { + await expect(UserManagementDetail.text_h2).toBeVisible(); + await UserManagementDetail.button_pwChange.click(); + await expect(UserManagementDetail.text_pwResetInfo).toBeVisible(); + }) + + await test.step(`In dem overlay den PW-Reset bestätigen, das PW kopieren und Dialog schließen`, async () => { + await UserManagementDetail.button_pwReset.click(); + await expect(UserManagementDetail.text_pwResetInfo).toBeVisible(); + new_password = await UserManagementDetail.input_pw.inputValue(); + await UserManagementDetail.button_close_pwreset.click(); + }) + + await test.step(`Login für Benutzer ${username_lastname} mit dem neuen PW`, async () => { + await Header.button_logout.click(); + await Landing.button_Anmelden.click(); + await Login.login('pwtest', new_password); + }) + + await test.step(`Neues PW vergeben`, async () => { + await Login.UpdatePW(); + await expect(Startseite.text_h2_Ueberschrift).toBeVisible(); + }) + }) }) \ No newline at end of file