@sanderling/spec
v0.0.1-rc4
Published
TypeScript spec API for sanderling, a property-based UI fuzzer for mobile apps.
Readme
@sanderling/spec
TypeScript spec API for sanderling, a property-based UI fuzzer for mobile apps.
Spec authors write specs in TypeScript that describe what an app should always do (safety invariants), generate weighted actions to exercise the app, and extract structured state from the accessibility tree. The sanderling CLI picks up the spec and drives the app under test.
Install
npm install --save-dev @sanderling/specUsage
import { extract, always, actions, Tap, weighted } from "@sanderling/spec";
export const spec = {
extract: extract((tree) => ({
onHomeScreen: tree.some((n) => n.text === "Home"),
})),
always: always(({ state }) => state.onHomeScreen || !state.startedOnHome),
actions: actions(({ tree }) =>
weighted([
[1, Tap(tree.first((n) => n.text === "Checkout"))],
]),
),
};Version compatibility
@sanderling/spec is released in lockstep with the sanderling CLI. Pin the same major/minor version as your installed sanderling binary.
License
Apache-2.0
