Answer the question
In order to leave comments, you need to log in
How to correctly run multiple Laravel Dusk tests?
There is one class in which authorization on the site is tested:
class LoginTest extends DuskTestCase
{
/**
* Тестируем авторизацию на сайте c корректными данными
*
* @return void
* @throws \Throwable
*/
public function testTrueLogin()
{
$this->browse(function (Browser $browser) {
$browser->visit('/login')
->type('email', '[email protected]')
->type('password', '123456')
->press('Войти')
->assertPathIs('/cabinet')
->quit();
});
}
/**
* Тестируем авторизацию на сайте c НЕ корректными данными
*
* @throws \Throwable
*/
public function testFalseLogin()
{
$this->browse(function (Browser $browser) {
$browser->visit('/login')
->type('email', '[email protected]')
->type('password', '123123')
->press('Войти')
->assertPathIs('/login');
});
}
}
1) Tests\Browser\LoginTest::testFalseLogin
Failed asserting that '' matches PCRE pattern "/^\/login/u".
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question