forked from paypal/paypal-checkout-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathselectors.js
35 lines (29 loc) · 1.02 KB
/
selectors.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* @flow */
export const WINDOW_NAME = {
BUTTON: '__zoid__paypal_buttons__',
CHECKOUT: '__zoid__paypal_checkout__',
LOGIN: 'injectedUl'
};
export const SELECTORS = {
LOGIN: {
EMAIL_FIELD: 'input#email',
PASSWORD_FIELD: 'input#password',
NEXT_BUTTON: 'button#btnNext',
LOGIN_BUTTON: 'button#btnLogin'
},
CHECKOUT: {
LOGIN_IFRAME: `iframe[name=${ WINDOW_NAME.LOGIN }]`,
CREDIT_CANCEL: 'button#billingInfoCancelBtn',
ECONSENT_ACCEPT_CHECKBOX: 'label[data-test-id=eConsentLabel]',
ECONSENT_ACCEPT_BUTTON: 'input#submitEConsent',
SHIPPING_ADDRESS: '#shippingAddress',
REVIEW_CONTINUE_BUTTON: 'input#confirmButtonTop',
REVIEW_CHANGE_PAYMENT: 'a.changePayment',
SELECT_FUNDING: (n : number) : string => `ul.allPlanList li.fundingsource:nth-child(${ n })`
}
};
export const DATA_ATTRIBUTES = {
BUTTON: {
FUNDING_SOURCE: 'data-funding-source'
}
};