This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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