Answer the question
In order to leave comments, you need to log in
Laravel Dusk: how to check button lock after form submit?
Question about Laravel Dusk. I read the documentation, googled, searched on StackOverflow until I could find a solution, maybe you have come across.
There is a form, there is a Submit button. I wrote a little JavaScript that, when clicked, blocks the Submit button so that the user doesn't accidentally click twice. The form is sent by a regular post request, the page is reloaded, the user gets some result.
I want to write a test that when the button is clicked, it is really blocked. Work for Laravel Dusk?
I am writing a test:
$this->browse(function (Browser $browser) {
$browser->visit('/')
->click('@my-button')
->assertButtonDisabled('@my-button');
}
<form onsubmit="return false">
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question