Sha256: 6920f5a6f31345d51b9728fae4c80674c9d92cb76bb5488e0b744cde1b621cd8

Contents?: true

Size: 771 Bytes

Versions: 1

Compression:

Stored size: 771 Bytes

Contents

if phantom.version.major < 1 || phantom.version.minor < 3
  console.log "Poltergeist requires a PhantomJS version of at least 1.3"
  phantom.exit(1)

class Poltergeist
  constructor: (port) ->
    @browser    = new Poltergeist.Browser(this)
    @connection = new Poltergeist.Connection(this, port)

  runCommand: (command) ->
    try
      @browser[command.name].apply(@browser, command.args)
    catch error
      @connection.send({ error: error.toString() })

  sendResponse: (response) ->
    @connection.send({ response: response })

class Poltergeist.ObsoleteNode
  toString: -> "Poltergeist.ObsoleteNode"

phantom.injectJs('web_page.js')
phantom.injectJs('node.js')
phantom.injectJs('connection.js')
phantom.injectJs('browser.js')

new Poltergeist(phantom.args[0])

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
poltergeist-0.1.0 lib/capybara/poltergeist/client/main.coffee