Questions tagged laravel-dusk

Explore the latest questions and answers asked by our top developers.

Laravel Dusk Test passes when ran individually but fails when ran as part of a suite

I am trying two run two tests on a single Test Class in Laravel dusk. It passes when ran individually but fails when ran as part of a suite. Here, my first test passes, but second test is failing. Exception looks like: There was 1 error: 1) TestsBrowserFrontJobApplyTest::jobseeker_can_apply_to_a_job IlluminateContractsContainerBindingResolutionException: Target class [env] does not exist. […]

By Bedram Tamang
Published
Categorised as laravel, laravel-dusk Tagged ,

Laravel testing url to resource in public directory

I’m using Laravel Dusk to test all links on a page, these links are PDF files that are that are copied from resources/docs to public/docs with laravel mix. The problem is that trying to access the URL of the docs using get(uri) method gives a 404, here is a simplified version of my Dusk: protected […]

Laravel dusk in vagrant timing out

I’m using a vagrant box (not homestead) to host our laravel project. I’m trying to use Laravel Dusk to do some automated browser testing using the chromium browser but it isn’t working right. When I run php artisan dusk the command just hangs for a while and eventually dies with this output: There was 1 […]

By joshua jackson
Published
Categorised as chromium, laravel, laravel-dusk, vagrant Tagged , , ,

Managing browser permissions with Laravel Dusk

Total Laravel Dusk noob here (started using it today). I wanted to test a "copy link" on the Web app I’m working on and I ran into browser permissions issues when trying to access the clipboard content while testing. Of course, that default behavior makes sense, because Google Chrome prompts the user and ask for […]

By Jacob P
Published
Categorised as javascript, laravel, laravel-dusk, php, testing Tagged , , , ,

clickAtXPath not working in laravel(5.8) Dusk

Dusk Error Dusk is throwing this error while using clickAtXPath BadMethodCallException: Call to undefined method [clickAtXPath]. Source: Laravel

By Sid Shams
Published
Categorised as laravel, laravel-dusk, laravel-dusk2, php Tagged , , ,

Command "dusk:chrome-driver" is not defined

While trying to install ChromeDriver Dusk shows this error Command "dusk:chrome-driver" is not defined. Did you mean one of these? dusk dusk:component dusk:fails dusk:install dusk:make dusk:page Error while running test: FacebookWebDriverExceptionSessionNotCreatedException: session not created: Chrome version must be between 70 and 73 Source: Laravel

By sidrah
Published
Categorised as google-chrome, laravel, laravel-dusk, php Tagged , , ,

Got unknown error: net::ERR_CONNECTION_REFUSED with laravel dusk in docker

I’m trying to implement browser testing with Laravel Dusk in docker environment. But when I run command php artisan dusk to testing (in my php container) it display this error for all my tests case: 1) TestsBrowserExampleTest::testBasicExample FacebookWebDriverExceptionUnknownErrorException: unknown error: net::ERR_CONNECTION_REFUSED (Session info: headless chrome=96.0.4664.45) /var/www/vendor/php-webdriver/webdriver/lib/Exception/WebDriverException.php:139 /var/www/vendor/php-webdriver/webdriver/lib/Remote/HttpCommandExecutor.php:372 /var/www/vendor/php-webdriver/webdriver/lib/Remote/RemoteWebDriver.php:585 /var/www/vendor/php-webdriver/webdriver/lib/Remote/RemoteExecuteMethod.php:27 /var/www/vendor/php-webdriver/webdriver/lib/WebDriverNavigation.php:41 /var/www/vendor/laravel/dusk/src/Browser.php:153 /var/www/tests/Browser/ExampleTest.php:19 /var/www/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:69 /var/www/tests/Browser/ExampleTest.php:21 Here […]

By simpsons3
Published
Categorised as docker, laravel, laravel-dusk Tagged , ,

Stripe iframe not accessible within Dusk component

I have no problem accessing and filling in the form at the test level: This works: public function user_can_subscribe() { $this->browse(function (Browser $browser) { $browser->visit(new SubscribePage) ->waitFor(‘.__PrivateStripeElement iframe’) ->withinFrame(‘.__PrivateStripeElement iframe’, function($browser) { $browser->pause(3000) ->keys(‘input[placeholder="Card number"]’, 4242424242424242) ->keys(‘input[placeholder="MM / YY"]’, ‘0125’) ->keys(‘input[placeholder="CVC"]’, ‘123’) ->keys(‘input[placeholder="ZIP"]’, ‘12345’);; }) ->press(‘@subscribe-button’); }); } I’d like to move the stripe form […]

By goddas
Published
Categorised as laravel, laravel-dusk, stripe-payments Tagged , ,

How can I use Laravel Dusk to test many pages at once?

Let’s say I have a database of employees and a profile page for each Employee at /employee-profile/{name}. I want to test the page using Laravel Dusk, but I don’t want to just test it for a random employee – I want to iterate through every employee in my database and test individually: /employee-profile/john /employee-profile/martha /employee-profile/alice […]

By sveti petar
Published
Categorised as laravel, laravel-dusk Tagged ,

Laravel Dusk: how to delete all data between sessions

Between test runs (e.g. individual php artisan dusk commands) the browser is storing that the user from a previous test is still logged in. This just started happening today, when I had to re-install dusk due to a ChromeDriver issue. In my DuskTestCase file I have this, which I believe previously was working: protected function […]

By vue-coder
Published
Categorised as laravel, laravel-dusk Tagged ,
1 2 3 7

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq