ediasoft/mink-selenium4-driver

Selenium4 (WebDriver) driver for Mink framework

Installs: 475

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 163

Language:JavaScript

Type:mink-driver

1.0.0 2023-07-10 09:16 UTC

This package is auto-updated.

Last update: 2024-12-10 12:19:42 UTC


README

This package is a fork of an existing package MinkSelenium2Driver

Usage Example

<?php

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

use Selenium\Client as SeleniumClient;

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

$mink = new Mink(array(
    'selenium4' => new Session(new Selenium4Driver($browser, null, $url)),
));

$mink->getSession('selenium4')->getPage()->findLink('Chat')->click();

Please refer to MinkExtension-example for an executable example.

Installation

{
    "require": {
        "behat/mink":                   "~1.5",
        "behat/mink-selenium4-driver":  "~1.0"
    }
}
$> 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