Questions tagged [laravel-dusk]

Laravel Dusk provides an expressive, easy-to-use browser automation and testing API. By default, Dusk does not require you to install JDK or Selenium on your machine. Instead, Dusk uses a standalone ChromeDriver installation. However, you are free to utilize any other Selenium compatible driver you wish.

477 questions
22
votes
8 answers

Laravel Dusk, how to destroy session data between tests

I am getting started using Laravel Dusk for browser testing, and have created a couple of tests to test my login form. I have the following code: class LoginTest extends DuskTestCase { public function testLogin() { $this->browse(function…
Inigo
  • 8,110
  • 18
  • 62
  • 110
18
votes
1 answer

How to reuse a Dusk test browser instance?

My project on the Laravel 5.4 framework and I am using Dusk for browser tests. I have a page that has several sections I'd like to test independently, however I'm running into the problem where I have to start a new browser instance, login, and…
amflare
  • 4,020
  • 3
  • 25
  • 44
15
votes
2 answers

Get Laravel Dusk to Run Properly on Ubuntu 16 wt Laravel 5.5

I've been trying to integrate Laravel Dusk into my testing scheme for a week and can't get any test to actually deliver expected results. Here's the situation: I'm running Laravel 55 on Homestead (per Project install) with php 7.1.* I installed…
Chukky Nze
  • 720
  • 3
  • 13
15
votes
3 answers

Laravel 5.4; How to run unit tests from a Laravel package?

I am trying to develop a Laravel composer package and run unit tests from within it. After spending the last couple of days reading various outdated and contradictory guides and blogposts, I am completely confused as to how to go about this. Here's…
Inigo
  • 8,110
  • 18
  • 62
  • 110
14
votes
4 answers

Laravel Dusk how to show the browser while executing tests

I am writing some tests and I want to see whether Dusk correctly fills in the input fields but Dusk doesn't show the browser while running the tests, is there any way to force it to do that?
Petar Vasilev
  • 4,281
  • 5
  • 40
  • 74
14
votes
2 answers

Code coverage for laravel dusk

Is there any way to get code coverage when running Laravel Dusk? I know it runs browser tests so it's not scrutinizing code, but is there a way to add a listener to check what code is covered? I did not see anything on this subject now.
rap-2-h
  • 30,204
  • 37
  • 167
  • 263
13
votes
6 answers

How to scroll down browser page - Laravel Dusk (Browser Tests)

I'm preparing tests using [Browser Tests (Laravel Dusk)][1] [1]: https://laravel.com/docs/5.4/dusk and I need force click to element which is not see before scroll down browser page. How can define in dusk test to click unsee element or scroll…
Tomasz
  • 1,368
  • 3
  • 17
  • 31
12
votes
1 answer

testing a new window with laravel dusk

I have this page that, when a particular button is clicked, a new window pops up (eg. an anchor tag with _target = blank). I want to verify that a string of text appears in this new window but, with Laravel Dusk, assertSee appears to be testing the…
neubert
  • 15,947
  • 24
  • 120
  • 212
12
votes
1 answer

Laravel dusk not working .env.dusk.local

I have an application and I want to use Laravel Dusk. I created a file named .env.dusk.local with a database for tests and a file named .env with my default database. I ran the php artisan command and created a user by /register. After I created a…
Lucas Lopes
  • 1,373
  • 3
  • 14
  • 23
11
votes
4 answers

Error on Laravel Dusk Facebook\WebDriver\Exception\SessionNotCreatedException: session not created: Chrome version must be between 70 and 73

Error when trying to run php artisan dusk. A Chrome version error happened. I Google the error and took a quick look in a couple of websites including Laracasts and the Dusk Github issues.
Eduardo Cruz
  • 617
  • 6
  • 18
11
votes
3 answers

Is there a way to assert current URL value in Laravel Dusk?

I'm testing a web application with subdomain routing with Laravel Dusk. I have some redirection between subdomain, if some kind of verification is invalid. So, my goal is to visit an URL $a then assert that I was redirected and the new URL is $b. I…
rap-2-h
  • 30,204
  • 37
  • 167
  • 263
10
votes
3 answers

Options for recording the tasks done in a browser for UI Automation Test

Is there a tool that can record user interactions with DOM elements for usage in creating automated tests (I'm using Codeception and Laravel Dusk but any tool with roots in Selenium is fine). I'm looking for something to record a sequence and get…
artlung
  • 33,305
  • 16
  • 69
  • 121
10
votes
4 answers

How to solve Exception It is unsafe to run Dusk in production in laravel 5.5?

I upgrated my project from laravel 5.4 to laravel 5.5 , I dont have any problem in local env but in server i get this exception , I searched a lot and i know this issue may be duplicated but no solutions solved my problem! How can i not registering…
Samira kalantari
  • 320
  • 1
  • 2
  • 16
10
votes
2 answers

Laravel Dusk NoSuchElementException / Unable to locate element

I'm trying to run some basic Laravel Dusk Tests but always running into problems with the Facebook WebDriver: I already updated chrome to the latest version and manually updated the Chrome WebDriver with Hombrew: Any suggestions? Cheers,…
Stan Barrows
  • 873
  • 1
  • 12
  • 27
10
votes
3 answers

How to click link icon with laravel dusk?

If I have a link: Click Me I know I can clickLink based on its text. public function testCanClickLink() { $this->browse(function ($browser) { $browser->visit('/welcome') ->clickLink('Click Me'); …
Jeff Puckett
  • 37,464
  • 17
  • 118
  • 167
1
2 3
31 32