Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/Pages/UserProfile.php
- This file was added.
<?php | |||||
namespace Tests\Browser\Pages; | |||||
use Laravel\Dusk\Browser; | |||||
use Laravel\Dusk\Page; | |||||
class UserProfile extends Page | |||||
{ | |||||
/** | |||||
* Get the URL for the page. | |||||
* | |||||
* @return string | |||||
*/ | |||||
public function url(): string | |||||
{ | |||||
return '/profile'; | |||||
} | |||||
/** | |||||
* Assert that the browser is on the page. | |||||
* | |||||
* @param \Laravel\Dusk\Browser $browser | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function assert(Browser $browser) | |||||
{ | |||||
$browser->assertPathIs($this->url()) | |||||
->waitUntilMissing('@app .app-loader') | |||||
->assertSeeIn('#user-profile .card-title', 'Your profile'); | |||||
} | |||||
/** | |||||
* Get the element shortcuts for the page. | |||||
* | |||||
* @return array | |||||
*/ | |||||
public function elements(): array | |||||
{ | |||||
return [ | |||||
'@app' => '#app', | |||||
'@form' => '#user-profile form', | |||||
]; | |||||
} | |||||
} |