thinsoldier's avatar

Is it possible to use Laravel Dusk to test a non Laravel site?

I have some legacy projects that I want to first upgrade to PHP 7 and then much later convert one or two of them to Laravel. Most of them are not using OOP code so browser based testing seems like a faster and easier way to test them and Laravel Dusk seems like the fastest and easiest way to do browser based testing.

0 likes
4 replies
bobbybouwmann's avatar
Level 88

Yeah you can use Laravel Dusk on other websites, however you have to run Laravel Dusk as a separate project. You can't run it inside another application, because it depends on the core of Laravel.

However you can simply just fetch another url on the internet and do your tests. Laravel Dusk will just fetch the url and it's content and handle that.

Here is a funny example with Laravel Dusk: https://laravel-news.com/automatically-making-monthly-payments-with-dusk

So you have a lot of options here! Let me know if that works for you!

6 likes
Ironmax's avatar

@bobbybouwmann Thanks man this is literally what I have been looking for, for the past 5 hours. This completely solves everything.

Please or to participate in this conversation.