Git Product home page Git Product logo

arquillian-phantom-driver's Introduction

Arquillian Phantom Driver

Arquillian Phantom Driver provides dependency on the GhostDriver, dependency on PhantomJS binary and provides runtime resolution of the binary artifact (distributed in Maven repository) to enable true headless unattended testing without need of local PhantomJS installation.

Usage

Add following snippet to your project's POM:

<dependencies>
    <dependency>
        <groupId>org.jboss.arquillian.extension</groupId>
        <artifactId>arquillian-phantom-driver</artifactId>
        <version>${artifact.version}</version>
    </dependency>
</dependencies>

Java code:

WebDriver driver = new PhantomJSDriver(
        ResolvingPhantomJSDriverService.createDefaultService(), // service resolving phantomjs binary automatically
        DesiredCapabilities.phantomjs());

or you can specify path to the phantomjs binary file. If the binary file doesn't exist or it isn't up to date, the resolver will copy own file to the given path:

DesiredCapabilities capabilities = DesiredCapabilities.phantomjs();

// where the binary binary is expected (will be resolved when file does not exist)
capabilities.setCapability("phantomjs.binary.path", "./target/phantomjs");

// enforce resolver to use given phantomjs version
capabilities.setCapability("phantomjs.binary.version", "2.1.1");

// if there is phantomjs available on PATH, use that one
capabilities.setCapability("phantomjs.prefer.resolved", Boolean.FALSE);

// NOTE: capabilities must be passed into the ResolvingPhantomJSDriverService if you plan on passing custom
// command-line arguments such as disabling SSL Certificate checking or other features.  

WebDriver driver = new PhantomJSDriver(
        ResolvingPhantomJSDriverService.createDefaultService(capabilities),
        capabilities);

Installation

mvn clean install

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.