Sort of working beta
This commit is contained in:
43
app/Browser/Components/Hellcase/MainNav.php
Normal file
43
app/Browser/Components/Hellcase/MainNav.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Browser\Components\Hellcase;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Laravel\Dusk\Component as BaseComponent;
|
||||
|
||||
class MainNav extends BaseComponent
|
||||
{
|
||||
/**
|
||||
* Get the root selector for the component.
|
||||
*/
|
||||
public function selector(): string
|
||||
{
|
||||
return 'header.header';
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert that the browser page contains the component.
|
||||
*/
|
||||
public function assert(Browser $browser): void
|
||||
{
|
||||
$browser->assertVisible($this->selector());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the element shortcuts for the component.
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function elements(): array
|
||||
{
|
||||
return [
|
||||
'@logo' => 'a.header-logo',
|
||||
'@daily-free-link' => 'a[href="/dailyfree"]',
|
||||
];
|
||||
}
|
||||
|
||||
public function goToHome(Browser $browser) {
|
||||
$browser->scrollIntoView('@logo');
|
||||
$browser->click('@logo');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user