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
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:
@@ -0,0 +1,135 @@
|
||||
import { faker } from '@faker-js/faker';
|
||||
|
||||
import { IS_EE } from '../config/constants';
|
||||
import { Users } from '../fixtures/userStates';
|
||||
import { OmnichannelSlaPolicies } from '../page-objects/omnichannel';
|
||||
import { test, expect } from '../utils/test';
|
||||
|
||||
const ERROR = {
|
||||
nameRequired: 'Name required',
|
||||
estimatedWaitTimeRequired: 'Estimated wait time (time in minutes) required',
|
||||
};
|
||||
|
||||
const INITIAL_SLA = {
|
||||
name: faker.person.firstName(),
|
||||
description: faker.lorem.sentence(),
|
||||
estimatedWaitTime: faker.string.numeric({ length: 1, exclude: '0' }),
|
||||
};
|
||||
|
||||
const EDITED_SLA = {
|
||||
name: faker.person.firstName(),
|
||||
description: faker.lorem.sentence(),
|
||||
estimatedWaitTime: faker.string.numeric({ length: 1, exclude: '0' }),
|
||||
};
|
||||
|
||||
test.skip(!IS_EE, 'Omnichannel SLA Policies > Enterprise Only');
|
||||
|
||||
test.use({ storageState: Users.user1.state });
|
||||
|
||||
test.describe('Omnichannel SLA Policies', () => {
|
||||
let poOmnichannelSlaPolicies: OmnichannelSlaPolicies;
|
||||
|
||||
test.beforeAll(async ({ api }) => {
|
||||
await api.post('/livechat/users/agent', { username: 'user1' });
|
||||
await api.post('/livechat/users/manager', { username: 'user1' });
|
||||
});
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
poOmnichannelSlaPolicies = new OmnichannelSlaPolicies(page);
|
||||
await poOmnichannelSlaPolicies.goto();
|
||||
});
|
||||
|
||||
test.afterAll(async ({ api }) => {
|
||||
await api.delete('/livechat/users/agent/user1');
|
||||
await api.delete('/livechat/users/manager/user1');
|
||||
});
|
||||
|
||||
test('Manage SLAs', async () => {
|
||||
await test.step('Add new SLA', async () => {
|
||||
await poOmnichannelSlaPolicies.createNew();
|
||||
|
||||
await test.step('should not submit form with empty required fields: name and estimated wait time', async () => {
|
||||
await poOmnichannelSlaPolicies.manageSlaPolicy.btnSave.click();
|
||||
await expect(poOmnichannelSlaPolicies.manageSlaPolicy.errorMessage(ERROR.nameRequired)).toBeVisible();
|
||||
await expect(poOmnichannelSlaPolicies.manageSlaPolicy.errorMessage(ERROR.estimatedWaitTimeRequired)).toBeVisible();
|
||||
});
|
||||
|
||||
await test.step('input a valid name', async () => {
|
||||
await poOmnichannelSlaPolicies.manageSlaPolicy.inputName.fill(INITIAL_SLA.name);
|
||||
await expect(poOmnichannelSlaPolicies.manageSlaPolicy.errorMessage(ERROR.nameRequired)).not.toBeVisible();
|
||||
});
|
||||
|
||||
await test.step('input a valid description', async () => {
|
||||
await poOmnichannelSlaPolicies.manageSlaPolicy.inputDescription.fill(INITIAL_SLA.description);
|
||||
});
|
||||
|
||||
await test.step('only allow numbers on estimated wait time field', async () => {
|
||||
await poOmnichannelSlaPolicies.manageSlaPolicy.inputEstimatedWaitTime.pressSequentially('a');
|
||||
await expect(poOmnichannelSlaPolicies.manageSlaPolicy.inputEstimatedWaitTime).toHaveValue('0');
|
||||
});
|
||||
|
||||
await test.step('not allow 0 on estimated wait time field', async () => {
|
||||
await poOmnichannelSlaPolicies.manageSlaPolicy.inputEstimatedWaitTime.fill('0');
|
||||
await expect(poOmnichannelSlaPolicies.manageSlaPolicy.errorMessage(ERROR.estimatedWaitTimeRequired)).toBeVisible();
|
||||
});
|
||||
|
||||
await test.step('input a valid estimated wait time', async () => {
|
||||
await poOmnichannelSlaPolicies.manageSlaPolicy.inputEstimatedWaitTime.fill(INITIAL_SLA.estimatedWaitTime);
|
||||
await expect(poOmnichannelSlaPolicies.manageSlaPolicy.errorMessage(ERROR.estimatedWaitTimeRequired)).not.toBeVisible();
|
||||
});
|
||||
|
||||
await test.step('save sla', async () => {
|
||||
await expect(poOmnichannelSlaPolicies.manageSlaPolicy.btnSave).toBeEnabled();
|
||||
await poOmnichannelSlaPolicies.manageSlaPolicy.btnSave.click();
|
||||
|
||||
await expect(poOmnichannelSlaPolicies.manageSlaPolicy.inputName).not.toBeVisible();
|
||||
await expect(poOmnichannelSlaPolicies.table.findRowByName(INITIAL_SLA.name)).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
await test.step('Search SLA', async () => {
|
||||
await poOmnichannelSlaPolicies.inputSearch.fill('random_text_that_should_have_no_match');
|
||||
await expect(poOmnichannelSlaPolicies.table.findRowByName(INITIAL_SLA.name)).not.toBeVisible();
|
||||
await expect(poOmnichannelSlaPolicies.emptyState).toBeVisible();
|
||||
await poOmnichannelSlaPolicies.inputSearch.fill(INITIAL_SLA.name);
|
||||
await expect(poOmnichannelSlaPolicies.table.findRowByName(INITIAL_SLA.name)).toBeVisible();
|
||||
await expect(poOmnichannelSlaPolicies.emptyState).not.toBeVisible();
|
||||
await poOmnichannelSlaPolicies.inputSearch.fill('');
|
||||
});
|
||||
|
||||
await test.step('Edit SLA', async () => {
|
||||
await poOmnichannelSlaPolicies.table.findRowByName(INITIAL_SLA.name).click();
|
||||
|
||||
await expect(poOmnichannelSlaPolicies.manageSlaPolicy.inputName).toHaveValue(INITIAL_SLA.name);
|
||||
await expect(poOmnichannelSlaPolicies.manageSlaPolicy.inputDescription).toHaveValue(INITIAL_SLA.description);
|
||||
await expect(poOmnichannelSlaPolicies.manageSlaPolicy.inputEstimatedWaitTime).toHaveValue(INITIAL_SLA.estimatedWaitTime);
|
||||
|
||||
await test.step('edit name', async () => {
|
||||
await poOmnichannelSlaPolicies.manageSlaPolicy.inputName.fill(EDITED_SLA.name);
|
||||
await expect(poOmnichannelSlaPolicies.manageSlaPolicy.errorMessage(ERROR.nameRequired)).not.toBeVisible();
|
||||
});
|
||||
|
||||
await test.step('edit description', async () => {
|
||||
await poOmnichannelSlaPolicies.manageSlaPolicy.inputDescription.fill(EDITED_SLA.description);
|
||||
});
|
||||
|
||||
await test.step('edit estimated wait time', async () => {
|
||||
await poOmnichannelSlaPolicies.manageSlaPolicy.inputEstimatedWaitTime.fill(EDITED_SLA.estimatedWaitTime);
|
||||
await expect(poOmnichannelSlaPolicies.manageSlaPolicy.errorMessage(ERROR.estimatedWaitTimeRequired)).not.toBeVisible();
|
||||
});
|
||||
|
||||
await test.step('save sla', async () => {
|
||||
await expect(poOmnichannelSlaPolicies.manageSlaPolicy.btnSave).toBeEnabled();
|
||||
await poOmnichannelSlaPolicies.manageSlaPolicy.btnSave.click();
|
||||
|
||||
await expect(poOmnichannelSlaPolicies.manageSlaPolicy.inputName).not.toBeVisible();
|
||||
await expect(poOmnichannelSlaPolicies.table.findRowByName(EDITED_SLA.name)).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
await test.step('Remove SLA', async () => {
|
||||
await poOmnichannelSlaPolicies.removeSLA(EDITED_SLA.name);
|
||||
await expect(poOmnichannelSlaPolicies.table.findRowByName(EDITED_SLA.name)).not.toBeVisible();
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user