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/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 38c886d43..61570e71a 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",