mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
* chore(prose): remove em-dashes from config files * chore(prose): remove em-dashes from android sdk config * docs(spec-api): remove em-dash from README * fix(doctor): reword sidecar-jar error without em-dash * test(sidecar): reword assertion message without em-dash * docs: add CLAUDE.md with project conventions * build: add docs target for pandoc site * docs(site): add pandoc template and stylesheet * docs(site): add pandoc build script * docs(site): add landing pages * docs(manual): add getting-started * docs(manual): add writing-specs * docs(manual): add runs * docs(manual): add cli reference * docs(dev): add design principles * docs(dev): add architecture * ci: deploy docs site to github pages * docs: rewrite README as entry point to docs site
40 lines
1.0 KiB
Markdown
40 lines
1.0 KiB
Markdown
# @uatu/spec
|
|
|
|
TypeScript spec API for [uatu](https://github.com/priyanshujain/uatu), 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 `uatu` CLI picks up the spec and drives the app under test.
|
|
|
|
## Install
|
|
|
|
```sh
|
|
npm install --save-dev @uatu/spec
|
|
```
|
|
|
|
## Usage
|
|
|
|
```ts
|
|
import { extract, always, actions, Tap, weighted } from "@uatu/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
|
|
|
|
`@uatu/spec` is released in lockstep with the uatu CLI. Pin the same major/minor version as your installed `uatu` binary.
|
|
|
|
## License
|
|
|
|
Apache-2.0
|