behat/mink-selenium2-driver

Selenium2 (WebDriver) driver for Mink framework

Installs: 52 650 342

Dependents: 791

Suggesters: 10

Security: 0

Stars: 507

Watchers: 17

Forks: 163

Open Issues: 57

Language:JavaScript

Type:mink-driver

v1.7.0 2023-12-09 11:58 UTC

This package is auto-updated.

Last update: 2024-11-12 21:16:09 UTC


README

Latest Stable Version Latest Unstable Version Total Downloads CI License codecov

Usage Example

<?php

use Behat\Mink\Mink,
    Behat\Mink\Session,
    Behat\Mink\Driver\Selenium2Driver;

require_once __DIR__ . '/vendor/autoload.php';

$browserName = 'firefox';
$url = 'http://example.com';

$mink = new Mink(array(
    'selenium2' => new Session(new Selenium2Driver($browserName)),
));

$session = $mink->getSession('selenium2');
$session->visit($url);

$session->getPage()->findLink('Chat')->click();

Please refer to MinkExtension-example for an executable example.

Installation

{
    "require": {
        "behat/mink":                   "~1.5",
        "behat/mink-selenium2-driver":  "~1.1"
    }
}
$> curl -sS https://getcomposer.org/installer | php
$> php composer.phar install

Testing

  1. Start WebDriver
    1. If you have Docker installed, run
    docker run -p 4444:4444 selenium/standalone-firefox:2.53.1
    1. If you do not have Docker, but you have Java
    curl -L https://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar > selenium-server-standalone-2.53.1.jar
    java -jar selenium-server-standalone-2.53.1.jar
  2. Start WebServer by running
    ./vendor/bin/mink-test-server
  3. Start PhpUnit
    composer require --dev phpunit/phpunit
    ./vendor/bin/phpunit -v --coverage-clover=coverage.clover

Copyright

Copyright (c) 2012 Pete Otaqui pete@otaqui.com.

Maintainers