1.0.0 • Published 7 years ago

carl-bot v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

CARL (CDN's Automatic Regression Library)

Installation

$ npm install carl-bot --save

Usage

Create a test file called index.js or test.js or whatever.js. Require CARL and add some tests:

const carl = require('carl-bot')

// give Carl some instructions
const config = {
  baseUrl: 'http://live-site.com',
  liveCdnHost: /^\/\/live-site\.media/,
  testCdnHost: 'localhost:8101',
  localTest: true,
  imagePath: './images',
  imageAttribute: 'data-src',
  maxDiffPercentage: 2
}

carl.init(config)

// add a test, passing URL and CSS selector
carl.test('/', '.image')

// start
carl.go()

Run the tests with, for example:

$ node whatever.js