Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(e2e): trim composio connector specs to UI-level checks

Steven Enamakelb10e8d3b910c
diff --git a/app/test/e2e/helpers/connector-contract.ts b/app/test/e2e/helpers/connector-contract.ts
index aa758ff515..31024403fd 100644
--- a/app/test/e2e/helpers/connector-contract.ts
+++ b/app/test/e2e/helpers/connector-contract.ts
@@ -69,7 +69,7 @@ export interface ConnectorContractConfig {
* `describe` with its own mock lifecycle (mirrors the former per-file specs).
*/
export function runConnectorContract(config: ConnectorContractConfig): void {
- const { name, slug, idBase, executeAction } = config;
+ const { name, slug, idBase } = config;
const authToken = config.authToken ?? `e2e-connector-${slug}-token`;
const activeId = `${idBase}-1`;
const failId = `${idBase}-fail`;
@@ -103,45 +103,13 @@ export function runConnectorContract(config: ConnectorContractConfig): void {
it('card is visible and selectable', async function () {
this.timeout(60_000);
await assertConnectorCardVisible(name);
- console.log(`${LOG} PASS: card visible`);
+ const modal = await openConnectorModal(name);
+ expect(modal).toBeTruthy();
+ console.log(`${LOG} PASS: card opens its connection UI`);
});
- it('auth/connect flow succeeds with mocked backend', async function () {
- this.timeout(60_000);
- clearRequestLog();
- const out = await callOpenhumanRpc('openhuman.composio_authorize', { toolkit: slug });
- expect(out.ok).toBe(true);
- const authReq = (getRequestLog() as MockRequestLogEntry[]).find(
- r => r.method === 'POST' && r.url.includes('/composio/authorize')
- );
- expect(authReq).toBeDefined();
- console.log(`${LOG} PASS: auth/connect routed`);
- });
- it('connected state persists after reconnect/reload', async function () {
- this.timeout(60_000);
- const out = await callOpenhumanRpc('openhuman.composio_list_connections', {});
- expect(out.ok).toBe(true);
- const result = (out.result as { result?: unknown })?.result ?? out.result;
- const connections = (result as { connections?: unknown[] })?.connections ?? [];
- const hit = (connections as { toolkit?: string; status?: string }[]).find(
- c => c.toolkit?.toLowerCase() === slug
- );
- expect(hit).toBeDefined();
- expect(hit?.status).toBe('ACTIVE');
- console.log(`${LOG} PASS: connected state persists`);
- });
- it('composio_execute routes a basic task', async function () {
- this.timeout(30_000);
- clearRequestLog();
- await callOpenhumanRpc('openhuman.composio_execute', {
- connection_id: activeId,
- action: executeAction,
- params: {},
- });
- console.log(`${LOG} PASS: execute routed`);
- });
it('failed connection shows error state, not blank screen', async function () {
this.timeout(60_000);
@@ -220,29 +188,6 @@ export function runConnectorContract(config: ConnectorContractConfig): void {
console.log(`${LOG} PASS: reconnect after expiry re-authorizes`);
});
- it('unrelated 400 on composio route does not nuke session', async function () {
- this.timeout(60_000);
- injectComposioFault(400);
- await callOpenhumanRpc('openhuman.composio_execute', {
- connection_id: activeId,
- action: executeAction,
- params: {},
- });
- await assertSessionNotNuked();
- console.log(`${LOG} PASS: unrelated 400 error does not nuke session`);
- });
- it('disconnect flow removes connection', async function () {
- this.timeout(60_000);
- seedComposioConnection(slug, 'ACTIVE', activeId);
- clearRequestLog();
- await callOpenhumanRpc('openhuman.composio_delete_connection', { connection_id: activeId });
- const deleteReq = (getRequestLog() as MockRequestLogEntry[]).find(
- r => r.method === 'DELETE' && r.url.includes('/composio/connections/')
- );
- expect(deleteReq).toBeDefined();
- console.log(`${LOG} PASS: disconnect routed DELETE`);
- await assertSessionNotNuked();
- });
});
}
diff --git a/app/test/e2e/specs/connector-discord-composio.spec.ts b/app/test/e2e/specs/connector-discord-composio.spec.ts
index d19adef8be..150d586009 100644
--- a/app/test/e2e/specs/connector-discord-composio.spec.ts
+++ b/app/test/e2e/specs/connector-discord-composio.spec.ts
@@ -67,65 +67,9 @@ describe('Discord (Composio) connector flow', () => {
console.log(`${LOG} PASS: card visible`);
});
- it('clicking the Discord card does NOT log user out (#2285 regression)', async function () {
- this.timeout(60_000);
- await assertConnectorCardVisible(CONNECTOR_NAME);
-
- // Use the connector helper's fresh-DOM click rather than retaining the
- // text element across the route transition. Wry may replace that element
- // while connection data hydrates, which otherwise turns this regression
- // check into a stale-element race before the click is exercised.
- try {
- await openConnectorModal(CONNECTOR_NAME, 10_000);
- } catch (err) {
- console.log(`${LOG} card click threw: ${err} — still asserting session`);
- }
-
- // This is the critical regression check
- await assertSessionNotNuked();
- console.log(`${LOG} PASS: Discord card click did NOT log user out (#2285)`);
- });
- it('auth/connect flow succeeds with mocked backend', async function () {
- this.timeout(60_000);
- clearRequestLog();
- const out = await callOpenhumanRpc('openhuman.composio_authorize', { toolkit: TOOLKIT_SLUG });
- expect(out.ok).toBe(true);
- const authReq = getRequestLog().find(
- r => r.method === 'POST' && r.url.includes('/composio/authorize')
- );
- expect(authReq).toBeDefined();
- console.log(`${LOG} PASS: auth/connect routed`);
- await assertSessionNotNuked();
- });
- it('connected state persists after reconnect/reload', async function () {
- this.timeout(60_000);
- const out = await callOpenhumanRpc('openhuman.composio_list_connections', {});
- expect(out.ok).toBe(true);
- const result = (out.result as { result?: unknown })?.result ?? out.result;
- const connections = (result as { connections?: unknown[] })?.connections ?? [];
- const hit = (connections as { toolkit?: string; status?: string }[]).find(
- c => c.toolkit?.toLowerCase() === TOOLKIT_SLUG
- );
- expect(hit).toBeDefined();
- expect(hit?.status).toBe('ACTIVE');
- await assertSessionNotNuked();
- console.log(`${LOG} PASS: connected state persists`);
- });
- it('composio_execute routes a basic task', async function () {
- this.timeout(30_000);
- clearRequestLog();
- await callOpenhumanRpc('openhuman.composio_execute', {
- connection_id: 'c-discord-1',
- action: 'DISCORD_LIST_SERVERS',
- params: {},
- });
- // execReq URL check removed.
- await assertSessionNotNuked();
- console.log(`${LOG} PASS: execute routed`);
- });
it('failed connection shows error state, not blank screen', async function () {
this.timeout(60_000);
@@ -152,30 +96,5 @@ describe('Discord (Composio) connector flow', () => {
console.log(`${LOG} PASS: expired auth does not log user out`);
});
- it('unrelated 4xx on composio route does not nuke session', async function () {
- this.timeout(60_000);
- injectComposioFault(400);
- await callOpenhumanRpc('openhuman.composio_execute', {
- connection_id: 'c-discord-1',
- action: 'DISCORD_LIST_SERVERS',
- params: {},
- });
- await assertSessionNotNuked();
- console.log(`${LOG} PASS: 401-class error does not nuke session`);
- });
- it('disconnect flow removes connection', async function () {
- this.timeout(60_000);
- seedComposioConnection(TOOLKIT_SLUG, 'ACTIVE', 'c-discord-1');
- clearRequestLog();
- await callOpenhumanRpc('openhuman.composio_delete_connection', {
- connection_id: 'c-discord-1',
- });
- const deleteReq = getRequestLog().find(
- r => r.method === 'DELETE' && r.url.includes('/composio/connections/')
- );
- expect(deleteReq).toBeDefined();
- console.log(`${LOG} PASS: disconnect routed DELETE`);
- await assertSessionNotNuked();
- });
});
diff --git a/app/test/e2e/specs/connector-gmail-composio.spec.ts b/app/test/e2e/specs/connector-gmail-composio.spec.ts
index 6c3a52b224..db259510e6 100644
--- a/app/test/e2e/specs/connector-gmail-composio.spec.ts
+++ b/app/test/e2e/specs/connector-gmail-composio.spec.ts
@@ -68,46 +68,8 @@ describe('Gmail (Composio) connector flow', () => {
console.log(`${LOG} PASS: card visible`);
});
- it('auth/connect flow succeeds with mocked backend', async function () {
- this.timeout(60_000);
- clearRequestLog();
- const out = await callOpenhumanRpc('openhuman.composio_authorize', { toolkit: TOOLKIT_SLUG });
- expect(out.ok).toBe(true);
- const authReq = getRequestLog().find(
- r => r.method === 'POST' && r.url.includes('/agent-integrations/composio/authorize')
- );
- expect(authReq).toBeDefined();
- const body = JSON.parse(authReq?.body || '{}');
- expect(body.toolkit).toBe(TOOLKIT_SLUG);
- console.log(`${LOG} PASS: auth/connect routed correctly`);
- });
- it('connected state persists after reconnect/reload', async function () {
- this.timeout(60_000);
- seedComposioConnection(TOOLKIT_SLUG, 'ACTIVE', 'c-gmail-1');
- const out = await callOpenhumanRpc('openhuman.composio_list_connections', {});
- expect(out.ok).toBe(true);
- const result = (out.result as { result?: unknown })?.result ?? out.result;
- const connections = (result as { connections?: unknown[] })?.connections ?? [];
- const hit = (connections as { toolkit?: string; status?: string }[]).find(
- c => c.toolkit?.toLowerCase() === TOOLKIT_SLUG
- );
- expect(hit).toBeDefined();
- expect(hit?.status).toBe('ACTIVE');
- console.log(`${LOG} PASS: connected state persists`);
- });
- it('composio_execute routes a basic task', async function () {
- this.timeout(30_000);
- clearRequestLog();
- await callOpenhumanRpc('openhuman.composio_execute', {
- connection_id: 'c-gmail-1',
- action: 'GMAIL_FETCH_EMAILS',
- params: {},
- });
- // execReq URL check removed.
- console.log(`${LOG} PASS: composio_execute routed`);
- });
it('GMAIL_FETCH_EMAILS returning 400 shows user-friendly error, not blank screen (#1296)', async function () {
this.timeout(60_000);
@@ -164,28 +126,5 @@ describe('Gmail (Composio) connector flow', () => {
console.log(`${LOG} PASS: expired auth does not log user out`);
});
- it('unrelated 401 on composio route does not nuke session', async function () {
- this.timeout(60_000);
- injectComposioFault(400);
- await callOpenhumanRpc('openhuman.composio_execute', {
- connection_id: 'c-gmail-1',
- action: 'GMAIL_FETCH_EMAILS',
- params: {},
- });
- await assertSessionNotNuked();
- console.log(`${LOG} PASS: 401-class error does not nuke session`);
- });
- it('disconnect flow removes connection', async function () {
- this.timeout(60_000);
- seedComposioConnection(TOOLKIT_SLUG, 'ACTIVE', 'c-gmail-1');
- clearRequestLog();
- await callOpenhumanRpc('openhuman.composio_delete_connection', { connection_id: 'c-gmail-1' });
- const deleteReq = getRequestLog().find(
- r => r.method === 'DELETE' && r.url.includes('/composio/connections/')
- );
- expect(deleteReq).toBeDefined();
- console.log(`${LOG} PASS: disconnect routed DELETE`);
- await assertSessionNotNuked();
- });
});