From 6836ed849bcca353fe096319dcdd5b1dafbf6d78 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 21 Jun 2016 12:31:38 +0300 Subject: [PATCH] Fix for test --- tests/acceptance/OnlinePaymentCest.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/acceptance/OnlinePaymentCest.php b/tests/acceptance/OnlinePaymentCest.php index 5a2d1380ad50..0a69a6942f01 100644 --- a/tests/acceptance/OnlinePaymentCest.php +++ b/tests/acceptance/OnlinePaymentCest.php @@ -22,14 +22,16 @@ class OnlinePaymentCest $productKey = $this->faker->text(10); // set gateway info - $I->wantTo('create a gateway'); - $I->amOnPage('/gateways/create?other_providers=true'); + if ( ! $I->grabFromDatabase('account_gateways', 'id', ['id' => 1])) { + $I->wantTo('create a gateway'); + $I->amOnPage('/gateways/create?other_providers=true'); - $I->fillField(['name' =>'23_apiKey'], env('stripe_secret_key') ?: Fixtures::get('stripe_secret_key')); - // Fails to load StripeJS causing "ReferenceError: Can't find variable: Stripe" - //$I->fillField(['name' =>'stripe_publishable_key'], env('stripe_secret_key') ?: Fixtures::get('stripe_publishable_key')); - $I->click('Save'); - $I->see('Successfully created gateway'); + $I->fillField(['name' =>'23_apiKey'], env('stripe_secret_key') ?: Fixtures::get('stripe_secret_key')); + // Fails to load StripeJS causing "ReferenceError: Can't find variable: Stripe" + //$I->fillField(['name' =>'stripe_publishable_key'], env('stripe_secret_key') ?: Fixtures::get('stripe_publishable_key')); + $I->click('Save'); + $I->see('Successfully created gateway'); + } // create client $I->amOnPage('/clients/create'); @@ -63,6 +65,7 @@ class OnlinePaymentCest $clientSession->does(function(AcceptanceTester $I) use ($invitationKey) { $I->amOnPage('/view/' . $invitationKey); $I->click('Pay Now'); + $I->click('Credit Card'); /* $I->fillField(['name' => 'first_name'], $this->faker->firstName);