Correct E2E teardown ordering and remove browser gates - #8316
Draft
isaacroldan wants to merge 9 commits into
Draft
Correct E2E teardown ordering and remove browser gates#8316isaacroldan wants to merge 9 commits into
isaacroldan wants to merge 9 commits into
Conversation
The E2E teardown drove the Dev Dashboard and store admin UI for work the App Management API can answer directly: - App lookup: replace the browser pagination in findAppOnDevDashboard with appByKey (client_id) and an appsConnection title search fallback. - Install gating: replace the isStoreAppsEmpty page scrape and the disabled-Delete-button probing with installCount polling. The same check gates both store deletion and app deletion. - Store uninstall: drop the browser click-through fallback; the Admin API path (from #8309) is now the only one in teardown. The browser is only used for the final delete-app click, which has no API mutation. The cleanup scripts keep their browser paths: org-wide sweeps have no local app dir to mint Admin API tokens from. API calls reuse the worker's CLI session via cli-kit, following the cleanup-stores.ts pattern. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Importing cli-kit's dist ESM inside Playwright's transpiled harness
crashes Node's require(esm) path on CI's Node version ("Unexpected
module status 3"). tsx's loader handles the interop — the same reason
the cleanup scripts import cli-kit under tsx without issues.
This also removes the process.env XDG mutation: the session dirs are
passed to the subprocess environment directly.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The App Management API resolves the request's organization from specifically-named GraphQL variables (organizationId, apiKey, appId). The lookup variable was named "key", so every teardown lookup failed with 404 "Cannot find a valid organization" and app/store deletion was skipped. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- appByKey now sends organizationId: without it a deleted app cannot
resolve an organization and 404s instead of returning null.
- Client IDs are only taken from /apps/{segment} URL parts that are
non-numeric; deploy output yields /apps/{numericAppId} URLs, which
now fall back to a name search.
- The settings-page navigation clicks through the accounts.shopify.com
account picker, which cold browser contexts bounce to — the main
reason direct-URL app deletion has been failing.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
isaacroldan
force-pushed
the
isaac/e2e-teardown-via-api
branch
from
August 12, 2026 14:21
c6d8bce to
69bb1f6
Compare
Settings pages under client-key URLs usually render without the Delete button; the numeric-id form (what the dashboard links to and the CLI's appDeepLink builds) works reliably — the run-level cleanup deletes 11/11 apps with it while key-form teardown deletes went 2/13. The app GID from the API lookup provides the numeric id. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Assisted-By: devx/215513a9-13fa-4e74-bb8f-79faee6e4f09
Assisted-By: devx/215513a9-13fa-4e74-bb8f-79faee6e4f09
Assisted-By: devx/215513a9-13fa-4e74-bb8f-79faee6e4f09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Per-test cleanup deleted the dev store before the app. Store cancellation can leave installation records that keep the app's Dev Dashboard delete action disabled, so this order can leak apps. The cleanup path also used store-admin page state as a gate and could replace the original test failure with a teardown exception.
What
installCountthrough the App Management API. The API work runs in the existing tsx subprocess boundary and uses cli-kit's GraphQL client, including shared throttling, network retry, and token refresh behavior.completed,failed, orskippedwithout throwing from teardown.No changeset: this changes internal E2E infrastructure only.
Testing
pnpm --filter @shopify/e2e type-checkpnpm --filter @shopify/e2e lintpnpm exec playwright test --project local— 23 passed