38 lines
714 B
Plaintext
38 lines
714 B
Plaintext
<?php
|
|
|
|
namespace DummyNamespace;
|
|
|
|
use Laravel\Dusk\Browser;
|
|
use Laravel\Dusk\Component as BaseComponent;
|
|
|
|
class DummyClass extends BaseComponent
|
|
{
|
|
/**
|
|
* Get the root selector for the component.
|
|
*/
|
|
public function selector(): string
|
|
{
|
|
return '#selector';
|
|
}
|
|
|
|
/**
|
|
* 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 [
|
|
'@element' => '#selector',
|
|
];
|
|
}
|
|
}
|