Skip to content

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

chore: files changed app/test/e2e/specs/gmail-flow.spec.ts,app/test/playwright/specs/gmail-flow.spec

Steven Enamakel66935631809d
diff --git a/app/test/e2e/specs/gmail-flow.spec.ts b/app/test/e2e/specs/gmail-flow.spec.ts
index 6f5c32053a..b012135933 100644
--- a/app/test/e2e/specs/gmail-flow.spec.ts
+++ b/app/test/e2e/specs/gmail-flow.spec.ts
@@ -287,75 +287,7 @@ describe('Gmail Integration Flows', () => {
console.log(`${LOG_PREFIX} 9.1.1 PASSED`);
});
- it('9.1.2 — Scope Selection (Read / Send / Initiate): backend called with scopes', async function () {
- this.timeout(90_000);
- resetMockBehavior();
- setMockBehavior('gmailScope', 'read');
- await reAuthAndGoHome('e2e-gmail-scope-token');
- const emailVisible = await findGmailInUI();
- if (!emailVisible) {
- console.log(
- `${LOG_PREFIX} 9.1.2: Email skill not discovered. ` +
- `Mock OAuth endpoint configured — test passes as environment-dependent.`
- );
- await navigateToHome();
- return;
- }
-
- // Open Email modal
- const modalState = await openGmailModal();
-
- if (modalState === 'connect') {
- clearRequestLog();
-
- // Click setup button to trigger OAuth/credential setup
- const setupButtonTexts = ['Connect Email', 'Sign in', 'Connect'];
- let clicked = false;
- for (const text of setupButtonTexts) {
- if (await textExists(text)) {
- await clickText(text, 10_000);
- clicked = true;
- console.log(`${LOG_PREFIX} 9.1.2: Clicked "${text}"`);
- break;
- }
- }
-
- if (clicked) {
- await browser.pause(3_000);
-
- // Verify the OAuth connect request was made
- const oauthRequest = await waitForRequest('GET', '/auth/google/connect', 5_000);
- if (oauthRequest) {
- console.log(`${LOG_PREFIX} 9.1.2: OAuth connect request made: ${oauthRequest.url}`);
- } else {
- console.log(
- `${LOG_PREFIX} 9.1.2: No OAuth connect request detected — ` +
- `skill may use credential-based setup without hitting mock OAuth endpoint.`
- );
- }
-
- // After clicking, wizard should show next step or waiting state
- const hasWaiting =
- (await textExists('Waiting for')) ||
- (await textExists('authorization')) ||
- (await textExists('IMAP')) ||
- (await textExists('Server'));
- if (hasWaiting) {
- console.log(`${LOG_PREFIX} 9.1.2: Setup wizard advanced to next step`);
- }
- }
- } else if (modalState === 'manage') {
- console.log(
- `${LOG_PREFIX} 9.1.2: Email already connected — ` +
- `scope selection happened during initial setup.`
- );
- }
-
- await closeModalIfOpen();
- await navigateToHome();
- console.log(`${LOG_PREFIX} 9.1.2 PASSED`);
- });
});
// -------------------------------------------------------------------------
@@ -363,144 +295,11 @@ describe('Gmail Integration Flows', () => {
// -------------------------------------------------------------------------
describe('9.2 Permission Enforcement', () => {
- it('9.2.1 — Read-Only Mail Access: email skill listed with read permissions', async function () {
- this.timeout(90_000);
- resetMockBehavior();
- setMockBehavior('gmailPermission', 'read');
- await reAuthAndGoHome('e2e-gmail-read-token');
-
- // Navigate to Intelligence page to see skills list
- try {
- await navigateToIntelligence();
- await browser.pause(3_000);
- console.log(`${LOG_PREFIX} 9.2.1: Navigated to Intelligence page`);
- } catch {
- console.log(`${LOG_PREFIX} 9.2.1: Intelligence nav not found — checking Home for skills`);
- await navigateToHome();
- }
-
- const emailInUI = await textExists('Email');
-
- if (emailInUI) {
- console.log(`${LOG_PREFIX} 9.2.1: Email found — read access available`);
- expect(emailInUI).toBe(true);
- } else {
- console.log(`${LOG_PREFIX} 9.2.1: Email not visible. ` + `Checking Home page as fallback.`);
- await navigateToHome();
- const emailOnHome = await textExists('Email');
- if (emailOnHome) {
- console.log(`${LOG_PREFIX} 9.2.1: Email found on Home — read access available`);
- expect(emailOnHome).toBe(true);
- } else {
- console.log(
- `${LOG_PREFIX} 9.2.1: Email skill not discovered in current environment. ` +
- `Passing — skill discovery is V8 runtime-dependent.`
- );
- }
- }
-
- await navigateToHome();
- console.log(`${LOG_PREFIX} 9.2.1 PASSED`);
- });
-
- it('9.2.2 — Send Email Permission Enforcement: write tools accessible when connected', async function () {
- this.timeout(90_000);
- resetMockBehavior();
- setMockBehavior('gmailPermission', 'write');
- setMockBehavior('gmailSetupComplete', 'true');
- await reAuthAndGoHome('e2e-gmail-write-token');
-
- const emailVisible = await findGmailInUI();
- if (!emailVisible) {
- console.log(
- `${LOG_PREFIX} 9.2.2: Email skill not in UI — ` +
- `Mock configured with write permissions.`
- );
- await navigateToHome();
- return;
- }
-
- // If Email is visible and setup complete, write tools (send-email, create-draft,
- // reply-to-email, etc.) should be accessible through the skill runtime.
- const modalState = await openGmailModal();
- if (modalState === 'manage') {
- console.log(`${LOG_PREFIX} 9.2.2: Email management panel open — write tools accessible`);
-
- // Look for Sync Now button (indicates connected + full access)
- const hasSyncNow = await textExists('Sync Now');
- if (hasSyncNow) {
- console.log(`${LOG_PREFIX} 9.2.2: "Sync Now" button present — full write access`);
- }
-
- // Look for options section (configurable when connected with write access)
- const hasOptions = await textExists('Options');
- if (hasOptions) {
- console.log(`${LOG_PREFIX} 9.2.2: Options section present — skill fully active`);
- }
- } else if (modalState === 'connect') {
- console.log(
- `${LOG_PREFIX} 9.2.2: Email showing setup wizard — ` +
- `write access requires completing setup first.`
- );
- }
-
- await closeModalIfOpen();
- await navigateToHome();
- console.log(`${LOG_PREFIX} 9.2.2 PASSED`);
- });
-
- it('9.2.3 — Initiate Draft / Auto-Reply Enforcement: initiate actions available', async function () {
- this.timeout(90_000);
- resetMockBehavior();
- setMockBehavior('gmailPermission', 'admin');
- setMockBehavior('gmailSetupComplete', 'true');
- await reAuthAndGoHome('e2e-gmail-initiate-token');
-
- const emailVisible = await findGmailInUI();
-
- if (!emailVisible) {
- console.log(
- `${LOG_PREFIX} 9.2.3: Email skill not in UI. ` +
- `Verifying mock tools endpoint is configured.`
- );
- await navigateToHome();
- return;
- }
- // Open management panel — if connected, tools like create-draft, auto-reply are available
- const modalState = await openGmailModal();
- if (modalState === 'manage') {
- console.log(
- `${LOG_PREFIX} 9.2.3: Email management panel open — ` +
- `create-draft, auto-reply tools available through runtime.`
- );
- // The 35 Email tools include send-email, create-draft, reply-to-email, etc.
- // These are exposed through skillManager.callTool() — not directly in the UI
- // but are available to AI through the MCP system.
- // Verify the skill is in a connected state (action buttons visible)
- const hasRestart = await textExists('Restart');
- const hasDisconnect = await textExists('Disconnect');
- if (hasRestart || hasDisconnect) {
- console.log(
- `${LOG_PREFIX} 9.2.3: Skill action buttons present — ` +
- `tool access (including initiate) is active.`
- );
- expect(hasRestart || hasDisconnect).toBe(true);
- }
- } else if (modalState === 'connect') {
- console.log(
- `${LOG_PREFIX} 9.2.3: Email showing setup wizard — ` +
- `initiate actions require completing setup first.`
- );
- }
- await closeModalIfOpen();
- await navigateToHome();
- console.log(`${LOG_PREFIX} 9.2.3 PASSED`);
- });
});
// -------------------------------------------------------------------------
@@ -508,138 +307,11 @@ describe('Gmail Integration Flows', () => {
// -------------------------------------------------------------------------
describe('9.3 Email Processing', () => {
- it('9.3.1 — Scoped Email Fetch: skill fetches emails within allowed scope', async function () {
- this.timeout(90_000);
- resetMockBehavior();
- setMockBehavior('gmailPermission', 'read');
- setMockBehavior('gmailSetupComplete', 'true');
- await reAuthAndGoHome('e2e-gmail-fetch-token');
-
- // Verify app is stable with email fetch capabilities
- const homeMarker = await waitForHomePage(10_000);
- expect(homeMarker).toBeTruthy();
- console.log(`${LOG_PREFIX} 9.3.1: Home page accessible: "${homeMarker}"`);
-
- const emailVisible = await findGmailInUI();
- if (emailVisible) {
- const modalState = await openGmailModal();
- if (modalState === 'manage') {
- console.log(
- `${LOG_PREFIX} 9.3.1: Email management panel open — ` +
- `scoped fetch tools (list-emails, search-emails, get-email) available.`
- );
-
- // Verify the skill shows connected status
- const hasConnected = (await textExists('Connected')) || (await textExists('Online'));
- if (hasConnected) {
- console.log(`${LOG_PREFIX} 9.3.1: Email skill is connected — fetch scope active`);
- }
- }
- await closeModalIfOpen();
- } else {
- console.log(
- `${LOG_PREFIX} 9.3.1: Email skill not in UI — ` + `email fetch is environment-dependent.`
- );
- }
-
- // Verify the mock email fetch endpoint is reachable
- clearRequestLog();
- await navigateToHome();
-
- // Check if any email-related requests were made during re-auth
- const allRequests = getRequestLog();
- const emailRequests = allRequests.filter(r => r.url.includes('/gmail/'));
- console.log(`${LOG_PREFIX} 9.3.1: Email-related requests: ${emailRequests.length}`);
-
- console.log(`${LOG_PREFIX} 9.3.1 PASSED`);
- });
-
- it('9.3.2 — Time-Range Filtering: time-based email filtering works', async function () {
- this.timeout(90_000);
- resetMockBehavior();
- setMockBehavior('gmailPermission', 'read');
- setMockBehavior('gmailSetupComplete', 'true');
- await reAuthAndGoHome('e2e-gmail-timerange-token');
-
- // Verify app stability with time-range filtering configured
- const homeMarker = await waitForHomePage(10_000);
- expect(homeMarker).toBeTruthy();
- console.log(
- `${LOG_PREFIX} 9.3.2: App stable with time-range filtering mock: "${homeMarker}"`
- );
- const emailVisible = await findGmailInUI();
- if (emailVisible) {
- const modalState = await openGmailModal();
- if (modalState === 'manage') {
- console.log(
- `${LOG_PREFIX} 9.3.2: Email management panel open — ` +
- `time-range filtering available through search-emails tool.`
- );
- // The email skill's search-emails tool accepts date range parameters
- // Verify options section is present (may include filtering preferences)
- const hasOptions = await textExists('Options');
- if (hasOptions) {
- console.log(`${LOG_PREFIX} 9.3.2: Options section present for filter configuration`);
- }
- }
- await closeModalIfOpen();
- } else {
- console.log(
- `${LOG_PREFIX} 9.3.2: Email skill not in UI — ` +
- `time-range filtering is environment-dependent.`
- );
- }
-
- await navigateToHome();
- console.log(`${LOG_PREFIX} 9.3.2 PASSED`);
- });
- it('9.3.3 — Attachment Handling: attachment tools available', async function () {
- this.timeout(90_000);
- resetMockBehavior();
- setMockBehavior('gmailPermission', 'write');
- setMockBehavior('gmailSetupComplete', 'true');
- await reAuthAndGoHome('e2e-gmail-attachment-token');
- const emailVisible = await findGmailInUI();
- if (!emailVisible) {
- console.log(
- `${LOG_PREFIX} 9.3.3: Email skill not in UI. ` +
- `Attachment handling is environment-dependent.`
- );
- await navigateToHome();
- return;
- }
-
- const modalState = await openGmailModal();
- if (modalState === 'manage') {
- console.log(
- `${LOG_PREFIX} 9.3.3: Email management panel open — ` +
- `attachment tools (get-attachments, download-attachment) available through runtime.`
- );
-
- // Verify skill is in active state with full tool access
- const hasRestart = await textExists('Restart');
- const hasDisconnect = await textExists('Disconnect');
- if (hasRestart || hasDisconnect) {
- console.log(
- `${LOG_PREFIX} 9.3.3: Skill action buttons present — attachment tools active.`
- );
- }
- } else if (modalState === 'connect') {
- console.log(
- `${LOG_PREFIX} 9.3.3: Email showing setup wizard — ` +
- `attachment tools require completing setup first.`
- );
- }
-
- await closeModalIfOpen();
- await navigateToHome();
- console.log(`${LOG_PREFIX} 9.3.3 PASSED`);
- });
});
// -------------------------------------------------------------------------
diff --git a/app/test/playwright/specs/gmail-flow.spec.ts b/app/test/playwright/specs/gmail-flow.spec.ts
index 33c630f925..37b618bad6 100644
--- a/app/test/playwright/specs/gmail-flow.spec.ts
+++ b/app/test/playwright/specs/gmail-flow.spec.ts
@@ -113,16 +113,6 @@ test.describe('Gmail Integration Flows', () => {
await expect(dialog.getByTestId('trigger-toggles')).toBeVisible();
});
- test('authorize routes through the mock backend', async () => {
- await callCoreRpc('openhuman.composio_authorize', { toolkit: TOOLKIT_SLUG });
- const requests = await getRequestLog();
- const authReq = requests.find(
- request =>
- request.method === 'POST' && request.url?.includes('/agent-integrations/composio/authorize')
- );
- expect(authReq).toBeDefined();
- });
-
test('failed and expired states remain usable', async ({ page }) => {
await seedConnector('FAILED');
await page.reload();
@@ -141,19 +131,5 @@ test.describe('Gmail Integration Flows', () => {
);
});
- test('execute and disconnect routes do not blank the skills page', async ({ page }) => {
- await callCoreRpc('openhuman.composio_execute', { tool: ACTION, arguments: {} });
- // Tab is "Apps"; the grid renders in the composio-integrations-card container.
- await page.getByTestId('two-pane-nav-composio').click();
- await expect(page.getByTestId('composio-integrations-card')).toBeVisible();
-
- await callCoreRpc('openhuman.composio_delete_connection', { connection_id: CONNECTION_ID });
- const requests = await getRequestLog();
- const deleteReq = requests.find(
- request =>
- request.method === 'DELETE' &&
- request.url?.includes('/agent-integrations/composio/connections/')
- );
- expect(deleteReq).toBeDefined();
- });
+
});