allow selenium host/port to be specified in env

This commit is contained in:
James 2020-10-08 12:11:02 +01:00
parent 7d3fb69463
commit 374ddd1560

View File

@ -9,8 +9,14 @@ namespace JHodges\PHPUnitBase;
abstract class BrowserTest extends \PHPUnit_Extensions_Selenium2TestCase{
public function setUp(){
$this->setHost('localhost');
$this->setPort(4444);
if(! $host=getenv('SeleniumHost')){
$host='localhost';
}
if(! $port=getenv('SeleniumPort')){
$port='4444';
}
$this->setHost($host);
$this->setPort($port);
$args=explode(' ',getenv('SeleniumBrowserArgsVal'));
$args[]='screenshot';
$this->setDesiredCapabilities([getenv('SeleniumBrowserArgsKey')=>['args'=>$args]]);