w-puppeteer-uitest
v1.0.41
Published
A uitest package for web developer.
Downloads
144
Maintainers
Readme
w-puppeteer-uitest
A uitest package for web developer.
Documentation
To view documentation or get support, visit docs.
Installation
Using npm(ES6 module):
Note: w-puppeteer-uitest is mainly dependent on
puppeteer
,jimp
,lodash-es
,wsemi
npm i w-puppeteer-uitest
Example
Link: [dev source code]
import { build, test } from './src/exp.mjs'
import readJson from './src/readJson.mjs'
let fd = 'D:\\開源-JS-003-2-w-puppeteer-uitest\\w-puppeteer-uitest\\'
let fd_html = fd + 'test-html\\'
let fd_action = fd + 'test-action\\'
let fd_out = fd + 'test-screenshot\\'
function readAction(name) {
return readJson(fd_action + name + '.action.json')
}
let optExp = {
headless: true,
num_web: 10,
ratio_similar: 0.97,
// htmlFilter: function(vs) {
// console.log(vs)
// return vs.filter(function(v) {
// return v.indexOf('hover') >= 0
// })
// },
}
//build(fd_html, readAction, fd_out, optExp)
test(fd_html, readAction, fd_out, optExp)