test(web): add Composio Drive E2E user journey

This commit is contained in:
Anish Sarkar 2026-05-06 17:22:37 +05:30
parent ae0caad292
commit 074b06441f
7 changed files with 275 additions and 0 deletions

View file

@ -0,0 +1,25 @@
import type { Page } from "@playwright/test";
/**
* Frontend route mock for the Composio OAuth redirect.
*
* In normal E2E runs we DON'T need this: the backend Composio fake
* returns a same-origin auth_url that lands directly on our callback,
* so the browser never navigates to composio.dev.
*
* Reserved here for future negative tests that intentionally exercise
* a tampered/external auth_url (e.g. validating that the frontend
* doesn't blindly follow off-origin redirects).
*/
export async function mockComposioOAuthRedirect(
page: Page,
options: { rewriteTo: string }
): Promise<void> {
await page.route(/composio\.dev/, async (route) => {
await route.fulfill({
status: 302,
headers: { Location: options.rewriteTo },
body: "",
});
});
}

View file

@ -0,0 +1,14 @@
import type { Page } from "@playwright/test";
/**
* Placeholder for the Composio Drive configuration view (folder
* selector + indexing options) rendered by ConnectorEditView.
*
* Phase 1 specs drive folder/file selection through the API helper
* (`updateConnectorConfig`) and `triggerIndex` for determinism. UI-
* level interaction with the folder tree is a Phase 2 task; this
* module is reserved for those selectors.
*/
export async function reservedForPhaseTwo(_page: Page): Promise<void> {
// Intentionally empty. See README in tests/connectors/composio/drive/.
}

View file

@ -0,0 +1,10 @@
import type { Page } from "@playwright/test";
/**
* Selectors for connector status indicators (last_indexed_at badge,
* indexing spinner, auth-expired banner). Reserved for Phase 2 UI-level
* assertions; Phase 1 specs assert these via the API.
*/
export async function reservedForPhaseTwo(_page: Page): Promise<void> {
// Intentionally empty.
}