doffy
Doffy
a headless browser automation library with easy-use API.
Doffy provide a few simple methods to simulate user action like goto
click
fill
, which are useful for headless web testing
and crawling
.
Feature
- Base on chrome headless, use Chrome Devtools Protocol, while Nightmare base on Electron and Casper is base on PhantomJS.
- All
Promise
, all API of Doffy return aPromise
QuickStart
install chrome headless
Mac: chrome headless is shipped on chrome-canary, install: https://www.google.com/chrome/browser/canary.html
Linux: chrome headless is also shipped on chrome 59. so you can install chrome 59 to use headless mode.
# https://askubuntu.com/questions/79280/how-to-install-chrome-browser-properly-via-command-line sudo apt-get install libxss1 libappindicator1 libindicator7wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.debsudo dpkg -i google-chrome*.deb # Might show "errors", fixed by next line sudo apt-get install -f
install doffy
# wait for npm publish
page automation:
;const doffy = ; async await doffy; await doffy; await doffy; await doffy; await doffy; await doffy; await doffy; await doffy; let isLogin = await doffy isLogin && console; await doffy;;
run mocha test
; const expect = expect;const doffy = ; ;
API
see wiki page => API doc please wait...
ChangeLog
2017.05.12
- New
LICENSE
MIT