Laravel Dusk: painless browser automation

preview_player
Показать описание
In this video, we dive into Laravel Dusk, a powerful, first-party tool for browser automation and testing within Laravel applications. You'll learn how to install Dusk, generate tests, and explore advanced features like interacting with multiple browsers simultaneously, making it easier to ensure your entire application functions smoothly.

Follow Aaron:

Featured in this episode:

Chapters
00:00 What is Laravel Dusk?
01:00 Set Up Laravel Dusk
02:20 Review Default Test
03:18 Turn Off Headless Browser
04:50 Create Own Test
13:08 Clean Up Code with Macros
14:41 Finish Writing Test
16:34 Two Browser Test
19:04 Other Use Cases for Dusk
Рекомендации по теме
Комментарии
Автор

Laravel's ecosystem is so damn good!

logsnroll
Автор

Dusk is so powerful, and it is not just for testing. I remember using it back in the days during uni to automatically sign up for classes 😅

CookingCoding
Автор

Omg! Aaron keep up reviewing all laravel packages, I will try dusk right now

wevertonlotosport
Автор

Hello Aaron.

I would agree with you and others that Laravel ecosystem is super cool and powerful. Thanks for the informative video. One thing to notice though, the dusk is not built for someone actually stating at the screen while validating stuff etc, but rather take a big hit on the automation part while using the GUI and markup to identify required components of the page to be or not presented at a certain point.

Having that said, you would like to have the fastest testing possible so the typeSlowly to me is just for the coders to view the process of their tests being executed at the time of development, but we should not forget to remove any slowdown parts to make sure the tests runs as quickly and lightly as possible.

Btw, great video and thanks for the Laravel Ecosystems serie touching the entire "family". I myself will have to watch or revisit some of the members as we code and develop based on the project needs so sometimes staying away for a while requires you to get back on track by RTFM :)

milenkostadinov
Автор

what a timing on the video!! I am planning on integrating the Dusk into one of my open source projects today.

vijaysmarthome
Автор

18:38 this multiple browser thing would be good solution for testing real time messaging like things... I really loved it!

skygnd
Автор

You’re making everything look so damn easy I really love your videos. Also a real life example of everything that amazing ❤

khaledwaleed
Автор

I have been using an sharing info on Laravel dusk for many years now. Nothing better than Dusk to test a Laravel monolith.

easyfullstack
Автор

Very cool example at the end. Thank you for going the extra mile to keep everyone engaged and pumped! 🚀

FarazSamapoor
Автор

Quite good integration. Laravel really is a great framework with a ton of useful things.

Strammeiche
Автор

This channel lately has made me want to play around with Laravel.... even though I haven't done web dev in like 5 years..

ronoudgenoeg
Автор

Thanks, love this. I knew and wanted to play with Dusk, but never got to it. Thanks for exploring and showing various Laravel stuff to/for us.

ivanjelenic
Автор

You are the new Jeffrey way!
That guy made a programmer and changed my life.
I love this. Always wanted to learn this. Can you teach us golang now? 😂

Автор

"when some product guy comes along... ...because that's how real users work"
That's savage and I'm here for it.

SuperHighFiveGuy
Автор

11:30 since I'm coming from the JS ecosystem, I only wish that getting elements on the page had more "accessible" selectors. I personally like how react-testing-library and Playwright promote using more accessible selectors such as labels or placeholder text. That's how real users see fields and I think it's a really good approach to also test that your UI is accessible as well as asserting whatever you want.

Of course there are times when you have to reach for data-* attribute selectors (or something else), but most of the time if you see that you have to use a weird selector to target an element, it's actively discouraged and can tell you that your UI isn't accessible and you can act on it and address it.

Other than that I guess Dusk's strength is its super tight integration with Laravel. No other tool can match that.

randmtv
Автор

clean, simple, rich information => thanks

ALiHameedAlHashemi
Автор

When I joined my last project, there were no tests. By chance, I came across Laravel Dusk at some point and we experimented with it a little and were thrilled. But then we ran into major problems that cost us a lot of time. The Chrome browser on our Windows development computers was automatically updated. As a result, we received an error message when running the tests that the version of the ChromeDriver did not match the version of the locally installed Chrome browser. So we always had to wait until there was a new, matching version. The customer didn't like this at all and stopped the implementation of the tests completely. Unfortunately, we were unable to find a solution to this problem.

TobiasRohde
Автор

Hey Aaron, this is really cool. Newbie question: at the end when you test the Reverb website, does that mean that I could, for example, build some kind of test application to test WordPress sites, for example, that are completely separate from the Laravel application that houses the Dusk test suite I'm running?

knightofrohan
Автор

Laughing while learning something new to me. haha thanks man

jnjmedia
Автор

Do we have tool or cli command for writing dusk test automatically? playwright and cypress do it well, you just have to do operations on page and it will write code for you automatically.

vuenice