/
024-astropay-santander-cash.js
56 lines (43 loc) · 1.8 KB
/
024-astropay-santander-cash.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import santanderCashJson from '@hipay/hipay-cypress-utils/fixtures/payment-means/santander-cash.json';
describe('Pay by Santander Cash', function () {
before(function () {
cy.logToAdmin();
cy.goToPaymentsTab();
cy.goToAdminHipayConfig();
cy.activateAstropayMethods();
cy.goToPaymentsTab();
cy.activatePaymentMethods("santander_cash");
cy.switchWooCurrency("MXN");
cy.adminLogOut();
});
after(function () {
cy.logToAdmin();
cy.switchWooCurrency("EUR");
cy.adminLogOut();
});
beforeEach(function () {
cy.selectItemAndGoToCart();
cy.addProductQuantity(2);
cy.goToCheckout();
cy.fillBillingForm("MX");
});
afterEach(() => {
cy.saveLastOrderId();
});
it('Pay by Santander Cash', function () {
cy.get('[for="payment_method_hipayenterprise_santander_cash"]').click({force: true});
cy.get('#santander-cash-national_identification_number')
.type(santanderCashJson.data.national_identification_number, {force: true})
.should('have.value', santanderCashJson.data.national_identification_number);
cy.get('#place_order').click({force: true});
cy.payAndCheck('paySantanderCash', santanderCashJson.url, "santander-cash");
});
it('Wrong form fields Santander Cash', function () {
cy.get('[for="payment_method_hipayenterprise_santander_cash"]').click({force: true});
cy.get('#santander-cash-national_identification_number')
.type("1111", {force: true})
.should('have.value', "1111");
cy.get('#place_order').click({force: true});
cy.get('#santander-cash-national_identification_number + .error-text-hp').contains("This is not a correct CPN/CURP");
});
});