diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 6fd8d3150117..50138d215a3c 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -268,7 +268,6 @@ jobs: env: MONGO_URL: 'mongodb://host.docker.internal:27017/rocketchat?replicaSet=rs0&directConnection=true' MONGO_OPLOG_URL: 'mongodb://mongodb:27017/local?replicaSet=rs0&directConnection=true' - VOIP_MANAGEMENT_SERVER_PWD: ${{ secrets.VOIP_MANAGEMENT_SERVER_PWD }} run: | export LOWERCASE_REPOSITORY=$(echo "${{ github.repository_owner }}" | tr "[:upper:]" "[:lower:]") @@ -447,7 +446,6 @@ jobs: DOCKER_TAG: ${{ needs.release-versions.outputs.gh-docker-tag }} TRANSPORTER: nats://nats:4222 ENTERPRISE_LICENSE: ${{ secrets.ENTERPRISE_LICENSE }} - VOIP_MANAGEMENT_SERVER_PWD: ${{ secrets.VOIP_MANAGEMENT_SERVER_PWD }} run: | export LOWERCASE_REPOSITORY=$(echo "${{ github.repository_owner }}" | tr "[:upper:]" "[:lower:]") diff --git a/apps/meteor/server/models/raw/LivechatInquiry.ts b/apps/meteor/server/models/raw/LivechatInquiry.ts index 703ddeafbaeb..23d1eea9bd98 100644 --- a/apps/meteor/server/models/raw/LivechatInquiry.ts +++ b/apps/meteor/server/models/raw/LivechatInquiry.ts @@ -5,6 +5,7 @@ import { LivechatInquiryStatus } from '@rocket.chat/core-typings'; import { BaseRaw } from './BaseRaw'; +// @ts-ignore Circular reference on field 'attachments' export class LivechatInquiryRaw extends BaseRaw implements ILivechatInquiryModel { constructor(db: Db, trash?: Collection>) { super(db, 'livechat_inquiry', trash); diff --git a/apps/meteor/tests/e2e/omnichannel-voip-footer.spec.ts b/apps/meteor/tests/e2e/omnichannel-voip-footer.spec.ts deleted file mode 100644 index 37d4f92bf637..000000000000 --- a/apps/meteor/tests/e2e/omnichannel-voip-footer.spec.ts +++ /dev/null @@ -1,178 +0,0 @@ -import type { Page } from '@playwright/test'; - -import { test, expect } from './utils/test'; -import { OmnichannelDialpadModal, OmnichannelVoipFooter, OmnichannelSection } from './page-objects'; -import { createAuxContext } from './utils'; -import { createToken } from '../../client/lib/utils/createToken'; -// import { IS_EE } from './config/constants'; - -type PageObjects = { - page: Page; - omncSection: OmnichannelSection; - dialpadModal: OmnichannelDialpadModal; - voipFooter: OmnichannelVoipFooter; -}; - -const createPageObjects = (page: Page) => ({ - page, - omncSection: new OmnichannelSection(page), - dialpadModal: new OmnichannelDialpadModal(page), - voipFooter: new OmnichannelVoipFooter(page), -}); - -test.skip(true /* IS_EE */, 'Omnichannel Voip Footer > Enterprise Only'); - -test.use({ storageState: 'admin-session.json' }); - -test.describe('Omnichannel VoIP Footer', () => { - let admin: PageObjects; - let user: PageObjects; - - test.beforeAll(async ({ api }) => { - // Enable Omnichannel - await api.post('/method.call/saveSettings', { - message: JSON.stringify({ - msg: 'method', - id: '67', - method: 'saveSettings', - params: [ - [{ _id: 'Livechat_enabled', value: true }], - { - twoFactorCode: 'b6769a5ae0a6071ecabbe868dbdfa925f856c2bb3d910f93cb39479c64ca221e', - twoFactorMethod: 'password', - }, - ], - }), - }); - - // Configure VoIP - const expectedSettings = { - VoIP_Enabled: true, - VoIP_Management_Server_Host: 'omni-asterisk.dev.rocket.chat', - VoIP_Management_Server_Port: 5038, - VoIP_Management_Server_Name: 'OminiAsterisk', - VoIP_Management_Server_Username: 'sales.rocket.chat', - VoIP_Server_Name: 'OmniAsterisk', - VoIP_Server_Websocket_Path: 'wss://omni-asterisk.dev.rocket.chat/ws', - }; - const promises = []; - for (const [key, value] of Object.entries(expectedSettings)) { - promises.push(api.post(`/settings/${key}`, { value })); - } - const allResults = await Promise.all(promises); - expect(allResults.every(({ status }) => status() === 200)).toBe(true); - - // Add agent - await Promise.all([ - api.post('/livechat/users/agent', { username: 'rocketchat.internal.admin.test' }), - api.post('/livechat/users/agent', { username: 'user1' }), - ]); - - // Add agent to extension and as a contact - await Promise.all([ - api.post('/omnichannel/agent/extension', { username: 'rocketchat.internal.admin.test', extension: '80018' }), - api.post('/omnichannel/agent/extension', { username: 'user1', extension: '80017' }), - api.post('/omnichannel/contact', { - name: 'Test User One', - phone: '80017', - email: '', - customFields: {}, - token: createToken(), - }), - ]); - }); - - test.beforeAll(async ({ browser }) => { - const { page } = await createAuxContext(browser, 'user1-session.json'); - user = createPageObjects(page); - - await expect(user.omncSection.element).toBeVisible({ timeout: 10000 }); - - if (await page.isVisible('[data-qa-id="deviceManagementFeatureModal"]')) { - await page.locator('[data-qa-id="deviceManagementFeatureModal"] button >> text="Got it"').click(); - } - - await expect(user.omncSection.btnVoipToggle).toBeEnabled(); - await page.waitForTimeout(2000); - await user.omncSection.btnVoipToggle.click(); - await expect(user.omncSection.btnVoipToggle).toHaveAttribute('aria-checked', 'true'); - }); - - test.afterAll(async ({ api }) => { - // Remove users from extensions - await Promise.all([ - api.delete(`/omnichannel/agent/extension/user1`), - api.delete(`/omnichannel/agent/extension/rocketchat.internal.admin.test`), - ]); - - // Remove users from extensions - await Promise.all([api.delete('/livechat/users/agent/user1'), api.delete('/livechat/users/agent/rocketchat.internal.admin.test')]); - }); - - test.beforeEach(async ({ page }) => { - admin = createPageObjects(page); - await page.goto('/home'); - }); - - test.beforeEach(async () => { - const { page, omncSection } = admin; - - // Enable voip - await expect(omncSection.element).toBeVisible({ timeout: 10000 }); - - // Close feature modal - if (await page.isVisible('[data-qa-id="deviceManagementFeatureModal"]')) { - await page.locator('[data-qa-id="deviceManagementFeatureModal"] button >> text="Got it"').click(); - } - - await expect(omncSection.btnVoipToggle).toBeEnabled(); - await page.waitForTimeout(2000); - await admin.omncSection.btnVoipToggle.click(); - await expect(omncSection.btnVoipToggle).toHaveAttribute('aria-checked', 'true'); - }); - - test('VoIP call identification', async () => { - await test.step('expect voip footer to identify known contact', async () => { - const { omncSection, dialpadModal, voipFooter } = admin; - - // Open dialpad modal - await expect(omncSection.btnDialpad).toBeEnabled(); - await omncSection.btnDialpad.click(); - - // Dial number and call - await expect(dialpadModal.element).toBeVisible(); - await dialpadModal.inputPhoneNumber.type('80017'); - await expect(dialpadModal.btnCall).toBeEnabled(); - await dialpadModal.btnCall.click(); - - // Check if contact name is there - await expect(voipFooter.element).toBeVisible({ timeout: 10000 }); - await expect(voipFooter.textTitle).toHaveText('Test User One'); - - // Reject the call - await voipFooter.btnEndCall.click(); - }); - - await test.step('expect voip footer to fallback to phone number for unknown contact', async () => { - const { omncSection, dialpadModal, voipFooter } = user; - - // Open dialpad modal - await expect(omncSection.btnDialpad).toBeEnabled(); - await omncSection.btnDialpad.click(); - - // Dial number and call - await expect(dialpadModal.element).toBeVisible(); - await dialpadModal.inputPhoneNumber.type('80018'); - await expect(dialpadModal.btnCall).toBeEnabled(); - await dialpadModal.btnCall.click(); - - // Check if contact name is there - await voipFooter.element.waitFor(); - await expect(voipFooter.element).toBeVisible({ timeout: 10000 }); - await expect(voipFooter.textTitle).toHaveText('80018'); - - // Reject the call - await voipFooter.btnEndCall.click(); - }); - }); -}); diff --git a/apps/meteor/tests/e2e/page-objects/index.ts b/apps/meteor/tests/e2e/page-objects/index.ts index 828e9c73afd3..47d50e611c42 100644 --- a/apps/meteor/tests/e2e/page-objects/index.ts +++ b/apps/meteor/tests/e2e/page-objects/index.ts @@ -9,6 +9,3 @@ export * from './omnichannel-agents'; export * from './omnichannel-departments'; export * from './omnichannel-current-chats'; export * from './omnichannel-livechat'; -export * from './omnichannel-section'; -export * from './omnichannel-voip-footer'; -export * from './omnichannel-dialpad-modal'; diff --git a/apps/meteor/tests/e2e/page-objects/omnichannel-dialpad-modal.ts b/apps/meteor/tests/e2e/page-objects/omnichannel-dialpad-modal.ts deleted file mode 100644 index b98ab2fd4d3c..000000000000 --- a/apps/meteor/tests/e2e/page-objects/omnichannel-dialpad-modal.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { Locator, Page } from '@playwright/test'; - -export class OmnichannelDialpadModal { - private readonly page: Page; - - constructor(page: Page) { - this.page = page; - } - - get element(): Locator { - return this.page.locator('dialog[data-qa-id="omncDialpadModal"]'); - } - - get inputPhoneNumber(): Locator { - return this.page.locator('input[type="text"]'); - } - - get btnCall(): Locator { - return this.page.locator('button[data-qa-id="omncDialpadCallButton"]'); - } -} diff --git a/apps/meteor/tests/e2e/page-objects/omnichannel-section.ts b/apps/meteor/tests/e2e/page-objects/omnichannel-section.ts deleted file mode 100644 index 8d617e25712b..000000000000 --- a/apps/meteor/tests/e2e/page-objects/omnichannel-section.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { Locator, Page } from '@playwright/test'; - -export class OmnichannelSection { - private readonly page: Page; - - constructor(page: Page) { - this.page = page; - } - - get element(): Locator { - return this.page.locator('div[data-qa-id="omncSection"]'); - } - - get btnVoipToggle(): Locator { - return this.page.locator('role=button[name="Enable/Disable VoIP"]'); - } - - get btnDialpad(): Locator { - return this.page.locator('role=button[name="Open Dialpad"]'); - } -} diff --git a/apps/meteor/tests/e2e/page-objects/omnichannel-voip-footer.ts b/apps/meteor/tests/e2e/page-objects/omnichannel-voip-footer.ts deleted file mode 100644 index a2febe220c1c..000000000000 --- a/apps/meteor/tests/e2e/page-objects/omnichannel-voip-footer.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { Locator, Page } from '@playwright/test'; - -export class OmnichannelVoipFooter { - private readonly page: Page; - - constructor(page: Page) { - this.page = page; - } - - get element(): Locator { - return this.page.locator('[data-qa-id="omncVoipFooter"]'); - } - - get btnReject(): Locator { - return this.page.locator('role=button[name="Reject call"]'); - } - - get btnEndCall(): Locator { - return this.page.locator('role=button[name="End call"]'); - } - - get textTitle(): Locator { - return this.page.locator('[data-qa-id="omncVoipTitle"]'); - } -} diff --git a/docker-compose-ci.yml b/docker-compose-ci.yml index c3c859d7a433..32b33c3d0a4e 100644 --- a/docker-compose-ci.yml +++ b/docker-compose-ci.yml @@ -14,7 +14,6 @@ services: - 'TRANSPORTER=${TRANSPORTER}' - MOLECULER_LOG_LEVEL=info - 'ROCKETCHAT_LICENSE=${ENTERPRISE_LICENSE}' - - 'OVERWRITE_SETTING_VoIP_Management_Server_Password=${VOIP_MANAGEMENT_SERVER_PWD}' extra_hosts: - 'host.docker.internal:host-gateway' depends_on: