Created regular tests
This commit is contained in:
28
tests/acceptance/ResetPasswordCest.php
Normal file
28
tests/acceptance/ResetPasswordCest.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
|
||||
class ResetPasswordCest
|
||||
{
|
||||
public function _before(AcceptanceTester $I)
|
||||
{
|
||||
// Artisan::call('migrate');
|
||||
|
||||
// factory(App\User::class)->create(['email' => 'admin@laraland.test']);
|
||||
}
|
||||
|
||||
public function _after(AcceptanceTester $I)
|
||||
{
|
||||
// Artisan::call('migrate:rollback');
|
||||
}
|
||||
|
||||
// tests
|
||||
public function memintaLinkResetPassword(AcceptanceTester $I)
|
||||
{
|
||||
$I->wantTo('get emailed by system with reset password link inside it');
|
||||
|
||||
$I->amOnPage('/password/reset');
|
||||
$I->fillField('email', 'admin@laraland.test');
|
||||
$I->click('button[type=submit]');
|
||||
$I->see('We have e-mailed your password reset link!');
|
||||
}
|
||||
}
|
||||
44
tests/acceptance/SigninCest.php
Normal file
44
tests/acceptance/SigninCest.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
|
||||
class SigninCest
|
||||
{
|
||||
public function _before(AcceptanceTester $I)
|
||||
{
|
||||
// Artisan::call('migrate');
|
||||
|
||||
// factory(App\User::class)->create(['email' => 'admin@laraland.test']);
|
||||
}
|
||||
|
||||
public function _after(AcceptanceTester $I)
|
||||
{
|
||||
// Artisan::call('migrate:rollback');
|
||||
}
|
||||
|
||||
// tests
|
||||
public function signinSuccessful(AcceptanceTester $I)
|
||||
{
|
||||
$I->wantTo('signin with correct credential and should go to dashboard page');
|
||||
|
||||
$I->amOnPage('/login');
|
||||
$I->fillField('email', 'admin@laraland.test');
|
||||
$I->fillField('password', 'secret');
|
||||
$I->click('button[type=submit]');
|
||||
|
||||
$I->see('Dashboard');
|
||||
$I->seeCurrentUrlEquals('/home');
|
||||
}
|
||||
|
||||
public function signinUnsuccessful(AcceptanceTester $I)
|
||||
{
|
||||
$I->wantTo('signin with incorrect credential and should go back to login page');
|
||||
|
||||
$I->amOnPage('/login');
|
||||
$I->fillField('email', 'admin@laraland.test');
|
||||
$I->fillField('password', 'notsecret');
|
||||
$I->click('button[type=submit]');
|
||||
|
||||
$I->see('Login');
|
||||
$I->seeCurrentUrlEquals('/login');
|
||||
}
|
||||
}
|
||||
1
tests/acceptance/_bootstrap.php
Normal file
1
tests/acceptance/_bootstrap.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php
|
||||
12
tests/acceptance/register.feature
Normal file
12
tests/acceptance/register.feature
Normal file
@@ -0,0 +1,12 @@
|
||||
#language: id
|
||||
Fitur: registrasi user baru
|
||||
|
||||
Sistem dapat mendaftarkan user(admin) baru
|
||||
dengan mengisi form registrasi yang ada di halaman depan aplikasi
|
||||
|
||||
|
||||
Skenario: registrasi dan masuk ke halaman dashboard
|
||||
|
||||
Dengan Saya berada di halaman registrasi
|
||||
Ketika Saya mengirim form registrasi
|
||||
Maka Saya akan dialihkan ke halaman dashboard
|
||||
21
tests/acceptance/reset_password.feature
Normal file
21
tests/acceptance/reset_password.feature
Normal file
@@ -0,0 +1,21 @@
|
||||
#language: id
|
||||
Fitur: reset password
|
||||
|
||||
Pengguna dapat mengganti password
|
||||
dengan memasukkan email pada halaman reset password
|
||||
lalu link reset password akan dikirimkan ke email tersebut
|
||||
dan pengguna dapat membuat password baru melalui link tersebut
|
||||
|
||||
|
||||
Skenario: meminta link reset password
|
||||
|
||||
Dengan Saya mempunyai hak akses di database
|
||||
Ketika Saya mengirim form berisi email saya
|
||||
Maka Saya melihat bahwa sebuah email telah dikirim dari sistem
|
||||
|
||||
|
||||
Skenario: mengganti password
|
||||
|
||||
Dengan Saya membuka link pada email dari sistem
|
||||
Ketika Saya mengirim form berisi password baru
|
||||
Maka Saya berhasil signin dengan password baru
|
||||
Reference in New Issue
Block a user