laravel / dusk

Laravel Dusk provides simple end-to-end testing and browser automation.
https://laravel.com/docs/dusk
MIT License
1.87k stars 320 forks source link

Chromedriver 127 renames wrong file on install #1109

Closed underdpt closed 1 month ago

underdpt commented 1 month ago

Dusk Version

8.2.1

Laravel Version

*

PHP Version

*

PHPUnit Version

NA

Database Driver & Version

No response

Description

When installing new version of chromedriver (127) instead of copying the executable file to the bin folder, a new file in the chromedriver zip download (THIRD_PARTY_NOTICES.chromedriver) is copied, so dusk becomes unusable.

The issue is on ChromeDriverCommand around line 228:

        $binary = $zip->getNameIndex(version_compare($version, '115.0', '<') ? 0 : 1);

It seems a new index should be used when version is > 127 or maybe find a more robust way to get the file to copy (maybe having an array with os => executable file?)

Steps To Reproduce

php artisan dusk:chrome-driver php artisan dusk

It throws an error like

dev.ERROR: Invalid path to Chromedriver [D:\desarrollos\enertrade.es\api.enertrade.es\vendor\laravel\dusk\src\Chrome/../../bin\chromedriver-win.exe]. Make sure to i
nstall the Chromedriver first by running the dusk:chrome-driver command.
damonbakker commented 1 month ago

I am having the same issue since today, testing pipelines suddenly started failing. I have to temporarily added an extra step to use an older version of the chromedriver until we have a permanent fix.

- php artisan dusk:install
- php artisan dusk:chrome-driver 126