PHP code example of robertfausk / mink-panther-driver

1. Go to this page and download the library: Download robertfausk/mink-panther-driver library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

robertfausk / mink-panther-driver example snippets




use Behat\Mink\Mink;
use Behat\Mink\Session;
use Behat\Mink\Driver\PantherDriver;
use Symfony\Component\Panther\PantherTestCase;

// These are the same options passed as in PantherTestCaseTrait::createPantherClient client constructor. 
protected static $defaultOptions = [
    'webServerDir' => __DIR__.'/../../../../public', // the Flex directory structure
    'hostname' => '127.0.0.1',
    'port' => 9080,
    'router' => '',
    'external_base_uri' => null,
    'readinessPath' => '',
    'browser' => PantherTestCase::CHROME,
];
$kernelOptions = []; # unused cause we do not extend class KernelTestCase
$managerOptions = [];

$mink = new Mink(array(
    'panther' => new Session(new PantherDriver($defaultOptions, $kernelOptions, $managerOptions)),
));

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