diff --git a/.github/workflows/e2e.run.tests.yml b/.github/workflows/e2e.run.tests.yml index 165c16743..476b06bce 100644 --- a/.github/workflows/e2e.run.tests.yml +++ b/.github/workflows/e2e.run.tests.yml @@ -18,8 +18,18 @@ jobs: - name: E2E | Boot up test system run: | cd authentik/ + rm -rf database ./database.unpack.sh docker compose up -d + cd ../ + docker compose up -d database + cd backend + cp .env.dist .env + ln -s src/auth/public.pem public.pem + npm install + npm run db:reset + npm run build + npm run start & cd ../frontend cp .env.dist .env npm install diff --git a/backend/package-lock.json b/backend/package-lock.json index 0477fcb47..e847450de 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -5,13 +5,13 @@ "requires": true, "packages": { "": { - "name": "backend", + "name": "dreammall-backend", "version": "1.2.1", "license": "Apache-2.0", "dependencies": { "@apollo/server": "^4.10.4", - "@getbrevo/brevo": "^2.1.1", - "@prisma/client": "^5.15.1", + "@getbrevo/brevo": "^2.2.0", + "@prisma/client": "^5.16.1", "@vuepress/theme-default": "^2.0.0-rc.37", "axios": "^1.7.2", "class-validator": "^0.14.1", @@ -20,7 +20,7 @@ "graphql": "^16.9.0", "graphql-scalars": "^1.23.0", "jsonwebtoken": "^9.0.2", - "prisma": "^5.15.1", + "prisma": "^5.16.1", "prisma-extension-soft-delete": "^1.0.1", "reflect-metadata": "^0.2.2", "tsconfig-paths": "^4.2.0", @@ -32,7 +32,7 @@ "@eslint-community/eslint-plugin-eslint-comments": "^4.3.0", "@types/jest": "^29.5.12", "@types/jsonwebtoken": "^9.0.6", - "@types/node": "^20.14.8", + "@types/node": "^20.14.9", "@types/uuid": "^10.0.0", "@typescript-eslint/eslint-plugin": "^7.13.1", "@typescript-eslint/parser": "^7.13.1", @@ -2389,9 +2389,9 @@ } }, "node_modules/@prisma/client": { - "version": "5.15.1", - "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.15.1.tgz", - "integrity": "sha512-fmZRGmsUJ9+VwC/AvfP/PwdpD0xAEyPvNsD9/B3+GYpETq9VejVRT3PiqNvl76q1uYYzNZeo8u/LmzzTetHSEg==", + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.16.1.tgz", + "integrity": "sha512-wM9SKQjF0qLxdnOZIVAIMKiz6Hu7vDt4FFAih85K1dk/Rr2mdahy6d3QP41K62N9O0DJJA//gUDA3Mp49xsKIg==", "hasInstallScript": true, "engines": { "node": ">=16.13" @@ -2406,43 +2406,43 @@ } }, "node_modules/@prisma/debug": { - "version": "5.15.1", - "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.15.1.tgz", - "integrity": "sha512-NQjdEplhXEcPvf84ghxExC+LD+iTimbg3sZvA3BhybVQIocBEBxFf9GTHhmRVPmjrWoBaYJBVgEEBXZT27JTbQ==" + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.16.1.tgz", + "integrity": "sha512-JsNgZAg6BD9RInLSrg7ZYzo11N7cVvYArq3fHGSD89HSgtN0VDdjV6bib7YddbcO6snzjchTiLfjeTqBjtArVQ==" }, "node_modules/@prisma/engines": { - "version": "5.15.1", - "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.15.1.tgz", - "integrity": "sha512-1iTRxJEFvpBpEWf2bYiMG6LBBQhX7X+GA5piH+tmPWgc/v+/ElxQf2kjQxby8AErmZqtZkdoKJ7FSRjNjBPE9Q==", + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.16.1.tgz", + "integrity": "sha512-KkyF3eIUtBIyp5A/rJHCtwQO18OjpGgx18PzjyGcJDY/+vNgaVyuVd+TgwBgeq6NLdd1XMwRCI+58vinHsAdfA==", "hasInstallScript": true, "dependencies": { - "@prisma/debug": "5.15.1", - "@prisma/engines-version": "5.15.1-1.5675a3182f972f1a8f31d16eee6abf4fd54910e3", - "@prisma/fetch-engine": "5.15.1", - "@prisma/get-platform": "5.15.1" + "@prisma/debug": "5.16.1", + "@prisma/engines-version": "5.16.0-24.34ace0eb2704183d2c05b60b52fba5c43c13f303", + "@prisma/fetch-engine": "5.16.1", + "@prisma/get-platform": "5.16.1" } }, "node_modules/@prisma/engines-version": { - "version": "5.15.1-1.5675a3182f972f1a8f31d16eee6abf4fd54910e3", - "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.15.1-1.5675a3182f972f1a8f31d16eee6abf4fd54910e3.tgz", - "integrity": "sha512-7csphKGCG6n/cN1MkT1mJvQ78Ir18IknlYZ8eyEoLKdQBb0HscR/6TyPmzqrMA7Rz01K1KeXqctwAqxtA/lKQg==" + "version": "5.16.0-24.34ace0eb2704183d2c05b60b52fba5c43c13f303", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.16.0-24.34ace0eb2704183d2c05b60b52fba5c43c13f303.tgz", + "integrity": "sha512-HkT2WbfmFZ9WUPyuJHhkiADxazHg8Y4gByrTSVeb3OikP6tjQ7txtSUGu9OBOBH0C13dPKN2qqH12xKtHu/Hiw==" }, "node_modules/@prisma/fetch-engine": { - "version": "5.15.1", - "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.15.1.tgz", - "integrity": "sha512-mj0wfsJ+mAdDp1ynT2JKxAXa+CoYMT267qF7g2Uv+oaVTI2CMfGWouMARht8T2QLTgl+gpXSFTwIYbcR+oWEtw==", + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.16.1.tgz", + "integrity": "sha512-oOkjaPU1lhcA/Rvr4GVfd1NLJBwExgNBE36Ueq7dr71kTMwy++a3U3oLd2ZwrV9dj9xoP6LjCcky799D9nEt4w==", "dependencies": { - "@prisma/debug": "5.15.1", - "@prisma/engines-version": "5.15.1-1.5675a3182f972f1a8f31d16eee6abf4fd54910e3", - "@prisma/get-platform": "5.15.1" + "@prisma/debug": "5.16.1", + "@prisma/engines-version": "5.16.0-24.34ace0eb2704183d2c05b60b52fba5c43c13f303", + "@prisma/get-platform": "5.16.1" } }, "node_modules/@prisma/get-platform": { - "version": "5.15.1", - "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.15.1.tgz", - "integrity": "sha512-oFccp7bYys+ZYkmtYzjR+0cRrGKvSuF+h5QhSkyEsYQ9kzJzQRvuWt2SiHRPt8xOQ4MTmujM+bP5uOexnnAHdQ==", + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.16.1.tgz", + "integrity": "sha512-R4IKnWnMkR2nUAbU5gjrPehdQYUUd7RENFD2/D+xXTNhcqczp0N+WEGQ3ViyI3+6mtVcjjNIMdnUTNyu3GxIgA==", "dependencies": { - "@prisma/debug": "5.15.1" + "@prisma/debug": "5.16.1" } }, "node_modules/@protobufjs/aspromise": { @@ -3030,9 +3030,9 @@ "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" }, "node_modules/@types/node": { - "version": "20.14.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.8.tgz", - "integrity": "sha512-DO+2/jZinXfROG7j7WKFn/3C6nFwxy2lLpgLjEXJz+0XKphZlTLJ14mo8Vfg8X5BWN6XjyESXq+LcYdT7tR3bA==", + "version": "20.14.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.9.tgz", + "integrity": "sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==", "dependencies": { "undici-types": "~5.26.4" } @@ -11365,12 +11365,12 @@ } }, "node_modules/prisma": { - "version": "5.15.1", - "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.15.1.tgz", - "integrity": "sha512-pYsUVpTlYvZ6mWvZKDv9rKdUa7tlfSUJY1CVtgb8Had1pHbIm9fr1MBASccr5XnSuCUrjnvKhWNwgSYy6aCajA==", + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.16.1.tgz", + "integrity": "sha512-Z1Uqodk44diztImxALgJJfNl2Uisl9xDRvqybMKEBYJLNKNhDfAHf+ZIJbZyYiBhLMbKU9cYGdDVG5IIXEnL2Q==", "hasInstallScript": true, "dependencies": { - "@prisma/engines": "5.15.1" + "@prisma/engines": "5.16.1" }, "bin": { "prisma": "build/index.js" diff --git a/backend/package.json b/backend/package.json index 19e1636c7..b2d17b988 100644 --- a/backend/package.json +++ b/backend/package.json @@ -32,8 +32,8 @@ }, "dependencies": { "@apollo/server": "^4.10.4", - "@getbrevo/brevo": "^2.1.1", - "@prisma/client": "^5.15.1", + "@getbrevo/brevo": "^2.2.0", + "@prisma/client": "^5.16.1", "@vuepress/theme-default": "^2.0.0-rc.37", "axios": "^1.7.2", "class-validator": "^0.14.1", @@ -42,7 +42,7 @@ "graphql": "^16.9.0", "graphql-scalars": "^1.23.0", "jsonwebtoken": "^9.0.2", - "prisma": "^5.15.1", + "prisma": "^5.16.1", "prisma-extension-soft-delete": "^1.0.1", "reflect-metadata": "^0.2.2", "tsconfig-paths": "^4.2.0", @@ -54,7 +54,7 @@ "@eslint-community/eslint-plugin-eslint-comments": "^4.3.0", "@types/jest": "^29.5.12", "@types/jsonwebtoken": "^9.0.6", - "@types/node": "^20.14.8", + "@types/node": "^20.14.9", "@types/uuid": "^10.0.0", "@typescript-eslint/eslint-plugin": "^7.13.1", "@typescript-eslint/parser": "^7.13.1", diff --git a/tests/cypress.config.ts b/tests/cypress.config.ts index ceb820462..79d23ab01 100644 --- a/tests/cypress.config.ts +++ b/tests/cypress.config.ts @@ -30,7 +30,8 @@ export default defineConfig({ viewportHeight: 1080, viewportWidth: 1920, env: { - authentikURL: 'http://localhost:9000', + authentikURL: 'http://localhost:9000/', + backendURL: 'http://localhost:4000/', }, setupNodeEvents, }, diff --git a/tests/cypress/e2e/features/Tables.feature b/tests/cypress/e2e/features/Tables.feature new file mode 100644 index 000000000..ad1dc5f14 --- /dev/null +++ b/tests/cypress/e2e/features/Tables.feature @@ -0,0 +1,11 @@ +Feature: Tables + As a user + I want to enter the room reachable via the central worldcafe button, + so that I can interact with other users in video conferences + + Scenario: Worldcafe Enter Room + Given I navigate to page '/signin' + When I submit the credentials 'akadmin' 'dreammall' + Then I am on page 'worldcafe' + When I click the enter my room button + Then My room is queried diff --git a/tests/cypress/e2e/pages/LoginPage.ts b/tests/cypress/e2e/pages/LoginPage.ts index 79de4711a..b277a91d3 100644 --- a/tests/cypress/e2e/pages/LoginPage.ts +++ b/tests/cypress/e2e/pages/LoginPage.ts @@ -14,7 +14,7 @@ class LoginPage { } agreeConsent() { - cy.url('include', 'dreammallearth-authorization-implicit-consent') + cy.url().should('include', 'dreammallearth-authorization-implicit-consent') cy.get(this.submitBtn).click() } } diff --git a/tests/cypress/e2e/pages/WorldcafePage.ts b/tests/cypress/e2e/pages/WorldcafePage.ts index c5536eef8..034f975de 100644 --- a/tests/cypress/e2e/pages/WorldcafePage.ts +++ b/tests/cypress/e2e/pages/WorldcafePage.ts @@ -1,6 +1,8 @@ class WorldcafePage { userMenuBtn: string = '.user-info' signOutBtn: string = '.sign-out' + centerBtn: string = '#create-button' + newTableBtnBtn: string = 'div.button-list > button.new-table-button' signoutButtonIsVisible() { cy.get(this.userMenuBtn).should('be.visible') @@ -10,6 +12,19 @@ class WorldcafePage { cy.get(this.userMenuBtn).first().click() cy.get(this.signOutBtn).click() } + + enterMyRoom() { + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + cy.intercept('POST', Cypress.env('backendURL'), (req) => { + // eslint-disable-next-line @typescript-eslint/no-unsafe-call, no-prototype-builtins, @typescript-eslint/no-unsafe-member-access + if (req.body.hasOwnProperty('query') && req.body.query.includes('joinMyRoom')) { + req.alias = 'postJoinMyRoomQuery' + } + }) + + cy.get(this.centerBtn).click() + cy.get(this.newTableBtnBtn).click() + } } export const worldcafePage = new WorldcafePage() diff --git a/tests/cypress/e2e/steps/tables.ts b/tests/cypress/e2e/steps/tables.ts new file mode 100644 index 000000000..706cf5262 --- /dev/null +++ b/tests/cypress/e2e/steps/tables.ts @@ -0,0 +1,13 @@ +import { Then, When } from '@badeball/cypress-cucumber-preprocessor' + +// eslint-disable-next-line import/no-relative-parent-imports +import { worldcafePage } from '../pages/WorldcafePage' + +When('I click the enter my room button', () => { + // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access + worldcafePage.enterMyRoom() +}) + +Then('My room is queried', () => { + cy.wait('@postJoinMyRoomQuery') +}) diff --git a/tests/package-lock.json b/tests/package-lock.json index 498385a53..8be353ea8 100644 --- a/tests/package-lock.json +++ b/tests/package-lock.json @@ -14,7 +14,11 @@ "@eslint-community/eslint-plugin-eslint-comments": "^4.3.0", "@typescript-eslint/eslint-plugin": "^7.8.0", "@typescript-eslint/parser": "^7.8.0", +<<<<<<< 714-feature-end-to-end-enter-room + "@vuepress/bundler-vite": "^2.0.0-rc.13", +======= "@vuepress/bundler-vite": "^2.0.0-rc.14", +>>>>>>> master "cypress": "^13.12.0", "cypress-network-idle": "^1.14.2", "eslint": "^8.57.0",