Skip to content

feat: add E2E test suite#1353

Merged
MODSetter merged 87 commits into
MODSetter:devfrom
AnishSarkar22:feat/e2e-testing
May 9, 2026
Merged

feat: add E2E test suite#1353
MODSetter merged 87 commits into
MODSetter:devfrom
AnishSarkar22:feat/e2e-testing

Conversation

@AnishSarkar22
Copy link
Copy Markdown
Contributor

@AnishSarkar22 AnishSarkar22 commented May 7, 2026

Description

  • added an E2E testing suite.
  • Also added masking-guard unit tests for composio connectors.
  • Added playwright cursor skill.

Motivation and Context

FIX #

Screenshots

API Changes

  • This PR includes API changes

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactoring
  • Documentation
  • Dependency/Build system
  • Breaking change
  • Other (specify):

Testing Performed

  • Tested locally
  • Manual/QA verification

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

High-level PR Summary

This PR introduces a comprehensive end-to-end testing suite using Playwright for the SurfSense application. The implementation includes a sophisticated test harness that intercepts external API calls at the system level through strict fakes and deterministic mocks, covering multiple integrations (Composio Drive/Gmail/Calendar, native Google connectors, Notion, Linear, Jira) while ensuring production code remains untouched. The architecture uses sys.modules hijacking before production imports to replace third-party SDKs with strict fakes that raise NotImplementedError on unknown surface areas, combined with CI network deny-listing (HTTPS_PROXY=http://127.0.0.1:1) to prevent any real external calls. The suite includes journey tests for OAuth flows, indexing pipelines, chat interactions with canary tokens for verification, plus supporting integration and unit tests for the fake implementations. Test infrastructure is fully isolated from production builds through .dockerignore exclusions and separate entrypoints (run_backend.py, run_celery.py).

⏱️ Estimated Review Time: 3+ hours

💡 Review Order Suggestion
Order File Path
1 surfsense_web/tests/README.md
2 surfsense_backend/tests/e2e/README.md
3 surfsense_web/playwright.config.ts
4 .github/workflows/e2e-tests.yml
5 surfsense_backend/tests/e2e/run_backend.py
6 surfsense_backend/tests/e2e/run_celery.py
7 surfsense_backend/tests/e2e/middleware/scenario.py
8 surfsense_backend/tests/e2e/fakes/composio_module.py
9 surfsense_backend/tests/e2e/fakes/fixtures/drive_files.json
10 surfsense_backend/tests/e2e/fakes/fixtures/gmail_messages.json
11 surfsense_backend/tests/e2e/fakes/fixtures/calendar_events.json
12 surfsense_backend/tests/e2e/fakes/fixtures/notion_pages.json
13 surfsense_backend/tests/e2e/fakes/fixtures/linear_issues.json
14 surfsense_backend/tests/e2e/fakes/fixtures/jira_issues.json
15 surfsense_backend/tests/e2e/fakes/native_google.py
16 surfsense_backend/tests/e2e/fakes/notion_module.py
17 surfsense_backend/tests/e2e/fakes/linear_module.py
18 surfsense_backend/tests/e2e/fakes/jira_module.py
19 surfsense_backend/tests/e2e/fakes/mcp_oauth_runtime.py
20 surfsense_backend/tests/e2e/fakes/mcp_runtime.py
21 surfsense_backend/tests/e2e/fakes/llm.py
22 surfsense_backend/tests/e2e/fakes/chat_llm.py
23 surfsense_backend/tests/e2e/fakes/embeddings.py
24 surfsense_web/tests/auth.setup.ts
25 surfsense_web/tests/fixtures/search-space.fixture.ts
26 surfsense_web/tests/fixtures/chat-thread.fixture.ts
27 surfsense_web/tests/fixtures/connectors/composio-drive.fixture.ts
28 surfsense_web/tests/fixtures/connectors/composio-gmail.fixture.ts
29 surfsense_web/tests/fixtures/connectors/composio-calendar.fixture.ts
30 surfsense_web/tests/fixtures/connectors/native-drive.fixture.ts
31 surfsense_web/tests/fixtures/connectors/native-gmail.fixture.ts
32 surfsense_web/tests/fixtures/connectors/native-calendar.fixture.ts
33 surfsense_web/tests/fixtures/connectors/notion.fixture.ts
34 surfsense_web/tests/fixtures/connectors/linear.fixture.ts
35 surfsense_web/tests/fixtures/connectors/jira.fixture.ts
36 surfsense_web/tests/fixtures/index.ts
37 surfsense_web/tests/helpers/canary.ts
38 surfsense_web/tests/helpers/api/auth.ts
39 surfsense_web/tests/helpers/api/search-spaces.ts
40 surfsense_web/tests/helpers/api/connectors.ts
41 surfsense_web/tests/helpers/api/documents.ts
42 surfsense_web/tests/helpers/api/chat.ts
43 surfsense_web/tests/helpers/waits/indexing.ts
44 surfsense_web/tests/helpers/ui/connector-popup.ts
45 surfsense_web/tests/helpers/ui/dashboard.ts
46 surfsense_web/tests/smoke/dashboard.spec.ts
47 surfsense_web/tests/smoke/chat-stream.spec.ts
48 surfsense_web/tests/connectors/composio/drive/README.md
49 surfsense_web/tests/connectors/composio/drive/journey.spec.ts
50 surfsense_web/tests/connectors/composio/gmail/journey.spec.ts
51 surfsense_web/tests/connectors/composio/calendar/journey.spec.ts
52 surfsense_web/tests/connectors/google/drive/journey.spec.ts
53 surfsense_web/tests/connectors/google/gmail/journey.spec.ts
54 surfsense_web/tests/connectors/google/calendar/journey.spec.ts
55 surfsense_web/tests/connectors/notion/journey.spec.ts
56 surfsense_web/tests/connectors/linear/journey.spec.ts
57 surfsense_web/tests/connectors/jira/journey.spec.ts
58 surfsense_backend/tests/integration/composio/conftest.py
59 surfsense_backend/tests/integration/composio/test_oauth_callback.py
60 surfsense_backend/tests/integration/composio/test_drive_folders_route.py
61 surfsense_backend/tests/unit/e2e_fakes/test_drive_list_files.py
62 surfsense_backend/tests/unit/utils/test_oauth_security.py
63 surfsense_web/package.json
64 surfsense_web/pnpm-lock.yaml
65 .gitignore
66 surfsense_backend/.dockerignore
67 surfsense_web/.dockerignore

Need help? Join our Discord

@AnishSarkar22 AnishSarkar22 marked this pull request as ready for review May 8, 2026 23:58
@MODSetter MODSetter merged commit 350ab2f into MODSetter:dev May 9, 2026
4 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants