Simple and complete custom Selenium Webdriver commands and utilities that encourage good testing practices.
npm install @lifeway/webdriver-testing-librarySimple 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.
> See the migration
> guide
> for details on moving from this library to the new library.
---
!NPM Shield
!Downloads Shield
Writing tests with Selenium Webdriver can feel very
different from other end-to-end test, or unit test, frameworks. The
cross-browser flexibily of the WebDriver spec
can make using Selenium necessary at times, however the interface can
cumbersome and there for lead to unmaintainable tests.
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's
interface. Writing tests with this library should feel similiar to writing
tests using any other Testing Library, and
therefore encourage better testing practices.
This module is distributed via npm which is bundled
node and should be installed as on of your projectsdevDependencies.
``sh`
npm install --save-dev @lifeway/webdriver-testing-library
This library has peerDependencies listings for selenium-webdriver.
`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'));
});
`
`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'));
});
``