Total Complexity | 6 |
Complexity/F | 1 |
Lines of Code | 41 |
Function Count | 6 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | /** |
||
4 | import config from 'config'; |
||
5 | import chai from 'chai'; |
||
6 | import chaiAsPromised from 'chai-as-promised'; |
||
7 | import test from 'selenium-webdriver/testing'; |
||
8 | |||
9 | /** |
||
10 | * Internal dependencies |
||
11 | */ |
||
12 | import * as t from './lib/test-helper'; |
||
13 | |||
14 | chai.use( chaiAsPromised ); |
||
15 | const assert = chai.assert; |
||
16 | |||
17 | test.describe( 'Checkout flow', function() { |
||
18 | this.timeout( config.get( 'mochaTimeoutMs' ) ); |
||
19 | |||
20 | test.before( function() { |
||
21 | this.timeout( config.get( 'startBrowserTimeoutMs' ) ); |
||
22 | } ); |
||
23 | |||
24 | test.before( t.startBrowser ); |
||
25 | |||
26 | test.describe( 'One-time payment', function() { |
||
27 | config.get( 'stripe' ).forEach( stripeSetting => { |
||
28 | test.before( () => { |
||
29 | t.setStripeSettings( stripeSetting ); |
||
30 | } ); |
||
31 | |||
32 | test.beforeEach( t.asGuestCustomer ); |
||
33 | |||
34 | test.it( 'Credit card', function() { |
||
35 | t.openOnePaymentProduct().addToCart(); |
||
36 | t.payWithStripe(); |
||
37 | |||
38 | assert.eventually.ok( t.redirectedTo( '/checkout/order-received/' ) ); |
||
39 | } ); |
||
40 | } ); |
||
41 | } ); |
||
42 | |||
43 | test.after( t.quitBrowser ); |
||
44 | } ); |
||
45 |