0.2.5 • Published 10 years ago

phantomcss-kit v0.2.5

Weekly downloads
1
License
ISC
Repository
github
Last release
10 years ago

phantomcss-kit

This NPM utility library provides a quick way to run a pre-defined PhantomCSS test suite against your web page.

Requirements

  • Python is required to run CasperJS.

Usage

  1. Install:
npm i phantomcss-kit --save-dev
  1. Create a page you would like run the tests against. Mark the elements to test using the pk-test attribute:
<div pk-test="first">Hello!</div>

The value of pk-test will be used as the name of the test case.

  1. Run the tests:
pk-test --url=%ABSOLUTE_PAGE_URL%

Generating test cases

To generate new test cases, use the --rebase flag:

pk-test --url=%ABSOLUTE_PAGE_URL% --rebase

Running a local web server

If you don't have a local web server at hand, you can start one together with the test suite:

pk-test --url=%ABSOLUTE_PAGE_URL% --serveDir=%PATH_TO_TEST_FOLDER%

You can set a custom port using the optional --port argument.

Configuring a delay

In case you are unable to take a screenshot of some element because it hasn't loaded yet, you can configure a fixed delay before taking screenshots:

pk-test --url=%ABSOLUTE_PAGE_URL% --wait=3000

Tolerance

The tolerance level can be adjusting using the --tolerance argument:

pk-test --url=%ABSOLUTE_PAGE_URL% --tolerance=1.25

More information

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago