test(lightspeed): MCP servers e2e — mocked API, scenarios, en-only suite#2724
Conversation
Add Chatbot MCP settings describe with Overlay, Dock, and Fullscreen coverage. Introduce POM helpers (open/close panel, verifyMcpSettingsPanel) and extend display-mode menu snapshot for MCP settings. Scope MCP table locators to avoid strict-mode clashes with the catalog; avoid form-only assertions in fullscreen. Made-with: Cursor
Changed Packages
|
Review Summary by QodoAdd e2e tests for MCP settings across display modes
WalkthroughsDescription• Add comprehensive e2e tests for MCP settings across all display modes • Introduce POM helpers for opening, closing, and verifying MCP settings panel • Extend display-mode menu snapshot to include MCP settings menu item • Scope MCP table locators to avoid conflicts with catalog elements • Skip File Attachment Validation test suite temporarily Diagramflowchart LR
A["Test Suite"] -->|"Add MCP settings tests"| B["Overlay/Dock/Fullscreen modes"]
C["POM Helpers"] -->|"openMcpSettingsPanel"| D["MCP Settings Panel"]
C -->|"closeMcpSettingsPanel"| D
C -->|"verifyMcpSettingsPanel"| E["Assertions & Snapshots"]
F["Display Mode Menu"] -->|"Include MCP settings item"| G["Updated Snapshot"]
File Changes1. workspaces/lightspeed/packages/app-legacy/e2e-tests/lightspeed.test.ts
|
Code Review by Qodo
1.
|
workspaces/lightspeed/packages/app-legacy/e2e-tests/lightspeed.test.ts
Outdated
Show resolved
Hide resolved
workspaces/lightspeed/packages/app-legacy/e2e-tests/pages/LightspeedPage.ts
Outdated
Show resolved
Hide resolved
- Mock GET /api/lightspeed/mcp-servers in devMode with replaceable scenarios - Add mcpServerMocks fixtures, presets, and status-detail helper for assertions - Extend verifyMcpSettingsPanel and heading helpers; scope MCP table actions - Add two-server and empty-list tests; runMcpPanelScenario helper - skipUnlessLocales: run Chatbot MCP settings e2e only on en project Made-with: Cursor
- mockMcpServers: handle PATCH for enable/disable; broaden route glob - LightspeedPage: mcpServersTableBodyRows, click Name/Status columns, gridcell toggle - tests: toggle row Disabled/14 tools; Name column sort order (allHealthy) Made-with: Cursor
8a72167 to
d6c40fa
Compare
workspaces/lightspeed/packages/app-legacy/e2e-tests/fixtures/mcpServerMocks.ts
Outdated
Show resolved
Hide resolved
workspaces/lightspeed/packages/app-legacy/e2e-tests/pages/LightspeedPage.ts
Outdated
Show resolved
Hide resolved
workspaces/lightspeed/packages/app-legacy/e2e-tests/pages/LightspeedPage.ts
Outdated
Show resolved
Hide resolved
workspaces/lightspeed/packages/app-legacy/e2e-tests/utils/devMode.ts
Outdated
Show resolved
Hide resolved
workspaces/lightspeed/packages/app-legacy/e2e-tests/lightspeed.test.ts
Outdated
Show resolved
Hide resolved
workspaces/lightspeed/packages/app-legacy/e2e-tests/lightspeed.test.ts
Outdated
Show resolved
Hide resolved
- Rename Chatbot MCP settings tests; Sort / Toggle 'works as expected' - Simplify getExpectedMcpStatusDetailForMock (early returns) Made-with: Cursor
|



Description:
The tests cover the following scenarios
Opening MCP settings from the chatbot — In overlay, dock, and fullscreen, you can open the MCP servers panel and the UI looks right (table, headings, buttons, and the panel closes cleanly).
When there are no MCP servers — The table shows the empty message.
When there are two servers, different situations — The list shows the right names and status text for: both healthy, one broken and one OK, one turned off and one on, or both needing a token.
Sorting by name — Clicking the Name column changes the order of the rows (e.g. alpha before beta, then reversed).
Turning a server on and off — Flipping the switch turns a server off (status shows Disabled) and turning it on again brings back the tool count line.
English-only for this block — Those MCP settings tests only run when the Playwright run is using the English locale, because Localization hasn't been done.
The rest of the Lightspeed file still has the older tests (chat, models, sidebar, etc.); the items above are what this MCP-focused work added or tightened.
Resolves:
https://redhat.atlassian.net/browse/RHIDP-12129