diff --git a/.travis.yml b/.travis.yml index ac07484b66d1..f76fe32447b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,6 +70,7 @@ script: - php ./vendor/codeception/codeception/codecept run --debug acceptance ExpenseCest.php - php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php + - php ./vendor/codeception/codeception/codecept run --debug acceptance QuoteCest.php - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php - php ./vendor/codeception/codeception/codecept run acceptance OnlinePaymentCest.php - php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php diff --git a/config/mail.php b/config/mail.php index 91d6e8fbcd8b..6b08e8efb333 100644 --- a/config/mail.php +++ b/config/mail.php @@ -108,17 +108,4 @@ return [ 'sendmail' => '/usr/sbin/sendmail -bs', - /* - |-------------------------------------------------------------------------- - | Mail "Pretend" - |-------------------------------------------------------------------------- - | - | When this option is enabled, e-mail will not actually be sent over the - | web and will instead be written to your application's logs files so - | you may inspect the message. This is great for local development. - | - */ - - 'pretend' => env('MAIL_PRETEND'), - ]; diff --git a/tests/acceptance/QuoteCest.php b/tests/acceptance/QuoteCest.php new file mode 100644 index 000000000000..33a33bc52ac0 --- /dev/null +++ b/tests/acceptance/QuoteCest.php @@ -0,0 +1,62 @@ +checkIfLogin($I); + + $this->faker = Factory::create(); + } + + public function createQuote(AcceptanceTester $I) + { + $clientEmail = $this->faker->safeEmail; + $productKey = $this->faker->text(10); + + $I->wantTo('create a quote'); + + // create client + $I->amOnPage('/clients/create'); + $I->fillField(['name' => 'contacts[0][email]'], $clientEmail); + $I->click('Save'); + $I->see($clientEmail); + + // create product + $I->amOnPage('/products/create'); + $I->fillField(['name' => 'product_key'], $productKey); + $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); + + // create quote + $I->amOnPage('/quotes/create'); + $I->selectDropdown($I, $clientEmail, '.client_select .dropdown-toggle'); + $I->fillField('table.invoice-table tbody tr:nth-child(1) #product_key', $productKey); + $I->click('table.invoice-table tbody tr:nth-child(1) .tt-selectable'); + $I->click('Save'); + $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('This quote is approved'); + }); + + } +}