Rize is a high-level, fluent and chainable API provided library which let you use puppeteer simply.
Full TypeScript support
You still can visit low-level
puppeteerbrowser and page instance.
Providing lots of useful assertions
If you are looking for all available APIs of
Rize, please go here.
puppeteer is as a peer dependency of
Rize, so you should install
yarn add --dev puppeteer rize
or via npm:
npm install --save-dev puppeteer rize
If you are in China, you may specify Chromium binary mirror.
On Linux or macOS:
PUPPETEER_DOWNLOAD_HOST=https://storage.googleapis.com.cnpmjs.org yarn add --dev puppeteer rize
SET PUPPETEER_DOWNLOAD_HOST=https://storage.googleapis.com.cnpmjs.org yarn add --dev puppeteer rize
For TypeScript users, you may install type declarations of
puppeteer. This is optional and it is recommended to install it if you are going to visit puppeteer's API directly:
yarn add --dev @types/puppeteer
npm install --save-dev @types/puppeteer
We recommend to use ES-style
import Rize from 'rize'
Also, using CommonJS-style syntax is OK:
const Rize = require('rize')
Now we can create a
const rize = new Rize()
Here is an example:
rize .goto('https://github.com/') .type('input.header-search-input', 'node') .press('Enter') .waitForNavigation() .assertSee('Node.js') .end() // Don't forget to call `end` function to exit browser!
Now you can go ahead to read this documentation to look for more details!
Copyright (c) 2018-present Pig Fang