# oi-grease

> Bunch of help methods for e2e automation testing via Puppeteer

Latest version **5.0.0** (published 2022-11-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install oi-grease
pnpm add oi-grease
yarn add oi-grease
bun add oi-grease
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2022-11-02 |
| First published | 2020-03-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 2 |
| Unpacked size | 62.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Oleksii Ihnatiuk |
| Maintainers | crispusdh |
| Keywords | puppeteer, wait, click, type, predicate |

## Links

- npm: https://www.npmjs.com/package/oi-grease
- Repository: https://github.com/CrispusDH/puppeteer-helpers
- Homepage: https://github.com/CrispusDH/puppeteer-helpers#readme
- Issues: https://github.com/CrispusDH/puppeteer-helpers/issues
- npm.io page: https://npm.io/package/oi-grease

## Dependencies (2)

- [p-filter](https://npm.io/package/p-filter.md) 2.1.0
- [pkg-conf](https://npm.io/package/pkg-conf.md) 3.1.0

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 5.0.0 (latest) — 2022-11-02
- 4.1.0 — 2022-10-24
- 4.0.0 — 2022-07-22
- 3.0.0 — 2021-09-30
- 2.1.0 — 2020-09-17
- 2.0.1 — 2020-09-17
- 2.0.0 — 2020-08-03
- 1.9.1 — 2020-06-28
- 1.9.0 — 2020-05-04
- 1.8.0 — 2020-04-24
- 1.7.1 — 2020-04-22
- 1.7.0 — 2020-04-22
- 1.6.3 — 2020-04-14
- 1.6.2 — 2020-04-08
- 1.6.1 — 2020-04-08
- … 15 more at https://npm.io/package/oi-grease/versions

## README

# puppeteer-helpers
Bunch of help methods for e2e automation testing via Puppeteer

# Purpose
Several examples why library exists:

 * You always have some troubles with click?
`waitForSelector()` does not help sometimes and you use `$eval(selector, (node) => node.click()`?
Please, stop clicking using JS if you write e2e UI tests. Our user does not interact with browser in such maner!

**Was**:
```typescript
    await page.waitForSelector(selector, { timeout:30000 });
    await page.$eval(selector, (e: any) => e.click());
```

**with Grease**:
```typescript
await click(page, selector);
```

`click()` will wait when `Puppeteer` find element and also when element become visible.

Library has other useful methods in API.md (TBD)

 * You aware `Puppeteer` does not have `getText()` method, strange but truth

 **Was**:
 ```typescript
  await page.waitForSelector(selector);
  const text = await page.$eval(selector, (el: any) => el.innerText);
 ```

 **with Grease**:
 ```typescript
 const text = await getText(page, selector);
 ```

`getText()`  will wait when `Puppeteer` find element and also when element become visible.
Only after that get text of element.

# API
TBD

# Contribution guide
TBD

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