Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion apps/cockpit/e2e/production-smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ const CHAT_PRIMITIVE_CAPABILITIES = [
'chat/debug',
] as const;

const CHAT_PRIMITIVE_READY_SELECTORS: Record<(typeof CHAT_PRIMITIVE_CAPABILITIES)[number], string> = {
'chat/messages': 'chat-message-list',
'chat/input': 'chat-input',
'chat/interrupts': 'chat-interrupt-panel',
'chat/debug': 'chat-debug',
};

const RENDER_CAPABILITIES = [
'render/spec-rendering',
'render/element-rendering',
Expand All @@ -73,7 +80,9 @@ test.describe('Production: Angular chat primitive apps load', () => {
test(`${cap} loads at examples URL`, async ({ page }) => {
const response = await page.goto(`${EXAMPLES_URL}/${cap}/`, { timeout: 15_000 });
expect(response?.status()).toBe(200);
await expect(page.locator('body')).not.toBeEmpty({ timeout: 10_000 });
await expect(page.locator(CHAT_PRIMITIVE_READY_SELECTORS[cap])).toBeAttached({
timeout: 10_000,
});
});
}
});
Expand Down
Loading