Understand Laravel Framework TestTools

Testing a Laravel Development application really is an easy task – the “Integrated” package from Jeffrey Way, which later got merged into the core framework is fantastic and helps you with the otherwise cumbersome task of testing and interacting with your application. But still – are you actually using tests?

laravel Development

A lot of times people really love the idea of tests, but simply don’t get to start using them in their own projects. That’s why chrome extension is created, that hopefully saves you some time when you need to test your app.

Using the chrome extension

The chrome extension allows you to “record” your activity on the page you’re currently viewing and translates these activities into Laravels testing syntax.

Take a look at the extension in action.

With just a few clicks, you just magically created an integration test for your registration process.

But wait! There’s more you can do!

If you, for example, want to generate dynamic data within your test, you can do this by using the Laravel TestTools context menu. The menu gives you access to some handy faker methods to generate emails, names or words on the fly.

Limitations of Chrome extension

You can not test your Javascript/VueJS/AngularJS single page application with this. Even though the extension will generate the test code for you it will not work with Laravel. That’s because when Laravel is running these tests it doesn’t have Javascript. What happens, when Javascript runs your tests is that it simulates a GET/POST/whatever request to the specified URL and fetches and parses the resulting HTML DOM. That DOM is then used to modify input fields, search text and submit forms.

Related Posts