Summary
Validate the critical "Trial Shard" journey: from the landing page signup to a fully provisioned and accessible shard. This test ensures the integration between the landing-page, the freeshard-controller API, and the backend provisioning logic.
Technical Context
- Test File: tests/e2e/tests/trial-provisioning.spec.ts
- Target API: POST /api/shards/assign_trial
- Infrastructure: Requires a running freeshard-controller and at least one "Standby" shard container in the test environment.
Implementation Details for the Agent
- Signup Flow:
- Navigate to /en/trial/ on the landing page.
- Fill in the email field (use a test-safe pattern like e2e-trial-timestamp@example.com).
- Note on Email: Based on current code analysis, the assign_trial endpoint accepts an optional owner_email. The test should verify that entering an email works, but also account for environments where email delivery is mocked.
- Check the "Legal Consent" checkbox.
- Click the "Create" button.
- Provisioning Wait State:
- The UI shows a spinner while the controller assigns a shard.
- The test must handle a timeout of at least 60s, as backend container startup can be slow.
- Assert that the POST request to assign_trial returns a 201/200 with shard metadata (hash_id, domain, code).
- Post-Provisioning Assertions:
- Verify the "Shard Ready" view appears.
- Assert that the ShardIdBadge displays the correct ID.
- Verification: Attempt to reach the generated shard domain (e.g., http://hash_id.localhost). Use request.get() to verify the shard splash screen or login page is reachable.
Handling Dependencies (Agent Instructions)
- CAPTCHA: Currently, no CAPTCHA is detected in the SignupForm.astro. If one is added, the test should use a bypass key or mock the validator in the controller.
- Standby Shards: The test environment must ensure that the controller has shards in the standby state. If the API returns 503 (No shards available), the test should fail with a descriptive message about infrastructure readiness.
Acceptance Criteria
Summary
Validate the critical "Trial Shard" journey: from the landing page signup to a fully provisioned and accessible shard. This test ensures the integration between the
landing-page, thefreeshard-controllerAPI, and the backend provisioning logic.Technical Context
Implementation Details for the Agent
Handling Dependencies (Agent Instructions)
Acceptance Criteria