make desired cap's env as json
This commit is contained in:
parent
36e74f63b6
commit
de0eb1dceb
@ -15,11 +15,15 @@ abstract class BrowserTest extends \PHPUnit_Extensions_Selenium2TestCase{
|
|||||||
if(! $port=(int)getenv('SeleniumPort')){
|
if(! $port=(int)getenv('SeleniumPort')){
|
||||||
$port=4444;
|
$port=4444;
|
||||||
}
|
}
|
||||||
|
if($dcj=getenv('SeleniumDesiredCapabilities')){
|
||||||
|
$dc=json_decode($dcj,true);
|
||||||
|
if($dc===null){
|
||||||
|
throw new \Exception("Invalid JSON: $dcj");
|
||||||
|
}
|
||||||
|
$this->setDesiredCapabilities($dc);
|
||||||
|
}
|
||||||
$this->setHost($host);
|
$this->setHost($host);
|
||||||
$this->setPort($port);
|
$this->setPort($port);
|
||||||
$args=explode(' ',getenv('SeleniumBrowserArgsVal'));
|
|
||||||
$args[]='screenshot';
|
|
||||||
$this->setDesiredCapabilities([getenv('SeleniumBrowserArgsKey')=>['args'=>$args]]);
|
|
||||||
if($url=getenv('SeleniumBrowserUrl')){
|
if($url=getenv('SeleniumBrowserUrl')){
|
||||||
$this->setBrowserUrl($url);
|
$this->setBrowserUrl($url);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user