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

e2e/lib/wp-admin-wc-settings-checkout-stripe.js (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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
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
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