/
020-astropay-bradesco.js
44 lines (35 loc) · 1.25 KB
/
020-astropay-bradesco.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
import bradescoJson from '@hipay/hipay-cypress-utils/fixtures/payment-means/bradesco.json';
describe('Pay by Bradesco', function () {
before(function () {
cy.logToAdmin();
cy.goToPaymentsTab();
cy.goToAdminHipayConfig();
cy.activateAstropayMethods();
cy.goToPaymentsTab();
cy.activatePaymentMethods("bradesco");
cy.switchWooCurrency("BRL");
cy.adminLogOut();
});
after(function () {
cy.logToAdmin();
cy.switchWooCurrency("EUR");
cy.adminLogOut();
});
beforeEach(function () {
cy.selectItemAndGoToCart();
cy.addProductQuantity(2);
cy.goToCheckout();
cy.fillBillingForm("BR");
});
afterEach(() => {
cy.saveLastOrderId();
});
it('Pay by Bradesco', function () {
cy.get('[for="payment_method_hipayenterprise_bradesco"]').click({force: true});
cy.get('#bradesco-national_identification_number')
.type(bradescoJson.data.national_identification_number, {force: true})
.should('have.value', bradescoJson.data.national_identification_number);
cy.get('#place_order').click({force: true});
cy.payAndCheck('payBradesco', bradescoJson.url, "bradesco");
});
});