snapshot of https://github.com/RocketChat/Rocket.Chat.git (develop, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Create issues from TODOs / todos (push) Failing after 3s
Close inactive issues / close-issues (push) Has been cancelled
Deploy GitHub Pages / deploy-preview (push) Has been cancelled
CI / ⚙️ Variables Setup (push) Has been cancelled
CI / ⚙️ Test Guard (push) Has been cancelled
CI / 🚀 Notify external services - draft (push) Has been cancelled
CI / 📦 Build Packages (push) Has been cancelled
CI / 📦 Meteor Build (coverage) (push) Has been cancelled
CI / 📦 Meteor Build (production) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], fips) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Publish Docker Images (ghcr.io) (push) Has been cancelled
CI / 📦 Track Image Sizes (push) Has been cancelled
CI / 🔎 Code Check - Action Lint (push) Has been cancelled
CI / 🔎 Code Check (push) Has been cancelled
CI / 🔨 Test Storybook (push) Has been cancelled
CI / 🔨 Test Unit (push) Has been cancelled
CI / 🔨 Test API (CE) (push) Has been cancelled
CI / 🔨 Test API Livechat (CE) (push) Has been cancelled
CI / 🔨 Test UI (CE) (push) Has been cancelled
CI / 🔨 Test API (EE) (push) Has been cancelled
CI / 🔨 Test API Livechat (EE) (push) Has been cancelled
CI / 🔨 Test API Apps (deno-runtime - EE) (push) Has been cancelled
CI / 🔨 Test UI (EE) (push) Has been cancelled
CI / 🔨 Test API (FIPS) (push) Has been cancelled
CI / 🔨 Test API Livechat (FIPS) (push) Has been cancelled
CI / 🔨 Test UI (FIPS) (push) Has been cancelled
CI / 🔨 Test Federation Matrix (push) Has been cancelled
CI / 📊 Report Coverage (push) Has been cancelled
CI / ✅ Tests Done (push) Has been cancelled
CI / 🚀 Publish build assets (push) Has been cancelled
CI / 🚀 Publish Docker Images (DockerHub) (push) Has been cancelled
CI / 🚀 Notify external services (push) Has been cancelled
CI / Update Version Durability (push) Has been cancelled
Release / Release (push) Has been cancelled
Code scanning - action / CodeQL-Build (push) Failing after 1s
Auto-close duplicate issues / auto-close-duplicates (push) Failing after 1s

This commit is contained in:
upstream-mirror
2026-09-16 01:21:02 +05:00
commit 30810eecd7
10161 changed files with 987110 additions and 0 deletions

View File

@@ -0,0 +1,98 @@
import type { Page } from '@playwright/test';
import { createAuxContext } from '../fixtures/createAuxContext';
import { Users } from '../fixtures/userStates';
import { HomeOmnichannel } from '../page-objects';
import { createAgent } from '../utils/omnichannel/agents';
import { createManager } from '../utils/omnichannel/managers';
import { createConversation } from '../utils/omnichannel/rooms';
import { test, expect } from '../utils/test';
test.describe('OC - Chat transfers [Agent role]', () => {
let sessions: { page: Page; poHomeOmnichannel: HomeOmnichannel }[];
let agents: Awaited<ReturnType<typeof createAgent>>[];
let managers: Awaited<ReturnType<typeof createManager>>[];
let conversations: Awaited<ReturnType<typeof createConversation>>[];
// Create agents and managers
test.beforeAll(async ({ api }) => {
agents = await Promise.all([createAgent(api, 'user1'), createAgent(api, 'user2')]);
managers = await Promise.all([createManager(api, 'user1')]);
});
// Livechat when agent idle
test.beforeAll(async ({ api }) => {
await api.post('/settings/Livechat_enabled_when_agent_idle', { value: false }).then((res) => expect(res.status()).toBe(200));
});
// Create agent sessions
test.beforeAll(async ({ browser }) => {
sessions = await Promise.all([
createAuxContext(browser, Users.user1).then(({ page }) => ({ page, poHomeOmnichannel: new HomeOmnichannel(page) })),
createAuxContext(browser, Users.user2).then(({ page }) => ({ page, poHomeOmnichannel: new HomeOmnichannel(page) })),
]);
});
// Delete all data
test.afterAll(async ({ api }) => {
await Promise.all([
...conversations.map((conversation) => conversation.delete()),
...agents.map((agent) => agent.delete()),
...managers.map((manager) => manager.delete()),
api.post('/settings/Livechat_enabled_when_agent_idle', { value: true }).then((res) => expect(res.status()).toBe(200)),
]);
});
// Make "user-1" online & "user-2" offline so that chat can be automatically routed to "user-1"
test.beforeAll(async () => {
const [agentA, agentB] = sessions;
await agentA.poHomeOmnichannel.navbar.changeUserStatus('online');
await agentB.poHomeOmnichannel.navbar.changeUserStatus('offline');
});
// Close sessions
test.afterAll(async () => {
await Promise.all(sessions.map(({ page }) => page.close()));
});
// Start a new chat for each test
test.beforeAll(async ({ api }) => {
conversations = [await createConversation(api)];
});
test('OC - Chat transfers [Agent role] - Transfer omnichannel chat to another agent', async () => {
const [agentA, agentB] = sessions;
const [{ visitor }] = conversations.map(({ data }) => data);
await test.step('expect to have 1 omnichannel assigned to agent 1', async () => {
await agentA.poHomeOmnichannel.sidebar.getSidebarItemByName(visitor.name).click();
});
await test.step('expect to not be able to transfer chat to "user-2" when that user is offline', async () => {
await agentB.poHomeOmnichannel.navbar.changeUserStatus('offline');
await agentA.poHomeOmnichannel.quickActionsRoomToolbar.forwardChat();
await agentA.poHomeOmnichannel.content.forwardChatModal.inputForwardUser.click();
await agentA.poHomeOmnichannel.content.forwardChatModal.inputForwardUser.type('user2');
await expect(agentA.page.locator('text=Empty')).toBeVisible();
await agentA.poHomeOmnichannel.goto();
});
await test.step('expect to be able to transfer an omnichannel to conversation to agent 2 as agent 1 when agent 2 is online', async () => {
await agentB.poHomeOmnichannel.navbar.changeUserStatus('online');
await agentA.poHomeOmnichannel.sidebar.getSidebarItemByName(visitor.name).click();
await agentA.poHomeOmnichannel.quickActionsRoomToolbar.forwardChat();
await agentA.poHomeOmnichannel.content.forwardChatModal.selectUser('user2');
await agentA.poHomeOmnichannel.content.forwardChatModal.inputComment.type('any_comment');
await agentA.poHomeOmnichannel.content.forwardChatModal.btnForward.click();
await agentA.poHomeOmnichannel.toastMessage.waitForDisplay();
});
await test.step('expect to have 1 omnichannel assigned to agent 2', async () => {
await agentB.poHomeOmnichannel.sidebar.getSidebarItemByName(visitor.name).click();
});
});
});