Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/Pages/UserList.php
<?php | <?php | ||||
namespace Tests\Browser\Pages; | namespace Tests\Browser\Pages; | ||||
use Laravel\Dusk\Browser; | |||||
use Laravel\Dusk\Page; | use Laravel\Dusk\Page; | ||||
class UserList extends Page | class UserList extends Page | ||||
{ | { | ||||
/** | /** | ||||
* Get the URL for the page. | * Get the URL for the page. | ||||
* | * | ||||
* @return string | * @return string | ||||
*/ | */ | ||||
public function url(): string | public function url(): string | ||||
{ | { | ||||
return '/users'; | return '/users'; | ||||
} | } | ||||
/** | /** | ||||
* Assert that the browser is on the page. | * Assert that the browser is on the page. | ||||
* | * | ||||
* @param \Laravel\Dusk\Browser $browser | * @param \Laravel\Dusk\Browser $browser The browser object | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function assert(Browser $browser) | public function assert($browser) | ||||
{ | { | ||||
$browser->assertPathIs($this->url()) | $browser->assertPathIs($this->url()) | ||||
->waitUntilMissing('@app .app-loader') | ->waitUntilMissing('@app .app-loader') | ||||
->assertSeeIn('#user-list .card-title', 'User Accounts'); | ->assertSeeIn('#user-list .card-title', 'User Accounts'); | ||||
} | } | ||||
/** | /** | ||||
* Get the element shortcuts for the page. | * Get the element shortcuts for the page. | ||||
Show All 11 Lines |