Doubao-powered voice input for Linux, Wayland and Omarchy
test: organize suites and upgrade Midscene to 1.12.9 (#24)
Leyang4bac41cb17b0
diff --git a/.github/workflows/midscene-omarchy-4.0.3.yml b/.github/workflows/midscene-omarchy-4.0.3.ymlindex 6c63e5e..2389f95 100644--- a/.github/workflows/midscene-omarchy-4.0.3.yml+++ b/.github/workflows/midscene-omarchy-4.0.3.yml@@ -10,16 +10,16 @@ on:- "scripts/build-pages-report.mjs"- "scripts/verify-omarchy-evidence.mjs"- "scripts/omarchy-shell-evidence.mjs"- - "tests/test_pages_report_history.mjs"- - "tests/midscene/package.json"- - "tests/midscene/package-lock.json"- - "tests/midscene/gtk_fixture.py"- - "tests/midscene/capture-report-preview.mjs"- - "tests/midscene/cases/**"- - "tests/midscene/midscene.config.ts"- - "tests/midscene/run-omarchy-midscene.sh"- - "tests/midscene/restore-omarchy-vm.sh"- - "tests/midscene/omarchy-vm.env"+ - "tests/contracts/test_pages_report_history.mjs"+ - "tests/e2e/package.json"+ - "tests/e2e/package-lock.json"+ - "tests/e2e/gtk_fixture.py"+ - "tests/e2e/capture-report-preview.mjs"+ - "tests/e2e/cases/**"+ - "tests/e2e/midscene.config.ts"+ - "tests/e2e/run-omarchy-midscene.sh"+ - "tests/e2e/restore-omarchy-vm.sh"+ - "tests/e2e/omarchy-vm.env"- "src/**"- "manifest.json"- "install.sh"@@ -34,16 +34,16 @@ on:- "scripts/build-pages-report.mjs"- "scripts/verify-omarchy-evidence.mjs"- "scripts/omarchy-shell-evidence.mjs"- - "tests/test_pages_report_history.mjs"- - "tests/midscene/package.json"- - "tests/midscene/package-lock.json"- - "tests/midscene/gtk_fixture.py"- - "tests/midscene/capture-report-preview.mjs"- - "tests/midscene/cases/**"- - "tests/midscene/midscene.config.ts"- - "tests/midscene/run-omarchy-midscene.sh"- - "tests/midscene/restore-omarchy-vm.sh"- - "tests/midscene/omarchy-vm.env"+ - "tests/contracts/test_pages_report_history.mjs"+ - "tests/e2e/package.json"+ - "tests/e2e/package-lock.json"+ - "tests/e2e/gtk_fixture.py"+ - "tests/e2e/capture-report-preview.mjs"+ - "tests/e2e/cases/**"+ - "tests/e2e/midscene.config.ts"+ - "tests/e2e/run-omarchy-midscene.sh"+ - "tests/e2e/restore-omarchy-vm.sh"+ - "tests/e2e/omarchy-vm.env"- "src/**"- "manifest.json"- "install.sh"@@ -113,20 +113,20 @@ jobs:GHCR_TOKEN: ${{ github.token }}- name: Restore prebuilt Omarchy VM- run: tests/midscene/restore-omarchy-vm.sh+ run: tests/e2e/restore-omarchy-vm.sh- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0with:node-version: "22"cache: npm- cache-dependency-path: tests/midscene/package-lock.json+ cache-dependency-path: tests/e2e/package-lock.json- name: Install Midscene and VNC bridgerun: |sudo apt-get install -y --no-install-recommends \fluxbox tigervnc-viewer x11-xserver-utils xvfbfor attempt in 1 2 3; do- if npm --prefix tests/midscene ci --include=optional --ignore-scripts; then+ if npm --prefix tests/e2e ci --include=optional --ignore-scripts; thenexit 0fiecho "npm install attempt $attempt failed; retrying." >&2@@ -135,11 +135,11 @@ jobs:exit 1- name: Run real Omarchy Midscene E2E- run: tests/midscene/run-omarchy-midscene.sh+ run: tests/e2e/run-omarchy-midscene.sh- name: Capture the final report node for the CI summaryif: always()- run: node tests/midscene/capture-report-preview.mjs+ run: node tests/e2e/capture-report-preview.mjs- name: Upload installer evidenceif: always()@@ -156,13 +156,13 @@ jobs:uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1with:name: omarchy-midscene-e2e-report- path: tests/midscene/midscene_run/+ path: tests/e2e/midscene_run/if-no-files-found: warnretention-days: 7- name: Verify visual evidence before publishingif: success()- run: node scripts/verify-omarchy-evidence.mjs tests/midscene/midscene_run+ run: node scripts/verify-omarchy-evidence.mjs tests/e2e/midscene_runpages-report:name: GitHub Pages reportdiff --git a/.github/workflows/midscene-ubuntu-22.04.yml b/.github/workflows/midscene-ubuntu-22.04.ymlindex 38f20c8..77b9a94 100644--- a/.github/workflows/midscene-ubuntu-22.04.yml+++ b/.github/workflows/midscene-ubuntu-22.04.yml@@ -8,12 +8,12 @@ on:- ".github/workflows/midscene-ubuntu-22.04.yml"- ".github/workflows/deploy-midscene-report.yml"- "scripts/build-pages-report.mjs"- - "tests/test_pages_report_history.mjs"- - "tests/midscene/package.json"- - "tests/midscene/package-lock.json"- - "tests/midscene/gtk_fixture.py"- - "tests/midscene/cases/**"- - "tests/midscene/midscene.config.ts"+ - "tests/contracts/test_pages_report_history.mjs"+ - "tests/e2e/package.json"+ - "tests/e2e/package-lock.json"+ - "tests/e2e/gtk_fixture.py"+ - "tests/e2e/cases/**"+ - "tests/e2e/midscene.config.ts"- "src/**"pull_request:branches: [main]@@ -21,12 +21,12 @@ on:- ".github/workflows/midscene-ubuntu-22.04.yml"- ".github/workflows/deploy-midscene-report.yml"- "scripts/build-pages-report.mjs"- - "tests/test_pages_report_history.mjs"- - "tests/midscene/package.json"- - "tests/midscene/package-lock.json"- - "tests/midscene/gtk_fixture.py"- - "tests/midscene/cases/**"- - "tests/midscene/midscene.config.ts"+ - "tests/contracts/test_pages_report_history.mjs"+ - "tests/e2e/package.json"+ - "tests/e2e/package-lock.json"+ - "tests/e2e/gtk_fixture.py"+ - "tests/e2e/cases/**"+ - "tests/e2e/midscene.config.ts"- "src/**"workflow_dispatch:@@ -63,7 +63,7 @@ jobs:with:node-version: "22"cache: npm- cache-dependency-path: tests/midscene/package-lock.json+ cache-dependency-path: tests/e2e/package-lock.json- name: Require Midscene model configurationrun: |@@ -107,7 +107,7 @@ jobs:python3-cairo python3-gi x11-xserver-utils xdg-utils xvfb- name: Install pinned Midscene dependencies- working-directory: tests/midscene+ working-directory: tests/e2e# sharp's platform packages are pinned explicitly. Skipping lifecycle# scripts avoids an npm ordering bug that tries to build sharp before# those prebuilt packages are linked.@@ -122,7 +122,7 @@ jobs:exit 1- name: Run Ubuntu 22.04 Midscene E2E- working-directory: tests/midscene+ working-directory: tests/e2eenv:NODE_OPTIONS: --dns-result-order=ipv4first --no-network-family-autoselection --require=./node_modules/@computer-use/libnut/dist/import_libnut.jsrun: |@@ -155,7 +155,7 @@ jobs:uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1with:name: midscene-ubuntu-22.04-e2e-report- path: tests/midscene/midscene_run/+ path: tests/e2e/midscene_run/if-no-files-found: warnretention-days: 7diff --git a/.github/workflows/omarchy-vm-image.yml b/.github/workflows/omarchy-vm-image.ymlindex 2159a8c..9d9738a 100644--- a/.github/workflows/omarchy-vm-image.yml+++ b/.github/workflows/omarchy-vm-image.yml@@ -5,11 +5,11 @@ on:push:branches: [ci/midscene-e2e]paths:- - "tests/midscene/.rebuild-omarchy-vm"- - "tests/midscene/install-omarchy-vm.sh"- - "tests/midscene/prepare-omarchy-host.sh"- - "tests/midscene/publish-omarchy-vm.sh"- - "tests/midscene/omarchy-vm.env"+ - "tests/e2e/.rebuild-omarchy-vm"+ - "tests/e2e/install-omarchy-vm.sh"+ - "tests/e2e/prepare-omarchy-host.sh"+ - "tests/e2e/publish-omarchy-vm.sh"+ - "tests/e2e/omarchy-vm.env"permissions:contents: read@@ -32,7 +32,7 @@ jobs:- uses: oras-project/setup-oras@1d808f7d7f6995cc68b7bf507bfe5c5446e1dc9d # v2.0.1- name: Install Omarchy from the verified official ISO- run: tests/midscene/install-omarchy-vm.sh+ run: tests/e2e/install-omarchy-vm.sh- name: Sign in to GitHub Container Registryrun: echo "$GHCR_TOKEN" | oras login ghcr.io --username "$GITHUB_ACTOR" --password-stdin@@ -40,7 +40,7 @@ jobs:GHCR_TOKEN: ${{ github.token }}- name: Publish versioned Omarchy base VM- run: tests/midscene/publish-omarchy-vm.sh+ run: tests/e2e/publish-omarchy-vm.sh- name: Upload installer evidenceif: always()diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 101e9a8..52f7510 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -116,7 +116,7 @@ jobs:run: |app_archive=(doubao-say-*-app-linux-*.tar.gz)test "${#app_archive[@]}" -eq 1- /usr/bin/python3 ../tests/manual_clean_install.py "${app_archive[0]}"+ /usr/bin/python3 ../tests/manual/clean_install.py "${app_archive[0]}"publish:name: Publish GitHub releasediff --git a/.github/workflows/tests.yml b/.github/workflows/tests.ymlindex d4f8244..7b7b03a 100644--- a/.github/workflows/tests.yml+++ b/.github/workflows/tests.yml@@ -24,8 +24,8 @@ jobs:- name: Statically check and test Pages history builderrun: |node --check scripts/build-pages-report.mjs- node --check tests/test_pages_report_history.mjs- node --test tests/test_pages_report_history.mjs+ node --check tests/contracts/test_pages_report_history.mjs+ node --test tests/contracts/test_pages_report_history.mjscore-compatibility:name: Core / Python ${{ matrix.python }}@@ -47,13 +47,13 @@ jobs:run: python -m pip install -r packaging/runtime-requirements.txt- name: Test platform-independent behaviorenv:- PYTHONPATH: src:tests+ PYTHONPATH: src:.run: |python -m unittest -v \- tests.test_delivery tests.test_gesture tests.test_input_worker \- tests.test_manual_safety tests.test_plugin_launch tests.test_polish \- tests.test_polish_preview tests.test_reasoning tests.test_settings \- tests.test_updates tests.test_version_check tests.test_voice_motion+ tests.unit.test_delivery tests.unit.test_gesture tests.unit.test_input_worker \+ tests.unit.test_manual_safety tests.unit.test_plugin_launch tests.unit.test_polish \+ tests.unit.test_polish_preview tests.unit.test_reasoning tests.unit.test_settings \+ tests.unit.test_updates tests.contracts.test_version_check tests.unit.test_voice_motionpython -m compileall -q src/doubao_input packagingfull-suite:@@ -97,7 +97,7 @@ jobs:python-version: "3.11"- name: Validate version and package testsenv:- PYTHONPATH: src:packaging+ PYTHONPATH: src:.run: |python packaging/version_check.py- python -m unittest -v tests.test_release tests.test_marketplace tests.test_version_check+ python -m unittest -v tests.contracts.test_release tests.contracts.test_marketplace tests.contracts.test_version_checkdiff --git a/.gitignore b/.gitignoreindex 8313730..bb54a46 100644--- a/.gitignore+++ b/.gitignore@@ -94,8 +94,8 @@ settings.json/backups//.midscene-omarchy//.midscene-config/-/tests/midscene/midscene_run/-/tests/midscene/node_modules/+/tests/e2e/midscene_run/+/tests/e2e/node_modules/*.bak*.orig*.rejdiff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex fa850ae..f27393c 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -20,10 +20,11 @@ make check```Tests use temporary fake credentials. Unit tests must not record audio, access-Doubao, send keyboard events or alter desktop configuration. Files named-`manual_*.py` are opt-in live tests, never normal CI. Stop recording before any-lifecycle test. Stop the normal app/plugin before fresh-login/onboarding tests;-they share the production application ID to prevent duplicate overlays.+Doubao, send keyboard events or alter desktop configuration. Files under+`tests/manual/` are opt-in live checks, never normal CI. The complete test+layout is documented in `tests/README.md`. Stop recording before any lifecycle+test. Stop the normal app/plugin before fresh-login/onboarding tests; they share+the production application ID to prevent duplicate overlays.## Change boundaries@@ -66,11 +67,11 @@ Always run opt-in desktop tests with a process-level timeout, for example:```shGTK_A11Y=none PYTHONPATH=src timeout --signal=TERM --kill-after=5s 35s \- dbus-run-session -- .venv/bin/python tests/manual_refactor_smoke.py+ dbus-run-session -- .venv/bin/python tests/manual/refactor_smoke.py```The smoke test also bounds event draining and has a 30-second kernel alarm.Do not drain GTK with an unbounded `while context.pending()` loop: recurring-sources may keep the queue ready forever. Use `tests/manual_safety.py` and register+sources may keep the queue ready forever. Use `tests/manual/safety.py` and registercleanup before assertions. Confirm the test process has exited after every run;a passing message alone is insufficient. A hard timeout is a failed test.diff --git a/Makefile b/Makefileindex dd99416..7fd63cc 100644--- a/Makefile+++ b/Makefile@@ -1,13 +1,19 @@PYTHON ?= .venv/bin/python-.PHONY: check test coverage lint compile shell whitespace release marketplace-check+.PHONY: check test test-unit test-contracts coverage lint compile shell whitespace release marketplace-checkcheck: lint test compile shell whitespace-test:- PYTHONPATH=src $(PYTHON) -m unittest discover -s tests -v+test: test-unit test-contracts++test-unit:+ PYTHONPATH=src:. $(PYTHON) -m unittest discover -s tests/unit -t . -v++test-contracts:+ PYTHONPATH=src:. $(PYTHON) -m unittest discover -s tests/contracts -t . -v+ node --test tests/contracts/test_pages_report_history.mjscoverage:- PYTHONPATH=src $(PYTHON) -m coverage run -m unittest discover -s tests+ PYTHONPATH=src:. $(PYTHON) -m coverage run -m unittest discover -s tests -t .$(PYTHON) -m coverage report$(PYTHON) -m coverage xmldiff --git a/README.md b/README.mdindex ee43838..f9f5f18 100644--- a/README.md+++ b/README.md@@ -330,7 +330,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for `make check`,this candidate and have not passed the new installer acceptance.```sh-PYTHONPATH=src .venv/bin/python -m unittest discover -s tests -v+make test.venv/bin/python -m compileall -q src/doubao_input packaging.venv/bin/python -m pip wheel -w dist/wheelhouse -r packaging/runtime-requirements.txtpython3 packaging/build-release.py@@ -342,7 +342,7 @@ and overlay focus. It uses a separate clipboard without CopyQ; optional PyQt6 anElectron fixtures extend toolkit coverage. Avoid typing during the test:```sh-timeout --kill-after=5s 50s env PYTHONPATH=src python3 tests/manual_x11.py --run+timeout --kill-after=5s 50s env PYTHONPATH=src python3 tests/manual/x11.py --run```This requires Xephyr, xfwm4, xfce4-terminal, xdotool, xclip and `/dev/uinput` access.diff --git a/README.zh-CN.md b/README.zh-CN.mdindex a63183f..c2e4486 100644--- a/README.zh-CN.md+++ b/README.zh-CN.md@@ -256,7 +256,7 @@ cd "${XDG_CONFIG_HOME:-$HOME/.config}/omarchy/plugins/md.lifeos.doubao-say"旧 Debian 打包脚本不属于本次候选版的发布路径,尚未完成新版安装验收。```sh-PYTHONPATH=src .venv/bin/python -m unittest discover -s tests -v+make test.venv/bin/python -m compileall -q src/doubao_input packaging.venv/bin/python -m pip wheel -w dist/wheelhouse -r packaging/runtime-requirements.txtpython3 packaging/build-release.py@@ -267,7 +267,7 @@ python3 packaging/build-release.py还会检查这两种界面。运行期间请勿打字:```sh-timeout --kill-after=5s 50s env PYTHONPATH=src python3 tests/manual_x11.py --run+timeout --kill-after=5s 50s env PYTHONPATH=src python3 tests/manual/x11.py --run```需要 Xephyr、xfwm4、xfce4-terminal、xdotool、xclip 和 `/dev/uinput` 权限。diff --git a/packaging/MARKETPLACE.md b/packaging/MARKETPLACE.mdindex c438d4b..60c1927 100644--- a/packaging/MARKETPLACE.md+++ b/packaging/MARKETPLACE.md@@ -14,9 +14,9 @@ Suggested category: **Productivity**. Tags: **ai, hyprland**.Git refs plus source. Redacted reports remain in ignored `artifacts/marketplace/`.2. Build the pinned offline wheel set and run `make release`. Keep installers,checksums and dependency notices together. Checksums are not signatures.-3. Run `tests/manual_clean_install.py` against the app archive. This tests a fresh+3. Run `tests/manual/clean_install.py` against the app archive. This tests a freshXDG directory/runtime on the host, **not** a fresh OS or desktop.- Run `.venv/bin/python tests/manual_source_install.py` for an isolated source+ Run `.venv/bin/python tests/manual/source_install.py` for an isolated sourcesnapshot, runtime check and launcher registration (also host-library based).4. On a separate clean Omarchy session, follow both documented installation routesseparately. For Git installation, run `./install.sh` before enabling.diff --git a/tests/README.md b/tests/README.mdnew file mode 100644index 0000000..48738f0--- /dev/null+++ b/tests/README.md@@ -0,0 +1,13 @@+# Tests++- [`unit/`](unit/) contains fast Python behavior and component tests.+- [`contracts/`](contracts/) verifies packaging, releases, version alignment,+ Marketplace rules, and the Pages report builder.+- [`e2e/`](e2e/) exercises complete desktop flows on Ubuntu and Omarchy with+ Midscene and publishes HTML reports from GitHub Actions.+- [`manual/`](manual/) contains opt-in checks that require a real desktop,+ devices, credentials, or human observation.++`make test-unit` and `make test-contracts` run the two local automated layers.+`make test` runs both. See `CONTRIBUTING.md` before running anything under+`manual/`.diff --git a/tests/__init__.py b/tests/__init__.pynew file mode 100644index 0000000..e69de29diff --git a/tests/contracts/__init__.py b/tests/contracts/__init__.pynew file mode 100644index 0000000..e69de29diff --git a/tests/test_marketplace.py b/tests/contracts/test_marketplace.pysimilarity index 98%rename from tests/test_marketplace.pyrename to tests/contracts/test_marketplace.pyindex 7bec354..bd68b87 100644--- a/tests/test_marketplace.py+++ b/tests/contracts/test_marketplace.py@@ -7,7 +7,7 @@ from unittest.mock import patchfrom doubao_input.preflight import check_runtime-ROOT = Path(__file__).resolve().parents[1]+ROOT = Path(__file__).resolve().parents[2]spec = importlib.util.spec_from_file_location("source_snapshot", ROOT / "packaging/source_snapshot.py")snapshot = importlib.util.module_from_spec(spec)spec.loader.exec_module(snapshot)diff --git a/tests/test_pages_report_history.mjs b/tests/contracts/test_pages_report_history.mjssimilarity index 99%rename from tests/test_pages_report_history.mjsrename to tests/contracts/test_pages_report_history.mjsindex ff51d75..7208856 100644--- a/tests/test_pages_report_history.mjs+++ b/tests/contracts/test_pages_report_history.mjs@@ -5,7 +5,7 @@ import os from 'node:os';import path from 'node:path';import test from 'node:test';-import { buildPagesReport } from '../scripts/build-pages-report.mjs';+import { buildPagesReport } from '../../scripts/build-pages-report.mjs';function runnerScript({ project, status = 'success', startedAt }) {return `<script type="midscene_test_run_dump">${JSON.stringify({diff --git a/tests/test_release.py b/tests/contracts/test_release.pysimilarity index 99%rename from tests/test_release.pyrename to tests/contracts/test_release.pyindex d1d381b..f2929cf 100644--- a/tests/test_release.py+++ b/tests/contracts/test_release.py@@ -9,7 +9,7 @@ import sysimport tarfilefrom unittest.mock import patch-ROOT = Path(__file__).resolve().parents[1]+ROOT = Path(__file__).resolve().parents[2]spec = importlib.util.spec_from_file_location("release_installer", ROOT / "packaging/install-release.py")installer = importlib.util.module_from_spec(spec)spec.loader.exec_module(installer)diff --git a/tests/test_version_check.py b/tests/contracts/test_version_check.pysimilarity index 94%rename from tests/test_version_check.pyrename to tests/contracts/test_version_check.pyindex 9b7b279..8c3c9e0 100644--- a/tests/test_version_check.py+++ b/tests/contracts/test_version_check.py@@ -3,7 +3,7 @@ import unittestfrom pathlib import Path-ROOT = Path(__file__).resolve().parents[1]+ROOT = Path(__file__).resolve().parents[2]SPEC = importlib.util.spec_from_file_location("version_check", ROOT / "packaging/version_check.py")VERSION_CHECK = importlib.util.module_from_spec(SPEC)SPEC.loader.exec_module(VERSION_CHECK)diff --git a/tests/midscene/.npmrc b/tests/e2e/.npmrcsimilarity index 100%rename from tests/midscene/.npmrcrename to tests/e2e/.npmrcdiff --git a/tests/midscene/README.md b/tests/e2e/README.mdsimilarity index 100%rename from tests/midscene/README.mdrename to tests/e2e/README.mddiff --git a/tests/midscene/capture-report-preview.mjs b/tests/e2e/capture-report-preview.mjssimilarity index 62%rename from tests/midscene/capture-report-preview.mjsrename to tests/e2e/capture-report-preview.mjsindex 122583d..7524f1d 100644--- a/tests/midscene/capture-report-preview.mjs+++ b/tests/e2e/capture-report-preview.mjs@@ -9,7 +9,7 @@ import {} from '../../scripts/omarchy-shell-evidence.mjs';const reportDirectory = path.resolve(- process.argv[2] || 'tests/midscene/midscene_run',+ process.argv[2] || 'tests/e2e/midscene_run',);const outputFile = path.resolve(process.argv[3] || path.join(reportDirectory, 'report-preview.png'),@@ -38,22 +38,11 @@ if (!executablePath) {const report = await findLatestTestReport(reportDirectory);const runnerDump = report.run;if (!runnerDump) throw new Error('Midscene Test runner dump was not found');-const executedSteps = (runnerDump.projects ?? []).flatMap((project) =>- (project.documents ?? []).flatMap((document) =>- (document.cases ?? []).flatMap((testCase) =>- (testCase.attempts ?? []).flatMap((attempt) =>- (attempt.steps ?? []).filter((step) => step.startedAt),- ),- ),- ),-);-const finalStep = executedSteps.at(-1);const previewUrl = new URL(pathToFileURL(report.file));-if (finalStep) {- const previewHash = new URLSearchParams({ 'runner-step': finalStep.id });- if (finalStep.agentDetails?.length) previewHash.set('runner-trace', 'page');- previewUrl.hash = previewHash.toString();-}+previewUrl.hash = new URLSearchParams({+ 'runner-step': 'last',+ 'runner-trace': 'page',+}).toString();await mkdir(path.dirname(outputFile), { recursive: true });const browser = await puppeteer.launch({@@ -68,18 +57,14 @@ try {await page.goto(previewUrl.href, {waitUntil: 'networkidle0',});- if (finalStep?.agentDetails?.length) {- await page.waitForFunction(() => document.body.innerText.includes('AI TRACE'));- await page.evaluate(() => window.scrollTo(0, 0));- } else if (finalStep) {- await page.waitForSelector('[aria-label="Execution steps"]');- }+ await page.waitForFunction(() => document.body.innerText.includes('AI TRACE'));+ await page.evaluate(() => window.scrollTo(0, 0));await page.waitForFunction(() =>/Passed|Failed|Error/.test(document.body.innerText),);await page.screenshot({ path: outputFile, type: 'png' });console.log(- `Captured final Midscene report node (${finalStep?.status ?? runnerDump.status}): ${outputFile}`,+ `Captured final Midscene report node (${runnerDump.status}): ${outputFile}`,);} finally {await browser.close();diff --git a/tests/midscene/cases/omarchy-shell.yaml b/tests/e2e/cases/omarchy-shell.yamlsimilarity index 100%rename from tests/midscene/cases/omarchy-shell.yamlrename to tests/e2e/cases/omarchy-shell.yamldiff --git a/tests/midscene/cases/onboarding.yaml b/tests/e2e/cases/onboarding.yamlsimilarity index 100%rename from tests/midscene/cases/onboarding.yamlrename to tests/e2e/cases/onboarding.yamldiff --git a/tests/midscene/gtk_fixture.py b/tests/e2e/gtk_fixture.pysimilarity index 100%rename from tests/midscene/gtk_fixture.pyrename to tests/e2e/gtk_fixture.pydiff --git a/tests/midscene/install-omarchy-vm.sh b/tests/e2e/install-omarchy-vm.shsimilarity index 93%rename from tests/midscene/install-omarchy-vm.shrename to tests/e2e/install-omarchy-vm.shindex 63ea023..d94f77a 100755--- a/tests/midscene/install-omarchy-vm.sh+++ b/tests/e2e/install-omarchy-vm.sh@@ -5,11 +5,11 @@ set -euo pipefail# dressed up with a few Omarchy files. The official ISO acceptance harness# drives the installer through QEMU screenshots, OCR and virtual keystrokes.readonly WORK_DIR="$PWD/.midscene-omarchy"-source "$PWD/tests/midscene/omarchy-vm.env"+source "$PWD/tests/e2e/omarchy-vm.env"readonly ISO_PATH="$WORK_DIR/omarchy-${OMARCHY_ISO_VERSION}.iso"readonly HARNESS_DIR="$WORK_DIR/omarchy-iso"-tests/midscene/prepare-omarchy-host.sh+tests/e2e/prepare-omarchy-host.shdf -h "$WORK_DIR"curl --fail --location --retry 5 --retry-all-errors \diff --git a/tests/midscene/midscene-node-reference.md b/tests/e2e/midscene-node-reference.mdsimilarity index 100%rename from tests/midscene/midscene-node-reference.mdrename to tests/e2e/midscene-node-reference.mddiff --git a/tests/midscene/midscene.config.ts b/tests/e2e/midscene.config.tssimilarity index 98%rename from tests/midscene/midscene.config.tsrename to tests/e2e/midscene.config.tsindex 582df29..fc9bc5f 100644--- a/tests/midscene/midscene.config.ts+++ b/tests/e2e/midscene.config.ts@@ -83,7 +83,7 @@ const setup = defineProjectSetup<DesktopContext>({await sleep(4000);} else {const root = resolve(import.meta.dirname, '../..');- const fixture = spawn('/usr/bin/python3', ['tests/midscene/gtk_fixture.py'], {+ const fixture = spawn('/usr/bin/python3', ['tests/e2e/gtk_fixture.py'], {cwd: root, detached: true, stdio: ['ignore', 'pipe', 'pipe'],env: {...process.env, GDK_BACKEND: 'x11', GSK_RENDERER: 'cairo', GTK_A11Y: 'none',diff --git a/tests/midscene/omarchy-vm.env b/tests/e2e/omarchy-vm.envsimilarity index 100%rename from tests/midscene/omarchy-vm.envrename to tests/e2e/omarchy-vm.envdiff --git a/tests/midscene/package-lock.json b/tests/e2e/package-lock.jsonsimilarity index 99%rename from tests/midscene/package-lock.jsonrename to tests/e2e/package-lock.jsonindex 862673f..e0ba9e2 100644--- a/tests/midscene/package-lock.json+++ b/tests/e2e/package-lock.json@@ -8,8 +8,8 @@"name": "doubao-say-midscene-e2e","version": "1.0.0","devDependencies": {- "@midscene/computer": "1.12.8",- "@midscene/test": "1.12.8",+ "@midscene/computer": "1.12.9",+ "@midscene/test": "1.12.9","@types/node": "^22.0.0","puppeteer-core": "^25.11.0","typescript": "^5.8.3"@@ -2230,15 +2230,15 @@}},"node_modules/@midscene/computer": {- "version": "1.12.8",- "resolved": "https://registry.npmjs.org/@midscene/computer/-/computer-1.12.8.tgz",- "integrity": "sha512-b0haZC1/XasS5FLbdEmln8dDbZPqhna1DjCoxvwhIj8eoISDfuKhAwAvdXaSPpvU8NHgV7cpywo8UiaTXkd4xQ==",+ "version": "1.12.9",+ "resolved": "https://registry.npmjs.org/@midscene/computer/-/computer-1.12.9.tgz",+ "integrity": "sha512-AHoO2rM+81U4yDGD2kadKJ3ShAGbxmLBkcVd5VT6jgUsSOqJNgyAC5Y2S5OtY201pk0B4476kh0CZR/dyH+Aog==","dev": true,"license": "MIT","dependencies": {"@computer-use/libnut": "^4.2.0",- "@midscene/core": "1.12.8",- "@midscene/shared": "1.12.8",+ "@midscene/core": "1.12.9",+ "@midscene/shared": "1.12.9","clipboardy": "^4.0.0","screenshot-desktop": "^1.15.3"},@@ -2250,13 +2250,13 @@}},"node_modules/@midscene/core": {- "version": "1.12.8",- "resolved": "https://registry.npmjs.org/@midscene/core/-/core-1.12.8.tgz",- "integrity": "sha512-dHiiJUPIgvVkuLFYDsn12+W0DkOGymG6YGm22RHFVKMWXjGd40zURWhgCOb3hxVEHzlVAWbhhfs32tgCrJp0zQ==",+ "version": "1.12.9",+ "resolved": "https://registry.npmjs.org/@midscene/core/-/core-1.12.9.tgz",+ "integrity": "sha512-37nbhwOuOfSa6mcpf3BtdNKiEm/lWUnYHXUw8OJbI3WoTX1tPv0h004kqLjcAODpFNytXIAipiy7o/fSrPrb7w==","dev": true,"license": "MIT","dependencies": {- "@midscene/shared": "1.12.8",+ "@midscene/shared": "1.12.9","@ui-tars/action-parser": "1.2.3","dayjs": "^1.11.11","dotenv": "^16.4.5",@@ -2275,9 +2275,9 @@}},"node_modules/@midscene/shared": {- "version": "1.12.8",- "resolved": "https://registry.npmjs.org/@midscene/shared/-/shared-1.12.8.tgz",- "integrity": "sha512-uCfLFik0/lMZlK02kALz3+8zsttlXZ8Ptw4XIHQ1e75Dt3Y4oyFw9jA0O/jkx3ceJLAdxK8Ja1lsOOOjuFZ3jA==",+ "version": "1.12.9",+ "resolved": "https://registry.npmjs.org/@midscene/shared/-/shared-1.12.9.tgz",+ "integrity": "sha512-e4Dw346bpRcCCLr487P0WkHqqLbqoFEUgknZuEIJfnjReA3ydpzDBmJRInWNV/Y2jGIZs5qA2sxakYlLqWK4VQ==","dev": true,"license": "MIT","dependencies": {@@ -2291,15 +2291,15 @@}},"node_modules/@midscene/test": {- "version": "1.12.8",- "resolved": "https://registry.npmjs.org/@midscene/test/-/test-1.12.8.tgz",- "integrity": "sha512-yQzIZax8csm2rHfIOfVdEcPQ3JBeQW4I5RvfiIEC1x9//K4/RFaGe58GZk9OXK0jfv+YgcZYN7FPCPgPNOqZLA==",+ "version": "1.12.9",+ "resolved": "https://registry.npmjs.org/@midscene/test/-/test-1.12.9.tgz",+ "integrity": "sha512-3vlZ/zQTRTk3t76Bbx7yInxEz1UwkfmBG9Vy/aWmdc+HpEJKgjN6bQcANPbCnNKoaR87t9zCZrJTLzb0eaap6g==","dev": true,"license": "MIT","dependencies": {"@inquirer/prompts": "^7.8.6",- "@midscene/core": "1.12.8",- "@midscene/shared": "1.12.8",+ "@midscene/core": "1.12.9",+ "@midscene/shared": "1.12.9","execa": "9.3.0","js-yaml": "4.1.0","tinyglobby": "0.2.15",diff --git a/tests/midscene/package.json b/tests/e2e/package.jsonsimilarity index 86%rename from tests/midscene/package.jsonrename to tests/e2e/package.jsonindex f47e688..2acb564 100644--- a/tests/midscene/package.json+++ b/tests/e2e/package.json@@ -13,8 +13,8 @@"@img/sharp-linux-x64": "0.34.5"},"devDependencies": {- "@midscene/computer": "1.12.8",- "@midscene/test": "1.12.8",+ "@midscene/computer": "1.12.9",+ "@midscene/test": "1.12.9","@types/node": "^22.0.0","puppeteer-core": "^25.11.0","typescript": "^5.8.3"diff --git a/tests/midscene/prepare-omarchy-host.sh b/tests/e2e/prepare-omarchy-host.shsimilarity index 96%rename from tests/midscene/prepare-omarchy-host.shrename to tests/e2e/prepare-omarchy-host.shindex 60aef8b..9fe2fd4 100755--- a/tests/midscene/prepare-omarchy-host.sh+++ b/tests/e2e/prepare-omarchy-host.sh@@ -6,7 +6,7 @@ readonly WORK_DIR="$ROOT_DIR/.midscene-omarchy"readonly HARNESS_DIR="$WORK_DIR/omarchy-iso"# shellcheck source=omarchy-vm.env-source "$ROOT_DIR/tests/midscene/omarchy-vm.env"+source "$ROOT_DIR/tests/e2e/omarchy-vm.env"if [[ ! -c /dev/kvm ]]; thenecho "::error::This GitHub runner does not expose /dev/kvm; a real Omarchy VM cannot be started."diff --git a/tests/midscene/publish-omarchy-vm.sh b/tests/e2e/publish-omarchy-vm.shsimilarity index 96%rename from tests/midscene/publish-omarchy-vm.shrename to tests/e2e/publish-omarchy-vm.shindex 7e024d4..e23e591 100755--- a/tests/midscene/publish-omarchy-vm.sh+++ b/tests/e2e/publish-omarchy-vm.sh@@ -5,7 +5,7 @@ readonly ROOT_DIR="$PWD"readonly WORK_DIR="$ROOT_DIR/.midscene-omarchy"# shellcheck source=omarchy-vm.env-source "$ROOT_DIR/tests/midscene/omarchy-vm.env"+source "$ROOT_DIR/tests/e2e/omarchy-vm.env"readonly BASE_DIR="$WORK_DIR/omarchy-iso/test-runs/omarchy-${OMARCHY_ISO_VERSION}"readonly BUNDLE_DIR="$WORK_DIR/registry"diff --git a/tests/midscene/restore-omarchy-vm.sh b/tests/e2e/restore-omarchy-vm.shsimilarity index 92%rename from tests/midscene/restore-omarchy-vm.shrename to tests/e2e/restore-omarchy-vm.shindex 6082b20..bb338fc 100755--- a/tests/midscene/restore-omarchy-vm.sh+++ b/tests/e2e/restore-omarchy-vm.sh@@ -5,14 +5,14 @@ readonly ROOT_DIR="$PWD"readonly WORK_DIR="$ROOT_DIR/.midscene-omarchy"# shellcheck source=omarchy-vm.env-source "$ROOT_DIR/tests/midscene/omarchy-vm.env"+source "$ROOT_DIR/tests/e2e/omarchy-vm.env"readonly BASE_DIR="$WORK_DIR/omarchy-iso/test-runs/omarchy-${OMARCHY_ISO_VERSION}"readonly BUNDLE_DIR="$WORK_DIR/registry"readonly IMAGE_TAG="${OMARCHY_ISO_VERSION}-${OMARCHY_ISO_SHA256:0:12}-${OMARCHY_ISO_HARNESS_SHA:0:12}"readonly IMAGE="ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/doubao-say-omarchy-ci-base:${IMAGE_TAG}"-tests/midscene/prepare-omarchy-host.sh+tests/e2e/prepare-omarchy-host.shmkdir -p "$BASE_DIR" "$BUNDLE_DIR"oras pull --output "$BUNDLE_DIR" "$IMAGE"(cd "$BUNDLE_DIR" && sha256sum --check --strict SHA256SUMS)diff --git a/tests/midscene/run-omarchy-midscene.sh b/tests/e2e/run-omarchy-midscene.shsimilarity index 96%rename from tests/midscene/run-omarchy-midscene.shrename to tests/e2e/run-omarchy-midscene.shindex 13d6595..f59ad9b 100755--- a/tests/midscene/run-omarchy-midscene.sh+++ b/tests/e2e/run-omarchy-midscene.sh@@ -5,7 +5,7 @@ readonly ROOT_DIR="$PWD"readonly WORK_DIR="$ROOT_DIR/.midscene-omarchy"readonly HARNESS_DIR="$WORK_DIR/omarchy-iso"# shellcheck source=omarchy-vm.env-source "$ROOT_DIR/tests/midscene/omarchy-vm.env"+source "$ROOT_DIR/tests/e2e/omarchy-vm.env"readonly ISO_PATH="$WORK_DIR/omarchy-${OMARCHY_ISO_VERSION}.iso"readonly BASE_DIR="$HARNESS_DIR/test-runs/omarchy-${OMARCHY_ISO_VERSION}"readonly SSH_KEY="$BASE_DIR/id_ed25519"@@ -13,7 +13,7 @@ readonly SSH_PORT=2222readonly PLUGIN_DIR="/home/omarchy/.config/omarchy/plugins/md.lifeos.doubao-say"readonly SHIM_DIR="$(mktemp -d)"readonly PLUGIN_ARCHIVE="$(mktemp /tmp/doubao-say-omarchy-plugin-XXXXXX.tar)"-export NODE_OPTIONS="${NODE_OPTIONS:-} --require=$ROOT_DIR/tests/midscene/node_modules/@computer-use/libnut/dist/import_libnut.js"+export NODE_OPTIONS="${NODE_OPTIONS:-} --require=$ROOT_DIR/tests/e2e/node_modules/@computer-use/libnut/dist/import_libnut.js"VM_PID=""@@ -112,7 +112,7 @@ ssh_guest trueecho "Creating the Omarchy plugin test payload."tar -C "$ROOT_DIR" --exclude='__pycache__' -cf "$PLUGIN_ARCHIVE" \LICENSE README.md manifest.json install.sh setup-omarchy.sh start.sh \- omarchy src tests/midscene/gtk_fixture.py+ omarchy src tests/e2e/gtk_fixture.pyfor _copy_attempt in 1 2 3 4 5; doif scp -i "$SSH_KEY" -P "$SSH_PORT" \@@ -161,7 +161,7 @@ start_guest_fixture() {export PYTHONPATH='$PLUGIN_DIR/src'; \export XDG_CONFIG_HOME=/tmp/doubao-midscene-config; \export PYTHONDONTWRITEBYTECODE=1; \- nohup setsid python3 '$PLUGIN_DIR/tests/midscene/gtk_fixture.py' \+ nohup setsid python3 '$PLUGIN_DIR/tests/e2e/gtk_fixture.py' \>/tmp/doubao-midscene-fixture.log 2>&1 </dev/null & \echo \$! >/tmp/doubao-midscene-fixture.pid"@@ -183,7 +183,7 @@ ATTEMPT_LOG=""for _test_attempt in 1 2 3; dostart_guest_fixtureATTEMPT_LOG="/tmp/omarchy-midscene-attempt-${_test_attempt}.log"- if npm --prefix tests/midscene test -- \+ if npm --prefix tests/e2e test -- \--project omarchy-onboarding 2>&1 | tee "$ATTEMPT_LOG"; thenMIDSCENE_PASSED=truebreak@@ -228,7 +228,7 @@ doneMENU_PASSED=falsefor _test_attempt in 1 2 3; doATTEMPT_LOG="/tmp/omarchy-menu-midscene-attempt-${_test_attempt}.log"- if OMARCHY_SSH_KEY="$SSH_KEY" npm --prefix tests/midscene test -- \+ if OMARCHY_SSH_KEY="$SSH_KEY" npm --prefix tests/e2e test -- \--project omarchy-shell 2>&1 | tee "$ATTEMPT_LOG"; thenMENU_PASSED=truebreakdiff --git a/tests/midscene/tsconfig.json b/tests/e2e/tsconfig.jsonsimilarity index 100%rename from tests/midscene/tsconfig.jsonrename to tests/e2e/tsconfig.jsondiff --git a/tests/manual/__init__.py b/tests/manual/__init__.pynew file mode 100644index 0000000..e69de29diff --git a/tests/manual_clean_install.py b/tests/manual/clean_install.pysimilarity index 100%rename from tests/manual_clean_install.pyrename to tests/manual/clean_install.pydiff --git a/tests/manual_control_layout.py b/tests/manual/control_layout.pysimilarity index 97%rename from tests/manual_control_layout.pyrename to tests/manual/control_layout.pyindex 553a742..0885239 100644--- a/tests/manual_control_layout.py+++ b/tests/manual/control_layout.py@@ -1,6 +1,6 @@"""Opt-in GTK layout regression; no recording, login, input or settings writes.-PYTHONPATH=src .venv/bin/python tests/manual_control_layout.py+PYTHONPATH=src .venv/bin/python tests/manual/control_layout.py"""import gidiff --git a/tests/manual_control_mapped.py b/tests/manual/control_mapped.pysimilarity index 100%rename from tests/manual_control_mapped.pyrename to tests/manual/control_mapped.pydiff --git a/tests/manual_direct_input.py b/tests/manual/direct_input.pysimilarity index 99%rename from tests/manual_direct_input.pyrename to tests/manual/direct_input.pyindex ca726b3..cd919a3 100644--- a/tests/manual_direct_input.py+++ b/tests/manual/direct_input.py@@ -14,7 +14,7 @@ import gigi.require_version('Gtk', '4.0')from gi.repository import Gtk, GLib-from manual_safety import hard_deadline+from safety import hard_deadlinefrom doubao_input.inject.injector import Injectorfrom doubao_input.inject.target import focused_targetdiff --git a/tests/manual_escape_guard.py b/tests/manual/escape_guard.pysimilarity index 98%rename from tests/manual_escape_guard.pyrename to tests/manual/escape_guard.pyindex f220f35..9444a2e 100644--- a/tests/manual_escape_guard.py+++ b/tests/manual/escape_guard.py@@ -9,7 +9,7 @@ gi.require_version("Gdk", "4.0")from gi.repository import Gdk, GLib, Gtkfrom doubao_input.trigger.escape_guard import EscapeGuard-from manual_safety import hard_deadline+from safety import hard_deadlinedef main():diff --git a/tests/manual_fresh_login.py b/tests/manual/fresh_login.pysimilarity index 100%rename from tests/manual_fresh_login.pyrename to tests/manual/fresh_login.pydiff --git a/tests/manual_onboarding_acceptance.py b/tests/manual/onboarding_acceptance.pysimilarity index 100%rename from tests/manual_onboarding_acceptance.pyrename to tests/manual/onboarding_acceptance.pydiff --git a/tests/manual_plugin_lifecycle.py b/tests/manual/plugin_lifecycle.pysimilarity index 100%rename from tests/manual_plugin_lifecycle.pyrename to tests/manual/plugin_lifecycle.pydiff --git a/tests/manual_polish_delivery.py b/tests/manual/polish_delivery.pysimilarity index 100%rename from tests/manual_polish_delivery.pyrename to tests/manual/polish_delivery.pydiff --git a/tests/manual/probes/__init__.py b/tests/manual/probes/__init__.pynew file mode 100644index 0000000..e69de29diff --git a/tests/probe/P6_asr.py b/tests/manual/probes/asr.pysimilarity index 95%rename from tests/probe/P6_asr.pyrename to tests/manual/probes/asr.pyindex 95c1a36..55f2dd3 100644--- a/tests/probe/P6_asr.py+++ b/tests/manual/probes/asr.py@@ -1,9 +1,9 @@"""P6 探针:用 P5 保存的凭证连 WSS,实时录音 5 秒,看是否返回 result.Text-用法:.venv/bin/python tests/probe/P6_asr.py+用法:.venv/bin/python tests/manual/probes/asr.py通过标准:打印至少一条非空 text。"""import sys, os, time, threading-sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "src"))+sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "..", "src"))from doubao_input.doubao.params_store import ParamsStorefrom doubao_input.doubao.asr_client import ASRClientfrom doubao_input.doubao.audio_capture import AudioCapturediff --git a/tests/probe/P5_login.py b/tests/manual/probes/login.pysimilarity index 90%rename from tests/probe/P5_login.pyrename to tests/manual/probes/login.pyindex 41482af..ece7551 100644--- a/tests/probe/P5_login.py+++ b/tests/manual/probes/login.py@@ -1,9 +1,9 @@"""P5 探针:用复用的豆包登录窗口,登录后提取凭证写 ~/.config/doubao-say/asr_params.json-用法:.venv/bin/python tests/proprobe/P5_login.py (在仓库根)+用法:.venv/bin/python tests/manual/probes/login.py (在仓库根)通过标准:登录后窗口自动关闭,JSON 写出 cookies/device_id/web_id。"""import sys, os-sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "src"))+sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "..", "src"))from doubao_input.doubao.login_window import LoginWindow # noqafrom doubao_input.doubao.params_store import ParamsStoreprint("P5: 准备开登录窗口,请在 WebView 中扫码登录豆包…")diff --git a/tests/manual_refactor_smoke.py b/tests/manual/refactor_smoke.pysimilarity index 99%rename from tests/manual_refactor_smoke.pyrename to tests/manual/refactor_smoke.pyindex 77cc7b8..945b4c3 100644--- a/tests/manual_refactor_smoke.py+++ b/tests/manual/refactor_smoke.py@@ -8,7 +8,7 @@ from contextlib import ExitStackfrom pathlib import Pathimport tempfilefrom unittest.mock import Mock, patch-from manual_safety import drain_events, hard_deadline+from safety import drain_events, hard_deadlineimport gigi.require_version("Gtk", "4.0")diff --git a/tests/manual_safety.py b/tests/manual/safety.pysimilarity index 100%rename from tests/manual_safety.pyrename to tests/manual/safety.pydiff --git a/tests/manual_settings_preview.py b/tests/manual/settings_preview.pysimilarity index 94%rename from tests/manual_settings_preview.pyrename to tests/manual/settings_preview.pyindex 4440b82..56ab66f 100644--- a/tests/manual_settings_preview.py+++ b/tests/manual/settings_preview.py@@ -1,6 +1,6 @@"""Opt-in GTK UI smoke test and screenshots; never runs in headless unit CI.-Run: PYTHONPATH=src .venv/bin/python tests/manual_settings_preview.py+Run: PYTHONPATH=src .venv/bin/python tests/manual/settings_preview.pySaves are validated in memory; user settings and autostart are not modified."""import json@@ -13,7 +13,7 @@ from doubao_input.i18n import set_languagefrom doubao_input.settings import Settingsfrom doubao_input.ui.settings_window import SettingsWindow-OUT = Path(__file__).resolve().parents[1] / "artifacts/acceptance/settings"+OUT = Path(__file__).resolve().parents[2] / "artifacts/acceptance/settings"class Preview(Gtk.Application):diff --git a/tests/manual_source_install.py b/tests/manual/source_install.pysimilarity index 98%rename from tests/manual_source_install.pyrename to tests/manual/source_install.pyindex 2ea5cd1..21289f9 100644--- a/tests/manual_source_install.py+++ b/tests/manual/source_install.py@@ -10,7 +10,7 @@ import subprocessimport sysimport tempfile-ROOT = Path(__file__).resolve().parents[1]+ROOT = Path(__file__).resolve().parents[2]spec = importlib.util.spec_from_file_location("source_snapshot", ROOT / "packaging/source_snapshot.py")snapshot = importlib.util.module_from_spec(spec)spec.loader.exec_module(snapshot)diff --git a/tests/manual_update_overlay.py b/tests/manual/update_overlay.pysimilarity index 100%rename from tests/manual_update_overlay.pyrename to tests/manual/update_overlay.pydiff --git a/tests/manual_waveform_performance.py b/tests/manual/waveform_performance.pysimilarity index 94%rename from tests/manual_waveform_performance.pyrename to tests/manual/waveform_performance.pyindex 3c34018..0f1f585 100644--- a/tests/manual_waveform_performance.py+++ b/tests/manual/waveform_performance.py@@ -2,7 +2,7 @@Run with LD_PRELOAD=libgtk4-layer-shell.so GTK_A11Y=none PYTHONPATH=srctimeout -k 5s 15s dbus-run-session ---python tests/manual_waveform_performance.py. Requires a desktop display.+python tests/manual/waveform_performance.py. Requires a desktop display."""import mathimport time@@ -12,7 +12,7 @@ import gigi.require_version('Gtk', '4.0')from gi.repository import GLib, Gtkfrom doubao_input.ui.overlay import Overlay-from manual_safety import hard_deadline+from safety import hard_deadlinedef main():diff --git a/tests/manual_x11.py b/tests/manual/x11.pysimilarity index 99%rename from tests/manual_x11.pyrename to tests/manual/x11.pyindex be21cd3..0f71ebd 100644--- a/tests/manual_x11.py+++ b/tests/manual/x11.py@@ -1,6 +1,6 @@"""Opt-in X11 delivery acceptance in a disposable Xephyr/XFWM desktop.-Run: timeout --kill-after=5s 50s env PYTHONPATH=src python tests/manual_x11.py --run+Run: timeout --kill-after=5s 50s env PYTHONPATH=src python tests/manual/x11.py --runRequires Xephyr, xfwm4, xdotool, xclip, xfce4-terminal and uinput access.PyQt6 and Electron add optional toolkit checks. Avoid typing/changing focus.The host clipboard, settings and running app are untouched; no audio/network.@@ -19,7 +19,7 @@ import timeimport ttyimport uuid-from manual_safety import hard_deadline+from safety import hard_deadlinedef stop(process):diff --git a/tests/unit/__init__.py b/tests/unit/__init__.pynew file mode 100644index 0000000..e69de29diff --git a/tests/test_app_edges.py b/tests/unit/test_app_edges.pysimilarity index 100%rename from tests/test_app_edges.pyrename to tests/unit/test_app_edges.pydiff --git a/tests/test_asr_sessions.py b/tests/unit/test_asr_sessions.pysimilarity index 100%rename from tests/test_asr_sessions.pyrename to tests/unit/test_asr_sessions.pydiff --git a/tests/test_au05.py b/tests/unit/test_au05.pysimilarity index 100%rename from tests/test_au05.pyrename to tests/unit/test_au05.pydiff --git a/tests/test_audio_capture.py b/tests/unit/test_audio_capture.pysimilarity index 100%rename from tests/test_audio_capture.pyrename to tests/unit/test_audio_capture.pydiff --git a/tests/test_basketball_motion.py b/tests/unit/test_basketball_motion.pysimilarity index 100%rename from tests/test_basketball_motion.pyrename to tests/unit/test_basketball_motion.pydiff --git a/tests/test_delivery.py b/tests/unit/test_delivery.pysimilarity index 100%rename from tests/test_delivery.pyrename to tests/unit/test_delivery.pydiff --git a/tests/test_desktop.py b/tests/unit/test_desktop.pysimilarity index 99%rename from tests/test_desktop.pyrename to tests/unit/test_desktop.pyindex 96c78dc..6aea24b 100644--- a/tests/test_desktop.py+++ b/tests/unit/test_desktop.py@@ -10,7 +10,7 @@ from unittest.mock import patchfrom doubao_input import __main__ as entrypoint, preflightfrom doubao_input.desktop import is_x11-ROOT = Path(__file__).resolve().parents[1]+ROOT = Path(__file__).resolve().parents[2]SESSIONS = (({"DISPLAY": ":99", "XDG_SESSION_TYPE": "x11"}, True),({"DISPLAY": ":99"}, True),diff --git a/tests/test_direct_input.py b/tests/unit/test_direct_input.pysimilarity index 100%rename from tests/test_direct_input.pyrename to tests/unit/test_direct_input.pydiff --git a/tests/test_escape_guard.py b/tests/unit/test_escape_guard.pysimilarity index 100%rename from tests/test_escape_guard.pyrename to tests/unit/test_escape_guard.pydiff --git a/tests/test_evdev_edges.py b/tests/unit/test_evdev_edges.pysimilarity index 100%rename from tests/test_evdev_edges.pyrename to tests/unit/test_evdev_edges.pydiff --git a/tests/test_gesture.py b/tests/unit/test_gesture.pysimilarity index 100%rename from tests/test_gesture.pyrename to tests/unit/test_gesture.pydiff --git a/tests/test_input_worker.py b/tests/unit/test_input_worker.pysimilarity index 100%rename from tests/test_input_worker.pyrename to tests/unit/test_input_worker.pydiff --git a/tests/test_language.py b/tests/unit/test_language.pysimilarity index 100%rename from tests/test_language.pyrename to tests/unit/test_language.pydiff --git a/tests/test_login_return.py b/tests/unit/test_login_return.pysimilarity index 100%rename from tests/test_login_return.pyrename to tests/unit/test_login_return.pydiff --git a/tests/test_manual_safety.py b/tests/unit/test_manual_safety.pysimilarity index 83%rename from tests/test_manual_safety.pyrename to tests/unit/test_manual_safety.pyindex 8b10aed..eee12cc 100644--- a/tests/test_manual_safety.py+++ b/tests/unit/test_manual_safety.py@@ -5,7 +5,7 @@ import unittestfrom pathlib import Pathfrom unittest.mock import Mock-from manual_safety import drain_events+from tests.manual.safety import drain_eventsclass ManualSafetyTest(unittest.TestCase):@@ -24,7 +24,7 @@ class ManualSafetyTest(unittest.TestCase):def test_hard_timeout_kills_a_busy_loop(self):result = subprocess.run([sys.executable, "-c",- "from manual_safety import hard_deadline\n"+ "from tests.manual.safety import hard_deadline\n""with hard_deadline(0.1):\n while True: pass\n"],- cwd=Path(__file__).parent, timeout=3)+ cwd=Path(__file__).resolve().parents[2], timeout=3)self.assertEqual(result.returncode, -signal.SIGALRM)diff --git a/tests/test_params_store.py b/tests/unit/test_params_store.pysimilarity index 100%rename from tests/test_params_store.pyrename to tests/unit/test_params_store.pydiff --git a/tests/test_plugin_launch.py b/tests/unit/test_plugin_launch.pysimilarity index 100%rename from tests/test_plugin_launch.pyrename to tests/unit/test_plugin_launch.pydiff --git a/tests/test_polish.py b/tests/unit/test_polish.pysimilarity index 100%rename from tests/test_polish.pyrename to tests/unit/test_polish.pydiff --git a/tests/test_polish_preview.py b/tests/unit/test_polish_preview.pysimilarity index 100%rename from tests/test_polish_preview.pyrename to tests/unit/test_polish_preview.pydiff --git a/tests/test_preferences.py b/tests/unit/test_preferences.pysimilarity index 100%rename from tests/test_preferences.pyrename to tests/unit/test_preferences.pydiff --git a/tests/test_product.py b/tests/unit/test_product.pysimilarity index 99%rename from tests/test_product.pyrename to tests/unit/test_product.pyindex 5eaa507..bd01bfd 100644--- a/tests/test_product.py+++ b/tests/unit/test_product.py@@ -25,7 +25,7 @@ def polishing_app(**values):class ProductTest(TestCase):def test_runtime_package_and_plugin_versions_match(self):- root = Path(__file__).resolve().parents[1]+ root = Path(__file__).resolve().parents[2]package_version = tomllib.loads((root / "pyproject.toml").read_text())["project"]["version"]plugin_version = json.loads((root / "manifest.json").read_text())["version"]self.assertEqual((VERSION, package_version, plugin_version), (VERSION,) * 3)diff --git a/tests/test_reasoning.py b/tests/unit/test_reasoning.pysimilarity index 100%rename from tests/test_reasoning.pyrename to tests/unit/test_reasoning.pydiff --git a/tests/test_runtime_edges.py b/tests/unit/test_runtime_edges.pysimilarity index 100%rename from tests/test_runtime_edges.pyrename to tests/unit/test_runtime_edges.pydiff --git a/tests/test_settings.py b/tests/unit/test_settings.pysimilarity index 100%rename from tests/test_settings.pyrename to tests/unit/test_settings.pydiff --git a/tests/test_setup_actions.py b/tests/unit/test_setup_actions.pysimilarity index 100%rename from tests/test_setup_actions.pyrename to tests/unit/test_setup_actions.pydiff --git a/tests/test_setup_session.py b/tests/unit/test_setup_session.pysimilarity index 100%rename from tests/test_setup_session.pyrename to tests/unit/test_setup_session.pydiff --git a/tests/test_transcription_sessions.py b/tests/unit/test_transcription_sessions.pysimilarity index 100%rename from tests/test_transcription_sessions.pyrename to tests/unit/test_transcription_sessions.pydiff --git a/tests/test_tray.py b/tests/unit/test_tray.pysimilarity index 100%rename from tests/test_tray.pyrename to tests/unit/test_tray.pydiff --git a/tests/test_tray_menu.py b/tests/unit/test_tray_menu.pysimilarity index 100%rename from tests/test_tray_menu.pyrename to tests/unit/test_tray_menu.pydiff --git a/tests/test_trigger_controller.py b/tests/unit/test_trigger_controller.pysimilarity index 100%rename from tests/test_trigger_controller.pyrename to tests/unit/test_trigger_controller.pydiff --git a/tests/test_trigger_picker.py b/tests/unit/test_trigger_picker.pysimilarity index 100%rename from tests/test_trigger_picker.pyrename to tests/unit/test_trigger_picker.pydiff --git a/tests/test_trigger_reader.py b/tests/unit/test_trigger_reader.pysimilarity index 100%rename from tests/test_trigger_reader.pyrename to tests/unit/test_trigger_reader.pydiff --git a/tests/test_updates.py b/tests/unit/test_updates.pysimilarity index 100%rename from tests/test_updates.pyrename to tests/unit/test_updates.pydiff --git a/tests/test_voice_motion.py b/tests/unit/test_voice_motion.pysimilarity index 100%rename from tests/test_voice_motion.pyrename to tests/unit/test_voice_motion.pydiff --git a/tests/test_volcengine_asr_client.py b/tests/unit/test_volcengine_asr_client.pysimilarity index 100%rename from tests/test_volcengine_asr_client.pyrename to tests/unit/test_volcengine_asr_client.pydiff --git a/tests/test_volcengine_protocol.py b/tests/unit/test_volcengine_protocol.pysimilarity index 100%rename from tests/test_volcengine_protocol.pyrename to tests/unit/test_volcengine_protocol.pydiff --git a/tests/test_waveform.py b/tests/unit/test_waveform.pysimilarity index 100%rename from tests/test_waveform.pyrename to tests/unit/test_waveform.pydiff --git a/tests/test_x11_input.py b/tests/unit/test_x11_input.pysimilarity index 100%rename from tests/test_x11_input.pyrename to tests/unit/test_x11_input.py