opnform/tests/Browser/Pages/Home.php

54 lines
975 B
PHP
Raw Normal View History

2022-09-20 19:59:52 +00:00
<?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.
*
* @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.
*
2024-02-23 10:54:12 +00:00
* @param \Laravel\Dusk\Browser $browser
2022-09-20 19:59:52 +00:00
* @return void
*/
public function clickLogout($browser)
{
$browser->click('@nav-dropdown-button')
->waitFor('@nav-dropdown')
->waitForText('Logout')
->clickLink('Logout')
->pause(100);
}
}