Skip to content

Commit

Permalink
Merge pull request #915 from mollie/e2e-new-payments
Browse files Browse the repository at this point in the history
E2E Bancomat payment
  • Loading branch information
SimonasB88 authored May 7, 2024
2 parents e71a0ba + 092a5d1 commit 4e3054b
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 7 deletions.
3 changes: 3 additions & 0 deletions cypress/e2e/ps8/01_mollie.ps8.ModuleConfiguration.specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ it('C339305: Connecting test API successsfully', () => {
cy.log(text) // Showing and asserting the text that loaded, to ensure the BO is loaded, not crashed with PHP fatals etc.
})
cy.iframe('[id^="uid_"]').find('button').click() // Cloudsync validation
cy.wait(15000) // Waiting for validation to process until the end
cy.get('#MOLLIE_ACCOUNT_SWITCH_on').click({force:true})
cy.get('#MOLLIE_API_KEY_TEST').type((Cypress.env('MOLLIE_TEST_API_KEY')),{delay: 0, log: false})
cy.get('#module_form_submit_btn').click()
Expand All @@ -45,6 +46,7 @@ it('C339339: Checking the Advanced Settings tab, verifying the Front-end compone
cy.get('[href="#advanced_settings"]').click({force:true})
cy.advancedSettingsValidation()
cy.reload()
cy.wait(3000)
cy.matchImage(); // let's make a snapshot for visual regression testing later, if UI matches
});
it('C688472: Checking the Subscriptions tab, and console errors', () => {
Expand All @@ -57,6 +59,7 @@ it('C688473: Checking the Subscriptions FAQ, and console errors', () => {
cy.OpeningModuleDashboardURL()
cy.get('#subtab-AdminMollieSubscriptionFAQ').click()
cy.subscriptionsUiCheck()
cy.wait(3000)
cy.matchImage(); // let's make a snapshot for visual regression testing later, if UI matches
});
})
18 changes: 18 additions & 0 deletions cypress/e2e/ps8/03_mollie.ps8.PaymentTestsOrdersAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,22 @@ it('C1860460: Pay with Klarna UK Checkouting [Orders API]', () => {
it('C1860461: Pay with Klarna UK Order Shipping, Refunding [Orders API]', () => {
cy.OrderShippingRefundingOrdersAPI()
})
it('C3006613: Bancomat Checkouting [Orders API]', () => {
cy.visit('/en/order-history')
cy.contains('Reorder').click()
cy.contains('DE').click({force:true})
//Billing country LT, DE etc.
cy.get('.clearfix > .btn').click()
cy.get('#js-delivery > .continue').click()
//Payment method choosing
cy.contains('Bancomat').click({force:true})
cy.get('.condition-label > .js-terms').click({force:true})
cy.contains('Place order').click()
cy.get('[value="paid"]').click()
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it('C3006614: Bancomat Order Shipping, Refunding [Orders API]', () => {
cy.OrderShippingRefundingOrdersAPI()
})
})
13 changes: 13 additions & 0 deletions cypress/e2e/ps8/05_mollie.ps8.PaymentTestsPaymentsAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,17 @@ it('C339401: 66 Bank Transfer Checkouting [Payments API]', () => {
it.skip('C339402: 67 Bank Transfer BO Refunding, Partial Refunding [Payments API]', () => { // somehow an error in console is thrown, will check why. Temporary skipping, because Mollie block is not loaded properly
cy.OrderRefundingPartialPaymentsAPI()
})
it('C3006615: Bancomat Checkouting [Payments API]', () => {
cy.navigatingToThePaymentPS8()
//Payment method choosing
cy.contains('Belfius').click({force:true})
cy.get('.condition-label > .js-terms').click({force:true})
cy.contains('Place order').click()
cy.get('[value="paid"]').click()
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it('C3006616: Bancomat BO Refunding, Partial Refunding [Payments API]', () => {
cy.OrderRefundingPartialPaymentsAPI()
})
})
4 changes: 2 additions & 2 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import 'cypress-iframe';
// Cypress.Commands.add("login", (email, password) => { ... })
Cypress.Commands.add("ConfOrdersAPI1784", () => {

const paymentMethods = ["applepay", "ideal", "creditcard", "in3", "klarnapaylater", "klarnapaynow", "klarnasliceit", "paypal", "banktransfer", "bancontact", "eps", "giropay", "przelewy24", "kbc", "belfius", "voucher", "directdebit", "billie", "klarna", "twint", "blik"];
const paymentMethods = ["applepay", "ideal", "creditcard", "in3", "klarnapaylater", "klarnapaynow", "klarnasliceit", "paypal", "banktransfer", "bancontact", "eps", "giropay", "przelewy24", "kbc", "belfius", "voucher", "directdebit", "billie", "klarna", "twint", "blik", "bancomatpay"];

// Iterate through the paymentMethods array using forEach
paymentMethods.forEach(method => {
Expand All @@ -59,7 +59,7 @@ Cypress.Commands.add("ConfOrdersAPI1784", () => {
})
Cypress.Commands.add("ConfPaymentsAPI1784", () => {

const paymentMethods = ["giropay", "eps", "przelewy24", "kbc", "belfius", "bancontact", "creditcard", "ideal", "banktransfer", "paypal", "applepay", "twint", "blik"];
const paymentMethods = ["giropay", "eps", "przelewy24", "kbc", "belfius", "bancontact", "creditcard", "ideal", "banktransfer", "paypal", "applepay", "twint", "blik", "bancomatpay"];

// Iterate through the paymentMethods array using forEach
paymentMethods.forEach(method => {
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"devDependencies": {
"@cypress/vue": "^6.0.0",
"@frsource/cypress-plugin-visual-regression-diff": "^3.3.10",
"cypress": "^13.7.3",
"cypress": "^13.8.1",
"cypress-fail-fast": "^7.0.3",
"cypress-iframe": "^1.0.1",
"cypress-shadow-dom": "^1.4.1",
Expand Down

0 comments on commit 4e3054b

Please sign in to comment.