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,163 @@
import type { Page } from '@playwright/test';
import { IS_EE } from '../config/constants';
import { Users } from '../fixtures/userStates';
import { OmnichannelBusinessHours } from '../page-objects/omnichannel';
import { setSettingValueById } from '../utils';
import { createAgent } from '../utils/omnichannel/agents';
import { createBusinessHour } from '../utils/omnichannel/businessHours';
import { createDepartment } from '../utils/omnichannel/departments';
import { test, expect } from '../utils/test';
test.use({ storageState: Users.admin.state });
// TODO: These tests needs to be refactored to be independent from each other
test.describe('OC - Business Hours', () => {
test.skip(!IS_EE, 'OC - Manage Business Hours > Enterprise Edition Only');
let poOmnichannelBusinessHours: OmnichannelBusinessHours;
let department: Awaited<ReturnType<typeof createDepartment>>;
let department2: Awaited<ReturnType<typeof createDepartment>>;
let agent: Awaited<ReturnType<typeof createAgent>>;
const BHName = 'TEST Business Hours';
test.beforeAll(async ({ api }) => {
department = await createDepartment(api);
department2 = await createDepartment(api);
agent = await createAgent(api, 'user2');
expect((await setSettingValueById(api, 'Omnichannel_enable_department_removal', true)).status()).toBe(200);
await api.post('/settings/Livechat_enable_business_hours', { value: true }).then((res) => expect(res.status()).toBe(200));
await api.post('/settings/Livechat_business_hour_type', { value: 'Multiple' }).then((res) => expect(res.status()).toBe(200));
});
test.afterAll(async ({ api }) => {
await department.delete();
await department2.delete();
await agent.delete();
expect((await setSettingValueById(api, 'Omnichannel_enable_department_removal', false)).status()).toBe(200);
await api.post('/settings/Livechat_enable_business_hours', { value: false }).then((res) => expect(res.status()).toBe(200));
await api.post('/settings/Livechat_business_hour_type', { value: 'Single' }).then((res) => expect(res.status()).toBe(200));
});
test.beforeEach(async ({ page }: { page: Page }) => {
poOmnichannelBusinessHours = new OmnichannelBusinessHours(page);
});
test('OC - Manage Business Hours - Create Business Hours', async () => {
await poOmnichannelBusinessHours.goto();
await test.step('expect correct form default state', async () => {
await poOmnichannelBusinessHours.btnCreateBusinessHour.click();
await poOmnichannelBusinessHours.btnBack.click();
await expect(poOmnichannelBusinessHours.inputSearch).toBeVisible();
});
await test.step('expect to create a new business hours', async () => {
await poOmnichannelBusinessHours.btnCreateBusinessHour.click();
await poOmnichannelBusinessHours.inputName.fill(BHName);
await poOmnichannelBusinessHours.selectDepartment(department.data.name);
await poOmnichannelBusinessHours.btnSave.click();
await test.step('expect business hours to have been created', async () => {
await poOmnichannelBusinessHours.search(BHName);
await expect(poOmnichannelBusinessHours.table.findRowByName(BHName)).toBeVisible();
});
});
await test.step('expect to be able to delete business hours', async () => {
await poOmnichannelBusinessHours.deleteBusinessHour(BHName);
});
await test.step('expect business hours to have been deleted', async () => {
await poOmnichannelBusinessHours.search(BHName);
await expect(poOmnichannelBusinessHours.table.findRowByName(BHName)).not.toBeVisible();
});
});
test('OC - Business hours - Edit BH departments', async ({ api }) => {
await test.step('expect to create new businessHours', async () => {
const createBH = await createBusinessHour(api, {
name: BHName,
departments: [department.data._id],
});
expect(createBH.status()).toBe(200);
});
await poOmnichannelBusinessHours.goto();
await test.step('expect to add business hours departments', async () => {
await poOmnichannelBusinessHours.search(BHName);
await poOmnichannelBusinessHours.table.findRowByName(BHName).click();
await poOmnichannelBusinessHours.selectDepartment(department2.data.name);
await poOmnichannelBusinessHours.btnSave.click();
await expect(poOmnichannelBusinessHours.btnSave).not.toBeVisible();
});
await test.step('expect department to be in the chosen departments list', async () => {
await poOmnichannelBusinessHours.search(BHName);
await poOmnichannelBusinessHours.table.findRowByName(BHName).click();
await expect(poOmnichannelBusinessHours.findDepartmentsChipOption(department2.data.name)).toBeVisible();
await poOmnichannelBusinessHours.btnBack.click();
});
await test.step('expect to remove business hours departments', async () => {
await poOmnichannelBusinessHours.search(BHName);
await poOmnichannelBusinessHours.table.findRowByName(BHName).click();
await poOmnichannelBusinessHours.selectDepartment(department2.data.name);
await poOmnichannelBusinessHours.btnSave.click();
await expect(poOmnichannelBusinessHours.btnSave).not.toBeVisible();
});
await test.step('expect department to not be in the chosen departments list', async () => {
await poOmnichannelBusinessHours.search(BHName);
await poOmnichannelBusinessHours.table.findRowByName(BHName).click();
await expect(poOmnichannelBusinessHours.findDepartmentsChipOption(department2.data.name)).toBeHidden();
await poOmnichannelBusinessHours.btnBack.click();
});
await test.step('expect delete business hours', async () => {
await poOmnichannelBusinessHours.deleteBusinessHour(BHName);
});
});
test('OC - Business hours - Toggle BH active status', async ({ api }) => {
await test.step('expect to create new businessHours', async () => {
const createBH = await createBusinessHour(api, {
name: BHName,
departments: [department.data._id],
});
expect(createBH.status()).toBe(200);
});
await poOmnichannelBusinessHours.goto();
await test.step('expect to disable business hours', async () => {
await poOmnichannelBusinessHours.search(BHName);
await poOmnichannelBusinessHours.table.findRowByName(BHName).click();
await poOmnichannelBusinessHours.getCheckboxByLabel('Enabled').click();
await expect(poOmnichannelBusinessHours.getCheckboxByLabel('Enabled')).not.toBeChecked();
await poOmnichannelBusinessHours.btnSave.click();
await expect(poOmnichannelBusinessHours.btnSave).not.toBeVisible();
});
await test.step('expect to enable business hours', async () => {
await poOmnichannelBusinessHours.search(BHName);
await poOmnichannelBusinessHours.table.findRowByName(BHName).click();
await poOmnichannelBusinessHours.getCheckboxByLabel('Enabled').click();
await expect(poOmnichannelBusinessHours.getCheckboxByLabel('Enabled')).toBeChecked();
await poOmnichannelBusinessHours.btnSave.click();
await expect(poOmnichannelBusinessHours.btnSave).not.toBeVisible();
});
await test.step('expect delete business hours', async () => {
await poOmnichannelBusinessHours.deleteBusinessHour(BHName);
});
});
});