Changeset View
Changeset View
Standalone View
Standalone View
src/tests/TestCaseDusk.php
Show First 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | abstract class TestCaseDusk extends BaseTestCase | ||||
/** | /** | ||||
* Replace Dusk's Browser with our (extended) Browser | * Replace Dusk's Browser with our (extended) Browser | ||||
*/ | */ | ||||
protected function newBrowser($driver) | protected function newBrowser($driver) | ||||
{ | { | ||||
return new Browser($driver); | return new Browser($driver); | ||||
} | } | ||||
/** | |||||
* Set baseURL to the admin UI location | |||||
*/ | |||||
protected static function useAdminUrl(): void | |||||
{ | |||||
// This will set baseURL for all tests in this file | |||||
// If we wanted to visit both user and admin in one test | |||||
// we can also just call visit() with full url | |||||
Browser::$baseUrl = str_replace('//', '//admin.', \config('app.url')); | |||||
} | |||||
} | } |