Created
June 8, 2022 07:01
-
-
Save firecentaur/1fd4b4822e6ddf6ab6f8654798484c1c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests\Browser; | |
use App\Models\User; | |
use Laravel\Dusk\Browser; | |
use Tests\DuskTestCase; | |
class LoginAsUserTest extends DuskTestCase | |
{ | |
/** | |
* A Dusk test example. | |
* | |
* @return void | |
*/ | |
public function testSeeLoginElements() | |
{ | |
//create a user | |
$this->browse(function (Browser $browser) { | |
$user = User::factory()->create(); | |
$browser->visit('/admin/login')->loginAs($user)->assertAuthenticatedAs($user); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment