-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
83 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace duncan3dc\Laravel\Drivers; | ||
|
||
use Symfony\Component\Process\Process; | ||
|
||
class ChromeProcess extends \Laravel\Dusk\Chrome\ChromeProcess | ||
{ | ||
/** | ||
* The port to run the Chromedriver on. | ||
* | ||
* @var int | ||
*/ | ||
private $port; | ||
|
||
/** | ||
* Create a new instance. | ||
* | ||
* @param int $port The port to run on | ||
*/ | ||
public function __construct(int $port = null) | ||
{ | ||
parent::__construct(); | ||
$this->port = $port ?: 9515; | ||
} | ||
|
||
|
||
/** | ||
* Build the Chromedriver with Symfony Process. | ||
* | ||
* @return Process | ||
*/ | ||
protected function process() | ||
{ | ||
return (new Process( | ||
[realpath($this->driver), " --port={$this->port}"], null, $this->chromeEnvironment() | ||
)); | ||
} | ||
} |