The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
test(channels): enhance telegram smoke test with live status checks
Steven Enamakel85cbfd65839c
diff --git a/app/test/playwright/specs/channels-smoke.spec.ts b/app/test/playwright/specs/channels-smoke.spec.tsindex 12cec98da3..dd6f4eb854 100644--- a/app/test/playwright/specs/channels-smoke.spec.ts+++ b/app/test/playwright/specs/channels-smoke.spec.ts@@ -1,11 +1,35 @@import { expect, test } from '@playwright/test';import {+ callCoreRpc,bootAuthenticatedPage,dismissWalkthroughIfPresent,waitForAppReady,} from '../helpers/core-rpc';+type TelegramStatus = { channel_id?: string; channel?: string; connected?: boolean };++async function telegramConnected(): Promise<boolean> {+ const response = (await callCoreRpc<unknown>('openhuman.channels_status', {+ channel: 'telegram',+ })) as { result?: unknown } | unknown;+ const unwrapped =+ response && typeof response === 'object' && 'result' in response+ ? (response as { result: unknown }).result+ : response;+ const entries = Array.isArray(unwrapped)+ ? unwrapped+ : unwrapped && typeof unwrapped === 'object' && 'entries' in unwrapped+ ? (unwrapped as { entries: unknown }).entries+ : unwrapped;+ expect(Array.isArray(entries), 'channels_status returns channel status entries').toBe(true);+ const telegram = (entries as TelegramStatus[]).find(+ (entry) => (entry.channel_id ?? entry.channel) === 'telegram'+ );+ expect(telegram, 'channels_status includes Telegram').toBeDefined();+ return telegram?.connected === true;+}+test.describe('Channels Smoke', () => {test.beforeEach(async ({ page }) => {await bootAuthenticatedPage(page, 'pw-channels-user', '/channels');@@ -18,7 +42,37 @@ test.describe('Channels Smoke', () => {// /channels redirects to /connections?tab=messaging; connectors now render// as ChannelTile buttons named "<Name>, <status>. <cta>." (not headings/// standalone Disconnected buttons).- await expect(page.getByRole('button', { name: /Telegram/ }).first()).toBeVisible();+ await expect(page.getByRole('button', { name: /Telegram, Not configured/ })).toBeVisible();await expect(page.getByRole('button', { name: /Discord/ }).first()).toBeVisible();+ await expect.poll(telegramConnected).toBe(false);+ });++ test('Telegram badge follows live status through connect and disconnect', async ({ page }) => {+ await waitForAppReady(page);+ await dismissWalkthroughIfPresent(page);+ const telegram = page.getByTestId('skill-row-channel-telegram');++ await expect.poll(telegramConnected).toBe(false);+ await expect(telegram).toContainText('Not configured');+ await callCoreRpc('openhuman.channels_connect', {+ channel: 'telegram',+ authMode: 'bot_token',+ credentials: { bot_token: '111111:e2e-channels-smoke-token' },+ });+ await expect.poll(telegramConnected).toBe(true);+ await page.goto('/#/chat');+ await page.goto('/#/channels');+ await waitForAppReady(page);+ await expect(telegram).toContainText('Connected');++ await callCoreRpc('openhuman.channels_disconnect', {+ channel: 'telegram',+ authMode: 'bot_token',+ });+ await expect.poll(telegramConnected).toBe(false);+ await page.goto('/#/chat');+ await page.goto('/#/channels');+ await waitForAppReady(page);+ await expect(telegram).toContainText('Not configured');});});