agentleFS
a-ghorbania-ghorbani/pocketpal-dev-team/skills/run-e2e/SKILL.md

run-e2e

Skill6 starsChanged 25 days agoMITView on GitHub

Build PocketPal AI from source in a worktree and run E2E specs against the local build. For testing the CI-built APK of a PR instead, use /run-pr-e2e.

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Verify before starting a run:

    line 37
  2. Very specific:

    pod install: after any Podfile.lock change (llama.rn upgrades, new native deps).

    line 52

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Run E2E Tests (local build)

You are building PocketPal AI from source in a worktree and running E2E specs against the local build. If the user wants to verify a PR matches the bit-identical artifact CI produced — without a local build — use /run-pr-e2e instead; that skill covers the CI-artifact path and defers to this one for everything generic.

Project facts (not exposed by --help)

  1. No CI gate on E2E. .github/workflows/e2e-tests.yml is a manual workflow_dispatch that only uploads the Android APK as an artifact; no specs are executed. Treat "E2E green" claims outside this skill as unverified until reproduced locally.
  2. Android uses a separate e2e flavor, package com.pocketpalai.e2e, output at android/app/build/outputs/apk/e2e/releaseE2e/app-e2e-releaseE2e.apk. The prod APK (outputs/apk/release/app-release.apk) is non-debuggable and has the src/__automation__/ bridge DCE-stripped — specs against it silently no-op. Always build via yarn android:build:e2e, never assembleRelease.
  3. iOS has no separate flavor. Same bundleId as prod (ai.pocketpal), differentiated only by the __E2E__ define from babel.config.js: transform-define driven by E2E_BUILD=true. yarn ios:build:e2e is the only correct build command for sim tests; yarn ios:build:ipa for iOS devices.
  4. Reset behaviour differs across platforms. iOS uses noReset:false, fullReset:false — install state (including downloaded models) is preserved across runs. Android uses fullReset:true — the app is reinstalled every run and any downloaded model is lost. Plan timing accordingly.
  5. e2e/devices.json is gitignored and per-worktree, copied from the submodule's local copy by tools/sync-worktree-config.sh; that copy may point Android appPath at the prod-release path. Each Android appPath must match the APK under test: the e2e-flavor output (../android/app/build/outputs/apk/e2e/releaseE2e/app-e2e-releaseE2e.apk) for a local yarn android:build:e2e. tools/run-pr-e2e.sh rewrites it to the APK it fetched. A wrong path surfaces as WebDriverError: The application at '...' does not exist, even when the build itself succeeded.
  6. TIMEOUTS.appReady = 60s in e2e/fixtures/models.ts. Most specs block on the chat-input testID for 60s before doing anything else. A broken first-paint manifests as no such element 'chat-input' after roughly the appReady timeout.

Available specs

