mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-03 22:47:32 -05:00 
			
		
		
		
	Merge remote-tracking branch 'upstream/develop' into develop
This commit is contained in:
		
						commit
						bf3bef9b0b
					
				@ -67,6 +67,7 @@ script:
 | 
			
		||||
  - php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php
 | 
			
		||||
  - php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php
 | 
			
		||||
  - php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php
 | 
			
		||||
  - 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 InvoiceDesignCest.php
 | 
			
		||||
 | 
			
		||||
@ -354,7 +354,7 @@
 | 
			
		||||
 | 
			
		||||
    // Focus the search input if the user clicks forward slash
 | 
			
		||||
    $('body').keypress(function(event) {
 | 
			
		||||
        if (event.which == 47) {
 | 
			
		||||
        if (event.which == 47 && !$('*:focus').length) {
 | 
			
		||||
            event.preventDefault();
 | 
			
		||||
            showSearch();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										56
									
								
								tests/acceptance/ExpenseCest.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										56
									
								
								tests/acceptance/ExpenseCest.php
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,56 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
use Faker\Factory;
 | 
			
		||||
use Codeception\Util\Fixtures;
 | 
			
		||||
 | 
			
		||||
class ExpenseCest
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @var \Faker\Generator
 | 
			
		||||
     */
 | 
			
		||||
    private $faker;
 | 
			
		||||
    
 | 
			
		||||
    public function _before(AcceptanceTester $I)
 | 
			
		||||
    {
 | 
			
		||||
        $I->checkIfLogin($I);
 | 
			
		||||
 | 
			
		||||
        $this->faker = Factory::create();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function createExpense(AcceptanceTester $I)
 | 
			
		||||
    {
 | 
			
		||||
        $I->wantTo('Create an expense');
 | 
			
		||||
 | 
			
		||||
        $vendorName = $this->faker->name;
 | 
			
		||||
        $clientEmail = $this->faker->safeEmail;
 | 
			
		||||
        $amount = $this->faker->numberBetween(10, 20);
 | 
			
		||||
 | 
			
		||||
        // create vendor
 | 
			
		||||
        $I->amOnPage('/vendors/create');
 | 
			
		||||
        $I->fillField(['name' => 'name'], $vendorName);
 | 
			
		||||
        $I->click('Save');
 | 
			
		||||
        $I->see($vendorName);
 | 
			
		||||
        $vendorId = $I->grabFromDatabase('vendors', 'id', ['name' => $vendorName]);
 | 
			
		||||
 | 
			
		||||
        // create client
 | 
			
		||||
        $I->amOnPage('/clients/create');
 | 
			
		||||
        $I->fillField(['name' => 'contacts[0][email]'], $clientEmail);
 | 
			
		||||
        $I->click('Save');
 | 
			
		||||
        $I->see($clientEmail);
 | 
			
		||||
 | 
			
		||||
        // create expense
 | 
			
		||||
        $I->amOnPage('/expenses/create');
 | 
			
		||||
        $I->fillField(['name' => 'amount'], $amount);
 | 
			
		||||
        $I->selectDropdown($I, $vendorName, '.vendor-select .dropdown-toggle');
 | 
			
		||||
        $I->selectDropdown($I, $clientEmail, '.client-select .dropdown-toggle');
 | 
			
		||||
        $I->click('Save');
 | 
			
		||||
        $I->seeInDatabase('expenses', ['vendor_id' => $vendorId]);
 | 
			
		||||
 | 
			
		||||
        // invoice expense
 | 
			
		||||
        $I->executeJS('submitAction(\'invoice\')');
 | 
			
		||||
        $I->click('Save');
 | 
			
		||||
        $I->wait(1);
 | 
			
		||||
        $I->see($clientEmail);
 | 
			
		||||
        $I->see($amount);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user