Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser.php
<?php | <?php | ||||
namespace Tests; | namespace Tests; | ||||
use Facebook\WebDriver\WebDriverKeys; | use Illuminate\Support\Facades\Cache; | ||||
use PHPUnit\Framework\Assert; | use PHPUnit\Framework\Assert; | ||||
use Tests\Browser\Components\Error; | use Tests\Browser\Components\Error; | ||||
use Tests\Browser\Components\Toast; | use Tests\Browser\Components\Toast; | ||||
/** | /** | ||||
* Laravel Dusk Browser extensions | * Laravel Dusk Browser extensions | ||||
*/ | */ | ||||
class Browser extends \Laravel\Dusk\Browser | class Browser extends \Laravel\Dusk\Browser | ||||
▲ Show 20 Lines • Show All 287 Lines • ▼ Show 20 Lines | public function storeConsoleLog($name) | ||||
$content = json_encode($console, JSON_PRETTY_PRINT); | $content = json_encode($console, JSON_PRETTY_PRINT); | ||||
file_put_contents($file, $content); | file_put_contents($file, $content); | ||||
} | } | ||||
} | } | ||||
return $this; | return $this; | ||||
} | } | ||||
/** | |||||
* Store custom config values in the cache to be picked up in the DevelConfig middleware on the next request. | |||||
* | |||||
* This allows to propagte custom config values to the server that interacts with the browser. | |||||
* | |||||
* @param array $config | |||||
* @return $this | |||||
*/ | |||||
public function withConfig(array $config) | |||||
{ | |||||
Cache::put('duskconfig', json_encode($config)); | |||||
return $this; | |||||
} | |||||
} | } |