diff --git a/tests/acceptance/CheckBalanceCest.php b/tests/acceptance/CheckBalanceCest.php index 950e42853677..b61f2326f06f 100644 --- a/tests/acceptance/CheckBalanceCest.php +++ b/tests/acceptance/CheckBalanceCest.php @@ -55,7 +55,7 @@ class CheckBalanceCest // update the invoice $I->amOnPage('/invoices/' . $invoiceId); $I->fillField(['name' => 'invoice_items[0][qty]'], 2); - $I->click('Save'); + $I->click('Save Invoice'); $I->wait(1); $I->amOnPage("/clients/{$clientId}"); $I->see('Balance $' . ($productPrice * 2)); diff --git a/tests/acceptance/TaskCest.php b/tests/acceptance/TaskCest.php index 1b7de334363c..f90b1c5291b9 100644 --- a/tests/acceptance/TaskCest.php +++ b/tests/acceptance/TaskCest.php @@ -18,14 +18,25 @@ class TaskCest public function createTimerTask(AcceptanceTester $I) { - $description = $this->faker->text(100); + $clientName = $this->faker->name; + $clientEmail = $this->faker->safeEmail; $project = $this->faker->text(20); + $description = $this->faker->text(100); $I->wantTo('create a timed task'); + + // create client + $I->amOnPage('/clients/create'); + $I->fillField(['name' => 'name'], $clientName); + $I->fillField(['name' => 'contacts[0][email]'], $clientEmail); + $I->click('Save'); + $I->see($clientEmail); + $clientId = $I->grabFromDatabase('clients', 'id', ['name' => $clientName]); + $I->amOnPage('/tasks/create'); $I->seeCurrentUrlEquals('/tasks/create'); - $I->selectDropdown($I, 'Wilford Borer', '.client-select .dropdown-toggle'); + $I->selectDropdown($I, $clientName, '.client-select .dropdown-toggle'); $I->selectDropdownCreate($I, 'project', $project); $I->fillField('#description', $description); @@ -34,7 +45,10 @@ class TaskCest $I->click('Stop'); $I->click('Save'); - $I->seeInDatabase('tasks', ['description' => $description]); + $I->seeInDatabase('tasks', [ + 'description' => $description, + 'client_id' => $clientId, + ]); $I->seeInDatabase('projects', ['name' => $project]); } diff --git a/tests/acceptance/TaxRatesCest.php b/tests/acceptance/TaxRatesCest.php index f7bdcef69c62..770a08106495 100644 --- a/tests/acceptance/TaxRatesCest.php +++ b/tests/acceptance/TaxRatesCest.php @@ -68,7 +68,7 @@ class TaxRatesCest // check total is right before saving $I->see("\${$total}"); - $I->click('Save'); + $I->click('Save Draft'); $I->wait(3); $I->see($clientEmail);