Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera

uno-de-piera/Framework.php Secret

Created May 31, 2020
Embed
What would you like to do?
<?php
namespace Tests\Browser\Pages;
use Laravel\Dusk\Browser;
use Laravel\Dusk\Page as BasePage;
class Framework extends BasePage
{
/**
* Get the URL for the page.
*
* @return string
*/
public function url()
{
return '/frameworks/create';
}
/**
* Assert that the browser is on the page.
*
* @return void
*/
public function assert(Browser $browser)
{
$browser->assertPathIs($this->url());
}
/**
* Get the element shortcuts for the page.
*
* @return array
*/
public function elements()
{
return [
'@framework-name' => '#name',
];
}
/**
* Create a new framework.
*
* @param \Laravel\Dusk\Browser $browser
* @param string $name
* @return void
*/
public function createFramework(Browser $browser, $name)
{
$browser->type('@framework-name', $name)
->press('Save Framework');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment