puppeteer-tools
v1.3.1
Published
A set of functions to let you write e2e tests more quickly and with interactions more user like
Downloads
5
Readme
Docs
API reference
Why use puppeteer-tools
- You want to have your e2e tests less coupled to your code and acting more like a real user
- You don't have a QA team and you want to have some e2e tests to make sure that main user flow will not break, so you need to write it as fast and easily as you can.
Installation
npm i puppeteer-tools
puppeteer-tools is like a plugin to puppeteer, so you need to install it too.
npm i puppeteer
Getting Started
import puppeteer from 'puppeteer';
import createPuppeteerTools from 'puppeteer-tools';
const browser = await puppeteer.launch();
const page = await browser.newPage();
const puppeteerTools = createPuppeteerTools(page);
await page.goto('http://myapp.com/login');
await puppeteerTools.form.fill([
{
data: 'mylogin',
label: 'Login',
type: 'text',
},
{
data: 'mypass',
label: 'Password',
type: 'text',
},
]);
await Promise.all([
page.waitForNavigation(),
page.click('button[type=submit]'),
]);
Coming soon
- More input types (check, radio, textarea, ...)
- Custom input types
- Possibility to execute some action between inputs fill in form.fill
Contributing
Not organized yet, so for now reach me on twitter @lebreRafael or just open issues and PRs