# karma-phantomjs-launcher

> A Karma plugin. Launcher for PhantomJS.

Latest version **1.0.4** (published 2017-03-10) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install karma-phantomjs-launcher
pnpm add karma-phantomjs-launcher
yarn add karma-phantomjs-launcher
bun add karma-phantomjs-launcher
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2017-03-10 |
| First published | 2013-03-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 278 |
| Author | Vojta Jina |
| Maintainers | vojtajina, zzo, dignifiedquire, karmarunnerbot |
| Keywords | karma-plugin, karma-launcher, phantomjs |

## Links

- npm: https://www.npmjs.com/package/karma-phantomjs-launcher
- Repository: https://github.com/karma-runner/karma-phantomjs-launcher
- Homepage: https://github.com/karma-runner/karma-phantomjs-launcher#readme
- Issues: https://github.com/karma-runner/karma-phantomjs-launcher/issues
- npm.io page: https://npm.io/package/karma-phantomjs-launcher

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) ^4.0.1
- [phantomjs-prebuilt](https://npm.io/package/phantomjs-prebuilt.md) ^2.1.7

## Recent versions

- 1.0.4 (latest) — 2017-03-10
- 1.0.3 — 2017-03-10
- 1.0.2 — 2016-08-31
- 1.0.1 — 2016-06-23
- 1.0.0 — 2016-01-28
- 0.2.3 — 2016-01-04
- 0.2.2 — 2015-12-24
- 0.2.1 — 2015-08-05
- 0.2.0 — 2015-05-29
- 0.1.4 — 2014-04-04
- 0.1.3 — 2014-04-01
- 0.1.2 — 2014-02-03
- 0.1.1 — 2013-11-27
- 0.1.0 — 2013-08-06
- 0.0.3 — 2013-08-05
- … 2 more at https://npm.io/package/karma-phantomjs-launcher/versions

## README

# karma-phantomjs-launcher

[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/karma-runner/karma-phantomjs-launcher)
 [![npm version](https://img.shields.io/npm/v/karma-phantomjs-launcher.svg?style=flat-square)](https://www.npmjs.com/package/karma-phantomjs-launcher) [![npm downloads](https://img.shields.io/npm/dm/karma-phantomjs-launcher.svg?style=flat-square)](https://www.npmjs.com/package/karma-phantomjs-launcher)

[![Build Status](https://img.shields.io/travis/karma-runner/karma-phantomjs-launcher/master.svg?style=flat-square)](https://travis-ci.org/karma-runner/karma-phantomjs-launcher) [![Dependency Status](https://img.shields.io/david/karma-runner/karma-phantomjs-launcher.svg?style=flat-square)](https://david-dm.org/karma-runner/karma-phantomjs-launcher) [![devDependency Status](https://img.shields.io/david/dev/karma-runner/karma-phantomjs-launcher.svg?style=flat-square)](https://david-dm.org/karma-runner/karma-phantomjs-launcher#info=devDependencies)

> Launcher for [PhantomJS].

## Installation

The easiest way is to keep `karma-phantomjs-launcher` as a devDependency in your `package.json`,
by running

```bash
$ npm install --save-dev karma-phantomjs-launcher
```

## Configuration

```js
// karma.conf.js
module.exports = function(config) {
  config.set({
    browsers: ['PhantomJS', 'PhantomJS_custom'],

    // you can define custom flags
    customLaunchers: {
      'PhantomJS_custom': {
        base: 'PhantomJS',
        options: {
          windowName: 'my-window',
          settings: {
            webSecurityEnabled: false
          },
        },
        flags: ['--load-images=true'],
        debug: true
      }
    },

    phantomjsLauncher: {
      // Have phantomjs exit if a ResourceError is encountered (useful if karma exits without killing phantom)
      exitOnResourceError: true
    }
  })
}
```

The `options` attribute allows you to initialize properties on
the phantomjs `page` object, so

```js
options: {
  windowName: 'my-window',
  settings: {
    webSecurityEnabled: false
  },
}
```

is equivalent to:

```js
var webPage = require('webpage')
var page = webPage.create()

page.windowName = 'my-window'
page.settings.webSecurityEnabled = false
```

You can pass list of browsers as a CLI argument too:
```bash
$ karma start --browsers PhantomJS_custom
```

If you set the `debug` option to `true`, you will be instructed to launch a web browser to
bring up the debugger. Note that you will want to put `debugger;` statements in your JavaScript
to hit breakpoints. You should be able to put breakpoints in both your test code and your client
code. Note that the `debug` option automatically adds the `--remote-debugger-port=9000` and
`--remote-debugger-autorun=yes` switches to PhantomJS.

----

For more information on Karma see the [homepage].


[homepage]: http://karma-runner.github.com
[PhantomJS]: http://phantomjs.org/

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