Skip to content

Commit

Permalink
Merge branch 'master' into update-backend-packages-2024-06-30
Browse files Browse the repository at this point in the history
  • Loading branch information
mahula authored Jul 1, 2024
2 parents c47d563 + 3e489e8 commit 0fcd56d
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/e2e.run.tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
11 changes: 11 additions & 0 deletions tests/cypress/e2e/features/Tables.feature
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tests/cypress/e2e/pages/LoginPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Expand Down
15 changes: 15 additions & 0 deletions tests/cypress/e2e/pages/WorldcafePage.ts
Original file line number Diff line number Diff line change
@@ -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')
Expand All @@ -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()
13 changes: 13 additions & 0 deletions tests/cypress/e2e/steps/tables.ts
Original file line number Diff line number Diff line change
@@ -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')
})
4 changes: 4 additions & 0 deletions tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0fcd56d

Please sign in to comment.