-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
261 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
|
||
/** | ||
* PhpStorm Meta file, to provide autocomplete information for PhpStorm | ||
* Generated on 2018-06-02 13:12:55. | ||
* Generated on 2018-06-16 11:33:10. | ||
* | ||
* @author Barry vd. Heuvel <[email protected]> | ||
* @see https://github.com/barryvdh/laravel-ide-helper | ||
|
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace Tests\Browser; | ||
|
||
use Tests\DuskTestCase; | ||
use Laravel\Dusk\Browser; | ||
use Illuminate\Foundation\Testing\DatabaseMigrations; | ||
|
||
class ExampleTest extends DuskTestCase | ||
{ | ||
/** | ||
* A basic browser test example. | ||
* | ||
* @return void | ||
*/ | ||
public function testBasicExample() | ||
{ | ||
$this->browse(function (Browser $browser) { | ||
$browser->visit('/') | ||
->assertSee('Laravel'); | ||
}); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace Tests\Browser\Pages; | ||
|
||
use Laravel\Dusk\Browser; | ||
|
||
class HomePage extends Page | ||
{ | ||
/** | ||
* Get the URL for the page. | ||
* | ||
* @return string | ||
*/ | ||
public function url() | ||
{ | ||
return '/'; | ||
} | ||
|
||
/** | ||
* Assert that the browser is on the page. | ||
* | ||
* @param Browser $browser | ||
* @return void | ||
*/ | ||
public function assert(Browser $browser) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Get the element shortcuts for the page. | ||
* | ||
* @return array | ||
*/ | ||
public function elements() | ||
{ | ||
return [ | ||
'@element' => '#selector', | ||
]; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Tests\Browser\Pages; | ||
|
||
use Laravel\Dusk\Page as BasePage; | ||
|
||
abstract class Page extends BasePage | ||
{ | ||
/** | ||
* Get the global element shortcuts for the site. | ||
* | ||
* @return array | ||
*/ | ||
public static function siteElements() | ||
{ | ||
return [ | ||
'@element' => '#selector', | ||
]; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace Tests; | ||
|
||
use Laravel\Dusk\TestCase as BaseTestCase; | ||
use Facebook\WebDriver\Chrome\ChromeOptions; | ||
use Facebook\WebDriver\Remote\RemoteWebDriver; | ||
use Facebook\WebDriver\Remote\DesiredCapabilities; | ||
|
||
abstract class DuskTestCase extends BaseTestCase | ||
{ | ||
use CreatesApplication; | ||
|
||
/** | ||
* Prepare for Dusk test execution. | ||
* | ||
* @beforeClass | ||
* @return void | ||
*/ | ||
public static function prepare() | ||
{ | ||
static::startChromeDriver(); | ||
} | ||
|
||
/** | ||
* Create the RemoteWebDriver instance. | ||
* | ||
* @return \Facebook\WebDriver\Remote\RemoteWebDriver | ||
*/ | ||
protected function driver() | ||
{ | ||
$options = (new ChromeOptions)->addArguments([ | ||
'--disable-gpu', | ||
'--headless' | ||
]); | ||
|
||
return RemoteWebDriver::create( | ||
'http://localhost:9515', DesiredCapabilities::chrome()->setCapability( | ||
ChromeOptions::CAPABILITY, $options | ||
) | ||
); | ||
} | ||
} |