Files
openhuman/app/test/e2e/helpers/core-rpc.ts
T
Mega MindandGitHub b7b3d62c58 test(e2e): skill execution flow (core RPC + Skills UI) (#283)
* test(e2e): skill execution flow (core RPC + Skills UI)

- Add skill-execution-flow.spec: core.ping, skills start/list_tools/call_tool/stop
  via shared RPC helper, seeded QuickJS echo skill (same tree as Rust json_rpc_e2e).
- Add core-rpc helpers: WebView invoke on tauri-driver, Node fetch + port probe on
  Appium Mac2 (no WKWebView execute).
- Extend navigateViaHash with Mac2 sidebar label fallbacks for /skills, /home, etc.
- Wire yarn test:e2e:skill-execution and e2e-run-all-flows.

Refs: #68
Made-with: Cursor

* fix(e2e): address CodeRabbit review for skill execution PR

- core-rpc-node: honor OPENHUMAN_CORE_HOST and OPENHUMAN_CORE_PORT before port scan
- shared-flows: Mac2 navigateViaHash for /settings/billing; throw on unmapped hash;
  navigateToBilling fallback without WebView execute on Mac2
- skill-e2e-runtime: javascript manifest + removeSeededEchoSkill teardown
- skill-execution-flow: teardown seeded skill; document RPC shapes vs json_rpc_e2e;
  skip placeholder for future agent chat tool_calls

Made-with: Cursor
2026-04-03 12:00:01 +05:30

20 lines
647 B
TypeScript

/**
* Core JSON-RPC for E2E: WebView execute on tauri-driver (Linux), Node fetch on Appium Mac2.
*/
import { callOpenhumanRpcNode } from './core-rpc-node';
import type { RpcCallResult } from './core-rpc-webview';
import { callOpenhumanRpcWebView } from './core-rpc-webview';
import { supportsExecuteScript } from './platform';
export type { RpcCallResult };
export async function callOpenhumanRpc<T = unknown>(
method: string,
params: Record<string, unknown> = {}
): Promise<RpcCallResult<T>> {
if (supportsExecuteScript()) {
return callOpenhumanRpcWebView<T>(method, params);
}
return callOpenhumanRpcNode<T>(method, params);
}