You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Install chrome driver (and chrome if you havent already)
./application dusk:chrome-driver
Add code to command and call command:
publicfunctionhandle(): void
{
$this->browse(function ($browser) {
$browser->visit('https://laravel-zero.com')
->assertSee('Something that makes this fail.');
});
}
This will throw the first exception as noted above.
Change the assertSee method to assertTitle and re run your command, this should now produce an expected ExpectationFailedException exception.
From what I can tell, the first seems to be caused by the lack of some php unit configuration/initialization process. It's unclear what I have to add to my laravel zero application for the the assertion exception type to be correct here. Im uncertain what all assertion methods are affected as well, it seems some work as expected and others dont. The first exception is not ideal for error handling within my application.
The text was updated successfully, but these errors were encountered:
surgiie
changed the title
Failed assertions dont always throw PHPUnit\Framework\ExpectationFailedException
Failed assertion methods dont throw PHPUnit\Framework\ExpectationFailedException
Nov 3, 2024
Certain assertions/browser action methods throw the following error when they fail:
While others throw a more expected exception type:
Reproduction
This will throw the first exception as noted above.
assertSee
method toassertTitle
and re run your command, this should now produce an expectedExpectationFailedException
exception.From what I can tell, the first seems to be caused by the lack of some php unit configuration/initialization process. It's unclear what I have to add to my laravel zero application for the the assertion exception type to be correct here. Im uncertain what all assertion methods are affected as well, it seems some work as expected and others dont. The first exception is not ideal for error handling within my application.
The text was updated successfully, but these errors were encountered: