How can I perform parallel testing with PHPUnit ?
Hi Miro!
To perform parallel testing with PHPUnit, please refer to the following code snippet.
<?php
require 'lib/globals.php';
require_once('vendor/autoload.php');
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Facebook\WebDriver\WebDriverBy;
use PHPUnit\Framework\Assert;
class LambdaTestParallel extends PHPUnit\Framework\TestCase {
protected static $driver;
public static $status='failed';
public function setupLambdatest($bName, $VName, $osName)
{
$url = ""https://"". $GLOBALS['LT_USERNAME'] ."":"" . $GLOBALS['LT_ACCESS_KEY'] .""@hub.lambdatest.com/wd/hub"";
$capabilities = array(
""build"" => ""Sample PHPUnit Build"",
""name"" => $bName.""-"".$VName.""-"".$osName,
""platform"" => $osName,
""browserName"" => $bName,
""version"" => $VName
);
self::$driver = RemoteWebDriver::create($url, $capabilities);
}
public function additionProvider()
{
return [
['Chrome', 'latest', 'Windows 10'],
['Firefox', 'latest-2', 'Windows 7'],
['Chrome', 'latest-1', 'macOS High Sierra'],
['MicrosoftEdge', 'latest', 'Windows 10'],
];
}
"