# grunt-phantomflow

> UI Web testing with decision trees and PhantomCSS

Latest version **1.3.0** (published 2018-02-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install grunt-phantomflow
pnpm add grunt-phantomflow
yarn add grunt-phantomflow
bun add grunt-phantomflow
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2018-02-08 |
| First published | 2014-06-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 335.9 KB |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 44 |
| Maintainers | jamescryer, meltuhamy |
| Keywords | gruntplugin, ui, testing, visual, regression, phantomcss, phantomjs, casperjs, css, html, flow, user, tdd, bdd, assert, d3, visualisation |

## Links

- npm: https://www.npmjs.com/package/grunt-phantomflow
- Repository: https://github.com/Huddle/grunt-phantomflow
- Issues: https://github.com/Huddle/grunt-phantomflow/issues
- npm.io page: https://npm.io/package/grunt-phantomflow

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^3.10.1
- [phantomflow](https://npm.io/package/phantomflow.md) ^1.3.0
- [grunt-contrib-connect](https://npm.io/package/grunt-contrib-connect.md) ^0.5.0

## Alternatives

- [@sveltejs/kit](https://npm.io/package/@sveltejs/kit.md) — 2.2M weekly downloads
- [@atlaskit/theme](https://npm.io/package/@atlaskit/theme.md) — 402.0K weekly downloads
- [@tangle-network/brand](https://npm.io/package/@tangle-network/brand.md) — 10.0K weekly downloads
- [seneca](https://npm.io/package/seneca.md) — 7.4K weekly downloads
- [@bsb/base](https://npm.io/package/@bsb/base.md) — 7.2K weekly downloads

## Recent versions

- 1.3.0 (latest) — 2018-02-08
- 1.2.2 — 2017-11-24
- 1.2.1 — 2017-11-24
- 1.2.0 — 2017-11-22
- 1.1.1 — 2017-03-15
- 1.1.0 — 2016-07-19
- 1.0.0 — 2016-03-02
- 0.2.8 — 2015-10-21
- 0.2.7 — 2015-10-01
- 0.2.6 — 2015-10-01
- 0.2.5 — 2015-09-29
- 0.2.4 — 2015-08-12
- 0.2.3 — 2015-01-14
- 0.2.2 — 2014-11-19
- 0.2.1 — 2014-06-04

## README

**Unmaintained notice**: As of December 22nd 2017 this project will no longer be maintained. What started out as a creative experiment four years ago became a significant tool in Huddle's Web development workflow, as well as the workflows of external Web engineers.  But like [PhantomCSS, its time to move on](https://github.com/Huddle/PhantomCSS#why-is-this-project-no-longer-maintained).

# grunt-phantomflow

> A grunt plugin for [PhantomFlow](https://github.com/Huddle/PhantomFlow)

## Grunt

### Basics

This plugin requires Grunt `~0.4.2`

If you are unfamilar with [Grunt](http://gruntjs.com/) check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins.

```shell
npm install grunt-phantomflow --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-phantomflow');
```

### Setup


```js
grunt.config.set('phantomflow', {
	app: {
		/*
			How many threads would you like to parallelise on?
			Default value is 4
		*/
		threads: 4,

		/*
			Any command line options to be passed down to casper?
			Example: ['--cookies-file=testcookies.txt']
			Default value is []
		*/
		casperArgs: [],

		/*
			Should a report/visualisation be generated after
			the test run? Default value is false
		*/
		createReport: false,

		/*
			Should the report output live somewhere else, e.g. for
			proxying through a real webserver?
			Example: '../visualtest/htdocs'
			Default value is undefined.
			If unset, the default set by PhantomFlow will be used.
		*/
		reports: null,
		
		/*
			Do you have scripts to include?
			Default value is ./include
		*/
		includes: './include',
		
		/*
			Where do the tests live?
			Default value is ./test
		*/
		tests: './test',
		
		/*
			Where should the results go?
			Default value is ./test-results
		*/
		results: './test-results',
		
		/*
			Hide elements in the page
		*/
		hideElements: ['img', 'input']
	}
});
```

### Command line parameters

#### Running a specific test

If you're working on a test you can use the `test` parameter to run a specific test file. The value can be a substring of the file name. Please note that test filenames should follow the *.test.js naming convention.

`grunt phantomflow:websitetests --test=mytestfile`

#### Reporting

To show the PhantomFlow visualisation use the 'report' param. You need to have previously generated a report by setting the createReport option to true. Tests will not be executed when the 'report' param is used. The previously generated visualisation will open in your browser.

`grunt phantomflow:websitetests --report`

#### Multithreading

By default phantomflow will divide and execute groups of tests concurrantly on different threads.  By default this is 4 threads

Use the thread parameter to increase the amount of threads and reduce the feedback time.

`grunt phantomflow:websitetests --threads=8`

#### Debugging

Show more logging: `grunt phantomflow:websitetests --debug=1`

Save screenshots and show more logging: `grunt phantomflow:websitetests --debug=2`

By default phantomflow will not abort when a test fails, set the `earlyexit` parameter to true stop the tests upon seeing the first failure.

`grunt phantomflow:websitetests --earlyexit=true`

#### Remote debugging using Web Inspector.

PhantomJS supports [remote debugging](https://github.com/ariya/phantomjs/wiki/Troubleshooting#remote-debugging). The following grunt options allow you to start phantom with the correct options.

```
grunt.config.set('phantomflow', {
	app: {
		remoteDebug: true, // default false
		remoteDebugAutoStart: false, // default false,
		remoteDebugPort: 9000 // default 9000
	}
});
```

### Overview
In your project's Gruntfile, use either `grunt.initConfig( {} )` or `grunt.config.set( 'phantomflow', {} )`.

```js

var phantomflowConfig = {
  test: {
    tests: '/mytests'
  },
  report: {} // this task is reserved for reporting only
};

grunt.initConfig({
  decision: phantomflowConfig
};
```

---
_Source: https://npm.io/package/grunt-phantomflow · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
