Skip to content

[E2E] Trial Shard Provisioning and Lifecycle Validation #100

Description

@BeSovereign

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

  1. 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.
  2. 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).
  3. 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

  • Test successfully creates a trial shard via the UI.
  • Browser is redirected or shows the correct pairing link/code.
  • The provisioned shard domain is verified to be alive via an HTTP check.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions