Added payment-methods tests

This commit is contained in:
Lars Kusch 2021-10-15 16:56:43 +02:00
parent 13894b0541
commit 7197d79e39
6 changed files with 39 additions and 30 deletions

View File

@ -48,10 +48,8 @@ class ACSSTest extends DuskTestCase
$cg->fees_and_limits = $fees_and_limits; $cg->fees_and_limits = $fees_and_limits;
$cg->save(); $cg->save();
// SOFORT required ['AUT', 'BEL', 'DEU', 'ITA', 'NLD', 'ESP'] to be billing country.
// Setting country to DEU (276).
$client = Client::first(); $client = Client::first();
$client->country_id = 276; $client->country_id = 276; // Change to US or Canada
$client->save(); $client->save();
} }
@ -63,8 +61,13 @@ class ACSSTest extends DuskTestCase
->click('@pay-now') ->click('@pay-now')
->press('Pay Now') ->press('Pay Now')
->clickLink('ACSS') ->clickLink('ACSS')
->press('Pay Now') ->type('#acss-name', 'John Doe')
->waitForText('Sofort test payment page', 120) ->type('#acss-name', 'John@Doe.com')
->withinFrame('iframe', function (Browser $browser) {
$browser->type('acss', '12345');
})
->click('#pay-now')
->waitForText('ACSS test payment page', 120)
->press('.common-Button.common-Button--default') ->press('.common-Button.common-Button--default')
->waitForText('Details of the payment', 60); ->waitForText('Details of the payment', 60);
}); });

View File

@ -48,10 +48,8 @@ class BECSTest extends DuskTestCase
$cg->fees_and_limits = $fees_and_limits; $cg->fees_and_limits = $fees_and_limits;
$cg->save(); $cg->save();
// SOFORT required ['AUT', 'BEL', 'DEU', 'ITA', 'NLD', 'ESP'] to be billing country.
// Setting country to DEU (276).
$client = Client::first(); $client = Client::first();
$client->country_id = 276; $client->country_id = 276; // Change to austria
$client->save(); $client->save();
} }
@ -63,8 +61,13 @@ class BECSTest extends DuskTestCase
->click('@pay-now') ->click('@pay-now')
->press('Pay Now') ->press('Pay Now')
->clickLink('BECS') ->clickLink('BECS')
->press('Pay Now') ->type('#becs-name', 'John Doe')
->waitForText('Sofort test payment page', 120) ->type('#becs-email', 'john@doe.com')
->withinFrame('iframe', function (Browser $browser) {
$browser->type('becs-iban', '000123456');
})
->click('#pay-now')
->waitForText('BECS test payment page', 120)
->press('.common-Button.common-Button--default') ->press('.common-Button.common-Button--default')
->waitForText('Details of the payment', 60); ->waitForText('Details of the payment', 60);
}); });

View File

@ -48,8 +48,6 @@ class BancontactTest extends DuskTestCase
$cg->fees_and_limits = $fees_and_limits; $cg->fees_and_limits = $fees_and_limits;
$cg->save(); $cg->save();
// SOFORT required ['AUT', 'BEL', 'DEU', 'ITA', 'NLD', 'ESP'] to be billing country.
// Setting country to DEU (276).
$client = Client::first(); $client = Client::first();
$client->country_id = 276; $client->country_id = 276;
$client->save(); $client->save();
@ -62,11 +60,11 @@ class BancontactTest extends DuskTestCase
->visitRoute('client.invoices.index') ->visitRoute('client.invoices.index')
->click('@pay-now') ->click('@pay-now')
->press('Pay Now') ->press('Pay Now')
->clickLink('Bancontact') ->clickLink('EPS')
->press('Pay Now') ->type('#bancontact-name', 'John Doe')
->waitForText('Sofort test payment page', 120) ->click('#pay-now')
->waitForText('Bancontact test payment page', 120)
->press('.common-Button.common-Button--default') ->press('.common-Button.common-Button--default')
->waitForText('Details of the payment', 60); ->waitForText('Details of the payment', 60);
}); });
} }}
}

View File

@ -48,8 +48,6 @@ class GiropayTest extends DuskTestCase
$cg->fees_and_limits = $fees_and_limits; $cg->fees_and_limits = $fees_and_limits;
$cg->save(); $cg->save();
// SOFORT required ['AUT', 'BEL', 'DEU', 'ITA', 'NLD', 'ESP'] to be billing country.
// Setting country to DEU (276).
$client = Client::first(); $client = Client::first();
$client->country_id = 276; $client->country_id = 276;
$client->save(); $client->save();
@ -63,8 +61,9 @@ class GiropayTest extends DuskTestCase
->click('@pay-now') ->click('@pay-now')
->press('Pay Now') ->press('Pay Now')
->clickLink('Giropay') ->clickLink('Giropay')
->press('Pay Now') ->type('#giropay-name', 'John Doe')
->waitForText('Sofort test payment page', 120) ->click('#pay-now')
->waitForText('Giropay test payment page', 120)
->press('.common-Button.common-Button--default') ->press('.common-Button.common-Button--default')
->waitForText('Details of the payment', 60); ->waitForText('Details of the payment', 60);
}); });

View File

@ -48,8 +48,6 @@ class Prezelewy24Test extends DuskTestCase
$cg->fees_and_limits = $fees_and_limits; $cg->fees_and_limits = $fees_and_limits;
$cg->save(); $cg->save();
// SOFORT required ['AUT', 'BEL', 'DEU', 'ITA', 'NLD', 'ESP'] to be billing country.
// Setting country to DEU (276).
$client = Client::first(); $client = Client::first();
$client->country_id = 276; $client->country_id = 276;
$client->save(); $client->save();
@ -62,9 +60,15 @@ class Prezelewy24Test extends DuskTestCase
->visitRoute('client.invoices.index') ->visitRoute('client.invoices.index')
->click('@pay-now') ->click('@pay-now')
->press('Pay Now') ->press('Pay Now')
->clickLink('Prezelewy24') ->clickLink('EPS')
->press('Pay Now') ->type('#eps-name', 'John Doe')
->waitForText('Sofort test payment page', 120) ->type('#eps-email', 'john@doe.com')
->check('#p24-mandate-acceptance', 'John Doe')
->withinFrame('iframe', function (Browser $browser) {
$browser->type('p24', '12345');
})
->click('#pay-now')
->waitForText('P24 test payment page', 120)
->press('.common-Button.common-Button--default') ->press('.common-Button.common-Button--default')
->waitForText('Details of the payment', 60); ->waitForText('Details of the payment', 60);
}); });

View File

@ -48,8 +48,6 @@ class iDEAL extends DuskTestCase
$cg->fees_and_limits = $fees_and_limits; $cg->fees_and_limits = $fees_and_limits;
$cg->save(); $cg->save();
// SOFORT required ['AUT', 'BEL', 'DEU', 'ITA', 'NLD', 'ESP'] to be billing country.
// Setting country to DEU (276).
$client = Client::first(); $client = Client::first();
$client->country_id = 276; $client->country_id = 276;
$client->save(); $client->save();
@ -63,8 +61,12 @@ class iDEAL extends DuskTestCase
->click('@pay-now') ->click('@pay-now')
->press('Pay Now') ->press('Pay Now')
->clickLink('iDeal') ->clickLink('iDeal')
->press('Pay Now') ->type('#ideal-name', 'John Doe')
->waitForText('Sofort test payment page', 120) ->withinFrame('iframe', function (Browser $browser) {
$browser->type('ideal', '12345');
})
->click('#pay-now')
->waitForText('iDeal test payment page', 120)
->press('.common-Button.common-Button--default') ->press('.common-Button.common-Button--default')
->waitForText('Details of the payment', 60); ->waitForText('Details of the payment', 60);
}); });