Hi guys.
I can't make the example login test works, here's my code:
/home/vagrant/Code/proyectoFinal/tests/Browser/authTest.php
use Illuminate\Support\Facades\DB;
use Tests\DuskTestCase;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use App\User;
use Laravel\Dusk\Chrome;
class Auth extends DuskTestCase
{
/** @test */
public function autenticar_usuario()
{
$unUsuario = factory(User::class)->create();
$this->browse(function ($browser) use ($unUsuario) {
$browser->visit('/')
->type('email', $unUsuario->email)
->type('password', 'secret')
->press('Login')
->AssertSee('Bienvenido');
});
}
}
My routes are these:
Route::get('/', 'HomeController@index')->name('login');
Auth::routes();
Route::get('/home', 'HomeController@index');
I've red that may be it has something to do with sessions, so here's my .env.dusk.local
APP_ENV=testing
APP_KEY=someLettersAndNumbers
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://proyecto.app
DB_CONNECTION=testing_db
DB_HOST=localhost
DB_DATABASE=testing
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
I am running Homestead 1.0.1 and Laravel 5.4.
This feature works fine when I run it from .env, which is using a mysql driver, but I don't think it's related to db because I've did others tests to try it and runs without any issues. When I do
art dusk
screenshot shows I'm still stuck in login page.
Any help would be appreciated.
Thanks in advance.