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

tests/e2e/lib/wp-admin-wc-settings-checkout-stripe.js   A

Size

Lines of Code 30

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
nc 1
dl 0
loc 30
rs 10
c 1
b 0
f 0
noi 2

1 Function

Rating   Name   Duplication   Size   Complexity  
A wp-admin-wc-settings-checkout-stripe.js ➔ ??? 0 3 1
1
/**
2
 * External dependencies
3
 */
4
import { By } from 'selenium-webdriver';
5
import { WebDriverHelper as helper } from 'wp-e2e-webdriver';
6
import { WPAdminWCSettings } from 'wc-e2e-page-objects';
7
8
const ENABLE_SELECTOR = By.css( '#woocommerce_stripe_enabled' );
9
const TEST_PUBLISHABLE_KEY_SELECTOR = By.css( '#woocommerce_stripe_test_publishable_key' );
10
const TEST_PUBLISHABLE_SECRET_KEY_SELECTOR = By.css( '#woocommerce_stripe_test_publishable_secret_key' );
11
12
13
export default class WPAdminWCSettingsCheckoutStripe extends WPAdminWCSettings {
14
	constructor( driver, args = {} ) {
15
		super( driver, args );
16
	}
17
18
	checkEnable() {
19
		return helper.setCheckbox( this.driver, ENABLE_SELECTOR );
20
	}
21
22
	uncheckEnable() {
23
		return helper.unsetCheckbox( this.driver, ENABLE_SELECTOR );
24
	}
25
26
	setTestPublishableKey( testPublishableKey ) {
27
		return helper.setWhenSettable( this.driver, TEST_PUBLISHABLE_KEY_SELECTOR, testPublishableKey );
28
	}
29
30
	setTestPublishableSecretKey( testPublishableSecretKey ) {
0 ignored issues
show
Unused Code introduced by
The parameter testPublishableSecretKey is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
31
		return helper.setWhenSettable( this.driver, TEST_PUBLISHABLE_SECRET_KEY_SELECTOR, testPublishableSecret );
0 ignored issues
show
Bug introduced by
The variable testPublishableSecret seems to be never declared. If this is a global, consider adding a /** global: testPublishableSecret */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
32
	}
33
}
34