karma-phantomjs-launcher
    Overview
    Documentation
    Tutorials
    Chat
    Insights
    Code
    Dependencies
    Contributors
    Jobs

karma-phantomjs-launcher

A Karma plugin. Launcher for PhantomJS.

1.0.4  •  Updated 1 years ago  •  by karma-runner  •  MIT License

js-standard-style npm version npm downloads

Build Status Dependency Status devDependency Status

Launcher for PhantomJS.

Installation

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

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

Configuration

// 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

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

is equivalent to:

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:

$ 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.

Popularity

Maintenance

Development

Last ver 3 years ago
Created 7 years ago
Last commit 3 years ago
15 days between commits

Technology

Node version: 7.2.1
0 unpacked

Compliance

MIT License
OSI Approved
0 vulnerabilities

Contributors

23 contributors
Friedel Ziegelmayer
Maintainer, 45 commits, 11 merges, 3 PRs
Vojta Jina
23 commits, 2 merges
Mark Ethan Trostler
7 commits, 1 merges
Works at ZZO Associates
sylvain-hamel
3 commits, 2 merges, 1 PRs
Works at www.octopus-itsm.com
Shinnosuke Watanabe
4 commits, 3 PRs
Jurko Gospodnetić
3 commits, 1 PRs
Works at PKE sistemi

Tags

karma-plugin
karma-launcher
phantomjs
Openbase helps developers choose among and use millions of open-source packages, so they can build amazing products faster.
FacebookTwitterLinkedIn
© 2020 Devstore, Inc.