1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 20:52:56 +01:00

Cypress tests for cp

This commit is contained in:
David Bomba 2023-03-12 12:47:21 +11:00
parent 0330fd31db
commit 9c80d6e8e1
5 changed files with 295 additions and 327 deletions

View File

@ -1,65 +0,0 @@
APP_NAME="Invoice Ninja"
APP_ENV=local
APP_KEY=base64:xV0ixUbXIGjeWImmcjCYL8/XespgcEk+dTTPlM17dNE=
APP_DEBUG=true
APP_DOMAIN=ninja.test:8000
APP_URL=http://ninja.test:8000/
#APP_URL=https://ninja.test
DB_CONNECTION=mysql
MULTI_DB_ENABLED=false
DB_HOST1=127.0.0.1
DB_DATABASE1=db-ninja-01
DB_USERNAME1=ninja
DB_PASSWORD1=ninja
DB_PORT1=3306
DB_HOST2=127.0.0.1
DB_DATABASE2=db-ninja-02
DB_USERNAME2=ninja
DB_PASSWORD2=ninja
DB_PORT2=3306
DEMO_MODE=false
LOG_CHANNEL=stack
REQUIRE_HTTPS=false
BROADCAST_DRIVER=pusher
CACHE_DRIVER=redis
QUEUE_CONNECTION=database
SESSION_DRIVER=redis
SESSION_DOMAIN=.ninja.test
SESSION_LIFETIME=120
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
PUSHER_APP_ID="ninja"
PUSHER_APP_KEY="ninja"
PUSHER_APP_SECRET="ninja"
PUSHER_APP_CLUSTER="ninja1"
MAIL_MAILER=log
MAIL_HOST=localhost
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=''
MAIL_FROM_NAME=''
GOOGLE_MAPS_API_KEY=
NINJA_ENVIRONMENT=selfhost
HASH_SALT=
FILESYSTEM_DRIVER=public
PDF_GENERATOR=snappdf
MIX_ASSET_URL=false

View File

@ -30,8 +30,11 @@ use App\Models\GroupSetting;
use App\Models\ClientContact;
use App\Models\VendorContact;
use App\Models\CompanyGateway;
use App\Models\BankIntegration;
use App\Models\BankTransaction;
use Illuminate\Database\Seeder;
use App\Models\RecurringInvoice;
use App\DataMapper\FeesAndLimits;
use App\DataMapper\ClientSettings;
use App\DataMapper\CompanySettings;
use App\Helpers\Invoice\InvoiceSum;
@ -44,8 +47,6 @@ use App\Repositories\InvoiceRepository;
use Illuminate\Database\Eloquent\Model;
use App\Events\Payment\PaymentWasCreated;
use App\Helpers\Invoice\InvoiceSumInclusive;
use App\Models\BankIntegration;
use App\Models\BankTransaction;
class RandomDataSeeder extends Seeder
{
@ -374,6 +375,13 @@ class RandomDataSeeder extends Seeder
$cg->require_shipping_address = true;
$cg->update_details = true;
$cg->config = encrypt(config('ninja.testvars.stripe'));
$gateway_types = $cg->driver()->gatewayTypes();
$fees_and_limits = new \stdClass;
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits;
$cg->fees_and_limits = $fees_and_limits;
$cg->save();
$cg = new CompanyGateway;

View File

@ -0,0 +1,35 @@
describe('Test Invoices', () => {
it('Show Invoice List.', () => {
cy.visit('/client/login');
cy.contains('Client Portal');
cy.get('input[name=email]').type('cypress@example.com');
cy.get('input[name=password]').type('password{enter}');
cy.url().should('include', '/invoices');
cy.get('[dusk="pay-now"]').first().click();
cy.url().should('include', '/invoices/payment');
cy.get('[dusk="pay-now-dropdown"]').first().click();
cy.get('[dusk="pay-with-0"]').first().click();
cy.url().should('include', '/payments/process');
cy.get('input[name=client_address_line_1]').clear().type('5 Wallaby Way');
cy.get('input[name=client_city]').clear().type('Perth');
cy.get('input[name=client_state]').clear().type('WA');
cy.get('select#client_country_id]').select("840");
cy.get('input[name=client_shipping_address_line_1]').clear().type('5 Wallaby Way');
cy.get('input[name=client_shipping_city]').clear().type('Perth');
cy.get('input[name=client_shipping_state]').clear().type('WA');
cy.get('select#client_shipping_country_id]').select("840");
cy.contains('Continue').click();
});
});

View File

@ -26,7 +26,9 @@ before(() => {
cy.artisan("migrate:fresh", {
'--seed': true,
});
cy.seed('RandomDataSeeder');
cy.artisan("db:seed", {
'--class': 'RandomDataSeeder',
});
});
after(() => {

File diff suppressed because it is too large Load Diff