Completed
Push — master ( 6d8164...bf7249 )
by Roy
03:26
created

tests/e2e/test-checkout-flow.js   A

Complexity

Total Complexity 6
Complexity/F 1

Size

Lines of Code 41
Function Count 6

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 0
nc 1
dl 0
loc 41
rs 10
c 2
b 0
f 0
wmc 6
mnd 0
bc 6
fnc 6
bpm 1
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
B test.describe(ꞌCheckout flowꞌ) 0 28 1
1
/**
2
 * External dependencies
3
 */
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