open-index/open-npm huggingface dataset:
npm package: @lifeway/webdriver-testing-library
Description: Simple and complete custom Selenium Webdriver commands and utilities that encourage good testing practices.
Latest version: 0.2.6

# Webdriver Testing Library

Simple and complete custom Selenium Webdriver commands and utilities that
encourage good testing practices.

> Due to limited bandwidth to maintain a healthy open-source project at this
> time, this project is being replaced by an internal project:
> [@lifewayit/webdriver-testing-library](https://github.com/lifewayit/e2e-testing-utilities).
> See the [migration
> guide](https://github.com/lifewayit/e2e-testing-utilities/tree/master/docs/migrating-from-original-testing-library.md)
> for details on moving from this library to the new library.

---
![NPM Shield](https://img.shields.io/npm/v/@lifeway/webdriver-testing-library.svg?style=flat-square)
![Downloads Shield](https://img.shields.io/npm/dm/@lifeway/webdriver-testing-library?style=flat-square)

## The Problem

Writing tests with [Selenium Webdriver](https://selenium.dev) can feel very
different from other end-to-end test, or unit test, frameworks. The
cross-browser flexibily of the [WebDriver spec](https://www.w3.org/TR/webdriver/)
can make using Selenium necessary at times, however the interface can
cumbersome and there for lead to unmaintainable tests.

## This Solution

The _Webdriver Testing Library_ is a collection of utilites intended combine
the browser compatibility of the Selenium Webdriver with the readability of
[React Testing Libary](https://github.com/testing-library/react-testing-library)'s
interface. Writing tests with this library should feel similiar to writing
tests using any other [Testing Library](https://testing-library.com/), and
therefore encourage better testing practices.

## Installation

This module is distributed via [npm](https://www.npmjs.com) which is bundled
[node](https://nodejs.org/) and should be installed as on of your projects
`devDependencies`.

```sh
npm install --save-dev @lifeway/webdriver-testing-library
```

This library has `peerDependencies` listings for `selenium-webdriver`.

## Examples

### Basic Example

```javascript
import { WebDriver } from 'selenium-webdriver';
import { click, queryByText } from '@lifeway/webdriver-testing-library';

test('Basic Example', async () => {
  const driver = new WebDriver();

  await click(driver)(queryByText('Login'));
});
```

### useScreen Example

```javascript
import { WebDriver } from 'selenium-webdriver';
import { useScreen } from '@lifeway/webdriver-testing-library';

test('useScreen Example', async () => {
  const driver = new WebDriver();
  const screen = useScreen(driver);

  await screen.click(screen.queryByText('Login'));
});
```