Skip to content

Latest commit

 

History

History
61 lines (47 loc) · 2.21 KB

README.md

File metadata and controls

61 lines (47 loc) · 2.21 KB

Mink WebDriver Classic Driver

Latest Stable Version Latest Unstable Version Total Downloads CI License codecov

Usage Example

<?php

use Behat\Mink\Mink,
    Behat\Mink\Session,
    Mink\WebdriverClassicDriver\WebdriverClassicDriver;

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

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

$mink = new Mink(array(
    'webdriver-classic' => new Session(new WebdriverClassicDriver($browserName)),
));

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

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

Please refer to MinkExtension-example for an executable example.

Installation

composer require behat/mink mink/webdriver-classic-driver

Testing

  1. Start WebDriver
    1. If you have Docker installed, run
    docker run -p 4444:4444 selenium/standalone-firefox:4.18.1
    1. If you do not have Docker, but you have Java
    curl -L https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.18.0/selenium-server-4.18.1.jar > selenium-server-4.18.1.jar
    java -jar selenium-server-4.18.1.jar standalone
  2. Start WebServer by running
    ./vendor/bin/mink-test-server
  3. Start PhpUnit
    ./vendor/bin/phpunit -v --coverage-clover=coverage.clover