mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Working on expense test
This commit is contained in:
parent
0bdc029df7
commit
de22178ac7
@ -22,6 +22,7 @@ class ExpenseCest
|
|||||||
$I->wantTo('Create an expense');
|
$I->wantTo('Create an expense');
|
||||||
|
|
||||||
$vendorName = $this->faker->name;
|
$vendorName = $this->faker->name;
|
||||||
|
$clientName = $this->faker->name;
|
||||||
$clientEmail = $this->faker->safeEmail;
|
$clientEmail = $this->faker->safeEmail;
|
||||||
$amount = $this->faker->numberBetween(10, 20);
|
$amount = $this->faker->numberBetween(10, 20);
|
||||||
|
|
||||||
@ -34,24 +35,27 @@ class ExpenseCest
|
|||||||
|
|
||||||
// create client
|
// create client
|
||||||
$I->amOnPage('/clients/create');
|
$I->amOnPage('/clients/create');
|
||||||
|
$I->fillField(['name' => 'name'], $clientName);
|
||||||
$I->fillField(['name' => 'contacts[0][email]'], $clientEmail);
|
$I->fillField(['name' => 'contacts[0][email]'], $clientEmail);
|
||||||
$I->click('Save');
|
$I->click('Save');
|
||||||
$I->see($clientEmail);
|
$I->see($clientEmail);
|
||||||
|
$clientId = $I->grabFromDatabase('clients', 'id', ['name' => $clientName]);
|
||||||
|
|
||||||
// create expense
|
// create expense
|
||||||
$I->amOnPage('/expenses/create');
|
$I->amOnPage('/expenses/create');
|
||||||
$I->fillField(['name' => 'amount'], $amount);
|
$I->fillField(['name' => 'amount'], $amount);
|
||||||
$I->selectDropdown($I, $vendorName, '.vendor-select .dropdown-toggle');
|
$I->selectDropdown($I, $vendorName, '.vendor-select .dropdown-toggle');
|
||||||
$I->selectDropdown($I, $clientEmail, '.client-select .dropdown-toggle');
|
$I->selectDropdown($I, $clientName, '.client-select .dropdown-toggle');
|
||||||
$I->click('Save');
|
$I->click('Save');
|
||||||
$I->wait(2);
|
$I->wait(2);
|
||||||
$I->seeInDatabase('expenses', ['vendor_id' => $vendorId]);
|
$I->seeInDatabase('expenses', ['vendor_id' => $vendorId]);
|
||||||
|
$I->seeInDatabase('expenses', ['client_id' => $clientId]);
|
||||||
|
|
||||||
// invoice expense
|
// invoice expense
|
||||||
$I->executeJS('submitAction(\'invoice\')');
|
$I->executeJS('submitAction(\'invoice\')');
|
||||||
$I->wait(2);
|
$I->wait(2);
|
||||||
$I->click('Save');
|
$I->click('Save');
|
||||||
$I->wait(4);
|
$I->wait(2);
|
||||||
$I->see($clientEmail);
|
$I->see($clientEmail);
|
||||||
$I->see($amount);
|
$I->see($amount);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user