Working on tests

This commit is contained in:
Hillel Coren 2018-02-14 12:27:59 +02:00
parent 63191d6166
commit 7f498b86ff

View File

@ -81,10 +81,18 @@ class QuoteCest
$I->selectDropdown($I, $templateName, '.template-select .dropdown-toggle'); $I->selectDropdown($I, $templateName, '.template-select .dropdown-toggle');
$I->click('Save'); $I->click('Save');
$I->click('Download'); $I->click('Download');
$I->click('More Actions');
$I->click('View as recipient'); $clientId = $I->grabFromDatabase('contacts', 'client_id', ['email' => $clientEmail]);
$I->click('Download'); $invoiceId = $I->grabFromDatabase('invoices', 'id', ['client_id' => $clientId]);
$I->click('Approve'); $proposalId = $I->grabFromDatabase('proposals', 'id', ['invoice_id' => $invoiceId]);
$I->see('Successfully approved'); $invitationKey = $I->grabFromDatabase('proposal_invitations', 'invitation_key', ['proposal_id' => $proposalId]);
$clientSession = $I->haveFriend('client');
$clientSession->does(function(AcceptanceTester $I) use ($invitationKey) {
$I->amOnPage('/proposal/' . $invitationKey);
$I->click('Approve');
$I->see('Successfully approved');
});
} }
} }