mazelab/phantomjsstarter

Starts phantomjs sessions with webdriver support

Installs: 1 224

Dependents: 0

Stars: 1

Watchers: 4

Forks: 1

Open Issues: 1

1.1.2 2015-12-21 14:39 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"