Frontend Lint & Test / test (push) Waiting to run
Publish Chatwoot EE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Waiting to run
Publish Chatwoot EE docker images / merge (push) Blocked by required conditions
Publish Chatwoot CE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Waiting to run
Publish Chatwoot CE docker images / merge (push) Blocked by required conditions
Run Chatwoot CE spec / backend-tests (0, 16) (push) Waiting to run
Run Chatwoot CE spec / backend-tests (1, 16) (push) Waiting to run
Run Chatwoot CE spec / backend-tests (10, 16) (push) Waiting to run
Run Chatwoot CE spec / backend-tests (11, 16) (push) Waiting to run
Run Chatwoot CE spec / backend-tests (12, 16) (push) Waiting to run
Run Chatwoot CE spec / backend-tests (13, 16) (push) Waiting to run
Run Chatwoot CE spec / backend-tests (14, 16) (push) Waiting to run
Run Chatwoot CE spec / backend-tests (15, 16) (push) Waiting to run
Run Chatwoot CE spec / backend-tests (2, 16) (push) Waiting to run
Run Chatwoot CE spec / backend-tests (3, 16) (push) Waiting to run
Run Chatwoot CE spec / backend-tests (4, 16) (push) Waiting to run
Run Chatwoot CE spec / backend-tests (5, 16) (push) Waiting to run
Run Chatwoot CE spec / backend-tests (6, 16) (push) Waiting to run
Run Chatwoot CE spec / backend-tests (7, 16) (push) Waiting to run
Run Chatwoot CE spec / backend-tests (8, 16) (push) Waiting to run
Run Chatwoot CE spec / backend-tests (9, 16) (push) Waiting to run
Build Chatwoot / build (push) Waiting to run
Publish Chatwoot EE docker images / build (linux/amd64, ubuntu-latest) (push) Failing after 15m13s
Publish Chatwoot CE docker images / build (linux/amd64, ubuntu-latest) (push) Failing after 14m33s
Run Chatwoot CE spec / lint-backend (push) In progress
Run Chatwoot CE spec / lint-frontend (push) In progress
Run Chatwoot CE spec / frontend-tests (push) In progress
Adds E2E UI tests for two core Phase 2 flows, building on the Playwright setup from #13578. **Agent onboarding** — validates the Agents settings page, Add Agent modal elements, form validation (name + email required, submit disabled until valid), and cancel behaviour. **Inbox creation** — walks through the full API channel inbox creation journey: channel selection → form fill → agent assignment → finish screen. ## What changed New UI component objects (`tests/playwright/components/ui/`): - `agent-page.component.ts` - `add-agent-modal.component.ts` - `add-agents-form.component.ts` - `settings-inbox-page.component.ts` - `channel-selector.component.ts` - `api-channel-form.component.ts` - `finish-setup.component.ts` New test specs (`tests/playwright/tests/e2e/ui/`): - `agent-onboarding-flow-ui-validation.spec.ts` - `inbox-creation-flow.spec.ts` Updated `components/ui/index.ts` barrel export to include all new components. ## How to test ```bash cd tests/playwright npx playwright test tests/e2e/ui/ ``` All 5 tests pass locally (3 login + 2 new flows). Closes part of the Phase 2 scope from the [Playwright E2E discussion #13500](https://github.com/orgs/chatwoot/discussions/13500). --------- Co-authored-by: Sony Mathew <sony@chatwoot.com> Co-authored-by: Sony Mathew <2040199+sony-mathew@users.noreply.github.com>
74 lines
1.7 KiB
TypeScript
74 lines
1.7 KiB
TypeScript
import { Page } from '@playwright/test';
|
|
|
|
export class AddAgentsForm {
|
|
constructor(private page: Page) {}
|
|
|
|
getPageHeading() {
|
|
return this.page
|
|
.locator('form')
|
|
.getByRole('heading', { name: 'Agents', level: 2, exact: true });
|
|
}
|
|
|
|
getAgentDropdown() {
|
|
return this.page.getByPlaceholder('Pick agents for the inbox');
|
|
}
|
|
|
|
getAgentSelector() {
|
|
return this.page.getByTestId('agent-selector');
|
|
}
|
|
|
|
getAgentOption(agentName: string) {
|
|
return this.getAgentSelector().getByRole('button', {
|
|
name: agentName,
|
|
exact: true,
|
|
});
|
|
}
|
|
|
|
getDropdownButtons() {
|
|
return this.getAgentSelector().getByRole('button');
|
|
}
|
|
|
|
getSubmitButton() {
|
|
return this.page.getByRole('button', { name: 'Add agents' });
|
|
}
|
|
|
|
async openAgentDropdown() {
|
|
await this.getAgentDropdown().click();
|
|
}
|
|
|
|
async selectAgent(agentName: string) {
|
|
await this.openAgentDropdown();
|
|
await this.getAgentOption(agentName).waitFor({ state: 'visible' });
|
|
await this.getAgentOption(agentName).click();
|
|
}
|
|
|
|
async selectAgentByIndex(index: number = 0) {
|
|
await this.openAgentDropdown();
|
|
const buttons = this.getDropdownButtons();
|
|
await buttons.first().waitFor({ state: 'visible' });
|
|
await buttons.nth(index).click();
|
|
}
|
|
|
|
async closeDropdown() {
|
|
await this.page.keyboard.press('Escape');
|
|
}
|
|
|
|
async submitForm() {
|
|
await this.getSubmitButton().click();
|
|
}
|
|
|
|
async addAgents(agentNames: string[]) {
|
|
for (const agentName of agentNames) {
|
|
await this.selectAgent(agentName);
|
|
}
|
|
await this.closeDropdown();
|
|
await this.submitForm();
|
|
}
|
|
|
|
async addFirstAgent() {
|
|
await this.selectAgentByIndex(0);
|
|
await this.closeDropdown();
|
|
await this.submitForm();
|
|
}
|
|
}
|