From 5138c58574bd9b028964248d2cfe9d7f9076fa54 Mon Sep 17 00:00:00 2001 From: Awet Issac Date: Thu, 17 Oct 2024 10:45:31 +0200 Subject: [PATCH 01/14] =?UTF-8?q?Die=20Playwright-Tests=20f=C3=BCr=20die?= =?UTF-8?q?=20Frontend-Funktionalit=C3=A4ten=20sowie=20Allure-Reporting=20?= =?UTF-8?q?f=C3=BCr=20die=20Testergebnisse=20wurden=20hinzugef=C3=BCgt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/playwright.yml | 44 ++++ .gitignore | 4 + docker-compose.yml | 2 +- modules/fbs-core/api/Dockerfile | 7 +- modules/fbs-core/web/config.js | 6 + modules/fbs-core/web/package-lock.json | 159 +++++++++++++++ modules/fbs-core/web/pages/course.js | 47 +++++ modules/fbs-core/web/pages/login.js | 33 +++ modules/fbs-core/web/playwright.config.js | 19 ++ .../fbs-core/web/test-results/.last-run.json | 4 + .../fbs-core/web/tests/SubmitTask.e2e.spec.js | 76 +++++++ modules/fbs-core/web/tests/login.spec.js | 28 +++ .../web/tests/performanceTest.spec.js | 44 ++++ package-lock.json | 190 ++++++++++++++++++ package.json | 19 ++ playwright.config.js | 79 ++++++++ 16 files changed, 757 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/playwright.yml create mode 100644 modules/fbs-core/web/config.js create mode 100644 modules/fbs-core/web/pages/course.js create mode 100644 modules/fbs-core/web/pages/login.js create mode 100644 modules/fbs-core/web/playwright.config.js create mode 100644 modules/fbs-core/web/test-results/.last-run.json create mode 100644 modules/fbs-core/web/tests/SubmitTask.e2e.spec.js create mode 100644 modules/fbs-core/web/tests/login.spec.js create mode 100644 modules/fbs-core/web/tests/performanceTest.spec.js create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 playwright.config.js diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml new file mode 100644 index 000000000..1e23a4a93 --- /dev/null +++ b/.github/workflows/playwright.yml @@ -0,0 +1,44 @@ +name: Playwright Tests with Allure Reports +on: + push: + branches: [ dev] + pull_request: + branches: [ dev ] +jobs: + test: + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: lts/* + - name: Install dependencies + run: npm ci + - name: Clean previous Allure results + run: | + rm -rf allure-results + rm -rf allure-report + - name: Install Playwright Browsers + run: npx playwright install --with-deps + - name: Install Allure dependencies + run: npm i -D allure-playwright + - name: Run Playwright tests with Allure + run: | + export PW_ALLURE_RESULTS_DIR=allure-results + npx playwright test --reporter=line,allure-playwright + - name: Generate Allure Report + run: | + npx allure generate allure-results --clean -o allure-report + - uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 + - uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + name: allure-report + path: allure-report/ + retention-days: 30 \ No newline at end of file diff --git a/.gitignore b/.gitignore index e87da029f..f813de359 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,7 @@ data/ master-runner/upload-dir/* docker-config +/test-results/ +/playwright-report/ +/blob-report/ +/playwright/.cache/ diff --git a/docker-compose.yml b/docker-compose.yml index bfdc67833..e2a8f8fea 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -249,7 +249,7 @@ services: context: modules/fbs-eat/eat restart: always ports: - - 5000:8050 + - 5001:8050 networks: - fbs environment: diff --git a/modules/fbs-core/api/Dockerfile b/modules/fbs-core/api/Dockerfile index d5151b63d..fa984a593 100644 --- a/modules/fbs-core/api/Dockerfile +++ b/modules/fbs-core/api/Dockerfile @@ -1,4 +1,4 @@ -FROM gradle:jdk18 AS BUILD +FROM gradle:jdk18 AS build RUN mkdir /build WORKDIR /build @@ -14,6 +14,7 @@ COPY modules/fbs-runner/checker/*.gradle /build/modules/fbs-runner/checker/ # Build web COPY modules/fbs-core/web /build/modules/fbs-core/web/ +RUN apt-get update && apt-get install -y build-essential curl RUN gradle fbs-core.web:installDist # Copy math-parser @@ -23,9 +24,9 @@ COPY modules/fbs-core/math-parser /build/modules/fbs-core/math-parser/ COPY modules/fbs-core/api /build/modules/fbs-core/api/ RUN gradle fbs-core.web:copyWebToWS fbs-core.api:installDist -FROM eclipse-temurin:18.0.2_9-jre-alpine +FROM eclipse-temurin:18-jre -RUN apk add --no-cache curl +RUN apt-get update && apt-get install -y curl COPY --from=build /build/modules/fbs-core/api/build/install/fbs-core.api /usr/local/fbs-core.api diff --git a/modules/fbs-core/web/config.js b/modules/fbs-core/web/config.js new file mode 100644 index 000000000..58bc1b447 --- /dev/null +++ b/modules/fbs-core/web/config.js @@ -0,0 +1,6 @@ +module.exports = { + local: 'http://localhost:4200/', + test: 'https://fk-feedback-test.mni.thm.de/login/', + production: 'https://feedback.mni.thm.de/login/' +}; + diff --git a/modules/fbs-core/web/package-lock.json b/modules/fbs-core/web/package-lock.json index 6544a48ca..a63b8de63 100644 --- a/modules/fbs-core/web/package-lock.json +++ b/modules/fbs-core/web/package-lock.json @@ -52,6 +52,8 @@ "@types/node": "^12.11.1", "@typescript-eslint/eslint-plugin": "5.29.0", "@typescript-eslint/parser": "5.46.1", + "allure-commandline": "^2.30.0", + "allure-playwright": "^3.0.0", "eslint": "^8.18.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-prettier": "^4.2.1", @@ -3812,6 +3814,23 @@ "url": "https://opencollective.com/parcel" } }, + "node_modules/@playwright/test": { + "version": "1.47.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.47.1.tgz", + "integrity": "sha512-dbWpcNQZ5nj16m+A5UNScYx7HX5trIy7g4phrcitn+Nk83S32EBX/CLU4hiF4RGKX/yRc93AAqtfaXB7JWBd4Q==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "playwright": "1.47.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@schematics/angular": { "version": "14.2.13", "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-14.2.13.tgz", @@ -4894,6 +4913,48 @@ "ajv": "^6.9.1" } }, + "node_modules/allure-commandline": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/allure-commandline/-/allure-commandline-2.30.0.tgz", + "integrity": "sha512-qSaGG/I8P38q8gufnxvEog+IrIeCick+PJxxoTp5Vh/L8kviymIfv3A7fvYWziOqZ/oDywyOuNFMEfPZiiKwAA==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "allure": "bin/allure" + } + }, + "node_modules/allure-js-commons": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/allure-js-commons/-/allure-js-commons-3.0.0.tgz", + "integrity": "sha512-jhWK05JMkEyquhk+K7ToypRgQuA0DLlSOZ+vK2tv9tCWz2zNQuImFHxzl/E//Z6Xk6/hCv5GTwagcJwJMn/ZTg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "md5": "^2.3.0", + "properties": "^1.2.1" + }, + "peerDependencies": { + "allure-playwright": "3.0.0" + }, + "peerDependenciesMeta": { + "allure-playwright": { + "optional": true + } + } + }, + "node_modules/allure-playwright": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/allure-playwright/-/allure-playwright-3.0.0.tgz", + "integrity": "sha512-SgRTEc2Z1JyF7x1SMwtHbW+QMEplcbW3lMw19vvtdkbB3L2RhRj8OvI2ieIyfRIchrYgTtvB8SYSLEeON1cV6w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "allure-js-commons": "3.0.0" + }, + "peerDependencies": { + "@playwright/test": ">=1.36.0" + } + }, "node_modules/angular-i18next": { "version": "14.2.0", "resolved": "https://registry.npmjs.org/angular-i18next/-/angular-i18next-14.2.0.tgz", @@ -5812,6 +5873,16 @@ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, + "node_modules/charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": "*" + } + }, "node_modules/chart.js": { "version": "2.9.4", "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-2.9.4.tgz", @@ -6559,6 +6630,16 @@ "node": ">= 8" } }, + "node_modules/crypt": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": "*" + } + }, "node_modules/css": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/css/-/css-3.0.0.tgz", @@ -8774,6 +8855,21 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "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, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -9703,6 +9799,13 @@ "node": ">=8" } }, + "node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true, + "license": "MIT" + }, "node_modules/is-core-module": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", @@ -10881,6 +10984,18 @@ "npm": ">=8.5.0" } }, + "node_modules/md5": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", + "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "charenc": "0.0.2", + "crypt": "0.0.2", + "is-buffer": "~1.1.6" + } + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -12659,6 +12774,40 @@ "node": ">=8" } }, + "node_modules/playwright": { + "version": "1.47.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.47.1.tgz", + "integrity": "sha512-SUEKi6947IqYbKxRiqnbUobVZY4bF1uu+ZnZNJX9DfU1tlf2UhWfvVjLf01pQx9URsOr18bFVUKXmanYWhbfkw==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "playwright-core": "1.47.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.47.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.47.1.tgz", + "integrity": "sha512-i1iyJdLftqtt51mEk6AhYFaAJCDx0xQ/O5NU8EKaWFgMjItPVma542Nh/Aq8aLCjIJSzjaiEQGW/nyqLkGF1OQ==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/postcss": { "version": "8.4.14", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", @@ -13444,6 +13593,16 @@ "node": ">=10" } }, + "node_modules/properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/properties/-/properties-1.2.1.tgz", + "integrity": "sha512-qYNxyMj1JeW54i/EWEFsM1cVwxJbtgPp8+0Wg9XjNaK6VE/c4oRi6PNu5p7w1mNXEIQIjV5Wwn8v8Gz82/QzdQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10" + } + }, "node_modules/protractor": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/protractor/-/protractor-7.0.0.tgz", diff --git a/modules/fbs-core/web/pages/course.js b/modules/fbs-core/web/pages/course.js new file mode 100644 index 000000000..24ca1218a --- /dev/null +++ b/modules/fbs-core/web/pages/course.js @@ -0,0 +1,47 @@ +import { expect } from '@playwright/test'; + +class CoursePage { + + constructor(page) { + this.page = page; + } + + async newCourse() { + await this.page.getByRole('link', { name: 'Kurse', exact: true }).click(); + } + + async chooseCourse(kursname) { + await this.page.getByText(kursname, { exact: true }).click(); + } + + async chooseTask(aufgabe) { + await this.page.getByText(aufgabe, { name: aufgabe }).click(); + } + + async taskSubmit(loesung) { + await this.page.getByLabel('Abgabe Text: ').fill(loesung); + await this.page.getByRole('Button', { name: 'Abgeben' }).click(); + + } + + async check(){ + + try { + await expect(this.page.locator('td:has-text("OK")')).toBeVisible({timeout: 3000}); + + } catch ( error ) { + + console.log("Fehler bei der Abgabe"); + + const errorMessageLocator = this.page.locator('[role="alert"], .error-message, .alert, td:has-text("SQLException")'); + + if (await errorMessageLocator.isVisible () ) { + const errorMessage = await errorMessageLocator.innerText(); + console.error("Fehler bei der Abgabe:", errorMessage); + } else { + console.error("Abgabe nicht erfolgreich und keine Fehlermeldung sichtbar."); + } + } + } +} +export default CoursePage; \ No newline at end of file diff --git a/modules/fbs-core/web/pages/login.js b/modules/fbs-core/web/pages/login.js new file mode 100644 index 000000000..a66198d3f --- /dev/null +++ b/modules/fbs-core/web/pages/login.js @@ -0,0 +1,33 @@ +import { expect } from '@playwright/test'; + +class LoginPage { + + constructor(page) { + this.page = page; + this.usernameInput = page.locator('input[name="username"]'); + this.passwordInput = page.locator('input[name="password"]'); + this.loginButton = page.getByRole('button', { name: 'Lokale Anmeldung' }); + } + + async navigateTo(EnvURL) { + await this.page.goto(EnvURL); + } + + async isLoginFormVisible() { + await expect(this.usernameInput).toBeVisible(); + await expect(this.passwordInput).toBeVisible(); + await expect(this.loginButton).toBeVisible(); + } + + async login(username, password) { + await this.usernameInput.fill(username); + await this.passwordInput.fill(password); + await this.loginButton.click(); + } + + async isErrorMessageVisible() { + await expect(page.locator('text=Prüfen Sie Ihren Benutzernamen und Ihr Passwort.')).toBeVisible(); + } + +} +export default LoginPage; \ No newline at end of file diff --git a/modules/fbs-core/web/playwright.config.js b/modules/fbs-core/web/playwright.config.js new file mode 100644 index 000000000..8e53a6f69 --- /dev/null +++ b/modules/fbs-core/web/playwright.config.js @@ -0,0 +1,19 @@ +// @ts-check +import { defineConfig } from '@playwright/test'; + +export default defineConfig({ + testDir: './tests', + timeout: 30000, + retries: 0, + + use: { + localURL: 'http://localhost:4200', + testURL: 'https://fk-feedback-test.mni.thm.de/login', + }, + + reporter: [ + //['html'], + ['allure-playwright'], + ], + +}); \ No newline at end of file diff --git a/modules/fbs-core/web/test-results/.last-run.json b/modules/fbs-core/web/test-results/.last-run.json new file mode 100644 index 000000000..cbcc1fbac --- /dev/null +++ b/modules/fbs-core/web/test-results/.last-run.json @@ -0,0 +1,4 @@ +{ + "status": "passed", + "failedTests": [] +} \ No newline at end of file diff --git a/modules/fbs-core/web/tests/SubmitTask.e2e.spec.js b/modules/fbs-core/web/tests/SubmitTask.e2e.spec.js new file mode 100644 index 000000000..e0e9cc4d4 --- /dev/null +++ b/modules/fbs-core/web/tests/SubmitTask.e2e.spec.js @@ -0,0 +1,76 @@ +import { test, expect } from '@playwright/test'; +import config from '../config'; +import LoginPage from '../pages/login'; +import CoursePage from '../pages/course'; + +const allure = require("allure-js-commons"); + +test.describe('E2E-Test im Feedbacksystem von Anmeldung bis zur Abgabe einer Aufgabe ', () => { + + test('Der Benutzer durchläuft den kompletten Prozess: Anmeldung, Teilnahme am Kurs, Abgabe der Aufgabe und Abmeldung ', async ({ page }) => { + allure.testCaseId('TF001'); + allure.label('Name:', 'Kompletter Prozess von Anmeldung bis Abmeldung'); + + + const username = 'Awed23'; + const password = 'Awed12345'; + const courseName = 'Datenbank'; + const taskName = 'Aufgabe 1'; + const sqlQuery =`SELECT DISTINCT s.student_name + FROM students s + JOIN student_in_course sic ON s.student_id = sic.student_id + JOIN course c ON sic.course_id = c.course_id + JOIN semester sem ON sic.semester_id = sem.semester_id + WHERE c.course_name = 'Datenbanksysteme' + AND sem.semester_name = 'Wintersemester 23/24'; + `; + + const loginPage = new LoginPage(page); + const coursePage = new CoursePage(page); + + // Schritt 1: Anmeldung + await test.step('Anmeldung', async () => { + allure.parameter('Vorbedingung :', 'Benutzer muss die Anmeldeseite des Feedbacksystems öffnen'); + allure.parameter('Testdaten: ', `Benutzername: ${username}, Passwort: *****`); + + await loginPage.navigateTo(config.test); + await loginPage.login(username, password); + + allure.parameter('Erwartung: ', 'Nach erfolgreichem Anmelden, soll die Kursseite geöffnet werden'); + try { + await expect(page).toHaveURL('https://fk-feedback-test.mni.thm.de/courses'); + allure.parameter('Tatsächliches Ergebnis :', 'Benutzer wurde erfolgreich zur Kursseite weitergeleitet.'); + } catch (error) { + allure.parameter('Tatsächliches Ergebnis: ', 'Unerwartetes Problem während der Anmeldung.'); + throw error; // Test wird bei Fehler abgebrochen + } + }); + + // Schritt 2: Teilnahme am Kurs und Abgabe der Aufgabe + await test.step('Teilnahme am Kurs und Abgabe der Aufgabe', async () => { + allure.parameter('Vorbedingung: ', 'Benutzer ist angemeldet und befindet sich auf der Kursseite'); + allure.parameter('Testdaten: ', `Kursname: ${courseName}, Aufgabe: ${taskName}, SQL-Query: ${sqlQuery}`); + + await coursePage.newCourse(); + allure.parameter('Erwartetes Ergebnis: ', 'Benutzer nimmt an einem Kurs erfolgreich teil.'); + await coursePage.chooseCourse(courseName); + allure.parameter('Erwartetes Ergebnis: ', 'Benutzer wählt die Aufgabe erfolgreich aus.'); + await coursePage.chooseTask(taskName); + allure.parameter('Erwartetes Ergebnis: ', 'Benutzer gibt die Aufgabe erfolgreich ab.'); + await coursePage.taskSubmit(sqlQuery); + + allure.parameter('Tatsächliches Ergebnis: ', 'Benutzer hat die Aufgabe erfolgreich eingereicht.'); + await coursePage.check(); + }); + + // Schritt 3: Abmeldung + await test.step('Abmeldung', async () => { + allure.parameter('Vorbedingung: ', 'Benutzer befindet sich auf der Kursseite'); + await page.getByLabel('User Menu').click(); + await page.getByRole('menuitem', { name: 'Logout' }).click(); + + allure.parameter('Erwartetes Ergebnis: ', 'Benutzer wird erfolgreich abgemeldet.'); + allure.parameter('Tatsächliches Ergebnis: ', 'Benutzer wurde erfolgreich abgemeldet.'); + }); + }); +}); diff --git a/modules/fbs-core/web/tests/login.spec.js b/modules/fbs-core/web/tests/login.spec.js new file mode 100644 index 000000000..8ada0fcb7 --- /dev/null +++ b/modules/fbs-core/web/tests/login.spec.js @@ -0,0 +1,28 @@ +import { test, expect } from '@playwright/test'; +import config from '../config'; +import LoginPage from '../pages/login'; + + +test.describe('Loginseite Test', () => { + + test('Überprüfe, ob das Anmeldeformular vorhanden ist', async ({ page }) => { + const loginPage = new LoginPage(page); + await loginPage.navigateTo(config.local); + await loginPage.isLoginFormVisible(); + }); + + test('Auf lokale Umgebung mit gültigen Anmededaten einlogen', async ({ page }) => { + const loginPage = new LoginPage(page); + await loginPage.navigateTo(config.local); + await loginPage.login('awed', 'Awed12345'); + await expect(page).toHaveURL('http://localhost:4200/courses'); + }); + + test('Anmeldung ist fehlgeschlagen, da entweder Nutzername oder Passwort falsch eingegben wurde', async ({ page }) => { + const loginPage = new LoginPage(page); + await loginPage.navigateTo(config.local); + await loginPage.login('admin', 'falsches Passwort'); + await expect(page.locator('text=Prüfen Sie Ihren Benutzernamen und Ihr Passwort.')).toBeVisible(); + }); + +}); \ No newline at end of file diff --git a/modules/fbs-core/web/tests/performanceTest.spec.js b/modules/fbs-core/web/tests/performanceTest.spec.js new file mode 100644 index 000000000..a3803eb7a --- /dev/null +++ b/modules/fbs-core/web/tests/performanceTest.spec.js @@ -0,0 +1,44 @@ +import { test, expect, chromium} from '@playwright/test'; +import config from '../config'; +import LoginPage from '../pages/login'; + +const allure = require("allure-js-commons"); +const loginUrl = config.test; +const user = { username: 'Awed23', password: 'Awed12345' }; + + +test('Performance-Test: Die Anmeldung erfolgt 10-Mal mit dem gleichen Benutzer', async () => { + + const browser = await chromium.launch({ headless: true }); + const context = await browser.newContext(); + + const loginAttempts = 10; + + // Simuliere 10 aufeinanderfolgende Anmeldeversuche für denselben Benutzer + for (let i = 0; i < loginAttempts; i++) { + const page = await context.newPage(); + const loginPage = new LoginPage(page); + + // Navigiere zur Login-Seite + await loginPage.navigateTo(loginUrl); + + // Fülle das Anmeldeformular aus + await loginPage.login(user.username, user.password); + + // Warte, bis die Seite nach der Anmeldung vollständig geladen ist (z.B. Dashboard) + await page.waitForLoadState('load'); + + // Überprüfe, ob die Anmeldung erfolgreich war + await expect(page).toHaveURL('https://fk-feedback-test.mni.thm.de/courses'); // Ersetze mit der Zielseite nach der Anmeldung + + console.log(`Anmeldeversuch ${i + 1} für Benutzer ${user.username} erfolgreich.`); + + // Browser-Tab schließen + await page.close(); + } + + // Browser schließen + await browser.close(); + + +}); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 000000000..7b3c28229 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,190 @@ +{ + "name": "feedbacksystem-1", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "feedbacksystem-1", + "version": "1.0.0", + "license": "ISC", + "devDependencies": { + "@playwright/test": "^1.47.1", + "@types/node": "^22.5.5", + "allure-commandline": "^2.30.0", + "allure-playwright": "^3.0.0" + } + }, + "node_modules/@playwright/test": { + "version": "1.47.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.47.1.tgz", + "integrity": "sha512-dbWpcNQZ5nj16m+A5UNScYx7HX5trIy7g4phrcitn+Nk83S32EBX/CLU4hiF4RGKX/yRc93AAqtfaXB7JWBd4Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright": "1.47.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@types/node": { + "version": "22.5.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.5.tgz", + "integrity": "sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "node_modules/allure-commandline": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/allure-commandline/-/allure-commandline-2.30.0.tgz", + "integrity": "sha512-qSaGG/I8P38q8gufnxvEog+IrIeCick+PJxxoTp5Vh/L8kviymIfv3A7fvYWziOqZ/oDywyOuNFMEfPZiiKwAA==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "allure": "bin/allure" + } + }, + "node_modules/allure-js-commons": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/allure-js-commons/-/allure-js-commons-3.0.0.tgz", + "integrity": "sha512-jhWK05JMkEyquhk+K7ToypRgQuA0DLlSOZ+vK2tv9tCWz2zNQuImFHxzl/E//Z6Xk6/hCv5GTwagcJwJMn/ZTg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "md5": "^2.3.0", + "properties": "^1.2.1" + }, + "peerDependencies": { + "allure-playwright": "3.0.0" + }, + "peerDependenciesMeta": { + "allure-playwright": { + "optional": true + } + } + }, + "node_modules/allure-playwright": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/allure-playwright/-/allure-playwright-3.0.0.tgz", + "integrity": "sha512-SgRTEc2Z1JyF7x1SMwtHbW+QMEplcbW3lMw19vvtdkbB3L2RhRj8OvI2ieIyfRIchrYgTtvB8SYSLEeON1cV6w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "allure-js-commons": "3.0.0" + }, + "peerDependencies": { + "@playwright/test": ">=1.36.0" + } + }, + "node_modules/charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": "*" + } + }, + "node_modules/crypt": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": "*" + } + }, + "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, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true, + "license": "MIT" + }, + "node_modules/md5": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", + "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "charenc": "0.0.2", + "crypt": "0.0.2", + "is-buffer": "~1.1.6" + } + }, + "node_modules/playwright": { + "version": "1.47.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.47.1.tgz", + "integrity": "sha512-SUEKi6947IqYbKxRiqnbUobVZY4bF1uu+ZnZNJX9DfU1tlf2UhWfvVjLf01pQx9URsOr18bFVUKXmanYWhbfkw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "1.47.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.47.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.47.1.tgz", + "integrity": "sha512-i1iyJdLftqtt51mEk6AhYFaAJCDx0xQ/O5NU8EKaWFgMjItPVma542Nh/Aq8aLCjIJSzjaiEQGW/nyqLkGF1OQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/properties/-/properties-1.2.1.tgz", + "integrity": "sha512-qYNxyMj1JeW54i/EWEFsM1cVwxJbtgPp8+0Wg9XjNaK6VE/c4oRi6PNu5p7w1mNXEIQIjV5Wwn8v8Gz82/QzdQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 000000000..00dfa6b58 --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "name": "feedbacksystem-1", + "version": "1.0.0", + "description": "
", + "main": "index.js", + "directories": { + "doc": "docs" + }, + "scripts": {}, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "@playwright/test": "^1.47.1", + "@types/node": "^22.5.5", + "allure-commandline": "^2.30.0", + "allure-playwright": "^3.0.0" + } +} diff --git a/playwright.config.js b/playwright.config.js new file mode 100644 index 000000000..4208666d3 --- /dev/null +++ b/playwright.config.js @@ -0,0 +1,79 @@ +// @ts-check +const { defineConfig, devices } = require('@playwright/test'); + +/** + * Read environment variables from file. + * https://github.com/motdotla/dotenv + */ +// require('dotenv').config({ path: path.resolve(__dirname, '.env') }); + +/** + * @see https://playwright.dev/docs/test-configuration + */ +module.exports = defineConfig({ + testDir: './tests', + /* Run tests in files in parallel */ + fullyParallel: true, + /* Fail the build on CI if you accidentally left test.only in the source code. */ + forbidOnly: !!process.env.CI, + /* Retry on CI only */ + retries: process.env.CI ? 2 : 0, + /* Opt out of parallel tests on CI. */ + workers: process.env.CI ? 1 : undefined, + /* Reporter to use. See https://playwright.dev/docs/test-reporters */ + reporter: 'html', + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ + use: { + /* Base URL to use in actions like `await page.goto('/')`. */ + // baseURL: 'http://127.0.0.1:3000', + + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ + trace: 'on-first-retry', + }, + + /* Configure projects for major browsers */ + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + + { + name: 'firefox', + use: { ...devices['Desktop Firefox'] }, + }, + + { + name: 'webkit', + use: { ...devices['Desktop Safari'] }, + }, + + /* Test against mobile viewports. */ + // { + // name: 'Mobile Chrome', + // use: { ...devices['Pixel 5'] }, + // }, + // { + // name: 'Mobile Safari', + // use: { ...devices['iPhone 12'] }, + // }, + + /* Test against branded browsers. */ + // { + // name: 'Microsoft Edge', + // use: { ...devices['Desktop Edge'], channel: 'msedge' }, + // }, + // { + // name: 'Google Chrome', + // use: { ...devices['Desktop Chrome'], channel: 'chrome' }, + // }, + ], + + /* Run your local dev server before starting the tests */ + // webServer: { + // command: 'npm run start', + // url: 'http://127.0.0.1:3000', + // reuseExistingServer: !process.env.CI, + // }, +}); + From 251b8ad356107140828fce2063c00d1d1cacc265 Mon Sep 17 00:00:00 2001 From: Awet Issac Date: Thu, 17 Oct 2024 11:23:27 +0200 Subject: [PATCH 02/14] Fix Workflow --- .github/workflows/playwright.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 1e23a4a93..0279b0000 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -26,7 +26,7 @@ jobs: - name: Run Playwright tests with Allure run: | export PW_ALLURE_RESULTS_DIR=allure-results - npx playwright test --reporter=line,allure-playwright + playwright test --reporter=line,allure-playwright - name: Generate Allure Report run: | npx allure generate allure-results --clean -o allure-report From 480a0be77b604f1746b75a2d5866563bb91d028c Mon Sep 17 00:00:00 2001 From: Awet Issac Date: Thu, 17 Oct 2024 12:09:03 +0200 Subject: [PATCH 03/14] Der Playwright-Workflow wurde gefixt. --- .github/workflows/playwright.yml | 3 ++- modules/fbs-core/web/playwright.config.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 0279b0000..ffa86dbb9 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -25,8 +25,9 @@ jobs: run: npm i -D allure-playwright - name: Run Playwright tests with Allure run: | + working-directory: ./modules/fbs-core/web export PW_ALLURE_RESULTS_DIR=allure-results - playwright test --reporter=line,allure-playwright + npx playwright test --reporter=line,allure-playwright - name: Generate Allure Report run: | npx allure generate allure-results --clean -o allure-report diff --git a/modules/fbs-core/web/playwright.config.js b/modules/fbs-core/web/playwright.config.js index 8e53a6f69..c13c75978 100644 --- a/modules/fbs-core/web/playwright.config.js +++ b/modules/fbs-core/web/playwright.config.js @@ -2,7 +2,7 @@ import { defineConfig } from '@playwright/test'; export default defineConfig({ - testDir: './tests', + testDir: './modules/fbs-core/web/tests', timeout: 30000, retries: 0, From 253525ca668fe50fc12227008f1e9d3fff914e5c Mon Sep 17 00:00:00 2001 From: Awet Issac Date: Thu, 17 Oct 2024 12:22:42 +0200 Subject: [PATCH 04/14] 3. Fix des Workflows --- .github/workflows/playwright.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index ffa86dbb9..8ed5a72d4 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -24,8 +24,8 @@ jobs: - name: Install Allure dependencies run: npm i -D allure-playwright - name: Run Playwright tests with Allure + working-directory: ./modules/fbs-core/web run: | - working-directory: ./modules/fbs-core/web export PW_ALLURE_RESULTS_DIR=allure-results npx playwright test --reporter=line,allure-playwright - name: Generate Allure Report From 68f60cbd3b9f2dc29d2c0398b4f3adbfd3352bd9 Mon Sep 17 00:00:00 2001 From: Awet Issac Date: Thu, 17 Oct 2024 14:42:33 +0200 Subject: [PATCH 05/14] 4. Fix des Workflows --- .github/workflows/playwright.yml | 2 +- modules/fbs-core/web/playwright.config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 8ed5a72d4..4373f197e 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -27,7 +27,7 @@ jobs: working-directory: ./modules/fbs-core/web run: | export PW_ALLURE_RESULTS_DIR=allure-results - npx playwright test --reporter=line,allure-playwright + npx playwright test ./tests --reporter=line,allure-playwright - name: Generate Allure Report run: | npx allure generate allure-results --clean -o allure-report diff --git a/modules/fbs-core/web/playwright.config.js b/modules/fbs-core/web/playwright.config.js index c13c75978..8e53a6f69 100644 --- a/modules/fbs-core/web/playwright.config.js +++ b/modules/fbs-core/web/playwright.config.js @@ -2,7 +2,7 @@ import { defineConfig } from '@playwright/test'; export default defineConfig({ - testDir: './modules/fbs-core/web/tests', + testDir: './tests', timeout: 30000, retries: 0, From 798fc8437ba0e428049ccb4072618c01afe6a47a Mon Sep 17 00:00:00 2001 From: Awet Issac Date: Thu, 17 Oct 2024 23:37:19 +0200 Subject: [PATCH 06/14] Die Tests wurden gefixt. --- .../fbs-core/web/test-results/.last-run.json | 6 ++- .../web/tests/performanceTest.spec.js | 44 ------------------- 2 files changed, 4 insertions(+), 46 deletions(-) delete mode 100644 modules/fbs-core/web/tests/performanceTest.spec.js diff --git a/modules/fbs-core/web/test-results/.last-run.json b/modules/fbs-core/web/test-results/.last-run.json index cbcc1fbac..f81379cea 100644 --- a/modules/fbs-core/web/test-results/.last-run.json +++ b/modules/fbs-core/web/test-results/.last-run.json @@ -1,4 +1,6 @@ { - "status": "passed", - "failedTests": [] + "status": "failed", + "failedTests": [ + "badc1754af1944f68b2b-49a525f8f7a7f51b67da" + ] } \ No newline at end of file diff --git a/modules/fbs-core/web/tests/performanceTest.spec.js b/modules/fbs-core/web/tests/performanceTest.spec.js deleted file mode 100644 index a3803eb7a..000000000 --- a/modules/fbs-core/web/tests/performanceTest.spec.js +++ /dev/null @@ -1,44 +0,0 @@ -import { test, expect, chromium} from '@playwright/test'; -import config from '../config'; -import LoginPage from '../pages/login'; - -const allure = require("allure-js-commons"); -const loginUrl = config.test; -const user = { username: 'Awed23', password: 'Awed12345' }; - - -test('Performance-Test: Die Anmeldung erfolgt 10-Mal mit dem gleichen Benutzer', async () => { - - const browser = await chromium.launch({ headless: true }); - const context = await browser.newContext(); - - const loginAttempts = 10; - - // Simuliere 10 aufeinanderfolgende Anmeldeversuche für denselben Benutzer - for (let i = 0; i < loginAttempts; i++) { - const page = await context.newPage(); - const loginPage = new LoginPage(page); - - // Navigiere zur Login-Seite - await loginPage.navigateTo(loginUrl); - - // Fülle das Anmeldeformular aus - await loginPage.login(user.username, user.password); - - // Warte, bis die Seite nach der Anmeldung vollständig geladen ist (z.B. Dashboard) - await page.waitForLoadState('load'); - - // Überprüfe, ob die Anmeldung erfolgreich war - await expect(page).toHaveURL('https://fk-feedback-test.mni.thm.de/courses'); // Ersetze mit der Zielseite nach der Anmeldung - - console.log(`Anmeldeversuch ${i + 1} für Benutzer ${user.username} erfolgreich.`); - - // Browser-Tab schließen - await page.close(); - } - - // Browser schließen - await browser.close(); - - -}); From 40a75dd1c37ada72b49b9ed81732670ee65c2840 Mon Sep 17 00:00:00 2001 From: Awet Issac Date: Sun, 20 Oct 2024 15:55:45 +0200 Subject: [PATCH 07/14] =?UTF-8?q?F=C3=BCge=20Docker-Setup=20und=20Anpassun?= =?UTF-8?q?g=20der=20Test=20in=20der=20lokalen=20Umgebung=20hinzu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Setze Docker-Umgebung auf und führe Docker-Container aus - Starte lokale Entwicklungsumgebung vor dem Testlauf - Integriere Playwright-Tests und generiere Allure-Berichte --- .github/workflows/playwright.yml | 16 ++++++++++++++-- .../fbs-core/web/tests/SubmitTask.e2e.spec.js | 6 +++--- modules/fbs-core/web/tests/login.spec.js | 2 ++ 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 4373f197e..64729427e 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -13,8 +13,20 @@ jobs: - uses: actions/setup-node@v4 with: node-version: lts/* - - name: Install dependencies - run: npm ci + - name: Install Docker Compose + run: sudo apt-get install -y docker-compose + - name: Set up Docker environment + run: | + cd feedbacksystem + docker-compose up -d --build + cd modules/fbs-core/web + npm install + - name: Verify local environment + run: | + cd modules/fbs-core/web + npm run start & + sleep 10 + curl -s http://localhost:4200 || exit 1 - name: Clean previous Allure results run: | rm -rf allure-results diff --git a/modules/fbs-core/web/tests/SubmitTask.e2e.spec.js b/modules/fbs-core/web/tests/SubmitTask.e2e.spec.js index e0e9cc4d4..3a68bda04 100644 --- a/modules/fbs-core/web/tests/SubmitTask.e2e.spec.js +++ b/modules/fbs-core/web/tests/SubmitTask.e2e.spec.js @@ -12,7 +12,7 @@ test.describe('E2E-Test im Feedbacksystem von Anmeldung bis zur Abgabe einer Auf allure.label('Name:', 'Kompletter Prozess von Anmeldung bis Abmeldung'); - const username = 'Awed23'; + const username = 'awed'; const password = 'Awed12345'; const courseName = 'Datenbank'; const taskName = 'Aufgabe 1'; @@ -33,12 +33,12 @@ test.describe('E2E-Test im Feedbacksystem von Anmeldung bis zur Abgabe einer Auf allure.parameter('Vorbedingung :', 'Benutzer muss die Anmeldeseite des Feedbacksystems öffnen'); allure.parameter('Testdaten: ', `Benutzername: ${username}, Passwort: *****`); - await loginPage.navigateTo(config.test); + await loginPage.navigateTo(config.local); await loginPage.login(username, password); allure.parameter('Erwartung: ', 'Nach erfolgreichem Anmelden, soll die Kursseite geöffnet werden'); try { - await expect(page).toHaveURL('https://fk-feedback-test.mni.thm.de/courses'); + await expect(page).toHaveURL('http://localhost:4200/courses'); allure.parameter('Tatsächliches Ergebnis :', 'Benutzer wurde erfolgreich zur Kursseite weitergeleitet.'); } catch (error) { allure.parameter('Tatsächliches Ergebnis: ', 'Unerwartetes Problem während der Anmeldung.'); diff --git a/modules/fbs-core/web/tests/login.spec.js b/modules/fbs-core/web/tests/login.spec.js index 8ada0fcb7..4a082297a 100644 --- a/modules/fbs-core/web/tests/login.spec.js +++ b/modules/fbs-core/web/tests/login.spec.js @@ -16,6 +16,8 @@ test.describe('Loginseite Test', () => { await loginPage.navigateTo(config.local); await loginPage.login('awed', 'Awed12345'); await expect(page).toHaveURL('http://localhost:4200/courses'); + await page.getByLabel('User Menu').click(); //logout + await page.getByRole('menuitem', { name: 'Logout' }).click(); }); test('Anmeldung ist fehlgeschlagen, da entweder Nutzername oder Passwort falsch eingegben wurde', async ({ page }) => { From c52038a6547572198a1a707a1c1578b8ed8ed33a Mon Sep 17 00:00:00 2001 From: Awet Issac Date: Sun, 20 Oct 2024 17:06:55 +0200 Subject: [PATCH 08/14] package-lock.json und package.json wurden angepasst --- .github/workflows/playwright.yml | 16 +- modules/fbs-core/web/package-lock.json | 385 ++++++++++++++++--------- modules/fbs-core/web/package.json | 7 +- 3 files changed, 249 insertions(+), 159 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 64729427e..4373f197e 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -13,20 +13,8 @@ jobs: - uses: actions/setup-node@v4 with: node-version: lts/* - - name: Install Docker Compose - run: sudo apt-get install -y docker-compose - - name: Set up Docker environment - run: | - cd feedbacksystem - docker-compose up -d --build - cd modules/fbs-core/web - npm install - - name: Verify local environment - run: | - cd modules/fbs-core/web - npm run start & - sleep 10 - curl -s http://localhost:4200 || exit 1 + - name: Install dependencies + run: npm ci - name: Clean previous Allure results run: | rm -rf allure-results diff --git a/modules/fbs-core/web/package-lock.json b/modules/fbs-core/web/package-lock.json index a63b8de63..076da6aaa 100644 --- a/modules/fbs-core/web/package-lock.json +++ b/modules/fbs-core/web/package-lock.json @@ -52,8 +52,7 @@ "@types/node": "^12.11.1", "@typescript-eslint/eslint-plugin": "5.29.0", "@typescript-eslint/parser": "5.46.1", - "allure-commandline": "^2.30.0", - "allure-playwright": "^3.0.0", + "concurrently": "^9.0.1", "eslint": "^8.18.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-prettier": "^4.2.1", @@ -3814,23 +3813,6 @@ "url": "https://opencollective.com/parcel" } }, - "node_modules/@playwright/test": { - "version": "1.47.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.47.1.tgz", - "integrity": "sha512-dbWpcNQZ5nj16m+A5UNScYx7HX5trIy7g4phrcitn+Nk83S32EBX/CLU4hiF4RGKX/yRc93AAqtfaXB7JWBd4Q==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "playwright": "1.47.1" - }, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=18" - } - }, "node_modules/@schematics/angular": { "version": "14.2.13", "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-14.2.13.tgz", @@ -4913,48 +4895,6 @@ "ajv": "^6.9.1" } }, - "node_modules/allure-commandline": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/allure-commandline/-/allure-commandline-2.30.0.tgz", - "integrity": "sha512-qSaGG/I8P38q8gufnxvEog+IrIeCick+PJxxoTp5Vh/L8kviymIfv3A7fvYWziOqZ/oDywyOuNFMEfPZiiKwAA==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "allure": "bin/allure" - } - }, - "node_modules/allure-js-commons": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/allure-js-commons/-/allure-js-commons-3.0.0.tgz", - "integrity": "sha512-jhWK05JMkEyquhk+K7ToypRgQuA0DLlSOZ+vK2tv9tCWz2zNQuImFHxzl/E//Z6Xk6/hCv5GTwagcJwJMn/ZTg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "md5": "^2.3.0", - "properties": "^1.2.1" - }, - "peerDependencies": { - "allure-playwright": "3.0.0" - }, - "peerDependenciesMeta": { - "allure-playwright": { - "optional": true - } - } - }, - "node_modules/allure-playwright": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/allure-playwright/-/allure-playwright-3.0.0.tgz", - "integrity": "sha512-SgRTEc2Z1JyF7x1SMwtHbW+QMEplcbW3lMw19vvtdkbB3L2RhRj8OvI2ieIyfRIchrYgTtvB8SYSLEeON1cV6w==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "allure-js-commons": "3.0.0" - }, - "peerDependencies": { - "@playwright/test": ">=1.36.0" - } - }, "node_modules/angular-i18next": { "version": "14.2.0", "resolved": "https://registry.npmjs.org/angular-i18next/-/angular-i18next-14.2.0.tgz", @@ -5873,16 +5813,6 @@ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, - "node_modules/charenc": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", - "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": "*" - } - }, "node_modules/chart.js": { "version": "2.9.4", "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-2.9.4.tgz", @@ -6252,6 +6182,236 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "node_modules/concurrently": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.0.1.tgz", + "integrity": "sha512-wYKvCd/f54sTXJMSfV6Ln/B8UrfLBKOYa+lzc6CHay3Qek+LorVSBdMVfyewFhRbH0Rbabsk4D+3PL/VjQ5gzg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.2", + "lodash": "^4.17.21", + "rxjs": "^7.8.1", + "shell-quote": "^1.8.1", + "supports-color": "^8.1.1", + "tree-kill": "^1.2.2", + "yargs": "^17.7.2" + }, + "bin": { + "conc": "dist/bin/concurrently.js", + "concurrently": "dist/bin/concurrently.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/concurrently/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/concurrently/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/concurrently/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/concurrently/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/concurrently/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/concurrently/node_modules/rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/concurrently/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/concurrently/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/tslib": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.0.tgz", + "integrity": "sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA==", + "dev": true, + "license": "0BSD" + }, + "node_modules/concurrently/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/concurrently/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/concurrently/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/connect": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", @@ -6630,16 +6790,6 @@ "node": ">= 8" } }, - "node_modules/crypt": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", - "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": "*" - } - }, "node_modules/css": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/css/-/css-3.0.0.tgz", @@ -9799,13 +9949,6 @@ "node": ">=8" } }, - "node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true, - "license": "MIT" - }, "node_modules/is-core-module": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", @@ -10984,18 +11127,6 @@ "npm": ">=8.5.0" } }, - "node_modules/md5": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", - "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "charenc": "0.0.2", - "crypt": "0.0.2", - "is-buffer": "~1.1.6" - } - }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -12774,40 +12905,6 @@ "node": ">=8" } }, - "node_modules/playwright": { - "version": "1.47.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.47.1.tgz", - "integrity": "sha512-SUEKi6947IqYbKxRiqnbUobVZY4bF1uu+ZnZNJX9DfU1tlf2UhWfvVjLf01pQx9URsOr18bFVUKXmanYWhbfkw==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "playwright-core": "1.47.1" - }, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "fsevents": "2.3.2" - } - }, - "node_modules/playwright-core": { - "version": "1.47.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.47.1.tgz", - "integrity": "sha512-i1iyJdLftqtt51mEk6AhYFaAJCDx0xQ/O5NU8EKaWFgMjItPVma542Nh/Aq8aLCjIJSzjaiEQGW/nyqLkGF1OQ==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "bin": { - "playwright-core": "cli.js" - }, - "engines": { - "node": ">=18" - } - }, "node_modules/postcss": { "version": "8.4.14", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz", @@ -13593,16 +13690,6 @@ "node": ">=10" } }, - "node_modules/properties": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/properties/-/properties-1.2.1.tgz", - "integrity": "sha512-qYNxyMj1JeW54i/EWEFsM1cVwxJbtgPp8+0Wg9XjNaK6VE/c4oRi6PNu5p7w1mNXEIQIjV5Wwn8v8Gz82/QzdQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10" - } - }, "node_modules/protractor": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/protractor/-/protractor-7.0.0.tgz", @@ -14791,6 +14878,16 @@ "node": ">=8" } }, + "node_modules/shell-quote": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", diff --git a/modules/fbs-core/web/package.json b/modules/fbs-core/web/package.json index fc483f575..48b0d22d1 100644 --- a/modules/fbs-core/web/package.json +++ b/modules/fbs-core/web/package.json @@ -9,7 +9,11 @@ "test": "ng test", "clean": "rimraf dist", "lint": "ng lint --max-warnings=0", - "e2e": "ng e2e" + "e2e": "ng e2e", + "docker:start": "docker-compose up -d", + "test:setup": "npm install", + "app:start": "npm run start", + "test:e2e": "npm run docker:start && npm run test:setup && concurrently \"npm run app:start\" \"npx playwright test\"" }, "private": true, "dependencies": { @@ -57,6 +61,7 @@ "@types/node": "^12.11.1", "@typescript-eslint/eslint-plugin": "5.29.0", "@typescript-eslint/parser": "5.46.1", + "concurrently": "^9.0.1", "eslint": "^8.18.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-prettier": "^4.2.1", From 0bc948178f3b879247ed96146e94939d368d933a Mon Sep 17 00:00:00 2001 From: Awet Issac Date: Sun, 20 Oct 2024 17:23:45 +0200 Subject: [PATCH 09/14] Das Playwright-Workflow updaten --- .github/workflows/playwright.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 4373f197e..cbe6e7ff2 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -16,6 +16,7 @@ jobs: - name: Install dependencies run: npm ci - name: Clean previous Allure results + working-directory: ./modules/fbs-core/web run: | rm -rf allure-results rm -rf allure-report @@ -25,9 +26,7 @@ jobs: run: npm i -D allure-playwright - name: Run Playwright tests with Allure working-directory: ./modules/fbs-core/web - run: | - export PW_ALLURE_RESULTS_DIR=allure-results - npx playwright test ./tests --reporter=line,allure-playwright + run: npm run test:e2e - name: Generate Allure Report run: | npx allure generate allure-results --clean -o allure-report From 77b9001690b80cded23fd6f862b37e73c4443a13 Mon Sep 17 00:00:00 2001 From: Awet Issac Date: Sun, 20 Oct 2024 17:35:23 +0200 Subject: [PATCH 10/14] Playwright-Workflow update --- .github/workflows/playwright.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index cbe6e7ff2..57a686322 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -20,6 +20,15 @@ jobs: run: | rm -rf allure-results rm -rf allure-report + - name: Install Docker + run: | + sudo apt-get update + sudo apt-get install -y docker.io + sudo apt-get install -y docker-compose + - name: Start Docker containers + run: docker-compose -f docker-compose.yml up -d + - name: Wait for services to be ready + run: sleep 30 - name: Install Playwright Browsers run: npx playwright install --with-deps - name: Install Allure dependencies From 61b28fef05cd538cb9f45c628a4baf13e0424e28 Mon Sep 17 00:00:00 2001 From: Awet Issac Date: Sun, 20 Oct 2024 17:54:56 +0200 Subject: [PATCH 11/14] Update --- .github/workflows/playwright.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 57a686322..fe6fc0a12 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -13,22 +13,26 @@ jobs: - uses: actions/setup-node@v4 with: node-version: lts/* + - name: Install Docker + run: | + sudo apt-get update + sudo apt-get install -y docker.io docker-compose + docker-compose --version + - name: Start Docker containers + working-directory: ./feedbacksystem + run: docker-compose up -d --build - name: Install dependencies run: npm ci + - name: Start Application + working-directory: ./modules/fbs-core/web + run: npm run start & + - name: Wait for services to be ready + run: sleep 30 - name: Clean previous Allure results working-directory: ./modules/fbs-core/web run: | rm -rf allure-results rm -rf allure-report - - name: Install Docker - run: | - sudo apt-get update - sudo apt-get install -y docker.io - sudo apt-get install -y docker-compose - - name: Start Docker containers - run: docker-compose -f docker-compose.yml up -d - - name: Wait for services to be ready - run: sleep 30 - name: Install Playwright Browsers run: npx playwright install --with-deps - name: Install Allure dependencies From e9db18a88ae51a06b52aabecee75badf75cb4f3d Mon Sep 17 00:00:00 2001 From: Awet Issac Date: Sun, 20 Oct 2024 19:06:06 +0200 Subject: [PATCH 12/14] Installation Docker entfernen --- .github/workflows/playwright.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index fe6fc0a12..c9b84289f 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -13,11 +13,6 @@ jobs: - uses: actions/setup-node@v4 with: node-version: lts/* - - name: Install Docker - run: | - sudo apt-get update - sudo apt-get install -y docker.io docker-compose - docker-compose --version - name: Start Docker containers working-directory: ./feedbacksystem run: docker-compose up -d --build From 30ffced42d875e9178a2424ec45bac9f3271a78b Mon Sep 17 00:00:00 2001 From: Awet Issac Date: Sun, 20 Oct 2024 19:10:31 +0200 Subject: [PATCH 13/14] Update: Docker Fix --- .github/workflows/playwright.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index c9b84289f..c9d98670b 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -14,7 +14,6 @@ jobs: with: node-version: lts/* - name: Start Docker containers - working-directory: ./feedbacksystem run: docker-compose up -d --build - name: Install dependencies run: npm ci From adb6d61bb0142fd7061532c45d54171435fac8fd Mon Sep 17 00:00:00 2001 From: Awet Issac Date: Sun, 20 Oct 2024 19:42:51 +0200 Subject: [PATCH 14/14] Run Tests --- .github/workflows/playwright.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index c9d98670b..0076936b1 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -2,8 +2,6 @@ name: Playwright Tests with Allure Reports on: push: branches: [ dev] - pull_request: - branches: [ dev ] jobs: test: timeout-minutes: 60 @@ -13,8 +11,6 @@ jobs: - uses: actions/setup-node@v4 with: node-version: lts/* - - name: Start Docker containers - run: docker-compose up -d --build - name: Install dependencies run: npm ci - name: Start Application