Working on tests

This commit is contained in:
Hillel Coren 2017-03-25 22:51:08 +03:00
parent 902cb2a5dc
commit 8bc6b026be
3 changed files with 19 additions and 5 deletions

View File

@ -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));

View File

@ -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]);
}

View File

@ -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);