All checks were successful
Push image to registry / build-image (push) Successful in 4m41s
48 lines
1.0 KiB
PHP
48 lines
1.0 KiB
PHP
<?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) {
|
|
try {
|
|
$browser->scrollIntoView('@logo');
|
|
$browser->click('@logo');
|
|
} catch (\Exception $e) {
|
|
$browser->visit('https://hellcase.com/');
|
|
}
|
|
}
|
|
}
|