HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/medvalue.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());
        });
    }
}