mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
Create booking test
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Browser\DryRun;
|
||||
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
|
||||
|
||||
|
||||
class CreateBookingTest extends DuskTestCase
|
||||
{
|
||||
public function testLogin()
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->visit('http://localhost:86')
|
||||
->pause(500)
|
||||
->typeSlowly('email', 'junkit.mah@bioloop.com.my')
|
||||
->typeSlowly('password', '123456abcabc')
|
||||
->click('#sign-in')
|
||||
->pause(5000)
|
||||
->assertPathIs('/dashboard');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @depends testLogin
|
||||
*/
|
||||
public function testCreateBooking()
|
||||
{
|
||||
$this->browse(function (Browser $browser) {
|
||||
$browser->waitForLocation('/dashboard')
|
||||
->waitForText('X1 Service')
|
||||
->typeSlowly('cc_sending', '10000')
|
||||
->pause(5000)
|
||||
->waitForText('Transfer Now',5000)
|
||||
->click('#transfer-now')
|
||||
->whenAvailable('#select-account-modal', function ($modal) {
|
||||
$modal->pause(1000)
|
||||
->press('#select-list')
|
||||
->press('#select-option')
|
||||
->pause(5000)
|
||||
->click('#confirm-new-booking');
|
||||
#->click('#cancel-new-booking');
|
||||
})
|
||||
->pause(7000)
|
||||
->typeSlowly('stock_code', '123')
|
||||
->typeSlowly('desc', 'Product A')
|
||||
->typeSlowly('unit_price', '100')
|
||||
->pause(7000)
|
||||
->click('#add-quantity')
|
||||
->click('#add-quantity')
|
||||
->pause(7000)
|
||||
->click('#minus-quantity')
|
||||
->click('#minus-quantity')
|
||||
->pause(7000)
|
||||
->typeSlowly('quantity', '5')
|
||||
->pause(7000)
|
||||
->click('#add-product')
|
||||
->pause(7000)
|
||||
->click('#save-purchase-order')
|
||||
->pause(10000);
|
||||
//Assert if booking created successfully
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user