File: D:/HostingSpaces/SBogers10/structura.komma.pro/tests/Browser/LoginTest.php
<?php
namespace Tests\Browser;
use App\KommaApp\Shop\Tests\DuskTestCase;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\Artisan;
use Laravel\Dusk\Browser;
class loginTest extends DuskTestCase
{
use DatabaseTransactions; //Automatically rolls back database actions after tests
/** @test */
public function testLoginFail()
{
Artisan::call('cache:clear'); //Clears auth throttling if active.
$this->browse(function (Browser $browser) {
$browser->visit('/kms')
->assertPathIs('/kms/login')
->type('email', 'info@komma.pro')
->type('password', 'Admin12')
->press('Login')
->assertSee('Het opgeven e-mailadres en')
->screenshot($this->getName());
});
}
/** @test */
public function testLogin()
{
Artisan::call('cache:clear'); //Clears auth throttling if active.
$this->browse(function (Browser $browser) {
$browser->visit('/kms')
->assertPathIs('/kms/login')
->type('email', 'info@komma.pro')
->type('password', 'Admin123')
->press('Login')
->pause(2000)
->assertSee(__('kms/users.title'))
->screenshot($this->getName());
});
}
}