staudenmeir / dusk-updater Goto Github PK
View Code? Open in Web Editor NEWUpdater for Laravel Dusk ChromeDriver binaries
License: MIT License
Updater for Laravel Dusk ChromeDriver binaries
License: MIT License
Hi, im using laravel/homestead
but when running test it return
Facebook\WebDriver\Exception\UnknownErrorException : unknown error: net::ERR_NAME_NOT_RESOLVED
(Session info: headless chrome=94.0.4606.61)
Thank you
We've been using this updater now for a few months and has been great! This morning, we've ran into this issue where it is not finding a notes file on googleapis.com. Below is the stack trace:
[2018-05-30 14:11:03] testing.ERROR: ErrorException: file_get_contents(https://chromedriver.storage.googleapis.com/2.39/notes.txt): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found
in /home/rof/src/github.com/rootinc/continuum/vendor/staudenmeir/dusk-updater/src/UpdateCommand.php:177
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'file_get_conten...', '/home/rof/src/g...', 177, Array)
#1 /home/rof/src/github.com/rootinc/continuum/vendor/staudenmeir/dusk-updater/src/UpdateCommand.php(177): file_get_contents('https://chromed...')
#2 /home/rof/src/github.com/rootinc/continuum/vendor/staudenmeir/dusk-updater/src/UpdateCommand.php(73): Staudenmeir\DuskUpdater\UpdateCommand->versions('2.39')
#3 [internal function]: Staudenmeir\DuskUpdater\UpdateCommand->handle()
#4 /home/rof/src/github.com/rootinc/continuum/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array)
#5 /home/rof/src/github.com/rootinc/continuum/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#6 /home/rof/src/github.com/rootinc/continuum/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#7 /home/rof/src/github.com/rootinc/continuum/vendor/laravel/framework/src/Illuminate/Container/Container.php(539): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#8 /home/rof/src/github.com/rootinc/continuum/vendor/laravel/framework/src/Illuminate/Console/Command.php(182): Illuminate\Container\Container->call(Array)
#9 /home/rof/src/github.com/rootinc/continuum/vendor/symfony/console/Command/Command.php(251): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#10 /home/rof/src/github.com/rootinc/continuum/vendor/laravel/framework/src/Illuminate/Console/Command.php(167): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#11 /home/rof/src/github.com/rootinc/continuum/vendor/symfony/console/Application.php(946): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /home/rof/src/github.com/rootinc/continuum/vendor/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(Staudenmeir\DuskUpdater\UpdateCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /home/rof/src/github.com/rootinc/continuum/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /home/rof/src/github.com/rootinc/continuum/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /home/rof/src/github.com/rootinc/continuum/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 {main}
Any help on this would be great!
I don't believe this is an issue with your package but maybe you can help.
I am using your package to get the latest chrome drivers but every-time I run php artisan dusk
I get this Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session with params: {"desiredCapabilities":{"browserName":"chrome","platform":"ANY","chromeOptions":{"binary":"","args":["--disable-gpu","--headless"]}}}
If I manually download and run the chrome exe then it works. Any thoughts on how to fix this?
This tool is a great idea; thank you for writing it.
Even after running your command, I'm getting:
Facebook\WebDriver\Exception\SessionNotCreatedException: session not created: Chrome version must be between 71 and 75
(Driver info: chromedriver=2.46.628388 (4a34a70827ac54148e092aafb70504c4ea7ae926),platform=Linux 4.4.0-116-generic x86_64)
So I searched through this repo's issues and found #5, which led me to see at https://github.com/staudenmeir/dusk-updater that you'd said "If Dusk is still using the previous version after the update, there is probably an old ChromeDriver process running."
I suggest moving that to an earlier and more prominent step (and clarify what you're saying to do) since almost always people will need to consider that.
I tried pkill chrome
and pkill Xvfb
, but neither helped.
I also tried exiting out of the Vagrant SSH and then running homestead.bat reload --provision
before SSHing back in, but I still get the same error.
Any ideas?
Thanks so much!
Hello there,
I seem to have a problem when updating the driver. I run php artisan:dusk update
and it tells me that it's updated, but when I run --detect
the old version still persists`.
And the version I'm running:
"name": "staudenmeir/dusk-updater",
"version": "v1.1.3",
"source": {
"type": "git",
"url": "https://github.com/staudenmeir/dusk-updater.git",
"reference": "f3450cb8dbb9fdbc1a1aee144c666a44983394c2"
},
The regex extracting the latest version is failing with a nasty exception when I run dusk:update
.
Exception: ErrorException: Undefined offset: 1 in
vendor/staudenmeir/dusk-updater/src/UpdateCommand.php:174
preg_match('/Latest stable release:.*?\?path=([\d.]+)/', $home, $matches);
Looking at the page it appears there's now SPAN tag wrapping a portion of the text which is preventing the match.
<span style="background-color:transparent">Latest stable </span>release: <a href="https://chromedriver.storage.googleapis.com/index.html?path=77.0.3865.40/"
It's been 9 months since someone tried to PR this into Dusk core, and I think Taylor may have been originally spooked a bit by the concerns you rose.
Would you be willing to try again to add the to the core Dusk repo, as I think it would be of considerable use to all Dusk users?
Hello! When trying to install this package via composer, I get the error "curl error 60 while downloading https://larapack.io/packages.json: SSL certificate problem: certificate has expired"
After looking into it, it's definitely a larapack.io issue. And after going through the history of the github for larapack.io, it definitely seems like the project has been abandoned.
Would you consider switching away from larapack?
Thanks!
The current error I'm receiving seems to indicate a need to update chromedriver, which is why I was happy to have found this package but ran into the issue below..
Code below shows the following:
art
is my shortcut for php artisan
if that wasn't clear).dusk-updater
art dusk:update
successfully (shows it updated to 2.45)Result: It seems that the chromedriver used in the test is not actually being updated. Or perhaps somehow I'm referencing a different chromedriver somehow, although this is a pretty bland setup, so not by explicit choice.
I've included this process below and my composer.json
also.
~/Sites/contract-lodge feature/task-66-new ● art dusk --env=testing --filter=testRaceCanBeCreated
PHPUnit 7.5.1 by Sebastian Bergmann and contributors.
E 1 / 1 (100%)
Time: 4.46 seconds, Memory: 24.00MB
There was 1 error:
1) Tests\Browser\RaceCreateTest::testRaceCanBeCreated
Facebook\WebDriver\Exception\UnknownServerException: unknown error: call function result missing 'value'
(Session info: headless chrome=71.0.3578.98)
(Driver info: chromedriver=2.34.522932 (4140ab217e1ca1bec0c4b4d1b148f3361eb3a03e),platform=Mac OS X 10.14.2 x86_64)
/Users/nateritter/Sites/contract-lodge/vendor/facebook/webdriver/lib/Exception/WebDriverException.php:114
/Users/nateritter/Sites/contract-lodge/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:326
/Users/nateritter/Sites/contract-lodge/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:547
/Users/nateritter/Sites/contract-lodge/vendor/facebook/webdriver/lib/Remote/RemoteExecuteMethod.php:40
/Users/nateritter/Sites/contract-lodge/vendor/facebook/webdriver/lib/Remote/RemoteWebElement.php:66
/Users/nateritter/Sites/contract-lodge/vendor/laravel/dusk/src/Concerns/InteractsWithElements.php:142
/Users/nateritter/Sites/contract-lodge/tests/Browser/RaceCreateTest.php:37
/Users/nateritter/Sites/contract-lodge/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:67
/Users/nateritter/Sites/contract-lodge/tests/Browser/RaceCreateTest.php:46
ERRORS!
Tests: 1, Assertions: 2, Errors: 1.
✘ ~/Sites/contract-lodge feature/task-66-new ● composer require --dev staudenmeir/dusk-updater
Using version ^1.0 for staudenmeir/dusk-updater
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Installing staudenmeir/dusk-updater (v1.0.2): Downloading (100%)
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: beyondcode/laravel-dump-server
Discovered Package: fideloper/proxy
Discovered Package: industrious/hellosign-laravel
Discovered Package: intervention/image
Discovered Package: laracasts/flash
Discovered Package: laravel/cashier
Discovered Package: laravel/dusk
Discovered Package: laravel/tinker
Discovered Package: mathieutu/laravel-pdflayer
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Discovered Package: staudenmeir/dusk-updater
Package manifest generated successfully.
~/Sites/contract-lodge feature/task-66-new ● art dusk:update
ChromeDriver binaries successfully updated to version 2.45 (Chrome v70-72).
~/Sites/contract-lodge feature/task-66-new ● art dusk --env=testing --filter=testRaceCanBeCreated
PHPUnit 7.5.1 by Sebastian Bergmann and contributors.
E 1 / 1 (100%)
Time: 4.82 seconds, Memory: 24.00MB
There was 1 error:
1) Tests\Browser\RaceCreateTest::testRaceCanBeCreated
Facebook\WebDriver\Exception\UnknownServerException: unknown error: call function result missing 'value'
(Session info: headless chrome=71.0.3578.98)
(Driver info: chromedriver=2.34.522932 (4140ab217e1ca1bec0c4b4d1b148f3361eb3a03e),platform=Mac OS X 10.14.2 x86_64)
/Users/nateritter/Sites/contract-lodge/vendor/facebook/webdriver/lib/Exception/WebDriverException.php:114
/Users/nateritter/Sites/contract-lodge/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:326
/Users/nateritter/Sites/contract-lodge/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:547
/Users/nateritter/Sites/contract-lodge/vendor/facebook/webdriver/lib/Remote/RemoteExecuteMethod.php:40
/Users/nateritter/Sites/contract-lodge/vendor/facebook/webdriver/lib/Remote/RemoteWebElement.php:66
/Users/nateritter/Sites/contract-lodge/vendor/laravel/dusk/src/Concerns/InteractsWithElements.php:142
/Users/nateritter/Sites/contract-lodge/tests/Browser/RaceCreateTest.php:37
/Users/nateritter/Sites/contract-lodge/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:67
/Users/nateritter/Sites/contract-lodge/tests/Browser/RaceCreateTest.php:46
ERRORS!
Tests: 1, Assertions: 2, Errors: 1.
composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"type": "project",
"require": {
"php": "^7.1.3",
"doctrine/dbal": "^2.9",
"fideloper/proxy": "^4.0",
"h4cc/wkhtmltopdf-amd64": "^0.12.4",
"h4cc/wkhtmltopdf-i386": "^0.12.4",
"industrious/hellosign-laravel": "dev-master",
"laracasts/flash": "^3.0",
"laravel/cashier": "~7.0",
"laravel/framework": "5.7.13",
"laravel/spark-aurelius": "*@dev",
"laravel/tinker": "^1.0",
"mathieutu/laravel-pdflayer": "^2.0"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"laravel/dusk": "^4.0",
"laravel/telescope": "^1.0",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0",
"staudenmeir/dusk-updater": "^1.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
},
"files": [
"app/Support/helpers.php"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
"laravel/telescope"
]
}
},
"scripts": {
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true,
"repositories": [
{
"type": "path",
"url": "./spark"
}
]
}
In my local environment, php artisan dusk fails because of chrome driver.
I have installed google chrome and it's driver recently. I have run dusk update with following command,
php artisan dusk:update
It's updating the driver and this is console output:
ChromeDriver binaries successfully updated to version 88.0.4324.96.
Now, when I run the detect command, it shows following error:
Chrome version could not be detected. Please submit an issue: https://github.com/staudenmeir/dusk-updater
php artisan dusk
is failing even after php artisan dusk:update
I am using v1.1.3.
php artisan dusk:update --detect
Chrome version 76.0.3809.87 detected.
When I try to "php artisan dusk:update 76.0.3809.87", it has errors as following:
ErrorException : fopen(https://chromedriver.storage.googleapis.com/76.0.3809.87/chromedriver_linux64.zip): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found
at /vendor/staudenmeir/dusk-updater/src/UpdateCommand.php:248
244| $archive = $this->directory.'chromedriver.zip';
245|
246| $url = sprintf(static::$downloadUrl, $version, $slug);
247|
248| file_put_contents($archive, fopen($url, 'r'));
249|
250| return $archive;
251| }
252|
Exception trace:
1 fopen("https://chromedriver.storage.googleapis.com/76.0.3809.87/chromedriver_linux64.zip", "r")
/vendor/staudenmeir/dusk-updater/src/UpdateCommand.php:248
2 Staudenmeir\DuskUpdater\UpdateCommand::download("76.0.3809.87", "linux64")
/vendor/staudenmeir/dusk-updater/src/UpdateCommand.php:227
Please use the argument -v to see more details.
This error show up when I try to update dusk (running the command php artisan dusk:update):
rename(/home/vagrant/code/vendor/staudenmeir/dusk-updater/src/../../../laravel/dusk/bin/chromedriver,/home/vagrant/code/vendor/staudenmeir/dusk-updater/src/../../../laravel/dusk/bin/chromedriver-linux): Operation not permitted
The latest version of ChromeDriver supports Chrome 74 but when I run the command php artisan dusk:update 74
(or without the version) it informs that the installed version is v71-73 compatible.
ChromeDriver binaries successfully updated to version 2.46 (Chrome v71-73)
Since the release of Chrome 115, Dusk Updater no longer works.
See laravel/dusk#1043 and laravel/dusk#1045 for recent changes to Dusk.
For info, I'm stuck on an old version of Laravel Dusk which is why I need Dusk Updater.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.