Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Matt Stauffer:
Introducing Laravel Dusk (new in Laravel 5.4)
Feb 06, 2017 @ 09:46:06

Kicking off his series of posts looking at the new features that come along with the v5.4 release of the Laravel Framework Matt Stauffer has posted a look at Dusk, a tool that makes it simpler to test your Laravel based applications.

If you follow anyone in the Laravel world on Twitter, or if you listen to the Laravel Podcast, you know by now that Laravel Dusk is the new face of application testing in the Laravel world.

[...] With Dusk, Taylor has completely re-written how application testing works in Laravel. Everything is now based on a tool called ChromeDriver, which is a standalone server that actually controls Chrome/Chromium. When you write application tests, Dusk sends your commands to ChromeDriver, which then spins up Chrome to run your tests in the browser and then reports back the results.

He starts with a brief look at how testing was being performed in most cases on Laravel applications (using the "Integrated" package) but pointed out that that only really worked for non-Javascript driven sites. With the introduction of Dusk and it's use of the ChromeDriver to make "browsing" in the test simpler. He includes the installation process of the latest version of Dusk and an example test checking to be sure the string "Laravel" is in a page. He includes a gif of the test in action and talks about some of the new interactions and assertions included in the tool. He wraps up the post looking at the use of Pages and a few other miscellaneous tips to help you get your testing up and working productively.

tagged: laravel framework testing dusk introduction tutorial interactions pages

Link: https://mattstauffer.co/blog/introducing-laravel-dusk-new-in-laravel-5-4