mazelab/phantomjsstarter

Starts phantomjs sessions with webdriver support

Installs: 68

Dependents: 0

Stars: 1

Watchers: 4

Forks: 1

Language: PHP

1.1.0 2015-05-06 10:43 UTC

README

Helper to start phantomjs sessions. We are using it in functional test frameworks like behat/mink.

Installation

    "require": {
        "mazelab/phantomjsstarter": "~1.0"
    }

Example

features/bootstrap/FeatureContext.php

    class FeatureContext extends MinkContext
    {

        /** @BeforeSuite */
        public static function setup(SuiteEvent $event)
        {
            $phantomjs = new Mazelab\Phantomjs\Starter(8643);
            $phantomjs->up();
        }

        ...

behat.yml

    default:
        context:
            class:  'FeatureContext'
        formatter:
            name:               pretty
            parameters:
                output_path:    null
        extensions:
            Behat\MinkExtension\Extension:
                default_session: selenium2
                javascript_session: selenium2
                base_url: 'https://dev.myproject.com'
                selenium2:
                    wd_host: "http://localhost:8643/wd/hub"