mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Add proposals to tests
This commit is contained in:
parent
08d4fe8d51
commit
b07462ec4a
@ -67,11 +67,6 @@ class ProposalSnippetRepository extends BaseRepository
|
||||
}
|
||||
|
||||
$proposal->fill($input);
|
||||
|
||||
if (isset($input['proposal_category_id'])) {
|
||||
$proposal->proposal_category_id = $input['proposal_category_id'] ? ProposalCategory::getPrivateId($input['proposal_category_id']) : null;
|
||||
}
|
||||
|
||||
$proposal->save();
|
||||
|
||||
return $proposal;
|
||||
|
@ -19,7 +19,7 @@ Detailed Guides
|
||||
Automated Installers
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Dockerfile: `github.com/invoiceninja/dockerfiles <https://github.com/invoiceninja/dockerfiles>`_
|
||||
- Dockerfile: `github.com <https://github.com/invoiceninja/dockerfiles>`_
|
||||
|
||||
- Cloudron: `cloudron.io <https://cloudron.io/store/com.invoiceninja.cloudronapp.html>`_
|
||||
|
||||
|
@ -20,8 +20,37 @@ class QuoteCest
|
||||
{
|
||||
$clientEmail = $this->faker->safeEmail;
|
||||
$productKey = $this->faker->text(10);
|
||||
$categoryName = $this->faker->text(11);
|
||||
$snippetName = $this->faker->text(12);
|
||||
$templateName = $this->faker->text(13);
|
||||
|
||||
$I->wantTo('create a quote');
|
||||
$I->wantTo('create a quote and proposal');
|
||||
|
||||
// create proposal category
|
||||
$I->amOnPage('/proposals/categories/create');
|
||||
$I->fillField(['name' => 'name'], $categoryName);
|
||||
$I->click('Save');
|
||||
$I->see('Successfully created category');
|
||||
$I->amOnPage('/proposals/categories');
|
||||
$I->see($categoryName);
|
||||
|
||||
// create proposal snippet
|
||||
$I->amOnPage('/proposals/snippets/create');
|
||||
$I->fillField(['name' => 'name'], $snippetName);
|
||||
$I->selectDropdown($I, $categoryName, '.category-select .dropdown-toggle');
|
||||
$I->click('Save');
|
||||
$I->see('Successfully created snippet');
|
||||
$I->amOnPage('/proposals/snippets');
|
||||
$I->see($snippetName);
|
||||
$I->see($categoryName);
|
||||
|
||||
// create proposal template
|
||||
$I->amOnPage('/proposals/templates/create');
|
||||
$I->fillField(['name' => 'name'], $templateName);
|
||||
$I->click('Save');
|
||||
$I->see('Successfully created template');
|
||||
$I->amOnPage('/proposals/templates');
|
||||
$I->see($templateName);
|
||||
|
||||
// create client
|
||||
$I->amOnPage('/clients/create');
|
||||
@ -35,8 +64,7 @@ class QuoteCest
|
||||
$I->fillField(['name' => 'notes'], $this->faker->text(80));
|
||||
$I->fillField(['name' => 'cost'], $this->faker->numberBetween(1, 20));
|
||||
$I->click('Save');
|
||||
$I->wait(1);
|
||||
//$I->see($productKey);
|
||||
$I->see('Successfully created product');
|
||||
|
||||
// create quote
|
||||
$I->amOnPage('/quotes/create');
|
||||
@ -46,17 +74,17 @@ class QuoteCest
|
||||
$I->click('Mark Sent');
|
||||
$I->see($clientEmail);
|
||||
|
||||
// enter payment
|
||||
$clientId = $I->grabFromDatabase('contacts', 'client_id', ['email' => $clientEmail]);
|
||||
$invoiceId = $I->grabFromDatabase('invoices', 'id', ['client_id' => $clientId]);
|
||||
$invitationKey = $I->grabFromDatabase('invitations', 'invitation_key', ['invoice_id' => $invoiceId]);
|
||||
|
||||
$clientSession = $I->haveFriend('client');
|
||||
$clientSession->does(function(AcceptanceTester $I) use ($invitationKey) {
|
||||
$I->amOnPage('/view/' . $invitationKey);
|
||||
$I->click('Approve');
|
||||
$I->see('Successfully approved');
|
||||
});
|
||||
$I->click('More Actions');
|
||||
$I->click('New Proposal');
|
||||
$I->see('Create');
|
||||
|
||||
$I->selectDropdown($I, $templateName, '.template-select .dropdown-toggle');
|
||||
$I->click('Save');
|
||||
$I->click('Download');
|
||||
$I->click('More Actions');
|
||||
$I->click('View as recipient');
|
||||
$I->click('Download');
|
||||
$I->click('Approve');
|
||||
$I->see('Successfully approved');
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user