w-puppeteer-uitest

1.0.41 • Public • Published

w-puppeteer-uitest

A uitest package for web developer.

language npm version license npm download npm download jsdelivr download

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)

Package Sidebar

Install

npm i w-puppeteer-uitest

Weekly Downloads

10

Version

1.0.41

License

MIT

Unpacked Size

1.65 MB

Total Files

98

Last publish

Collaborators

  • semisphere