Pick the smallest spec that exercises what changed; default quick-smoke. Core specs live in e2e/specs/*.spec.ts (quick-smoke, load-stress, benchmark-matrix, memory-profile, visual-capture, diagnostic), feature specs in e2e/specs/features/*.spec.ts (thinking, language, draft-autosave, remote-server, talent-tool-use). Read references/specs.md for what each tests and when to use it. benchmark-matrix, memory-profile, tts-memory-profile, visual-capture, and diagnostic are measurement infrastructure, excluded from the /run-pr-e2e default list.

Parse input

Extract from $ARGUMENTS:

  • Worktree (optional): if a branch name is given, check it out in a dedicated ./worktrees/E2E-<safe-name> via ./tools/create-worktree.sh ... --detach --ref origin/<branch>. If main, use ./worktrees/E2E-main. If omitted, use the current task worktree if there is one; otherwise stop and ask the user which worktree. (For the PR-CI-artifact path, redirect to /run-pr-e2e.)
  • Platform: ios, android, both (default: both).
  • Devices: all / virtual-only / real-only / connected / comma-separated IDs (runner default: all).
  • Spec: any basename from the catalogs above (the runner resolves both specs/ and specs/features/); default quick-smoke.
  • Flags: pass through --each-model, --each-device, --all-models, --skip-build, --dry-run, --models a,b. Anything else: consult npx ts-node scripts/run-e2e.ts --help.

Step 1 — Pre-flight

Verify before starting a run:

  • Worktree: reuse an existing one for the branch when present; otherwise create with ./tools/create-worktree.sh (--detach --ref origin/<branch>, or --ref origin/main for main). Never test inside repos/pocketpal-ai/ — it's a read-only submodule.
  • Local branch is in sync with origin. Stale checkouts produce results that don't reflect the code being shipped.
  • iOS simulator is booted (the runner does not boot it).
  • Android emulator or device is attached and showing as device in adb devices.
  • Phone claimed. Claim a phone through agistry before driving it and release it after (a pipeline stage uses the DEVICE its orchestrator claimed); iOS runs go through ios-router (this host has no iOS toolchain).
  • Appium ports 4723 and 4724 are free — the WDIO config spawns Appium on these (see wdio.{ios,android}.local.conf.ts); a leftover daemon from a previous run causes session creation to hang.

Step 2 — One-time worktree setup

Each fresh worktree needs three project-specific things beyond root yarn install:

  • e2e/ has its own package.json (WDIO + Appium client deps). Run yarn install separately in that subdirectory.
  • ios/ has a Gemfile that pins xcpretty and the cocoapods version. Install via Bundler before pod install, otherwise yarn ios:build:e2e fails opaquely — xcpretty swallows the real xcodebuild error.
  • pod install after any Podfile.lock change (llama.rn upgrades, new native deps).

Then verify e2e/devices.json (gitignored, per-worktree, synced on creation). For a local yarn android:build:e2e, each Android appPath must be ../android/app/build/outputs/apk/e2e/releaseE2e/app-e2e-releaseE2e.apk; the synced copy often holds the prod-release path, which fails Android session creation with APK does not exist.

Step 3 — Run the pipeline

Entry point: npx ts-node scripts/run-e2e.ts from inside e2e/. Required flags: --platform <ios|android|both> and --spec <name>. Everything else is documented in --help.

Non-obvious flag semantics:

  • --dry-run first whenever changing platform/devices/spec — it prints the matched targets and per-device WDIO invocations without spending the build budget.
  • --each-device is required to iterate over more than one device from devices.json. Passing --devices a,b alone does not imply --each-device; without it the runner picks the default device only.
  • Builds are sequential (iOS first, then Android). Cold builds typically run ~10-15 min iOS + ~3-5 min Android per worktree.

Step 4 — Report

Reports land in e2e/reports/<timestamp>/:

  • summary.json — overall pass/fail + per-device breakdown.
  • junit-results.xml — merged JUnit across devices.
  • <device-id>/[<model-id>/] subdirectories — per-run JUnit + screenshots/failure-*.png.

For each failure, open the per-device subdirectory and look at the failure screenshot and the per-device JUnit before drilling into the spec.

Failure-mode lookup

SymptomLikely cause
WebDriverError: The application at '...app-release.apk' does not existe2e/devices.json Android appPath does not match the APK that was built or fetched. Fix the path; the build itself is fine.
iOS red box No script URL provided. unsanitizedScriptURLString = (null)The installed app on the sim is a Debug build expecting Metro, not the Release .app from the build. Uninstall and reinstall from the new .app.
no such element 'chat-input' ~appReady seconds after session start (iOS)First-paint is broken, or the install on the sim is from a different build than the .app on disk. Confirm install matches build before deeper investigation.
iOS BUILD FAILED with no error text above itBundler gems (specifically xcpretty) are missing in ios/. Install Bundler gems, then retry.
iOS build succeeds but the .app won't launch after a Podfile.lock changePods are stale. Re-run pod install.
Android Appium connects but session creation hangs >60sA stale Appium daemon is holding port 4723/4724. Free the ports and retry.
Run times shorter than the spec's workload would implyiOS preserves install state, so a previously downloaded model short-circuits the download step. Compare timings only with a clean install.

Notes

  • The runner script is scripts/run-e2e.ts. There is no run-e2e-pipeline.ts.
  • devices.json and real-iOS builds (yarn ios:build:ipa, not :e2e): see Project facts 3 and 5.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.