Doctor (E2E)
Backend end-to-end (E2E) tests for the Subscriberbot product. This repo exercises the workspace microservice wspace-subscriberbot-svc through the workspaces public GraphQL gateway. It is a focused backend test suite only — no UI or service-startup automation lives here.
What's inside
.
├── Makefile # Root test orchestration
├── README.md # This file
├── core/scripts/common.sh # Shared harness copied from workspaces-doctor
└── wspace/modules/subscriberbot/
├── Makefile # Module-level targets
├── README.md # Detailed coverage notes
└── scripts/
├── test-subscriberbot.sh # Per-domain CRUDL suite
├── test-subscriberbot-stories.sh # 12 website story scenarios
└── test-subscriberbot-onboarding-journey.sh # Spec-driven onboarding journey
Prerequisites
-
curl,jq,make -
For local runs, source the shared env file from
workspaces-doctorto get tokens (do not runbootstrap-envfrom this repo):source /home/ubuntu/products/workspaces/workspaces-doctor/core/env/e2e-env.shThis provides
E2E_AUTH_TOKEN,E2E_WORKSPACE_TOKEN,E2E_WORKSPACE_ID, etc. -
For alpha/prod runs, export the credentials directly (they override the shared env file values):
export AUTH_TOKEN="<alpha-or-prod-jwt>"
export WORKSPACE_TOKEN="<workspace-access-jwt>"
export WORKSPACE_ID="<workspace-uuid>"
export USER_ID="<user-uuid>"
Target environment
The suite defaults to the production workspaces public gateway. Select the target with SUBSCRIBERBOT_TARGET:
| Target | SUBSCRIBERBOT_TARGET | Canonical endpoint |
|---|---|---|
| prod | prod (default) | https://graphqlworkspaces.burdenoff.com/workspaces/graphql |
| alpha | alpha | https://alphagraphqlworkspaces.burdenoff.com/workspaces/graphql |
| local | local | http://localhost:4003/workspaces/graphql |
Direct endpoint overrides take precedence:
SUBSCRIBERBOT_ENDPOINT=http://localhost:4003/workspaces/graphql make test-health
E2E_WSPACE_PUBLIC_GATEWAY / E2E_WORKSPACE_GATEWAY / WSPACE_GATEWAY_URL are also honored before the target default.
Running tests
Smoke / story tests (default: prod)
make test
Runs test-stories (all 12 story scenarios) and test-onboarding.
Local smoke / story tests
SUBSCRIBERBOT_TARGET=local make test
Everything
make test-all
Runs the CRUDL domain suite, the 12 story scenarios, and the onboarding journey.
Individual suites
make test-health
make test-provider
make test-relationship
make test-inbox
...
make test-stories
make test-onboarding
See make help for the full list.
Alpha with Cloudflare Access
When SUBSCRIBERBOT_TARGET=alpha, the suite automatically attaches CF-Access-Client-Id and CF-Access-Client-Secret headers if the env vars are set:
export CF_ACCESS_CLIENT_ID="..."
export CF_ACCESS_CLIENT_SECRET="..."
SUBSCRIBERBOT_TARGET=alpha make test
Custom endpoint / run label
SUBSCRIBERBOT_ENDPOINT=http://localhost:4003/workspaces/graphql \
RUN_ID=ci-run-42 \
make test-stories
Test coverage
CRUDL suite (test-subscriberbot.sh)
| Domain | Operations |
|---|---|
| health | subHealth |
| provider | subCreateProvider / subListProviders / subProvider / subUpdateProvider / subArchiveProvider |
| plan | subCreatePlan / subListPlans |
| relationship | subCreateRelationship / subListRelationships / subRelationship / subUpdateRelationship / subTransitionRelationship / subCancelRelationship |
| entitlement | subCreateEntitlement / subListEntitlements |
| asset | subCreateAsset / subListAssets |
| channel | subCreateChannel / subListChannels / subVerifyChannel |
| inbox | subIngestMessage / subListInboxMessages / subMarkMessageRead |
| invoice | subCreateInvoice / subListInvoices / subMarkInvoicePaid |
| payment | subCreatePaymentInstrument / subListPaymentInstruments / subRemovePaymentInstrument |
| agent | subCreateAgent / subListAgents / subAgent / subSetAgentStatus |
| policy | subCreatePolicy / subListPolicies |
| workflow | subCreateWorkflow / subListWorkflows / subActivateWorkflow |
| renewal | subListRenewalEvents |
Story scenarios (test-subscriberbot-stories.sh)
Twelve multi-step user journeys matching the product website stories, e.g. discover-hidden-subscriptions, one-place-manage-cancel, universal-inbox, cut-wasted-spend, autonomous-management, etc.
Onboarding journey (test-subscriberbot-onboarding-journey.sh)
A spec-driven end-to-end flow based on subscriberbot-specs/journey/END_TO_END_USER_JOURNEY.md:
- Health probe
- Connect and verify an email channel
- Discovery surfaces a provider, plan, and linked relationship
- Universal inbox ingests and marks-read a message
- Relationship lifecycle control (pause + resume)
- AI cost agent + autonomous policy + activated workflow
Notes
- Tests rely on the shared harness in
core/scripts/common.sh. The harness is self-contained to this repo and sources/home/ubuntu/products/workspaces/workspaces-doctor/core/env/e2e-env.shat runtime via the caller's environment. - Permission/RBAC walls are treated as FAIL in the onboarding journey and as SKIP in the CRUDL/story suites, matching the conventions of the source
workspaces-doctortests. - Cleanup is best-effort: relationships are cancelled and providers archived where the schema supports terminal mutations.
The doctor suite defaults to production. Use SUBSCRIBERBOT_TARGET=local|alpha to switch. See Environment Selection for endpoint details.
Related
- Repository:
subscriberbot-doctor - Service:
wspace-subscriberbot-svc - Specs:
subscriberbot-specs