Initial commit
This commit is contained in:
54
tests/Browser/Pages/Home.php
Normal file
54
tests/Browser/Pages/Home.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Browser\Pages;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
|
||||
class Home extends Page
|
||||
{
|
||||
/**
|
||||
* Get the URL for the page.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function url()
|
||||
{
|
||||
return '/home';
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert that the browser is on the page.
|
||||
*
|
||||
* @param Browser $browser
|
||||
* @return void
|
||||
*/
|
||||
public function assert(Browser $browser)
|
||||
{
|
||||
$browser->waitForLocation($this->url())->assertPathIs($this->url());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the element shortcuts for the page.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function elements()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Click on the log out link.
|
||||
*
|
||||
* @param \Laravel\Dusk\Browser $browser
|
||||
* @return void
|
||||
*/
|
||||
public function clickLogout($browser)
|
||||
{
|
||||
$browser->click('@nav-dropdown-button')
|
||||
->waitFor('@nav-dropdown')
|
||||
->waitForText('Logout')
|
||||
->clickLink('Logout')
|
||||
->pause(100);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user