Skip to content

E2E: Per-test store isolation for robust parallel execution #7269

@phyllis-sy-wu

Description

@phyllis-sy-wu

Problem/Feature

When multiple tests share a dev store, earlier test failures can leave state (installed apps, modified config) that causes later tests to fail. Shared stores also prevent true parallel execution since app dev binds to a specific store.

Proposed Solution

  • Per-test dev store creation: storeTestFixture (test-scoped, not worker-scoped) creates a fresh dev store per test via browser automation on admin.shopify.com/store-create/organization/{orgId}
    • Handles shadow DOM form elements (s-internal-text-field, s-internal-select) using chained Playwright locators
    • Selects a random plan from available options
    • Waits for redirect to confirm store creation, extracts FQDN
  • Robust teardown with escalating retry (setup/teardown.ts):
    • Phase 1: Uninstall app from store (verified via "Add apps to your store" empty state)
    • Phase 2: Delete store (verified via "Your plan was canceled" page). Escalates to phase 1 on failure (re-uninstall before retrying delete)
    • Phase 3: Delete app from dev dashboard (always runs, even if phases 1-2 fail)
    • Each phase is independent — failure never prevents later phases
  • Safety check: deleteStoreFromAdmin refuses to delete if apps are still installed (prevents orphaned app installs)
  • Cleanup scripts for manual/CI use:
    • scripts/cleanup-stores.ts — find and delete leftover E2E stores (uninstall apps first)
    • scripts/cleanup-apps.ts — find and delete leftover E2E apps from dev dashboard
    • pnpm test:e2e-cleanup runs both (stores first, then apps)
  • Tagged logging: [e2e][w0][browser], [e2e][w1][cli] etc. with section headers (----- SETUP: store ... -----, ----- TEARDOWN: app ... -----) for debugging parallel output

Expected result: Each test is fully isolated — no shared store state, no cross-test interference, safe cleanup even on failure.

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