Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wildhoney/webmonkey
🙊 Robust and versatile headless monkey testing for the modern web with reproducible steps, error alerts, strategy sharing and many other good things.
https://github.com/wildhoney/webmonkey
headless monkey-testing puppeteer stress-testing testing
Last synced: 3 months ago
JSON representation
🙊 Robust and versatile headless monkey testing for the modern web with reproducible steps, error alerts, strategy sharing and many other good things.
- Host: GitHub
- URL: https://github.com/wildhoney/webmonkey
- Owner: Wildhoney
- License: mit
- Created: 2019-02-04T20:09:46.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T01:58:57.000Z (about 2 years ago)
- Last Synced: 2024-11-01T11:51:27.732Z (3 months ago)
- Topics: headless, monkey-testing, puppeteer, stress-testing, testing
- Language: JavaScript
- Homepage:
- Size: 2.89 MB
- Stars: 9
- Watchers: 3
- Forks: 4
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> Robust and versatile headless monkey testing for the modern web with reproducible steps, error alerts, strategy sharing and many other good things.
![Travis](http://img.shields.io/travis/Wildhoney/Webmonkey.svg?style=for-the-badge)
Â
![npm](http://img.shields.io/npm/v/webmonkey.svg?style=for-the-badge)
Â
![License MIT](http://img.shields.io/badge/license-mit-lightgrey.svg?style=for-the-badge)
Â
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=for-the-badge)](https://github.com/prettier/prettier)It's important to remember that [monkey testing](https://en.wikipedia.org/wiki/Monkey_testing) should be used in conjunction with smarter tests such as [integration tests](https://en.wikipedia.org/wiki/Integration_testing).
![Screenshot](media/screenshot-0.3.5.png)
## Getting Started
Once `webmonkey` has been installed globally, you can begin testing by supplying the `--url` parameter you'd like to test. As that's the only required field, testing begins immediately and proceeds with 50 actions.
```console
foo@bar:~$ webmonkey --url https://news.bbc.co.uk/
```For other parameters you can type `webmonkey --help` at any time.
### Strategy
By default each action has an equal chance of being chosen at random to be run. However you can tweak this by passing the `--strategy` parameter which allows for a comma separated list of actions followed by how likely they are to be chosen — for example `--strategy clicker=10,reloader=0` would make clicker 10 times as likely to run than any other action – aside from reloader which will never run.
### Authenticating
Oftentimes you'll want to authenticate before proceeding with the testing. In cases such as these `webmonkey` provides a hooks file where you export two optional functions — `create` and `destroy` — you can specify the location of the hooks file with the `--hooks` parameter.
The hooks file **must** be in the `*.mjs` format – for instance to authenticate on a fictitious website one might implement the following.
```javascript
export const create = async (page) => {
await page.goto('https://www.example.com/');
await page.focus('#username');
await page.keyboard.type('webmonkey');
await page.focus('#password');
await page.keyboard.type('monkeynuts');
await page.keyboard.press('Enter');
await page.waitForNavigation({ waitUntil: 'networkidle0' });
};
```## Meet the Team
Currently we have the following set of monkeys that perform various actions on your supplied domain:
Clicker
Performs clicks in random regions of the visible viewport.
Networker
Cycles through a list of preset network conditions.
Scroller
Scrolls the viewport to different areas of the page.
Sizer
Randomly selects a different height and width for the viewport.
Toucher
Similar to theclicker
action but instead performs touches.
Typer
Focuses on random input fields and types random characters.
Refresher
Refreshes the page occasionally.