Skip to content

Commit

Permalink
We are all Green Sir (Fix for last failing Test Case)
Browse files Browse the repository at this point in the history
  • Loading branch information
zanechua committed Nov 13, 2018
1 parent c23a455 commit 7bd8f25
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
21 changes: 20 additions & 1 deletion tests/Browser/InvoiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public function test_invoice_log_payment()
->clickLink('Pending')
->pause(500);
$browser
->script("jQuery(\"a[href='{$this->baseUrl()}/invoice/{$invoice->id}/edit'] > i\").click();");
->script("jQuery(\"a[data-tooltip='View Invoice'] > i\").click();");
$browser
->assertPathBeginsWith('/invoice')
->clickLink('Log Payment')
Expand Down Expand Up @@ -319,6 +319,25 @@ public function test_end_to_end_invoice()
->assertPathIs('/invoices')
->clickLink('Pending')
->pause(500);
$browser
->script("jQuery(\"a[data-tooltip='View Invoice'] > i\").click();");
$browser
->assertPathBeginsWith('/invoice')
->clickLink('Log Payment')
->type('amount', $faker->randomFloat($nbMaxDecimals = 2, $min = 0, $max = 999999999999))
->type('notes', $faker->text(50));
$browser
->script('jQuery("#receiveddate").datepicker("setDate", new Date());jQuery("#receiveddate").val("' . Carbon::now()->format('j F, Y') . '");');
$browser
->script('jQuery("#mode").selectize()[0].selectize.setValue("Cheque");');
$browser
->press('SUBMIT')
->assertPresent('#invoice-action-container')
->assertPathBeginsWith('/invoice')
->clickLink('Invoices')
->assertPathIs('/invoices')
->clickLink('Pending')
->pause(500);
$browser
->script('jQuery(".invoice-delete-btn > i").click();');
$browser
Expand Down
1 change: 1 addition & 0 deletions tests/DuskTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ protected function driver()
else
{
$options = (new ChromeOptions)->addArguments([
'--window-size=1024,768',
'--disable-gpu',
'--headless',
'--no-sandbox',
Expand Down

0 comments on commit 7bd8f25

Please sign in to comment.