Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

refactor: restructure test suite into api/cli/infra groups

Luigi Agostib1ff38b051a1
diff --git a/.github/DEFINITION_OF_DONE.md b/.github/DEFINITION_OF_DONE.md
index 2b18d584..81672efb 100644
--- a/.github/DEFINITION_OF_DONE.md
+++ b/.github/DEFINITION_OF_DONE.md
@@ -20,7 +20,7 @@ These run automatically via `ci.yml`. If your PR fails them, fix and re-push.
## Manual — Testing (Required)
- [ ] **New/changed functionality has tests** — Same-package unit tests preferred
-- [ ] **Docker E2E tests run locally** — If you modified handlers/bridge/tabs, run: `./dev e2e` and/or the narrower suite you changed, for example `./dev e2e api-fast`, `./dev e2e api-full`, or `./dev e2e cli-full`
+- [ ] **Docker E2E tests run locally** — If you modified handlers/bridge/tabs, run: `./dev e2e pr` and/or the narrower suite you changed, for example `./dev e2e api`, `./dev e2e cli`, or `./dev e2e infra`
- [ ] **npm commands work** (if npm wrapper touched):
- `npm pack` in `/npm/` produces valid tarball
- `npm install -g pinchtab` (or from local tarball) succeeds
diff --git a/.github/workflows/ci-e2e.yml b/.github/workflows/ci-e2e.yml
index 6a1869d7..6222eec8 100644
--- a/.github/workflows/ci-e2e.yml
+++ b/.github/workflows/ci-e2e.yml
@@ -14,45 +14,108 @@ on:
- 'skill/**'
- 'plugin/**'
workflow_dispatch:
+ inputs:
+ suite:
+ description: 'Suite to run'
+ required: false
+ default: 'all'
+ type: choice
+ options:
+ - all
+ - api
+ - cli
+ - infra
jobs:
- api-fast:
- if: github.event_name != 'workflow_dispatch'
+ detect-changes:
+ if: github.event_name == 'pull_request'
+ runs-on: ubuntu-latest
+ outputs:
+ api_touched: ${{ steps.changes.outputs.api_touched }}
+ cli_touched: ${{ steps.changes.outputs.cli_touched }}
+ infra_touched: ${{ steps.changes.outputs.infra_touched }}
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Detect touched E2E files
+ id: changes
+ run: |
+ CHANGED=$(git diff --name-only origin/main...HEAD)
+
+ # Find touched extended/standalone scenarios
+ API_TOUCHED=$(echo "$CHANGED" | grep -E 'tests/e2e/scenarios/api/.*-extended\.sh|tests/e2e/scenarios/api/[^/-]+\.sh' | tr '\n' ' ' || true)
+ CLI_TOUCHED=$(echo "$CHANGED" | grep -E 'tests/e2e/scenarios/cli/.*-extended\.sh|tests/e2e/scenarios/cli/[^/-]+\.sh' | tr '\n' ' ' || true)
+ INFRA_TOUCHED=$(echo "$CHANGED" | grep -E 'tests/e2e/scenarios/infra/.*-extended\.sh|tests/e2e/scenarios/infra/[^/-]+\.sh' | tr '\n' ' ' || true)
+
+ echo "api_touched=$API_TOUCHED" >> "$GITHUB_OUTPUT"
+ echo "cli_touched=$CLI_TOUCHED" >> "$GITHUB_OUTPUT"
+ echo "infra_touched=$INFRA_TOUCHED" >> "$GITHUB_OUTPUT"
+
+ api:
+ needs: [detect-changes]
+ if: always() && (needs.detect-changes.result == 'success' || needs.detect-changes.result == 'skipped')
+ uses: ./.github/workflows/reusable-e2e.yml
+ with:
+ ref: ${{ github.sha }}
+ suite: api
+ extra_scenarios: ${{ needs.detect-changes.outputs.api_touched || '' }}
+ summary_title: E2E API Tests
+ timeout_minutes: 15
+ compose_file: tests/e2e/docker-compose.yml
+
+ cli:
+ needs: [detect-changes]
+ if: always() && (needs.detect-changes.result == 'success' || needs.detect-changes.result == 'skipped')
uses: ./.github/workflows/reusable-e2e.yml
with:
ref: ${{ github.sha }}
- suite: api-fast
- summary_title: E2E API Fast Tests
+ suite: cli
+ extra_scenarios: ${{ needs.detect-changes.outputs.cli_touched || '' }}
+ summary_title: E2E CLI Tests
timeout_minutes: 15
compose_file: tests/e2e/docker-compose.yml
- cli-fast:
- if: github.event_name != 'workflow_dispatch'
+ infra:
+ needs: [detect-changes]
+ if: always() && (needs.detect-changes.result == 'success' || needs.detect-changes.result == 'skipped')
uses: ./.github/workflows/reusable-e2e.yml
with:
ref: ${{ github.sha }}
- suite: cli-fast
- summary_title: E2E CLI Fast Tests
+ suite: infra
+ extra_scenarios: ${{ needs.detect-changes.outputs.infra_touched || '' }}
+ summary_title: E2E Infra Tests
timeout_minutes: 15
compose_file: tests/e2e/docker-compose.yml
- full-api:
- if: github.event_name == 'workflow_dispatch'
+ # Extended suites for manual dispatch
+ api-extended:
+ if: github.event_name == 'workflow_dispatch' && (inputs.suite == 'all' || inputs.suite == 'api')
uses: ./.github/workflows/reusable-e2e.yml
with:
ref: ${{ github.sha }}
- suite: full-api
- summary_title: E2E Full API Tests
+ suite: api-extended
+ summary_title: E2E API Extended Tests
timeout_minutes: 20
compose_file: tests/e2e/docker-compose-multi.yml
- full-cli:
- if: github.event_name == 'workflow_dispatch'
+ cli-extended:
+ if: github.event_name == 'workflow_dispatch' && (inputs.suite == 'all' || inputs.suite == 'cli')
uses: ./.github/workflows/reusable-e2e.yml
with:
ref: ${{ github.sha }}
- suite: full-cli
- summary_title: E2E Full CLI Tests
+ suite: cli-extended
+ summary_title: E2E CLI Extended Tests
timeout_minutes: 20
compose_file: tests/e2e/docker-compose.yml
+
+ infra-extended:
+ if: github.event_name == 'workflow_dispatch' && (inputs.suite == 'all' || inputs.suite == 'infra')
+ uses: ./.github/workflows/reusable-e2e.yml
+ with:
+ ref: ${{ github.sha }}
+ suite: infra-extended
+ summary_title: E2E Infra Extended Tests
+ timeout_minutes: 25
+ compose_file: tests/e2e/docker-compose-multi.yml
diff --git a/.github/workflows/reusable-e2e.yml b/.github/workflows/reusable-e2e.yml
index 7f300872..e673d423 100644
--- a/.github/workflows/reusable-e2e.yml
+++ b/.github/workflows/reusable-e2e.yml
@@ -19,6 +19,10 @@ on:
required: false
type: string
default: ''
+ extra_scenarios:
+ required: false
+ type: string
+ default: ''
dump_instance_inventory:
required: false
type: boolean
@@ -92,7 +96,12 @@ jobs:
mkdir -p tests/e2e/results
rm -f tests/e2e/results/summary*.txt tests/e2e/results/report*.md e2e-output.log
- ./dev e2e "${{ inputs.suite }}" 2>&1 | tee e2e-output.log
+ EXTRA="${{ inputs.extra_scenarios }}"
+ if [ -n "$EXTRA" ]; then
+ ./dev e2e "${{ inputs.suite }}" "extra=$EXTRA" 2>&1 | tee e2e-output.log
+ else
+ ./dev e2e "${{ inputs.suite }}" 2>&1 | tee e2e-output.log
+ fi
EXIT_CODE=${PIPESTATUS[0]}
if [ "$EXIT_CODE" -eq 127 ]; then
diff --git a/TESTING.md b/TESTING.md
index d5a8896a..e2ebb292 100644
--- a/TESTING.md
+++ b/TESTING.md
@@ -8,19 +8,22 @@ The `dev` developer toolkit is the easiest way to run checks and tests:
./dev # Interactive picker
./dev test # All tests (unit + E2E)
./dev test unit # Unit tests only
-./dev e2e # Release suite (api-full + cli-full)
-./dev e2e pr # PR suite (api-fast + cli-fast)
-./dev e2e api-fast # API fast, single-instance
-./dev e2e cli-fast # CLI fast, single-instance
-./dev e2e api-full # API full, multi-instance
-./dev e2e cli-full # CLI full, single-instance
-./dev e2e full-api auth # Full API suite filtered to scenario filenames containing "auth"
+./dev e2e # Release suite (all extended tests)
+./dev e2e pr # PR suite (api + cli + infra basic)
+./dev e2e api # API basic tests
+./dev e2e cli # CLI basic tests
+./dev e2e infra # Infra basic tests
+./dev e2e api-extended # API extended, multi-instance
+./dev e2e cli-extended # CLI extended tests
+./dev e2e infra-extended # Infra extended, multi-instance
+./dev e2e api-extended auth # Extended API suite filtered to "auth"
/bin/bash tests/e2e/run.sh api
-/bin/bash tests/e2e/run.sh api all=true
-/bin/bash tests/e2e/run.sh api all=true filter=auth
+/bin/bash tests/e2e/run.sh api extended=true
+/bin/bash tests/e2e/run.sh api extended=true filter=auth
/bin/bash tests/e2e/run.sh cli
-/bin/bash tests/e2e/run.sh cli all=true
+/bin/bash tests/e2e/run.sh cli extended=true
+/bin/bash tests/e2e/run.sh infra
./dev check # All checks (format, vet, build, lint)
./dev check go # Go checks only
./dev check security # Gosec security scan
@@ -28,7 +31,7 @@ The `dev` developer toolkit is the easiest way to run checks and tests:
./dev doctor # Setup dev environment
```
-E2E summaries and markdown reports prefix each test with its scenario filename, for example `[auth-full] auth: login sets session cookie`, so it is easy to see which filename filter to use.
+E2E summaries and markdown reports prefix each test with its scenario filename, for example `[auth-extended] auth: login sets session cookie`, so it is easy to see which filename filter to use.
## Unit Tests
@@ -42,45 +45,46 @@ Unit tests are standard Go tests that validate individual packages and functions
## E2E Tests
-End-to-end tests launch a real pinchtab server with Chrome and run e2e-level tests against it.
+End-to-end tests launch a real pinchtab server with Chrome and run e2e-level tests against it. Tests are organized into three parallel groups:
+
+- **api** — Browser control and page interaction (tabs, actions, files)
+- **cli** — CLI command tests
+- **infra** — System, network, security, stealth, orchestration
### PR Suites
```bash
./dev e2e pr
-./dev e2e api-fast
-./dev e2e cli-fast
+./dev e2e api
+./dev e2e cli
+./dev e2e infra
```
Use these on pull requests and during normal development:
-- `pr` runs the same E2E suite composition as the PR workflow
-- `api-fast` runs the API `*-basic.sh` groups on the single-instance stack
-- `cli-fast` runs the CLI `*-basic.sh` groups on the single-instance stack
+- `pr` runs all three basic suites (same as CI PR workflow)
+- `api` runs the API `*-basic.sh` groups on the single-instance stack
+- `cli` runs the CLI `*-basic.sh` groups on the single-instance stack
+- `infra` runs the Infra `*-basic.sh` groups on the single-instance stack
-### Full API Suite
+### Extended Suites
```bash
-./dev e2e api-full
+./dev e2e api-extended
+./dev e2e cli-extended
+./dev e2e infra-extended
```
-Runs the grouped API `basic` and `full` scenarios on the multi-instance stack. `api-fast` is the `basic` layer only on the single-instance stack; `api-full` adds the extra and edge-case groups plus the multi-instance-only coverage.
-
-### Full CLI Suite
-
-```bash
-./dev e2e cli-full
-```
-
-Runs the grouped CLI `basic` and `full` scenarios on the single-instance stack. `cli-fast` is the `basic` layer only; `cli-full` adds the extra and edge-case groups.
+Extended suites run both `*-basic.sh` and `*-extended.sh` scenarios plus standalone scripts. `api-extended` and `infra-extended` use the multi-instance stack for orchestration coverage.
### Release Meta-Suite
```bash
./dev e2e
+./dev e2e release
```
-Runs `api-full` and `cli-full` in sequence.
+Runs `api-extended`, `cli-extended`, and `infra-extended` in sequence.
## Environment Variables
@@ -103,40 +107,60 @@ Everything is cleaned up automatically when tests finish.
## Test File Structure
-E2E tests are organized by surface and feature group:
+E2E tests are organized by group and feature:
+
+```
+tests/e2e/scenarios/
+├── api/ # Browser control, tabs, actions, files
+│ ├── browser-basic.sh
+│ ├── browser-extended.sh
+│ ├── tabs-basic.sh
+│ └── ...
+├── cli/ # CLI command tests
+│ ├── browser-basic.sh
+│ ├── browser-extended.sh
+│ └── ...
+└── infra/ # System, network, security, stealth
+ ├── system-basic.sh
+ ├── system-extended.sh
+ ├── stealth-basic.sh
+ ├── orchestrator-extended.sh
+ └── ...
+```
-- **`tests/e2e/scenarios-api/*.sh`** — grouped API entrypoints such as `tabs-basic.sh` and `tabs-full.sh`
- - `*-basic.sh` is the PR-fast happy-path layer
- - `*-full.sh` adds the extra and edge-case coverage for the same feature
- - Use Docker Compose: `tests/e2e/docker-compose.yml` for `api-fast`, `tests/e2e/docker-compose-multi.yml` for `api-full`
+- `*-basic.sh` is the PR happy-path layer
+- `*-extended.sh` adds extra and edge-case coverage
+- Standalone scripts (no suffix) run only in extended mode
-- **`tests/e2e/scenarios-cli/*.sh`** — grouped CLI entrypoints such as `tabs-basic.sh` and `tabs-full.sh`
- - Follows the same `basic` vs `full` split as the API side
- - Use Docker Compose: `tests/e2e/docker-compose.yml` for both `cli-fast` and `cli-full`
+Docker Compose files:
+- `tests/e2e/docker-compose.yml` — single-instance stack for basic tests
+- `tests/e2e/docker-compose-multi.yml` — multi-instance stack for extended tests
## E2E Results
Each suite writes its own summary and markdown report under `tests/e2e/results/`:
-- `summary-api-fast.txt` / `report-api-fast.md`
-- `summary-api-full.txt` / `report-api-full.md`
-- `summary-cli-fast.txt` / `report-cli-fast.md`
-- `summary-cli-full.txt` / `report-cli-full.md`
+- `summary-api.txt` / `report-api.md`
+- `summary-api-extended.txt` / `report-api-extended.md`
+- `summary-cli.txt` / `report-cli.md`
+- `summary-cli-extended.txt` / `report-cli-extended.md`
+- `summary-infra.txt` / `report-infra.md`
+- `summary-infra-extended.txt` / `report-infra-extended.md`
The runner clears the target suite files before each run so stale results do not survive into the next suite.
## Writing New E2E Tests
-Add new coverage directly to a grouped entrypoint in `tests/e2e/scenarios-api/` or `tests/e2e/scenarios-cli/`. Keep `*-basic.sh` focused on the happy path and put the extra and edge-case coverage in the matching `*-full.sh`.
+Add new coverage directly to a grouped entrypoint in `tests/e2e/scenarios/api/`, `tests/e2e/scenarios/cli/`, or `tests/e2e/scenarios/infra/`. Keep `*-basic.sh` focused on the happy path and put the extra and edge-case coverage in the matching `*-extended.sh`.
### Example: Grouped API Entrypoint
```bash
#!/bin/bash
-# tests/e2e/scenarios-api/tabs-basic.sh
-SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${SCRIPT_DIR}/../helpers/api.sh"
+# tests/e2e/scenarios/api/tabs-basic.sh
+GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+source "${GROUP_DIR}/../../helpers/api.sh"
start_test "tab-scoped snapshot"
# ...
diff --git a/dev b/dev
index 51cce6d5..6e06ec0c 100755
--- a/dev
+++ b/dev
@@ -25,13 +25,15 @@ COMMANDS=(
"test unit:🔬:Go unit tests"
"test dashboard:🔬:Dashboard unit tests"
"e2e:🐳:E2E suites"
- " pr:🐳:PR suite (api-fast + cli-fast)"
- " release:🐳:Release suite (api-full + cli-full)"
+ " pr:🐳:PR suite (api + cli + infra)"
+ " release:🐳:Release suite (all extended)"
" docker:🐳:Build local image and run Docker smoke test"
- " api-fast:🐳:API fast (single-instance)"
- " cli-fast:🐳:CLI fast (single-instance)"
- " api-full:🐳:API full (multi-instance)"
- " cli-full:🐳:CLI full (single-instance)"
+ " api:🐳:API basic tests"
+ " cli:🐳:CLI basic tests"
+ " infra:🐳:Infra basic tests"
+ " api-extended:🐳:API extended (multi-instance)"
+ " cli-extended:🐳:CLI extended tests"
+ " infra-extended:🐳:Infra extended (multi-instance)"
"doctor:🩺:Setup dev environment"
"check go:🧪:Go only"
"check dashboard:🧪:Dashboard only"
diff --git a/docs/guides/contributing.md b/docs/guides/contributing.md
index 3f55b8ed..c0656573 100644
--- a/docs/guides/contributing.md
+++ b/docs/guides/contributing.md
@@ -248,9 +248,13 @@ go test ./... -v -coverprofile=coverage.out
go tool cover -html=coverage.out # View coverage
./dev e2e # Run the default E2E release suite
./dev e2e docker # Build the local image and run Docker smoke
-./dev e2e pr # Run API fast + CLI fast
-./dev e2e api-full # Run the multi-instance API suite
-./dev e2e cli-full # Run the single-instance CLI full suite
+./dev e2e pr # Run API + CLI + Infra basic tests
+./dev e2e api # Run API basic tests
+./dev e2e cli # Run CLI basic tests
+./dev e2e infra # Run Infra basic tests
+./dev e2e api-extended # Run API extended (multi-instance)
+./dev e2e cli-extended # Run CLI extended tests
+./dev e2e infra-extended # Run Infra extended (multi-instance)
```
### Developer Toolkit (`dev`)
@@ -279,14 +283,16 @@ All dev scripts are accessible through `./dev`:
| `test` | Run all tests |
| `test unit` | Unit tests only |
| `test dashboard` | Dashboard tests only |
-| `e2e` | Run the default E2E release suite (`api-full` + `cli-full`) |
+| `e2e` | Run the default E2E release suite (all extended tests) |
| `e2e docker` | Build the local image and run the Docker smoke test |
-| `e2e pr` | Run the PR E2E suite (`api-fast` + `cli-fast`) |
-| `e2e api-fast` | Run the fast API E2E suite on the single-instance stack |
-| `e2e cli-fast` | Run the fast CLI E2E suite on the single-instance stack |
-| `e2e api-full` | Run the full API E2E suite on the multi-instance stack |
-| `e2e cli-full` | Run the full CLI E2E suite on the single-instance stack |
-| `e2e release` | Run the release E2E meta-suite |
+| `e2e pr` | Run the PR E2E suite (`api` + `cli` + `infra` basic tests) |
+| `e2e api` | Run API basic tests |
+| `e2e cli` | Run CLI basic tests |
+| `e2e infra` | Run Infra basic tests |
+| `e2e api-extended` | Run API extended tests (multi-instance) |
+| `e2e cli-extended` | Run CLI extended tests |
+| `e2e infra-extended` | Run Infra extended tests (multi-instance) |
+| `e2e release` | Run the release E2E meta-suite (all extended) |
| `build` | Build the application |
| `dev` | Build and run the application |
| `run` | Run the application |
diff --git a/scripts/e2e.sh b/scripts/e2e.sh
index 5a4e426a..315413d6 100755
--- a/scripts/e2e.sh
+++ b/scripts/e2e.sh
@@ -9,7 +9,26 @@ MUTED=$'\033[38;2;90;100;128m'
SUCCESS=$'\033[38;2;0;229;204m'
ERROR=$'\033[38;2;230;57;70m'
NC=$'\033[0m'
-E2E_FILTER="${2:-}"
+
+# Parse arguments after suite
+E2E_FILTER=""
+E2E_EXTRA=""
+for arg in "${@:2}"; do
+ case "$arg" in
+ filter=*)
+ E2E_FILTER="${arg#filter=}"
+ ;;
+ extra=*)
+ E2E_EXTRA="${arg#extra=}"
+ ;;
+ *)
+ # Backwards compatibility: treat bare argument as filter
+ if [ -z "$E2E_FILTER" ]; then
+ E2E_FILTER="$arg"
+ fi
+ ;;
+ esac
+done
show_filter_status() {
@@ -121,46 +140,45 @@ prepare_suite_results() {
tests/e2e/results/report.md
}
-run_api_fast() {
+run_api() {
local compose_file="tests/e2e/docker-compose.yml"
- local summary_file="tests/e2e/results/summary-api-fast.txt"
- local report_file="tests/e2e/results/report-api-fast.md"
- local progress_file="tests/e2e/results/progress-api-fast.log"
- local log_prefix="logs-api-fast"
- echo " ${ACCENT}${BOLD}🐳 E2E API Fast tests (Docker)${NC}"
+ local summary_file="tests/e2e/results/summary-api.txt"
+ local report_file="tests/e2e/results/report-api.md"
+ local progress_file="tests/e2e/results/progress-api.log"
+ local log_prefix="logs-api"
+ echo " ${ACCENT}${BOLD}E2E API tests (Docker)${NC}"
show_filter_status
echo ""
prepare_suite_results "${summary_file}" "${report_file}" "${progress_file}" "${log_prefix}"
build_support_images "${compose_file}"
set +e
- if [ -n "${E2E_FILTER}" ]; then
- $COMPOSE -f "${compose_file}" run --build --rm runner-api /bin/bash /e2e/run.sh api "filter=${E2E_FILTER}"
- else
- $COMPOSE -f "${compose_file}" run --build --rm runner-api /bin/bash /e2e/run.sh api
- fi
- local api_fast_exit=$?
+ local args=""
+ [ -n "${E2E_FILTER}" ] && args="${args} filter=${E2E_FILTER}"
+ [ -n "${E2E_EXTRA}" ] && args="${args} extra=${E2E_EXTRA}"
+ $COMPOSE -f "${compose_file}" run --build --rm runner-api /bin/bash /e2e/run.sh api ${args}
+ local api_exit=$?
set -e
- if [ "${api_fast_exit}" -ne 0 ]; then
+ if [ "${api_exit}" -ne 0 ]; then
dump_compose_failure "${compose_file}" "${log_prefix}" runner-api pinchtab
show_suite_artifacts "${summary_file}" "${report_file}" "${progress_file}" "${log_prefix}" runner-api pinchtab
fi
compose_down "${compose_file}"
- return "${api_fast_exit}"
+ return "${api_exit}"
}
-run_full_api() {
+run_api_extended() {
local compose_file="tests/e2e/docker-compose-multi.yml"
- local summary_file="tests/e2e/results/summary-api-full.txt"
- local report_file="tests/e2e/results/report-api-full.md"
- local progress_file="tests/e2e/results/progress-api-full.log"
- local log_prefix="logs-api-full"
- echo " ${ACCENT}${BOLD}🐳 E2E Full API tests (Docker)${NC}"
+ local summary_file="tests/e2e/results/summary-api-extended.txt"
+ local report_file="tests/e2e/results/report-api-extended.md"
+ local progress_file="tests/e2e/results/progress-api-extended.log"
+ local log_prefix="logs-api-extended"
+ echo " ${ACCENT}${BOLD}E2E API Extended tests (Docker)${NC}"
show_filter_status
echo ""
prepare_suite_results "${summary_file}" "${report_file}" "${progress_file}" "${log_prefix}"
build_support_images "${compose_file}"
set +e
- E2E_SCENARIO_FILTER="${E2E_FILTER}" $COMPOSE -f "${compose_file}" up --build --abort-on-container-exit --exit-code-from runner-api runner-api
+ E2E_SUITE=api E2E_EXTENDED=true E2E_SCENARIO_FILTER="${E2E_FILTER}" $COMPOSE -f "${compose_file}" up --build --abort-on-container-exit --exit-code-from runner-api runner-api
local api_exit=$?
set -e
if [ "${api_exit}" -ne 0 ]; then
@@ -171,40 +189,39 @@ run_full_api() {
return "${api_exit}"
}
-run_cli_fast() {
+run_cli() {
local compose_file="tests/e2e/docker-compose.yml"
- local summary_file="tests/e2e/results/summary-cli-fast.txt"
- local report_file="tests/e2e/results/report-cli-fast.md"
- local progress_file="tests/e2e/results/progress-cli-fast.log"
- local log_prefix="logs-cli-fast"
- echo " ${ACCENT}${BOLD}🐳 E2E CLI Fast tests (Docker)${NC}"
+ local summary_file="tests/e2e/results/summary-cli.txt"
+ local report_file="tests/e2e/results/report-cli.md"
+ local progress_file="tests/e2e/results/progress-cli.log"
+ local log_prefix="logs-cli"
+ echo " ${ACCENT}${BOLD}E2E CLI tests (Docker)${NC}"
show_filter_status
echo ""
prepare_suite_results "${summary_file}" "${report_file}" "${progress_file}" "${log_prefix}"
build_support_images "${compose_file}"
set +e
- if [ -n "${E2E_FILTER}" ]; then
- $COMPOSE -f "${compose_file}" run --build --rm runner-cli /bin/bash /e2e/run.sh cli "filter=${E2E_FILTER}"
- else
- $COMPOSE -f "${compose_file}" run --build --rm runner-cli /bin/bash /e2e/run.sh cli
- fi
- local cli_fast_exit=$?
+ local args=""
+ [ -n "${E2E_FILTER}" ] && args="${args} filter=${E2E_FILTER}"
+ [ -n "${E2E_EXTRA}" ] && args="${args} extra=${E2E_EXTRA}"
+ $COMPOSE -f "${compose_file}" run --build --rm runner-cli /bin/bash /e2e/run.sh cli ${args}
+ local cli_exit=$?
set -e
- if [ "${cli_fast_exit}" -ne 0 ]; then
+ if [ "${cli_exit}" -ne 0 ]; then
dump_compose_failure "${compose_file}" "${log_prefix}" runner-cli pinchtab
show_suite_artifacts "${summary_file}" "${report_file}" "${progress_file}" "${log_prefix}" runner-cli pinchtab
fi
compose_down "${compose_file}"
- return "${cli_fast_exit}"
+ return "${cli_exit}"
}
-run_full_cli() {
+run_cli_extended() {
local compose_file="tests/e2e/docker-compose.yml"
- local summary_file="tests/e2e/results/summary-cli-full.txt"
- local report_file="tests/e2e/results/report-cli-full.md"
- local progress_file="tests/e2e/results/progress-cli-full.log"
- local log_prefix="logs-cli-full"
- echo " ${ACCENT}${BOLD}🐳 E2E Full CLI tests (Docker)${NC}"
+ local summary_file="tests/e2e/results/summary-cli-extended.txt"
+ local report_file="tests/e2e/results/report-cli-extended.md"
+ local progress_file="tests/e2e/results/progress-cli-extended.log"
+ local log_prefix="logs-cli-extended"
+ echo " ${ACCENT}${BOLD}E2E CLI Extended tests (Docker)${NC}"
show_filter_status
echo ""
prepare_suite_results "${summary_file}" "${report_file}" "${progress_file}" "${log_prefix}"
@@ -221,20 +238,74 @@ run_full_cli() {
return "${cli_exit}"
}
+run_infra() {
+ local compose_file="tests/e2e/docker-compose.yml"
+ local summary_file="tests/e2e/results/summary-infra.txt"
+ local report_file="tests/e2e/results/report-infra.md"
+ local progress_file="tests/e2e/results/progress-infra.log"
+ local log_prefix="logs-infra"
+ echo " ${ACCENT}${BOLD}E2E Infra tests (Docker)${NC}"
+ show_filter_status
+ echo ""
+ prepare_suite_results "${summary_file}" "${report_file}" "${progress_file}" "${log_prefix}"
+ build_support_images "${compose_file}"
+ set +e
+ local args=""
+ [ -n "${E2E_FILTER}" ] && args="${args} filter=${E2E_FILTER}"
+ [ -n "${E2E_EXTRA}" ] && args="${args} extra=${E2E_EXTRA}"
+ $COMPOSE -f "${compose_file}" run --build --rm runner-api /bin/bash /e2e/run.sh infra ${args}
+ local infra_exit=$?
+ set -e
+ if [ "${infra_exit}" -ne 0 ]; then
+ dump_compose_failure "${compose_file}" "${log_prefix}" runner-api pinchtab
+ show_suite_artifacts "${summary_file}" "${report_file}" "${progress_file}" "${log_prefix}" runner-api pinchtab
+ fi
+ compose_down "${compose_file}"
+ return "${infra_exit}"
+}
+
+run_infra_extended() {
+ local compose_file="tests/e2e/docker-compose-multi.yml"
+ local summary_file="tests/e2e/results/summary-infra-extended.txt"
+ local report_file="tests/e2e/results/report-infra-extended.md"
+ local progress_file="tests/e2e/results/progress-infra-extended.log"
+ local log_prefix="logs-infra-extended"
+ echo " ${ACCENT}${BOLD}E2E Infra Extended tests (Docker)${NC}"
+ show_filter_status
+ echo ""
+ prepare_suite_results "${summary_file}" "${report_file}" "${progress_file}" "${log_prefix}"
+ build_support_images "${compose_file}"
+ set +e
+ E2E_SUITE=infra E2E_EXTENDED=true E2E_SCENARIO_FILTER="${E2E_FILTER}" $COMPOSE -f "${compose_file}" up --build --abort-on-container-exit --exit-code-from runner-api runner-api
+ local infra_exit=$?
+ set -e
+ if [ "${infra_exit}" -ne 0 ]; then
+ dump_compose_failure "${compose_file}" "${log_prefix}" runner-api pinchtab pinchtab-secure pinchtab-medium pinchtab-full pinchtab-lite pinchtab-bridge
+ show_suite_artifacts "${summary_file}" "${report_file}" "${progress_file}" "${log_prefix}" runner-api pinchtab pinchtab-secure pinchtab-medium pinchtab-full pinchtab-lite pinchtab-bridge
+ fi
+ compose_down "${compose_file}"
+ return "${infra_exit}"
+}
+
run_pr() {
- local api_fast_exit=0
- local cli_fast_exit=0
+ local api_exit=0
+ local cli_exit=0
+ local infra_exit=0
- run_api_fast || api_fast_exit=$?
+ run_api || api_exit=$?
echo ""
- run_cli_fast || cli_fast_exit=$?
+ run_cli || cli_exit=$?
echo ""
- if [ "${api_fast_exit}" -ne 0 ] || [ "${cli_fast_exit}" -ne 0 ]; then
+
+ run_infra || infra_exit=$?
+
+ echo ""
+ if [ "${api_exit}" -ne 0 ] || [ "${cli_exit}" -ne 0 ] || [ "${infra_exit}" -ne 0 ]; then
echo " ${ERROR}PR E2E suites failed${NC}"
- echo " ${MUTED}exit codes: api-fast=${api_fast_exit}, cli-fast=${cli_fast_exit}${NC}"
+ echo " ${MUTED}exit codes: api=${api_exit}, cli=${cli_exit}, infra=${infra_exit}${NC}"
return 1
fi
echo " ${SUCCESS}PR E2E suites passed${NC}"
@@ -244,17 +315,22 @@ run_pr() {
run_release() {
local api_exit=0
local cli_exit=0
+ local infra_exit=0
+
+ run_api_extended || api_exit=$?
- run_full_api || api_exit=$?
+ echo ""
+
+ run_cli_extended || cli_exit=$?
echo ""
- run_full_cli || cli_exit=$?
+ run_infra_extended || infra_exit=$?
echo ""
- if [ "${api_exit}" -ne 0 ] || [ "${cli_exit}" -ne 0 ]; then
+ if [ "${api_exit}" -ne 0 ] || [ "${cli_exit}" -ne 0 ] || [ "${infra_exit}" -ne 0 ]; then
echo " ${ERROR}Some E2E suites failed${NC}"
- echo " ${MUTED}exit codes: api-full=${api_exit}, cli-full=${cli_exit}${NC}"
+ echo " ${MUTED}exit codes: api-extended=${api_exit}, cli-extended=${cli_exit}, infra-extended=${infra_exit}${NC}"
return 1
fi
echo " ${SUCCESS}All E2E suites passed${NC}"
@@ -269,24 +345,43 @@ case "${suite}" in
pr)
run_pr
;;
- api-fast)
- run_api_fast
+ api)
+ run_api
;;
- cli-fast)
- run_cli_fast
+ api-extended)
+ run_api_extended
;;
- api-full|full-api|curl)
- run_full_api
+ cli)
+ run_cli
+ ;;
+ cli-extended)
+ run_cli_extended
+ ;;
+ infra)
+ run_infra
;;
- cli-full|full-cli|cli)
- run_full_cli
+ infra-extended)
+ run_infra_extended
;;
release|all)
run_release
;;
+ # Backwards compatibility aliases
+ api-fast)
+ run_api
+ ;;
+ cli-fast)
+ run_cli
+ ;;
+ api-full|full-api|curl)
+ run_api_extended
+ ;;
+ cli-full|full-cli)
+ run_cli_extended
+ ;;
*)
echo "Unknown E2E suite: ${suite}" >&2
- echo "Available suites: pr, api-fast, cli-fast, api-full, cli-full, release" >&2
+ echo "Available suites: pr, api, cli, infra, api-extended, cli-extended, infra-extended, release" >&2
exit 1
;;
esac
diff --git a/skills/pinchtab-dev/SKILL.md b/skills/pinchtab-dev/SKILL.md
index 01a299c7..90d3875c 100644
--- a/skills/pinchtab-dev/SKILL.md
+++ b/skills/pinchtab-dev/SKILL.md
@@ -28,8 +28,8 @@ All development commands run via `./dev`:
| `./dev check dashboard` | Dashboard checks only |
| `./dev test unit` | Go unit tests |
| `./dev test dashboard` | Dashboard unit tests |
-| `./dev e2e pr` | PR suite (api-fast + cli-fast) |
-| `./dev e2e release` | Release suite (api-full + cli-full) |
+| `./dev e2e pr` | PR suite (api + cli + infra) |
+| `./dev e2e release` | Release suite (all extended) |
| `./dev e2e docker` | Build local image and Docker smoke test |
| `./dev doctor` | Setup dev environment |
@@ -117,18 +117,20 @@ go test ./internal/handlers # Specific package
### E2E Tests (requires Docker)
```bash
-./dev e2e pr # Fast suite for PRs (api-fast + cli-fast)
-./dev e2e api-fast # API tests only (fast)
-./dev e2e cli-fast # CLI tests only (fast)
-./dev e2e api-full # API tests (full, with multiple configs)
-./dev e2e cli-full # CLI tests (full)
-./dev e2e release # Full release suite (api-full + cli-full)
+./dev e2e pr # PR suite (api + cli + infra basic tests)
+./dev e2e api # API basic tests
+./dev e2e cli # CLI basic tests
+./dev e2e infra # Infra basic tests
+./dev e2e api-extended # API extended tests (multi-instance)
+./dev e2e cli-extended # CLI extended tests
+./dev e2e infra-extended # Infra extended tests (multi-instance)
+./dev e2e release # Full release suite (all extended tests)
./dev e2e docker # Docker smoke test only
# Run specific test file(s) with filter (second argument)
-./dev e2e api-fast clipboard # Run only clipboard-basic.sh
-./dev e2e api-full "clipboard|console" # Run clipboard and console tests
-./dev e2e cli-fast browser # Run browser-basic.sh in CLI suite
+./dev e2e api clipboard # Run only clipboard-basic.sh
+./dev e2e api-extended "clipboard|console" # Run clipboard and console tests
+./dev e2e cli browser # Run browser-basic.sh in CLI suite
```
The filter is a regex pattern matched against scenario filenames. Requires Docker daemon running.
diff --git a/tests/e2e/README.md b/tests/e2e/README.md
index 7a17e73e..f8c5951e 100644
--- a/tests/e2e/README.md
+++ b/tests/e2e/README.md
@@ -7,18 +7,22 @@ End-to-end tests for PinchTab that exercise the full stack including browser aut
### With Docker (recommended)
```bash
-./dev e2e # Run the release suite
-./dev e2e pr # Run the PR suite
-./dev e2e api-fast # Run API fast on the single-instance stack
-./dev e2e cli-fast # Run CLI fast on the single-instance stack
-./dev e2e api-full # Run API full on the multi-instance stack
-./dev e2e cli-full # Run CLI full on the single-instance stack
+./dev e2e # Run the release suite (all extended tests)
+./dev e2e pr # Run the PR suite (api + cli + infra basic tests)
+./dev e2e api # Run API basic tests
+./dev e2e cli # Run CLI basic tests
+./dev e2e infra # Run infra basic tests
+./dev e2e api-extended # Run API extended tests
+./dev e2e cli-extended # Run CLI extended tests
+./dev e2e infra-extended # Run infra extended tests
# Manual grouped runners
/bin/bash tests/e2e/run.sh api
-/bin/bash tests/e2e/run.sh api all=true
+/bin/bash tests/e2e/run.sh api extended=true
/bin/bash tests/e2e/run.sh cli
-/bin/bash tests/e2e/run.sh cli all=true
+/bin/bash tests/e2e/run.sh cli extended=true
+/bin/bash tests/e2e/run.sh infra
+/bin/bash tests/e2e/run.sh infra extended=true
```
Or directly:
@@ -32,8 +36,8 @@ docker compose -f tests/e2e/docker-compose-multi.yml up --build runner-api
```
tests/e2e/
-├── docker-compose.yml # Single-instance stack for api-fast and cli suites
-├── docker-compose-multi.yml # Multi-instance API full stack
+├── docker-compose.yml # Single-instance stack for basic suites
+├── docker-compose-multi.yml # Multi-instance extended stack
├── config/ # E2E-specific PinchTab configs
│ ├── pinchtab.json
│ ├── pinchtab-medium-permissive.json
@@ -53,19 +57,36 @@ tests/e2e/
│ ├── api-snapshot.sh
│ ├── cli.sh
│ └── base.sh
-├── scenarios-api/ # Grouped API entrypoints
-│ ├── browser-basic.sh
-│ ├── browser-full.sh
-│ ├── tabs-basic.sh
-│ ├── tabs-full.sh
-│ ├── orchestrator-full.sh
-│ ├── stealth-basic.sh
-│ └── stealth-full.sh
-├── scenarios-cli/ # Grouped CLI entrypoints
-│ ├── browser-basic.sh
-│ ├── browser-full.sh
-│ ├── tabs-basic.sh
-│ └── tabs-full.sh
+├── scenarios/ # Test scenarios organized by type
+│ ├── api/ # Browser control and page interaction
+│ │ ├── browser-basic.sh
+│ │ ├── browser-extended.sh
+│ │ ├── tabs-basic.sh
+│ │ ├── tabs-extended.sh
+│ │ ├── actions-basic.sh
+│ │ ├── actions-extended.sh
+│ │ ├── files-basic.sh
+│ │ ├── files-extended.sh
+│ │ ├── clipboard-basic.sh
+│ │ └── console-basic.sh
+│ ├── cli/ # CLI command tests
+│ │ ├── browser-basic.sh
+│ │ ├── browser-extended.sh
+│ │ ├── tabs-basic.sh
+│ │ ├── tabs-extended.sh
+│ │ └── ...
+│ └── infra/ # System, network, security, stealth
+│ ├── system-basic.sh
+│ ├── system-extended.sh
+│ ├── network-basic.sh
+│ ├── network-extended.sh
+│ ├── security-basic.sh
+│ ├── security-extended.sh
+│ ├── stealth-basic.sh
+│ ├── stealth-extended.sh
+│ ├── orchestrator-extended.sh
+│ ├── auth-extended.sh
+│ └── ...
├── runner-api/ # API test runner container
│ └── Dockerfile
├── runner-cli/ # CLI test runner container
@@ -77,37 +98,55 @@ The Docker stacks reuse the repository root `Dockerfile` and mount explicit conf
## Test Groups
-The API and CLI suites are grouped by feature area:
-
-- `browser-basic` / `browser-full`
-- `tabs-basic` / `tabs-full`
-- `actions-basic` / `actions-full`
-- `files-basic` / `files-full`
-- `security-basic`
-- `orchestrator-full` on API
-- `system-basic` / `system-full`
-- `stealth-basic` / `stealth-full` on API
-
-Manual real-world scenario:
-- `autosolver-realworld.sh` on API (opt-in, not CI): runs AutoSolver against Pixelscan/Sannysoft/BrowserScan and logs before/after detection text signals.
-
-The `basic` entrypoints are the PR-fast happy path. The `full` entrypoints add extra and edge-case coverage for the same feature. The top-level runner defaults to the basic layer; pass `all=true` to run both basic and full.
+Tests are organized into three parallel groups:
+
+### API Group (`scenarios/api/`)
+Browser control and page interaction tests:
+- `browser-basic` / `browser-extended`
+- `tabs-basic` / `tabs-extended`
+- `actions-basic` / `actions-extended`
+- `files-basic` / `files-extended`
+- `clipboard-basic`
+- `console-basic`
+
+### CLI Group (`scenarios/cli/`)
+CLI command tests:
+- `browser-basic` / `browser-extended`
+- `tabs-basic` / `tabs-extended`
+- `actions-basic` / `actions-extended`
+- `files-basic` / `files-extended`
+- `system-basic` / `system-extended`
+- And more...
+
+### Infra Group (`scenarios/infra/`)
+System, networking, security, and stealth tests:
+- `system-basic` / `system-extended`
+- `network-basic` / `network-extended`
+- `security-basic` / `security-extended`
+- `stealth-basic` / `stealth-extended`
+- `orchestrator-extended`
+- `auth-extended`
+- `autosolver.sh` (standalone)
+- `autosolver-realworld.sh` (opt-in, not CI)
+- `idpi-hardening.sh` (standalone)
+
+The `basic` entrypoints are the PR happy path. The `extended` entrypoints add extra and edge-case coverage. The top-level runner defaults to the basic layer; pass `extended=true` to run both.
Compose usage:
-- `docker-compose.yml` powers `api-fast`, `cli-fast`, and `cli-full`
-- `docker-compose-multi.yml` powers `api-full`
+- `docker-compose.yml` powers basic suites
+- `docker-compose-multi.yml` powers extended suites
## Adding Tests
-1. Add or update a grouped entrypoint such as `tabs-basic.sh` or `tabs-full.sh`
-2. Source `../helpers/api.sh` or `../helpers/cli.sh`
-3. Put the happy path in `*-basic.sh` and the extra/edge cases in `*-full.sh`
+1. Add or update a grouped entrypoint such as `tabs-basic.sh` or `tabs-extended.sh`
+2. Source `../../helpers/api.sh` or `../../helpers/cli.sh`
+3. Put the happy path in `*-basic.sh` and the extra/edge cases in `*-extended.sh`
4. Use the assertion helpers:
```bash
#!/bin/bash
-SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${SCRIPT_DIR}/../helpers/api.sh"
+GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+source "${GROUP_DIR}/../../helpers/api.sh"
start_test "My test name"
@@ -128,8 +167,8 @@ end_test
```
The action scenarios already cover common interaction regressions against the bundled fixtures:
-- `tests/e2e/scenarios-api/actions-basic.sh` groups the API happy-path actions
-- `tests/e2e/scenarios-cli/actions-basic.sh` groups the matching CLI commands
+- `tests/e2e/scenarios/api/actions-basic.sh` groups the API happy-path actions
+- `tests/e2e/scenarios/cli/actions-basic.sh` groups the matching CLI commands
## Adding Fixtures
@@ -144,17 +183,20 @@ Add HTML files to `fixtures/` for testing specific scenarios:
## CI Integration
The E2E tests run automatically:
-- On PRs and pushes to `main`: `api-fast` and `cli-fast`
-- Manually via workflow dispatch: `api-full` and `cli-full`
+- On PRs: `api`, `cli`, and `infra` basic tests (3 parallel jobs)
+- Manually via workflow dispatch: Extended tests for all groups
+- Touched extended files are auto-detected and run in PR
## Result Files
Each suite writes its own result files in `tests/e2e/results/`:
-- `summary-api-fast.txt` / `report-api-fast.md`
-- `summary-api-full.txt` / `report-api-full.md`
-- `summary-cli-fast.txt` / `report-cli-fast.md`
-- `summary-cli-full.txt` / `report-cli-full.md`
+- `summary-api.txt` / `report-api.md`
+- `summary-api-extended.txt` / `report-api-extended.md`
+- `summary-cli.txt` / `report-cli.md`
+- `summary-cli-extended.txt` / `report-cli-extended.md`
+- `summary-infra.txt` / `report-infra.md`
+- `summary-infra-extended.txt` / `report-infra-extended.md`
The launcher deletes the target suite files before each run to avoid stale output.
@@ -174,9 +216,9 @@ docker compose -f tests/e2e/docker-compose.yml run runner-cli bash
### Run specific scenario
```bash
-docker compose -f tests/e2e/docker-compose.yml run runner-api /bin/bash /e2e/scenarios-api/tabs-basic.sh
-docker compose -f tests/e2e/docker-compose-multi.yml run runner-api /bin/bash /e2e/scenarios-api/tabs-full.sh
+docker compose -f tests/e2e/docker-compose.yml run runner-api /bin/bash /e2e/scenarios/api/tabs-basic.sh
+docker compose -f tests/e2e/docker-compose-multi.yml run runner-api /bin/bash /e2e/scenarios/infra/tabs-extended.sh
```
### Orchestrator Coverage
-`api-full` uses `docker-compose-multi.yml` and includes the multi-instance and remote-bridge orchestrator scenarios through `orchestrator-full.sh`.
+`infra-extended` uses `docker-compose-multi.yml` and includes the multi-instance and remote-bridge orchestrator scenarios through `orchestrator-extended.sh`.
diff --git a/tests/e2e/docker-compose-multi.yml b/tests/e2e/docker-compose-multi.yml
index 4335ac8c..4f495e2c 100644
--- a/tests/e2e/docker-compose-multi.yml
+++ b/tests/e2e/docker-compose-multi.yml
@@ -175,8 +175,10 @@ services:
- E2E_BRIDGE_TOKEN=e2e-bridge-token
- FIXTURES_URL=http://fixtures:80
- E2E_SCENARIO_FILTER
+ - E2E_SUITE=api
+ - E2E_EXTENDED=true
- STEALTH_MATRIX
volumes:
- ./:/e2e:ro
- ./results:/results
- command: ["/bin/bash", "-lc", "if [ -n \"${E2E_SCENARIO_FILTER:-}\" ]; then exec /bin/bash /e2e/run.sh api all=true \"filter=${E2E_SCENARIO_FILTER:-}\"; else exec /bin/bash /e2e/run.sh api all=true; fi"]
+ command: ["/bin/bash", "-lc", "SUITE=${E2E_SUITE:-api}; EXTENDED=${E2E_EXTENDED:-true}; ARGS=\"\"; [ \"$EXTENDED\" = \"true\" ] && ARGS=\"extended=true\"; if [ -n \"${E2E_SCENARIO_FILTER:-}\" ]; then exec /bin/bash /e2e/run.sh $SUITE $ARGS \"filter=${E2E_SCENARIO_FILTER:-}\"; else exec /bin/bash /e2e/run.sh $SUITE $ARGS; fi"]
diff --git a/tests/e2e/docker-compose.yml b/tests/e2e/docker-compose.yml
index 8157a2b1..e2546466 100644
--- a/tests/e2e/docker-compose.yml
+++ b/tests/e2e/docker-compose.yml
@@ -64,11 +64,12 @@ services:
- E2E_SERVER_TOKEN=e2e-token
- FIXTURES_URL=http://fixtures:80
- E2E_SCENARIO_FILTER
+ - E2E_SUITE=api
- STEALTH_MATRIX
volumes:
- ./:/e2e:ro
- ./results:/results
- command: ["/bin/bash", "-lc", "if [ -n \"${E2E_SCENARIO_FILTER:-}\" ]; then exec /bin/bash /e2e/run.sh api \"filter=${E2E_SCENARIO_FILTER:-}\"; else exec /bin/bash /e2e/run.sh api; fi"]
+ command: ["/bin/bash", "-lc", "SUITE=${E2E_SUITE:-api}; if [ -n \"${E2E_SCENARIO_FILTER:-}\" ]; then exec /bin/bash /e2e/run.sh $SUITE \"filter=${E2E_SCENARIO_FILTER:-}\"; else exec /bin/bash /e2e/run.sh $SUITE; fi"]
runner-cli:
build:
@@ -84,7 +85,9 @@ services:
- E2E_SERVER_TOKEN=e2e-token
- FIXTURES_URL=http://fixtures:80
- E2E_SCENARIO_FILTER
+ - E2E_SUITE=cli
+ - E2E_EXTENDED=true
volumes:
- ./:/e2e:ro
- ./results:/results
- command: ["/bin/bash", "-lc", "if [ -n \"${E2E_SCENARIO_FILTER:-}\" ]; then exec /bin/bash /e2e/run.sh cli all=true \"filter=${E2E_SCENARIO_FILTER:-}\"; else exec /bin/bash /e2e/run.sh cli all=true; fi"]
+ command: ["/bin/bash", "-lc", "SUITE=${E2E_SUITE:-cli}; EXTENDED=${E2E_EXTENDED:-false}; ARGS=\"\"; [ \"$EXTENDED\" = \"true\" ] && ARGS=\"extended=true\"; if [ -n \"${E2E_SCENARIO_FILTER:-}\" ]; then exec /bin/bash /e2e/run.sh $SUITE $ARGS \"filter=${E2E_SCENARIO_FILTER:-}\"; else exec /bin/bash /e2e/run.sh $SUITE $ARGS; fi"]
diff --git a/tests/e2e/run.sh b/tests/e2e/run.sh
index f47e36a1..c83bc288 100644
--- a/tests/e2e/run.sh
+++ b/tests/e2e/run.sh
@@ -21,102 +21,139 @@ require_commands() {
fi
}
-case "$SUITE" in
- api|scenarios-api|scenarios)
- source "${ROOT_DIR}/helpers/api.sh"
- GROUP_DIR="${ROOT_DIR}/scenarios-api"
- SUITE_KIND="api"
- RUN_ALL=false
- SUITE_TITLE_BASIC="PinchTab E2E API Fast Suite"
- SUITE_TITLE_ALL="PinchTab E2E Test Suite"
- SUMMARY_FILE_BASIC="summary-api-fast.txt"
- SUMMARY_FILE_ALL="summary-api-full.txt"
- REPORT_FILE_BASIC="report-api-fast.md"
- REPORT_FILE_ALL="report-api-full.md"
- PROGRESS_FILE_BASIC="progress-api-fast.log"
- PROGRESS_FILE_ALL="progress-api-full.log"
- REQUIRED_COMMANDS=(curl jq grep sed awk seq)
- ;;
- cli|scenarios-cli)
- source "${ROOT_DIR}/helpers/cli.sh"
- GROUP_DIR="${ROOT_DIR}/scenarios-cli"
- SUITE_KIND="cli"
- RUN_ALL=false
- SUITE_TITLE_BASIC=" PinchTab CLI Fast E2E Suite"
- SUITE_TITLE_ALL=" PinchTab CLI E2E Tests"
- SUMMARY_FILE_BASIC="summary-cli-fast.txt"
- SUMMARY_FILE_ALL="summary-cli-full.txt"
- REPORT_FILE_BASIC="report-cli-fast.md"
- REPORT_FILE_ALL="report-cli-full.md"
- PROGRESS_FILE_BASIC="progress-cli-fast.log"
- PROGRESS_FILE_ALL="progress-cli-full.log"
- REQUIRED_COMMANDS=(pinchtab curl jq grep sed awk seq mktemp)
- ;;
- *)
- echo "unknown suite: $SUITE" >&2
- echo "usage: /bin/bash tests/e2e/run.sh api|cli [all=true|all=false] [filter=<substring>]" >&2
- exit 1
- ;;
-esac
-
-require_commands "${REQUIRED_COMMANDS[@]}"
-
+# Parse arguments
+RUN_EXTENDED=false
SCENARIO_FILTER="${E2E_SCENARIO_FILTER:-}"
+EXTRA_SCENARIOS=""
for arg in "$@"; do
case "$arg" in
- all=true)
- RUN_ALL=true
+ extended=true|all=true)
+ RUN_EXTENDED=true
;;
- all=false)
- RUN_ALL=false
+ extended=false|all=false)
+ RUN_EXTENDED=false
;;
filter=*)
SCENARIO_FILTER="${arg#filter=}"
;;
+ extra=*)
+ EXTRA_SCENARIOS="${arg#extra=}"
+ ;;
*)
echo "unknown argument: $arg" >&2
- echo "usage: /bin/bash tests/e2e/run.sh api|cli [all=true|all=false] [filter=<substring>]" >&2
+ echo "usage: /bin/bash tests/e2e/run.sh api|cli|infra [extended=true|all=true] [filter=<substring>] [extra=<files>]" >&2
exit 1
;;
esac
done
-SCENARIO_GROUPS=()
-for basic_path in "${GROUP_DIR}"/*-basic.sh; do
- if [ ! -f "${basic_path}" ]; then
- echo "no basic group entries found in: ${GROUP_DIR}" >&2
+# Map suite to directory and configuration
+case "$SUITE" in
+ api|api-extended)
+ source "${ROOT_DIR}/helpers/api.sh"
+ GROUP_DIR="${ROOT_DIR}/scenarios/api"
+ SUITE_KIND="api"
+ [ "$SUITE" = "api-extended" ] && RUN_EXTENDED=true
+ SUITE_TITLE_BASIC="PinchTab E2E API Suite"
+ SUITE_TITLE_EXTENDED="PinchTab E2E API Extended Suite"
+ SUMMARY_FILE_BASIC="summary-api.txt"
+ SUMMARY_FILE_EXTENDED="summary-api-extended.txt"
+ REPORT_FILE_BASIC="report-api.md"
+ REPORT_FILE_EXTENDED="report-api-extended.md"
+ PROGRESS_FILE_BASIC="progress-api.log"
+ PROGRESS_FILE_EXTENDED="progress-api-extended.log"
+ REQUIRED_COMMANDS=(curl jq grep sed awk seq)
+ ;;
+ cli|cli-extended)
+ source "${ROOT_DIR}/helpers/cli.sh"
+ GROUP_DIR="${ROOT_DIR}/scenarios/cli"
+ SUITE_KIND="cli"
+ [ "$SUITE" = "cli-extended" ] && RUN_EXTENDED=true
+ SUITE_TITLE_BASIC="PinchTab E2E CLI Suite"
+ SUITE_TITLE_EXTENDED="PinchTab E2E CLI Extended Suite"
+ SUMMARY_FILE_BASIC="summary-cli.txt"
+ SUMMARY_FILE_EXTENDED="summary-cli-extended.txt"
+ REPORT_FILE_BASIC="report-cli.md"
+ REPORT_FILE_EXTENDED="report-cli-extended.md"
+ PROGRESS_FILE_BASIC="progress-cli.log"
+ PROGRESS_FILE_EXTENDED="progress-cli-extended.log"
+ REQUIRED_COMMANDS=(pinchtab curl jq grep sed awk seq mktemp)
+ ;;
+ infra|infra-extended)
+ source "${ROOT_DIR}/helpers/api.sh"
+ GROUP_DIR="${ROOT_DIR}/scenarios/infra"
+ SUITE_KIND="api"
+ [ "$SUITE" = "infra-extended" ] && RUN_EXTENDED=true
+ SUITE_TITLE_BASIC="PinchTab E2E Infra Suite"
+ SUITE_TITLE_EXTENDED="PinchTab E2E Infra Extended Suite"
+ SUMMARY_FILE_BASIC="summary-infra.txt"
+ SUMMARY_FILE_EXTENDED="summary-infra-extended.txt"
+ REPORT_FILE_BASIC="report-infra.md"
+ REPORT_FILE_EXTENDED="report-infra-extended.md"
+ PROGRESS_FILE_BASIC="progress-infra.log"
+ PROGRESS_FILE_EXTENDED="progress-infra-extended.log"
+ REQUIRED_COMMANDS=(curl jq grep sed awk seq)
+ ;;
+ *)
+ echo "unknown suite: $SUITE" >&2
+ echo "usage: /bin/bash tests/e2e/run.sh api|cli|infra [extended=true|all=true] [filter=<substring>] [extra=<files>]" >&2
exit 1
- fi
+ ;;
+esac
- feature=$(basename "${basic_path}" -basic.sh)
- basic_script="${feature}-basic.sh"
- SCENARIO_GROUPS+=("${basic_script}")
+require_commands "${REQUIRED_COMMANDS[@]}"
- if [ "$RUN_ALL" = "true" ]; then
- full_script="${feature}-full.sh"
- full_path="${GROUP_DIR}/${full_script}"
- if [ -f "${full_path}" ]; then
- SCENARIO_GROUPS+=("${full_script}")
- fi
+# Build scenario list
+SCENARIO_GROUPS=()
+
+# Always include basic scenarios
+for basic_path in "${GROUP_DIR}"/*-basic.sh; do
+ if [ -f "${basic_path}" ]; then
+ SCENARIO_GROUPS+=("$(basename "${basic_path}")")
fi
done
-if [ "$RUN_ALL" = "true" ]; then
- for full_path in "${GROUP_DIR}"/*-full.sh; do
- if [ ! -f "${full_path}" ]; then
- echo "no full group entries found in: ${GROUP_DIR}" >&2
- exit 1
+# Include extended if requested
+if [ "$RUN_EXTENDED" = "true" ]; then
+ for extended_path in "${GROUP_DIR}"/*-extended.sh; do
+ if [ -f "${extended_path}" ]; then
+ extended_script=$(basename "${extended_path}")
+ case " ${SCENARIO_GROUPS[*]} " in
+ *" ${extended_script} "*) ;;
+ *) SCENARIO_GROUPS+=("${extended_script}") ;;
+ esac
+ fi
+ done
+ # Include standalone scripts (no -basic or -extended suffix)
+ for standalone in "${GROUP_DIR}"/*.sh; do
+ if [ -f "$standalone" ]; then
+ name=$(basename "$standalone")
+ if [[ "$name" != *-basic.sh && "$name" != *-extended.sh ]]; then
+ case " ${SCENARIO_GROUPS[*]} " in
+ *" ${name} "*) ;;
+ *) SCENARIO_GROUPS+=("$name") ;;
+ esac
+ fi
fi
+ done
+fi
- full_script=$(basename "${full_path}")
- case " ${SCENARIO_GROUPS[*]} " in
- *" ${full_script} "*) ;;
- *) SCENARIO_GROUPS+=("${full_script}") ;;
- esac
+# Add extra touched scenarios
+if [ -n "$EXTRA_SCENARIOS" ]; then
+ for extra in $EXTRA_SCENARIOS; do
+ name=$(basename "$extra")
+ # Only add if not already in list and file exists
+ if [ -f "${GROUP_DIR}/${name}" ]; then
+ case " ${SCENARIO_GROUPS[*]} " in
+ *" ${name} "*) ;;
+ *) SCENARIO_GROUPS+=("${name}") ;;
+ esac
+ fi
done
fi
+# Apply filter if specified
if [ -n "$SCENARIO_FILTER" ]; then
FILTERED_GROUPS=()
for script_name in "${SCENARIO_GROUPS[@]}"; do
@@ -131,11 +168,18 @@ if [ -n "$SCENARIO_FILTER" ]; then
fi
fi
-if [ "$RUN_ALL" = "true" ]; then
- SUITE_TITLE="$SUITE_TITLE_ALL"
- SUMMARY_FILE="$SUMMARY_FILE_ALL"
- REPORT_FILE="$REPORT_FILE_ALL"
- PROGRESS_FILE="$PROGRESS_FILE_ALL"
+# Check we have scenarios to run
+if [ "${#SCENARIO_GROUPS[@]}" -eq 0 ]; then
+ echo "no scenario files found in: ${GROUP_DIR}" >&2
+ exit 1
+fi
+
+# Set output file names based on mode
+if [ "$RUN_EXTENDED" = "true" ]; then
+ SUITE_TITLE="$SUITE_TITLE_EXTENDED"
+ SUMMARY_FILE="$SUMMARY_FILE_EXTENDED"
+ REPORT_FILE="$REPORT_FILE_EXTENDED"
+ PROGRESS_FILE="$PROGRESS_FILE_EXTENDED"
else
SUITE_TITLE="$SUITE_TITLE_BASIC"
SUMMARY_FILE="$SUMMARY_FILE_BASIC"
@@ -149,6 +193,7 @@ export E2E_REPORT_FILE="$REPORT_FILE"
export E2E_PROGRESS_FILE="$PROGRESS_FILE"
export E2E_GENERATE_MARKDOWN_REPORT=1
+# Print header and wait for instances
if [ "$SUITE_KIND" = "api" ]; then
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo -e "${BLUE}${SUITE_TITLE}${NC}"
@@ -158,12 +203,15 @@ if [ "$SUITE_KIND" = "api" ]; then
if [ -n "$SCENARIO_FILTER" ]; then
echo "FILTER: ${SCENARIO_FILTER}"
fi
+ if [ -n "$EXTRA_SCENARIOS" ]; then
+ echo "EXTRA: ${EXTRA_SCENARIOS}"
+ fi
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "Waiting for instances to become ready..."
wait_for_instance_ready "${E2E_SERVER}"
- if [ "$RUN_ALL" = "true" ]; then
+ if [ "$RUN_EXTENDED" = "true" ]; then
wait_for_instance_ready "${E2E_SECURE_SERVER}"
if [ -n "${E2E_MEDIUM_SERVER:-}" ]; then
wait_for_instance_ready "${E2E_MEDIUM_SERVER}"
@@ -189,6 +237,9 @@ else
if [ -n "$SCENARIO_FILTER" ]; then
echo " Filter: $SCENARIO_FILTER"
fi
+ if [ -n "$EXTRA_SCENARIOS" ]; then
+ echo " Extra: $EXTRA_SCENARIOS"
+ fi
echo ""
wait_for_instance_ready "$E2E_SERVER"
@@ -199,14 +250,15 @@ else
fi
echo ""
- if [ "$RUN_ALL" = "true" ]; then
- echo "Running CLI tests..."
+ if [ "$RUN_EXTENDED" = "true" ]; then
+ echo "Running CLI extended tests..."
else
- echo "Running CLI fast tests..."
+ echo "Running CLI tests..."
fi
echo ""
fi
+# Run scenarios
for script_name in "${SCENARIO_GROUPS[@]}"; do
script_path="${GROUP_DIR}/${script_name}"
if [ ! -f "${script_path}" ]; then
diff --git a/tests/e2e/scenarios-api/actions-basic.sh b/tests/e2e/scenarios/api/actions-basic.sh
similarity index 99%
rename from tests/e2e/scenarios-api/actions-basic.sh
rename to tests/e2e/scenarios/api/actions-basic.sh
index 127bdd30..600a9ffd 100644
--- a/tests/e2e/scenarios-api/actions-basic.sh
+++ b/tests/e2e/scenarios/api/actions-basic.sh
@@ -2,7 +2,7 @@
# actions-basic.sh — API happy-path action scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
# ─────────────────────────────────────────────────────────────────
start_test "pinchtab click <button>"
diff --git a/tests/e2e/scenarios-api/actions-full.sh b/tests/e2e/scenarios/api/actions-extended.sh
similarity index 98%
rename from tests/e2e/scenarios-api/actions-full.sh
rename to tests/e2e/scenarios/api/actions-extended.sh
index d51922d9..67144cc5 100644
--- a/tests/e2e/scenarios-api/actions-full.sh
+++ b/tests/e2e/scenarios/api/actions-extended.sh
@@ -1,10 +1,10 @@
#!/bin/bash
-# actions-full.sh — API advanced action scenarios.
+# actions-extended.sh — API advanced action scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
-source "${GROUP_DIR}/../helpers/api-snapshot.sh"
-source "${GROUP_DIR}/../helpers/api-actions.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api-snapshot.sh"
+source "${GROUP_DIR}/../../helpers/api-actions.sh"
# ─────────────────────────────────────────────────────────────────
start_test "HTTP: dblclick by ref"
diff --git a/tests/e2e/scenarios-api/browser-basic.sh b/tests/e2e/scenarios/api/browser-basic.sh
similarity index 99%
rename from tests/e2e/scenarios-api/browser-basic.sh
rename to tests/e2e/scenarios/api/browser-basic.sh
index 6bb24a34..58ab24b1 100644
--- a/tests/e2e/scenarios-api/browser-basic.sh
+++ b/tests/e2e/scenarios/api/browser-basic.sh
@@ -2,7 +2,7 @@
# browser-basic.sh — API happy-path browser scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
# ─────────────────────────────────────────────────────────────────
start_test "pinchtab health"
diff --git a/tests/e2e/scenarios-api/browser-full.sh b/tests/e2e/scenarios/api/browser-extended.sh
similarity index 99%
rename from tests/e2e/scenarios-api/browser-full.sh
rename to tests/e2e/scenarios/api/browser-extended.sh
index c5069db4..2e08b7e5 100644
--- a/tests/e2e/scenarios-api/browser-full.sh
+++ b/tests/e2e/scenarios/api/browser-extended.sh
@@ -1,8 +1,8 @@
#!/bin/bash
-# browser-full.sh — API advanced browser scenarios.
+# browser-extended.sh — API advanced browser scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
start_test "error handling: invalid selector syntax"
diff --git a/tests/e2e/scenarios-api/clipboard-basic.sh b/tests/e2e/scenarios/api/clipboard-basic.sh
similarity index 99%
rename from tests/e2e/scenarios-api/clipboard-basic.sh
rename to tests/e2e/scenarios/api/clipboard-basic.sh
index 46134c83..6758728c 100755
--- a/tests/e2e/scenarios-api/clipboard-basic.sh
+++ b/tests/e2e/scenarios/api/clipboard-basic.sh
@@ -2,7 +2,7 @@
# clipboard-basic.sh — Clipboard read/write API tests.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
# ─────────────────────────────────────────────────────────────────
start_test "POST /clipboard/write sets clipboard text"
diff --git a/tests/e2e/scenarios-api/console-basic.sh b/tests/e2e/scenarios/api/console-basic.sh
similarity index 99%
rename from tests/e2e/scenarios-api/console-basic.sh
rename to tests/e2e/scenarios/api/console-basic.sh
index 5e8b23dc..a619847e 100755
--- a/tests/e2e/scenarios-api/console-basic.sh
+++ b/tests/e2e/scenarios/api/console-basic.sh
@@ -2,7 +2,7 @@
# console-basic.sh — Console and error logs API tests.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
# ─────────────────────────────────────────────────────────────────
start_test "GET /console returns empty array initially"
diff --git a/tests/e2e/scenarios-api/files-basic.sh b/tests/e2e/scenarios/api/files-basic.sh
similarity index 99%
rename from tests/e2e/scenarios-api/files-basic.sh
rename to tests/e2e/scenarios/api/files-basic.sh
index 0ab2df7f..7fe0d1ad 100644
--- a/tests/e2e/scenarios-api/files-basic.sh
+++ b/tests/e2e/scenarios/api/files-basic.sh
@@ -2,7 +2,7 @@
# files-basic.sh — API happy-path file and capture scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
# ─────────────────────────────────────────────────────────────────
start_test "pinchtab screenshot"
diff --git a/tests/e2e/scenarios-api/files-full.sh b/tests/e2e/scenarios/api/files-extended.sh
similarity index 98%
rename from tests/e2e/scenarios-api/files-full.sh
rename to tests/e2e/scenarios/api/files-extended.sh
index a5c2268b..c0a9e17d 100644
--- a/tests/e2e/scenarios-api/files-full.sh
+++ b/tests/e2e/scenarios/api/files-extended.sh
@@ -1,8 +1,8 @@
#!/bin/bash
-# files-full.sh — API advanced file and capture scenarios.
+# files-extended.sh — API advanced file and capture scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
# Migrated from: tests/integration/upload_test.go (UP6-UP9, UP11)
diff --git a/tests/e2e/scenarios-api/tabs-basic.sh b/tests/e2e/scenarios/api/tabs-basic.sh
similarity index 99%
rename from tests/e2e/scenarios-api/tabs-basic.sh
rename to tests/e2e/scenarios/api/tabs-basic.sh
index f0cd4ab0..6a734544 100644
--- a/tests/e2e/scenarios-api/tabs-basic.sh
+++ b/tests/e2e/scenarios/api/tabs-basic.sh
@@ -2,7 +2,7 @@
# tabs-basic.sh — API happy-path tab scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
# ─────────────────────────────────────────────────────────────────
start_test "pinchtab snap --tab <id> (regression #207)"
diff --git a/tests/e2e/scenarios-api/tabs-full.sh b/tests/e2e/scenarios/api/tabs-extended.sh
similarity index 99%
rename from tests/e2e/scenarios-api/tabs-full.sh
rename to tests/e2e/scenarios/api/tabs-extended.sh
index c3a53678..c9307ad3 100644
--- a/tests/e2e/scenarios-api/tabs-full.sh
+++ b/tests/e2e/scenarios/api/tabs-extended.sh
@@ -1,8 +1,8 @@
#!/bin/bash
-# tabs-full.sh — API advanced tab scenarios.
+# tabs-extended.sh — API advanced tab scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
start_test "tab-specific upload: POST /tabs/{id}/upload"
diff --git a/tests/e2e/scenarios-cli/actions-basic.sh b/tests/e2e/scenarios/cli/actions-basic.sh
similarity index 98%
rename from tests/e2e/scenarios-cli/actions-basic.sh
rename to tests/e2e/scenarios/cli/actions-basic.sh
index 9018dab2..36b055fe 100644
--- a/tests/e2e/scenarios-cli/actions-basic.sh
+++ b/tests/e2e/scenarios/cli/actions-basic.sh
@@ -2,7 +2,7 @@
# actions-basic.sh — CLI happy-path action scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/cli.sh"
+source "${GROUP_DIR}/../../helpers/cli.sh"
# ─────────────────────────────────────────────────────────────────
start_test "pinchtab fill <selector> <text>"
diff --git a/tests/e2e/scenarios-cli/actions-full.sh b/tests/e2e/scenarios/cli/actions-extended.sh
similarity index 98%
rename from tests/e2e/scenarios-cli/actions-full.sh
rename to tests/e2e/scenarios/cli/actions-extended.sh
index 5d88a530..893d2226 100644
--- a/tests/e2e/scenarios-cli/actions-full.sh
+++ b/tests/e2e/scenarios/cli/actions-extended.sh
@@ -1,8 +1,8 @@
#!/bin/bash
-# actions-full.sh — CLI advanced action scenarios.
+# actions-extended.sh — CLI advanced action scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/cli.sh"
+source "${GROUP_DIR}/../../helpers/cli.sh"
# ─────────────────────────────────────────────────────────────────
start_test "pinchtab type <ref> <text>"
diff --git a/tests/e2e/scenarios-cli/autosolver-check.sh b/tests/e2e/scenarios/cli/autosolver-check.sh
similarity index 98%
rename from tests/e2e/scenarios-cli/autosolver-check.sh
rename to tests/e2e/scenarios/cli/autosolver-check.sh
index f02638b9..3fd88bf4 100644
--- a/tests/e2e/scenarios-cli/autosolver-check.sh
+++ b/tests/e2e/scenarios/cli/autosolver-check.sh
@@ -25,10 +25,10 @@
# ==============================
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${SCRIPT_DIR}/../helpers/base.sh"
-source "${SCRIPT_DIR}/../helpers/api-assertions.sh"
-source "${SCRIPT_DIR}/../helpers/api-http.sh"
-source "${SCRIPT_DIR}/../helpers/autosolver.sh"
+source "${SCRIPT_DIR}/../../helpers/base.sh"
+source "${SCRIPT_DIR}/../../helpers/api-assertions.sh"
+source "${SCRIPT_DIR}/../../helpers/api-http.sh"
+source "${SCRIPT_DIR}/../../helpers/autosolver.sh"
# ─────────────────────────────────────────────────────────────────────────────
# Report state
diff --git a/tests/e2e/scenarios-cli/browser-basic.sh b/tests/e2e/scenarios/cli/browser-basic.sh
similarity index 99%
rename from tests/e2e/scenarios-cli/browser-basic.sh
rename to tests/e2e/scenarios/cli/browser-basic.sh
index a503de26..d581a69f 100644
--- a/tests/e2e/scenarios-cli/browser-basic.sh
+++ b/tests/e2e/scenarios/cli/browser-basic.sh
@@ -2,7 +2,7 @@
# browser-basic.sh — CLI happy-path browser scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/cli.sh"
+source "${GROUP_DIR}/../../helpers/cli.sh"
# ─────────────────────────────────────────────────────────────────
start_test "pinchtab health"
diff --git a/tests/e2e/scenarios-cli/browser-full.sh b/tests/e2e/scenarios/cli/browser-extended.sh
similarity index 99%
rename from tests/e2e/scenarios-cli/browser-full.sh
rename to tests/e2e/scenarios/cli/browser-extended.sh
index f314e356..ae609fd0 100644
--- a/tests/e2e/scenarios-cli/browser-full.sh
+++ b/tests/e2e/scenarios/cli/browser-extended.sh
@@ -1,8 +1,8 @@
#!/bin/bash
-# browser-full.sh — CLI advanced browser scenarios.
+# browser-extended.sh — CLI advanced browser scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/cli.sh"
+source "${GROUP_DIR}/../../helpers/cli.sh"
# ─────────────────────────────────────────────────────────────────
start_test "pinchtab scroll <pixels>"
diff --git a/tests/e2e/scenarios-cli/cache-basic.sh b/tests/e2e/scenarios/cli/cache-basic.sh
similarity index 96%
rename from tests/e2e/scenarios-cli/cache-basic.sh
rename to tests/e2e/scenarios/cli/cache-basic.sh
index fc1e8ec6..2562f512 100755
--- a/tests/e2e/scenarios-cli/cache-basic.sh
+++ b/tests/e2e/scenarios/cli/cache-basic.sh
@@ -2,7 +2,7 @@
# cache-basic.sh — CLI cache management scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/cli.sh"
+source "${GROUP_DIR}/../../helpers/cli.sh"
# ─────────────────────────────────────────────────────────────────
start_test "pinchtab cache clear"
diff --git a/tests/e2e/scenarios-cli/clipboard-basic.sh b/tests/e2e/scenarios/cli/clipboard-basic.sh
similarity index 97%
rename from tests/e2e/scenarios-cli/clipboard-basic.sh
rename to tests/e2e/scenarios/cli/clipboard-basic.sh
index e32010e5..c1cdf71d 100755
--- a/tests/e2e/scenarios-cli/clipboard-basic.sh
+++ b/tests/e2e/scenarios/cli/clipboard-basic.sh
@@ -2,7 +2,7 @@
# clipboard-basic.sh — CLI clipboard commands.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/cli.sh"
+source "${GROUP_DIR}/../../helpers/cli.sh"
# ─────────────────────────────────────────────────────────────────
start_test "pinchtab clipboard write <text>"
diff --git a/tests/e2e/scenarios-cli/console-basic.sh b/tests/e2e/scenarios/cli/console-basic.sh
similarity index 98%
rename from tests/e2e/scenarios-cli/console-basic.sh
rename to tests/e2e/scenarios/cli/console-basic.sh
index 66f6aa97..e0d6844a 100755
--- a/tests/e2e/scenarios-cli/console-basic.sh
+++ b/tests/e2e/scenarios/cli/console-basic.sh
@@ -2,7 +2,7 @@
# console-basic.sh — CLI console and errors commands.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/cli.sh"
+source "${GROUP_DIR}/../../helpers/cli.sh"
# ─────────────────────────────────────────────────────────────────
start_test "pinchtab console"
diff --git a/tests/e2e/scenarios-cli/dashboard-basic.sh b/tests/e2e/scenarios/cli/dashboard-basic.sh
similarity index 98%
rename from tests/e2e/scenarios-cli/dashboard-basic.sh
rename to tests/e2e/scenarios/cli/dashboard-basic.sh
index 92cbc8b7..425c61ab 100644
--- a/tests/e2e/scenarios-cli/dashboard-basic.sh
+++ b/tests/e2e/scenarios/cli/dashboard-basic.sh
@@ -2,7 +2,7 @@
# dashboard-basic.sh — Dashboard command scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/cli.sh"
+source "${GROUP_DIR}/../../helpers/cli.sh"
# ─────────────────────────────────────────────────────────────────
start_test "pinchtab dashboard --no-open prints URL"
diff --git a/tests/e2e/scenarios-cli/files-basic.sh b/tests/e2e/scenarios/cli/files-basic.sh
similarity index 98%
rename from tests/e2e/scenarios-cli/files-basic.sh
rename to tests/e2e/scenarios/cli/files-basic.sh
index d024a215..0b4c4c7a 100644
--- a/tests/e2e/scenarios-cli/files-basic.sh
+++ b/tests/e2e/scenarios/cli/files-basic.sh
@@ -2,7 +2,7 @@
# files-basic.sh — CLI happy-path file and capture scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/cli.sh"
+source "${GROUP_DIR}/../../helpers/cli.sh"
start_test "pinchtab screenshot"
pt_ok nav "${FIXTURES_URL}/index.html"
diff --git a/tests/e2e/scenarios-cli/files-full.sh b/tests/e2e/scenarios/cli/files-extended.sh
similarity index 96%
rename from tests/e2e/scenarios-cli/files-full.sh
rename to tests/e2e/scenarios/cli/files-extended.sh
index ca14dedd..133ccc8a 100644
--- a/tests/e2e/scenarios-cli/files-full.sh
+++ b/tests/e2e/scenarios/cli/files-extended.sh
@@ -1,8 +1,8 @@
#!/bin/bash
-# files-full.sh — CLI advanced file and capture scenarios.
+# files-extended.sh — CLI advanced file and capture scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/cli.sh"
+source "${GROUP_DIR}/../../helpers/cli.sh"
# ─────────────────────────────────────────────────────────────────
start_test "pinchtab screenshot -o custom.jpg"
diff --git a/tests/e2e/scenarios-cli/security-basic.sh b/tests/e2e/scenarios/cli/security-basic.sh
similarity index 96%
rename from tests/e2e/scenarios-cli/security-basic.sh
rename to tests/e2e/scenarios/cli/security-basic.sh
index 8ffc31ca..530a0fc4 100644
--- a/tests/e2e/scenarios-cli/security-basic.sh
+++ b/tests/e2e/scenarios/cli/security-basic.sh
@@ -2,7 +2,7 @@
# security-basic.sh — CLI security baseline scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/cli.sh"
+source "${GROUP_DIR}/../../helpers/cli.sh"
# ─────────────────────────────────────────────────────────────────
start_test "pinchtab security (non-interactive)"
diff --git a/tests/e2e/scenarios-cli/sessions-basic.sh b/tests/e2e/scenarios/cli/sessions-basic.sh
similarity index 98%
rename from tests/e2e/scenarios-cli/sessions-basic.sh
rename to tests/e2e/scenarios/cli/sessions-basic.sh
index ad49fce7..9b8f2d1e 100755
--- a/tests/e2e/scenarios-cli/sessions-basic.sh
+++ b/tests/e2e/scenarios/cli/sessions-basic.sh
@@ -2,7 +2,7 @@
# sessions-basic.sh — CLI agent session happy-path scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/cli.sh"
+source "${GROUP_DIR}/../../helpers/cli.sh"
# ─────────────────────────────────────────────────────────────────
start_test "pinchtab session create"
diff --git a/tests/e2e/scenarios-cli/state-basic.sh b/tests/e2e/scenarios/cli/state-basic.sh
similarity index 99%
rename from tests/e2e/scenarios-cli/state-basic.sh
rename to tests/e2e/scenarios/cli/state-basic.sh
index 9768d944..14e35889 100644
--- a/tests/e2e/scenarios-cli/state-basic.sh
+++ b/tests/e2e/scenarios/cli/state-basic.sh
@@ -2,7 +2,7 @@
# state-basic.sh — CLI tests for `pinchtab state` commands.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/cli.sh"
+source "${GROUP_DIR}/../../helpers/cli.sh"
STATE_NAME="cli-e2e-state-$(date +%s)"
diff --git a/tests/e2e/scenarios-cli/stealth-basic.sh b/tests/e2e/scenarios/cli/stealth-basic.sh
similarity index 99%
rename from tests/e2e/scenarios-cli/stealth-basic.sh
rename to tests/e2e/scenarios/cli/stealth-basic.sh
index f372173a..3fa3d9be 100644
--- a/tests/e2e/scenarios-cli/stealth-basic.sh
+++ b/tests/e2e/scenarios/cli/stealth-basic.sh
@@ -2,7 +2,7 @@
# stealth-basic.sh — CLI stealth baseline scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/cli.sh"
+source "${GROUP_DIR}/../../helpers/cli.sh"
# Tests pinchtab's stealth capabilities using the CLI interface.
diff --git a/tests/e2e/scenarios-cli/storage-basic.sh b/tests/e2e/scenarios/cli/storage-basic.sh
similarity index 99%
rename from tests/e2e/scenarios-cli/storage-basic.sh
rename to tests/e2e/scenarios/cli/storage-basic.sh
index 33766644..6119fc56 100644
--- a/tests/e2e/scenarios-cli/storage-basic.sh
+++ b/tests/e2e/scenarios/cli/storage-basic.sh
@@ -2,7 +2,7 @@
# storage-basic.sh — CLI tests for `pinchtab storage` commands.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/cli.sh"
+source "${GROUP_DIR}/../../helpers/cli.sh"
# ═══════════════════════════════════════════════════════════════════
# Setup: Navigate to a fixture page so storage has a valid origin
diff --git a/tests/e2e/scenarios-cli/system-basic.sh b/tests/e2e/scenarios/cli/system-basic.sh
similarity index 99%
rename from tests/e2e/scenarios-cli/system-basic.sh
rename to tests/e2e/scenarios/cli/system-basic.sh
index 9436f923..1b3b6c40 100644
--- a/tests/e2e/scenarios-cli/system-basic.sh
+++ b/tests/e2e/scenarios/cli/system-basic.sh
@@ -2,7 +2,7 @@
# system-basic.sh — CLI config, instance, and activity happy-path scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/cli.sh"
+source "${GROUP_DIR}/../../helpers/cli.sh"
# ─────────────────────────────────────────────────────────────────
start_test "pinchtab instance logs"
diff --git a/tests/e2e/scenarios-cli/system-full.sh b/tests/e2e/scenarios/cli/system-extended.sh
similarity index 98%
rename from tests/e2e/scenarios-cli/system-full.sh
rename to tests/e2e/scenarios/cli/system-extended.sh
index 28200fe2..3ffe3668 100644
--- a/tests/e2e/scenarios-cli/system-full.sh
+++ b/tests/e2e/scenarios/cli/system-extended.sh
@@ -1,8 +1,8 @@
#!/bin/bash
-# system-full.sh — CLI advanced instance and daemon scenarios.
+# system-extended.sh — CLI advanced instance and daemon scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/cli.sh"
+source "${GROUP_DIR}/../../helpers/cli.sh"
# ─────────────────────────────────────────────────────────────────
start_test "pinchtab daemon (non-interactive shows status)"
diff --git a/tests/e2e/scenarios-cli/tabs-basic.sh b/tests/e2e/scenarios/cli/tabs-basic.sh
similarity index 98%
rename from tests/e2e/scenarios-cli/tabs-basic.sh
rename to tests/e2e/scenarios/cli/tabs-basic.sh
index f0b7f040..85e4b954 100644
--- a/tests/e2e/scenarios-cli/tabs-basic.sh
+++ b/tests/e2e/scenarios/cli/tabs-basic.sh
@@ -2,7 +2,7 @@
# tabs-basic.sh — CLI happy-path tab scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/cli.sh"
+source "${GROUP_DIR}/../../helpers/cli.sh"
# ─────────────────────────────────────────────────────────────────
start_test "pinchtab tab (list)"
diff --git a/tests/e2e/scenarios-cli/tabs-full.sh b/tests/e2e/scenarios/cli/tabs-extended.sh
similarity index 98%
rename from tests/e2e/scenarios-cli/tabs-full.sh
rename to tests/e2e/scenarios/cli/tabs-extended.sh
index adab9e52..afb7d819 100644
--- a/tests/e2e/scenarios-cli/tabs-full.sh
+++ b/tests/e2e/scenarios/cli/tabs-extended.sh
@@ -1,8 +1,8 @@
#!/bin/bash
-# tabs-full.sh — CLI advanced tab scenarios.
+# tabs-extended.sh — CLI advanced tab scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/cli.sh"
+source "${GROUP_DIR}/../../helpers/cli.sh"
# ─────────────────────────────────────────────────────────────────
start_test "pinchtab back (no history)"
diff --git a/tests/e2e/scenarios-api/auth-full.sh b/tests/e2e/scenarios/infra/auth-extended.sh
similarity index 99%
rename from tests/e2e/scenarios-api/auth-full.sh
rename to tests/e2e/scenarios/infra/auth-extended.sh
index 0f81ba7f..4764a1bc 100644
--- a/tests/e2e/scenarios-api/auth-full.sh
+++ b/tests/e2e/scenarios/infra/auth-extended.sh
@@ -1,8 +1,8 @@
#!/bin/bash
-# auth-full.sh — API auth, session, and elevation scenarios.
+# auth-extended.sh — API auth, session, and elevation scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
AUTH_COOKIE_FILE="/tmp/pinchtab-auth-cookie-$$.txt"
AUTH_HEADERS_FILE="/tmp/pinchtab-auth-headers-$$.txt"
diff --git a/tests/e2e/scenarios-api/autosolver-realworld.sh b/tests/e2e/scenarios/infra/autosolver-realworld.sh
similarity index 99%
rename from tests/e2e/scenarios-api/autosolver-realworld.sh
rename to tests/e2e/scenarios/infra/autosolver-realworld.sh
index 9d5a846b..55e44117 100644
--- a/tests/e2e/scenarios-api/autosolver-realworld.sh
+++ b/tests/e2e/scenarios/infra/autosolver-realworld.sh
@@ -25,7 +25,7 @@
# - TamperedFunctions
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
if [ "${RUN_REAL_WORLD_AUTOSOLVER:-0}" != "1" ]; then
echo "[autosolver-realworld] skipped: set RUN_REAL_WORLD_AUTOSOLVER=1 to run this scenario"
diff --git a/tests/e2e/scenarios-api/autosolver.sh b/tests/e2e/scenarios/infra/autosolver.sh
similarity index 99%
rename from tests/e2e/scenarios-api/autosolver.sh
rename to tests/e2e/scenarios/infra/autosolver.sh
index ae9c7b65..d80f31f1 100644
--- a/tests/e2e/scenarios-api/autosolver.sh
+++ b/tests/e2e/scenarios/infra/autosolver.sh
@@ -16,8 +16,8 @@
# bash tests/e2e/scenarios-api/autosolver.sh
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
-source "${GROUP_DIR}/../helpers/autosolver.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/autosolver.sh"
# ─────────────────────────────────────────────────────────────────────────────
# TEST 1: BotDetect Baseline
diff --git a/tests/e2e/scenarios-api/dashboard-full.sh b/tests/e2e/scenarios/infra/dashboard-extended.sh
similarity index 98%
rename from tests/e2e/scenarios-api/dashboard-full.sh
rename to tests/e2e/scenarios/infra/dashboard-extended.sh
index ec78c770..74048711 100644
--- a/tests/e2e/scenarios-api/dashboard-full.sh
+++ b/tests/e2e/scenarios/infra/dashboard-extended.sh
@@ -1,8 +1,8 @@
#!/bin/bash
-# dashboard-full.sh — API full dashboard scenarios.
+# dashboard-extended.sh — API full dashboard scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
if [ -z "${E2E_FULL_SERVER:-}" ]; then
echo " E2E_FULL_SERVER not set, skipping dashboard full scenarios"
diff --git a/tests/e2e/scenarios-api/engine-modes-full.sh b/tests/e2e/scenarios/infra/engine-modes-extended.sh
similarity index 99%
rename from tests/e2e/scenarios-api/engine-modes-full.sh
rename to tests/e2e/scenarios/infra/engine-modes-extended.sh
index a2741c0b..4da84774 100755
--- a/tests/e2e/scenarios-api/engine-modes-full.sh
+++ b/tests/e2e/scenarios/infra/engine-modes-extended.sh
@@ -8,7 +8,7 @@
# Requires: E2E_SERVER (chrome), E2E_LITE_SERVER, E2E_SECURE_SERVER
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
CHROME_SERVER="$E2E_SERVER"
diff --git a/tests/e2e/scenarios-api/idpi-hardening.sh b/tests/e2e/scenarios/infra/idpi-hardening.sh
similarity index 99%
rename from tests/e2e/scenarios-api/idpi-hardening.sh
rename to tests/e2e/scenarios/infra/idpi-hardening.sh
index c387f669..fc75bf54 100755
--- a/tests/e2e/scenarios-api/idpi-hardening.sh
+++ b/tests/e2e/scenarios/infra/idpi-hardening.sh
@@ -9,7 +9,7 @@
# Uses both the permissive server (IDPI warn mode) and secure server (IDPI strict/block).
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
secure_get() {
local path="$1"
diff --git a/tests/e2e/scenarios-api/network-basic.sh b/tests/e2e/scenarios/infra/network-basic.sh
similarity index 98%
rename from tests/e2e/scenarios-api/network-basic.sh
rename to tests/e2e/scenarios/infra/network-basic.sh
index 3a3a4ce9..85bb0b3e 100755
--- a/tests/e2e/scenarios-api/network-basic.sh
+++ b/tests/e2e/scenarios/infra/network-basic.sh
@@ -3,7 +3,7 @@
# Covers: /network, /network/{requestId}, /network/clear
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
# ─────────────────────────────────────────────────────────────────
start_test "GET /network: returns entries after navigation"
diff --git a/tests/e2e/scenarios-api/network-full.sh b/tests/e2e/scenarios/infra/network-extended.sh
similarity index 99%
rename from tests/e2e/scenarios-api/network-full.sh
rename to tests/e2e/scenarios/infra/network-extended.sh
index 8cd4886d..b69779d7 100755
--- a/tests/e2e/scenarios-api/network-full.sh
+++ b/tests/e2e/scenarios/infra/network-extended.sh
@@ -1,10 +1,10 @@
#!/bin/bash
-# network-full.sh — Network capture & export API tests.
+# network-extended.sh — Network capture & export API tests.
# Covers: /network/export, /network/export/stream, format registry,
# header redaction, body inclusion, file output, and tab-scoped variants.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
# ─────────────────────────────────────────────────────────────────
# Setup: navigate to a page that generates network traffic
diff --git a/tests/e2e/scenarios-api/orchestrator-full.sh b/tests/e2e/scenarios/infra/orchestrator-extended.sh
similarity index 99%
rename from tests/e2e/scenarios-api/orchestrator-full.sh
rename to tests/e2e/scenarios/infra/orchestrator-extended.sh
index 7bb7106f..1021053a 100644
--- a/tests/e2e/scenarios-api/orchestrator-full.sh
+++ b/tests/e2e/scenarios/infra/orchestrator-extended.sh
@@ -1,8 +1,8 @@
#!/bin/bash
-# orchestrator-full.sh — API full orchestration scenarios.
+# orchestrator-extended.sh — API full orchestration scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
BRIDGE_URL="${E2E_BRIDGE_URL:-}"
BRIDGE_TOKEN="${E2E_BRIDGE_TOKEN:-}"
diff --git a/tests/e2e/scenarios-api/security-basic.sh b/tests/e2e/scenarios/infra/security-basic.sh
similarity index 97%
rename from tests/e2e/scenarios-api/security-basic.sh
rename to tests/e2e/scenarios/infra/security-basic.sh
index 1f08b3e5..dd810599 100644
--- a/tests/e2e/scenarios-api/security-basic.sh
+++ b/tests/e2e/scenarios/infra/security-basic.sh
@@ -2,7 +2,7 @@
# security-basic.sh — API security baseline scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
start_test "security: evaluate ALLOWED when enabled"
diff --git a/tests/e2e/scenarios-api/security-full.sh b/tests/e2e/scenarios/infra/security-extended.sh
similarity index 97%
rename from tests/e2e/scenarios-api/security-full.sh
rename to tests/e2e/scenarios/infra/security-extended.sh
index b8d72e99..072fa24a 100644
--- a/tests/e2e/scenarios-api/security-full.sh
+++ b/tests/e2e/scenarios/infra/security-extended.sh
@@ -1,8 +1,8 @@
#!/bin/bash
-# security-full.sh — API extended security scenarios.
+# security-extended.sh — API extended security scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
secure_get() {
local path="$1"
diff --git a/tests/e2e/scenarios-api/sessions-full.sh b/tests/e2e/scenarios/infra/sessions-extended.sh
similarity index 98%
rename from tests/e2e/scenarios-api/sessions-full.sh
rename to tests/e2e/scenarios/infra/sessions-extended.sh
index c8fa4cee..d3eb92fb 100755
--- a/tests/e2e/scenarios-api/sessions-full.sh
+++ b/tests/e2e/scenarios/infra/sessions-extended.sh
@@ -1,8 +1,8 @@
#!/bin/bash
-# sessions-full.sh — Agent session CRUD and auth scenarios.
+# sessions-extended.sh — Agent session CRUD and auth scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
# ─────────────────────────────────────────────────────────────────
start_test "POST /sessions creates a session"
diff --git a/tests/e2e/scenarios-api/state-basic.sh b/tests/e2e/scenarios/infra/state-basic.sh
similarity index 99%
rename from tests/e2e/scenarios-api/state-basic.sh
rename to tests/e2e/scenarios/infra/state-basic.sh
index e5c49dfd..5504e397 100644
--- a/tests/e2e/scenarios-api/state-basic.sh
+++ b/tests/e2e/scenarios/infra/state-basic.sh
@@ -3,7 +3,7 @@
# Requires: a running PinchTab instance with security.allowStateExport=true.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
STATE_NAME="pt-e2e-state-$(date +%s)"
diff --git a/tests/e2e/scenarios-api/stealth-basic.sh b/tests/e2e/scenarios/infra/stealth-basic.sh
similarity index 99%
rename from tests/e2e/scenarios-api/stealth-basic.sh
rename to tests/e2e/scenarios/infra/stealth-basic.sh
index 4616907b..51020637 100644
--- a/tests/e2e/scenarios-api/stealth-basic.sh
+++ b/tests/e2e/scenarios/infra/stealth-basic.sh
@@ -2,7 +2,7 @@
# stealth-basic.sh — API stealth baseline scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
# Migrated from: tests/integration/stealth_test.go
diff --git a/tests/e2e/scenarios-api/stealth-full.sh b/tests/e2e/scenarios/infra/stealth-extended.sh
similarity index 99%
rename from tests/e2e/scenarios-api/stealth-full.sh
rename to tests/e2e/scenarios/infra/stealth-extended.sh
index d147fca8..1a02a135 100644
--- a/tests/e2e/scenarios-api/stealth-full.sh
+++ b/tests/e2e/scenarios/infra/stealth-extended.sh
@@ -1,8 +1,8 @@
#!/bin/bash
-# stealth-full.sh — API extended stealth scenarios.
+# stealth-extended.sh — API extended stealth scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
run_stealth_level_matrix() {
STEALTH_LEVEL="${STEALTH_LEVEL:-light}"
diff --git a/tests/e2e/scenarios-api/storage-basic.sh b/tests/e2e/scenarios/infra/storage-basic.sh
similarity index 99%
rename from tests/e2e/scenarios-api/storage-basic.sh
rename to tests/e2e/scenarios/infra/storage-basic.sh
index 35133d35..00b7c8c4 100644
--- a/tests/e2e/scenarios-api/storage-basic.sh
+++ b/tests/e2e/scenarios/infra/storage-basic.sh
@@ -4,7 +4,7 @@
# and an active tab navigated to a page (e.g. https://example.com).
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
# ═══════════════════════════════════════════════════════════════════
# Setup: Navigate to a fixture page so storage has a valid origin
diff --git a/tests/e2e/scenarios-api/system-basic.sh b/tests/e2e/scenarios/infra/system-basic.sh
similarity index 99%
rename from tests/e2e/scenarios-api/system-basic.sh
rename to tests/e2e/scenarios/infra/system-basic.sh
index 606b8edb..0123b31e 100644
--- a/tests/e2e/scenarios-api/system-basic.sh
+++ b/tests/e2e/scenarios/infra/system-basic.sh
@@ -2,7 +2,7 @@
# system-basic.sh — API config and observability happy-path scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
# CF7: Chrome version in user agent
diff --git a/tests/e2e/scenarios-api/system-full.sh b/tests/e2e/scenarios/infra/system-extended.sh
similarity index 99%
rename from tests/e2e/scenarios-api/system-full.sh
rename to tests/e2e/scenarios/infra/system-extended.sh
index 3c8637cc..a4276137 100644
--- a/tests/e2e/scenarios-api/system-full.sh
+++ b/tests/e2e/scenarios/infra/system-extended.sh
@@ -1,8 +1,8 @@
#!/bin/bash
-# system-full.sh — API advanced config and platform scenarios.
+# system-extended.sh — API advanced config and platform scenarios.
GROUP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${GROUP_DIR}/../helpers/api.sh"
+source "${GROUP_DIR}/../../helpers/api.sh"
# Migrated from: tests/integration/metrics_test.go