Skip to content

Commit

Permalink
feat(*): adding config handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Nickersoft committed Jul 4, 2023
1 parent 2d52fc7 commit 4c74f6b
Show file tree
Hide file tree
Showing 9 changed files with 466 additions and 97 deletions.
10 changes: 10 additions & 0 deletions .oarc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"show": true,
"filterLinks": "/read",
"cookies": [
{
"name": "session",
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2ODg0MzYyMjMsImV4cCI6MTY4ODQzODAyMywiYXVkIjoiaHR0cHM6Ly9saW5ndWlzdGljLmlvIiwiaXNzIjoiaHR0cHM6Ly9saW5ndWlzdGljLmlvIiwic3ViIjoiMTgwIn0.RKoH9_1j_A64xiSAqacydwmbKevVJE38_xYAsT55YS8%3AeyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2ODg0MzYyMjMsImV4cCI6MTY5MTExNDYyMywiYXVkIjoiaHR0cHM6Ly9saW5ndWlzdGljLmlvIiwiaXNzIjoiaHR0cHM6Ly9saW5ndWlzdGljLmlvIiwic3ViIjoiMTgwIiwianRpIjoiMjMifQ.LNR3P9rWhfwBIPW7d0JPDGQ7Gc41dguBBT5dIt9xyYQ.NEwrRX9bteOfg5Tr3XvHEVZXRw32vXGXOUc1SMMav%2Bg"
}
]
}
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 🦍 oa

`oa` (short for "oo oo aa aa") is a simple command-line tool for monkey testing frontend applications.
`oa` (short for ["oo oo aa aa"](https://www.youtube.com/watch?v=yb8ZAP5JCuk)) is a simple command-line tool for monkey testing frontend applications.

[Monkey testing](https://en.wikipedia.org/wiki/Monkey_testing) is a technique in which random click, input and keyboard events are sent to an application to test its resilience. In other words, as if a monkey was using it. Monkey testing can also be helpful for adding an increased load to the application to debug performance and memory bottlenecks.

Expand Down Expand Up @@ -28,9 +28,12 @@ oa http://127.0.0.1:8080/login

`oa` supports a few flags to customize its behavior:

| Name | Alias | Description | Default |
| --------- | ----- | ---------------------------------------------------------------------------------------- | ------- |
| `--show` | `-s` | Show the browser window while testing. | `false` |
| `--count` | `-c` | The number of monkeys/instances to run. | 3 |
| `--time` | `-t` | The duration to run the test. Supports human-readable times such as '5m', '1 hour', etc. | 10s |
| Name | Alias | Description | Default |
| ---------- | ----- | ---------------------------------------------------------------------------------------- | ------- |
| `--show` | `-s` | Show the browser window while testing. | `false` |
| `--num` | `-n` | The number of monkeys/instances to run. | 1 |
| `--time` | `-t` | The duration to run the test. Supports human-readable times such as '5m', '1 hour', etc. | 10s |
| `--header` | `-H` | HTTP header to pass to the browser. Can be used multiple times. | |
| `--cookie` | `-c` | Cookie string to pass to the browser. Can be used multiple times. | 10s |


3 changes: 3 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"fmt": {
"lineWidth": 120
},
"tasks": {
"build": "deno compile --allow-env --allow-write --allow-read --allow-run --allow-net -o bin/chaos oa.ts",
"dev": "deno run --allow-env --allow-write --allow-read --allow-run --allow-net --watch oa.ts"
Expand Down
146 changes: 146 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 20 additions & 1 deletion deps.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
export { getSetCookies } from "https://deno.land/std@0.192.0/http/cookie.ts";

export {
default as puppeteer,
type ElementHandle,
type KeyInput,
type Page,
} from "https://deno.land/x/puppeteer@16.2.0/mod.ts";

export type { Protocol } from "https://deno.land/x/puppeteer@16.2.0/vendor/puppeteer-core/vendor/devtools-protocol/types/protocol.d.ts";

export { cosmiconfig } from "npm:cosmiconfig@^8";

export {
type ArgumentValue,
Command,
Expand All @@ -13,12 +19,25 @@ export {

export { string } from "https://deno.land/x/zod@v3.21.4/mod.ts";

export { draw, random, range, shuffle, sleep } from "npm:radash@^10";
export {
draw,
objectify,
random,
range,
shake,
shuffle,
sleep,
} from "npm:radash@^10";

export * as stdColors from "https://deno.land/std@0.192.0/fmt/colors.ts";

export { colors } from "https://deno.land/x/cliffy@v1.0.0-rc.1/ansi/colors.ts";

export {
type BackgroundColorName,
backgroundColorNames,
Chalk,
type ChalkInstance,
} from "npm:chalk@^5";

export { default as ms } from "npm:ms@^2";
Expand Down
Loading

0 comments on commit 4c74f6b

Please sign in to comment.