Added migration, schdule and signing in
This commit is contained in:
47
app/Browser/Components/Hellcase/EpicGamesLogin.php
Normal file
47
app/Browser/Components/Hellcase/EpicGamesLogin.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Browser\Components\Hellcase;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Laravel\Dusk\Component as BaseComponent;
|
||||
|
||||
class EpicGamesLogin extends BaseComponent
|
||||
{
|
||||
/**
|
||||
* Get the root selector for the component.
|
||||
*/
|
||||
public function selector(): string
|
||||
{
|
||||
return 'form';
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 [
|
||||
'@email' => 'input#email',
|
||||
'@password' => 'input#password',
|
||||
'@signin-button' => 'button[type="submit"]',
|
||||
];
|
||||
}
|
||||
|
||||
public function fillForm(Browser $browser, $email, $password) {
|
||||
$browser->type('@email', $email);
|
||||
sleep(1);
|
||||
$browser->type('@password', $password);
|
||||
sleep(1);
|
||||
$browser->click('@signin-button');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user