ChromeProcess.php 743 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace Tests;
  3. use Laravel\Dusk\Chrome\ChromeProcess as BaseChromeProcess;
  4. class ChromeProcess extends BaseChromeProcess
  5. {
  6. public function __construct($driver = null)
  7. {
  8. parent::__construct($driver);
  9. if ($this->onWindows()) {
  10. $this->driver = realpath(__DIR__.'/resources/drivers/chromedriver-win.exe');
  11. } elseif ($this->onMac()) {
  12. $this->driver = realpath(__DIR__.'/resources/drivers/chromedriver-mac');
  13. } else {
  14. if (is_file('/usr/bin/google-chrome')) {
  15. $this->driver = '/usr/bin/google-chrome';
  16. } else {
  17. $this->driver = realpath(__DIR__.'/resources/drivers/chromedriver-linux');
  18. }
  19. }
  20. }
  21. }