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
183 lines
5.0 KiB
TypeScript
183 lines
5.0 KiB
TypeScript
import type { Locator, Page } from '@playwright/test';
|
|
|
|
import { OmnichannelContactCenter } from './omnichannel-contact-center';
|
|
import { FlexTab } from '../../fragments/flextabs/flextab';
|
|
import { Listbox } from '../../fragments/listbox';
|
|
import { OmnichannelConfirmRemoveChat } from '../../fragments/modals';
|
|
import { Table } from '../../fragments/table';
|
|
import { OmnichannelSectionsHref } from '../omnichannel-admin';
|
|
|
|
class OmnichannelConversationFlexTab extends FlexTab {
|
|
constructor(page: Page) {
|
|
super(page.getByRole('dialog', { name: 'Conversation' }));
|
|
}
|
|
|
|
private get btnOpenChat(): Locator {
|
|
return this.root.getByRole('button', { name: 'Open chat' });
|
|
}
|
|
|
|
async openChat() {
|
|
await this.btnOpenChat.click();
|
|
await this.waitForDismissal();
|
|
}
|
|
}
|
|
|
|
export class OmnichannelChatsFilters extends FlexTab {
|
|
readonly listbox: Listbox;
|
|
|
|
constructor(page: Page) {
|
|
super(page.getByRole('dialog', { name: 'Filters' }));
|
|
this.listbox = new Listbox(page);
|
|
}
|
|
|
|
get inputFrom(): Locator {
|
|
return this.root.locator('input[name="from"]');
|
|
}
|
|
|
|
get inputTo(): Locator {
|
|
return this.root.locator('input[name="to"]');
|
|
}
|
|
|
|
get btnApply(): Locator {
|
|
return this.root.getByRole('button', { name: 'Apply' });
|
|
}
|
|
|
|
get inputServedBy(): Locator {
|
|
return this.root.getByLabel('Served By').locator('input');
|
|
}
|
|
|
|
get inputDepartment(): Locator {
|
|
return this.root.getByLabel('Department').locator('input');
|
|
}
|
|
|
|
get selectStatusContainer(): Locator {
|
|
return this.root.getByRole('button', { name: 'Status' });
|
|
}
|
|
|
|
get inputTags(): Locator {
|
|
return this.root.getByLabel('Tags').locator('input');
|
|
}
|
|
|
|
get inputUnits(): Locator {
|
|
return this.root.getByLabel('Units').locator('input');
|
|
}
|
|
|
|
get btnClearFilters(): Locator {
|
|
return this.root.getByRole('button', { name: 'Clear filters' });
|
|
}
|
|
|
|
async selectServedBy(option: string) {
|
|
await this.inputServedBy.click();
|
|
await this.inputServedBy.fill(option);
|
|
await this.listbox.selectOption(option);
|
|
await this.btnApply.click();
|
|
}
|
|
|
|
async selectStatus(option: string) {
|
|
await this.selectStatusContainer.click();
|
|
await this.listbox.selectOption(option);
|
|
await this.btnApply.click();
|
|
}
|
|
|
|
async selectDepartment(option: string) {
|
|
await this.inputDepartment.click();
|
|
await this.inputDepartment.fill(option);
|
|
await this.listbox.selectOption(option);
|
|
await this.inputDepartment.click();
|
|
await this.btnApply.click();
|
|
}
|
|
|
|
async selectTag(option: string) {
|
|
await this.inputTags.click();
|
|
await this.inputTags.fill(option);
|
|
await this.listbox.selectOption(option);
|
|
await this.inputTags.click();
|
|
await this.btnApply.click();
|
|
}
|
|
|
|
async removeTag(option: string) {
|
|
await this.inputTags.click();
|
|
await this.listbox.selectOption(option);
|
|
await this.inputTags.click();
|
|
await this.btnApply.click();
|
|
}
|
|
|
|
async selectUnit(unitName: string) {
|
|
await this.inputUnits.click();
|
|
await this.inputUnits.fill(unitName);
|
|
await this.listbox.selectOption(unitName);
|
|
await this.btnApply.click();
|
|
}
|
|
|
|
async addTag(option: string) {
|
|
await this.inputTags.click();
|
|
await this.listbox.selectOption(option);
|
|
await this.inputTags.click();
|
|
}
|
|
}
|
|
|
|
class OmnichannelContactCenterChatsTable extends Table {
|
|
btnRemoveByName(name: string): Locator {
|
|
return this.findRowByName(name).getByRole('button', { name: 'Remove' });
|
|
}
|
|
}
|
|
|
|
export class OmnichannelContactCenterChats extends OmnichannelContactCenter {
|
|
protected readonly route = OmnichannelSectionsHref.currentChats;
|
|
|
|
protected override readonly tableName = 'Omnichannel Contact Center Chats';
|
|
|
|
readonly filters: OmnichannelChatsFilters;
|
|
|
|
readonly confirmRemoveChatModal: OmnichannelConfirmRemoveChat;
|
|
|
|
readonly conversation: OmnichannelConversationFlexTab;
|
|
|
|
constructor(page: Page) {
|
|
super(page);
|
|
this.filters = new OmnichannelChatsFilters(page);
|
|
this.confirmRemoveChatModal = new OmnichannelConfirmRemoveChat(page);
|
|
this.conversation = new OmnichannelConversationFlexTab(page);
|
|
}
|
|
|
|
override get table(): OmnichannelContactCenterChatsTable {
|
|
return new OmnichannelContactCenterChatsTable(this.page.getByRole('table', { name: this.tableName }));
|
|
}
|
|
|
|
async removeChatByName(name: string) {
|
|
await this.table.btnRemoveByName(name).click();
|
|
await this.confirmRemoveChatModal.confirm();
|
|
}
|
|
|
|
async openChat(name: string) {
|
|
await this.inputSearch.fill(name);
|
|
await this.table.findRowByName(name).click();
|
|
await this.conversation.openChat();
|
|
await this.page.locator('#main-content').waitFor();
|
|
}
|
|
|
|
get btnFilters(): Locator {
|
|
return this.page.getByRole('button', { name: 'Filters' });
|
|
}
|
|
|
|
btnStatusChip(name: string): Locator {
|
|
return this.page.getByRole('button', { name: `Status: ${name}` });
|
|
}
|
|
|
|
btnServedByChip(name: string): Locator {
|
|
return this.page.getByRole('button', { name: `Served by: ${name}` });
|
|
}
|
|
|
|
btnDepartmentChip(name: string): Locator {
|
|
return this.page.getByRole('button', { name: `Department: ${name}` });
|
|
}
|
|
|
|
btnSearchChip(name: string): Locator {
|
|
return this.page.getByRole('button', { name: `Text: ${name}` });
|
|
}
|
|
|
|
btnUnitsChip(name: string): Locator {
|
|
return this.page.getByRole('button', { name: `Units: ${name}` });
|
|
}
|
|
}
|