# browser-test-helpers

> A small set of generic test helpers for browser interaction tests.

Latest version **1.0.0** (published 2015-05-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install browser-test-helpers
pnpm add browser-test-helpers
yarn add browser-test-helpers
bun add browser-test-helpers
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-05-04 |
| First published | 2015-05-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Kyle Robinson Young |
| Maintainers | shama |
| Keywords | browser, test, helpers, click, fillIn |

## Links

- npm: https://www.npmjs.com/package/browser-test-helpers
- Repository: https://github.com/shama/browser-test-helpers
- Homepage: https://github.com/shama/browser-test-helpers#readme
- Issues: https://github.com/shama/browser-test-helpers/issues
- npm.io page: https://npm.io/package/browser-test-helpers

## Dependencies (2)

- [xtend](https://npm.io/package/xtend.md) ^4.0.0
- [global](https://npm.io/package/global.md) ^4.3.0

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-05-04

## README

# browser-test-helpers

A small set of generic test helpers for browser interaction tests.

## api

### `var help = new BrowserTestHelpers()`

#### `help.click(element[, options])`
Simulates a click event on the given `element`.

```js
var button = document.querySelector('button')
help.click(button, { bubbles: false })
```

#### `help.fillIn(element, value)`
Fills in an field with the given `value`.

```js
var input = document.querySelector('input')
help.fillIn(input, 'Testing')
```

#### `help.triggerEvent(element, type[, options])`
Triggers the `type` of event on the given `element`.

```js
var input = document.querySelector('input')
help.triggerEvent(input, 'focus')
```

#### `help.keyEvent(element, type[, options])`
Triggers a `KeyboardEvent` on the given `element`.

```js
var el = document.getElementById('bear')
help.keyEvent(el, 'keypress', { keyCode: 13, shiftKey: true })
```

# license
(c) 2015 Kyle Robinson Young. MIT License

---
_Source: https://npm.io/package/browser-test-helpers · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
