diff --git a/cypress/e2e/ps1785/01_mollie.ps1785.ModuleConfiguration.specs.js b/cypress/e2e/ps1785/01_mollie.ps1785.ModuleConfiguration.specs.js index 82dcb99f9..13c32c3a3 100755 --- a/cypress/e2e/ps1785/01_mollie.ps1785.ModuleConfiguration.specs.js +++ b/cypress/e2e/ps1785/01_mollie.ps1785.ModuleConfiguration.specs.js @@ -43,35 +43,9 @@ it('C339339: 03 Checking the Advanced Settings tab, verifying the Front-end comp cy.visit('/admin1/') cy.OpeningModuleDashboardURL() cy.get('[href="#advanced_settings"]').click({force:true}) - cy.get('[id="MOLLIE_PAYMENTSCREEN_LOCALE"]').should('be.visible') - cy.get('[id="MOLLIE_SEND_ORDER_CONFIRMATION"]').should('be.visible') - cy.get('[id="MOLLIE_AUTHORIZABLE_PAYMENT_INVOICE_ON_STATUS"]').should('be.visible') - cy.get('[class="help-block"]').should('be.visible') - cy.get('[id="MOLLIE_STATUS_AWAITING"]').should('be.visible') - cy.get('[id="MOLLIE_STATUS_PAID"]').should('be.visible') - cy.get('[name="MOLLIE_MAIL_WHEN_PAID"]').should('exist') - cy.get('[name="MOLLIE_MAIL_WHEN_COMPLETED"]').should('exist') - cy.get('[name="MOLLIE_STATUS_COMPLETED"]').should('exist') - cy.get('[name="MOLLIE_MAIL_WHEN_CANCELED"]').should('exist') - cy.get('[name="MOLLIE_STATUS_CANCELED"]').should('exist') - cy.get('[name="MOLLIE_MAIL_WHEN_EXPIRED"]').should('exist') - cy.get('[name="MOLLIE_STATUS_EXPIRED"]').should('exist') - cy.get('[name="MOLLIE_MAIL_WHEN_REFUNDED"]').should('exist') - cy.get('[name="MOLLIE_STATUS_REFUNDED"]').should('exist') - cy.get('[name="MOLLIE_STATUS_OPEN"]').should('exist') - cy.get('[name="MOLLIE_MAIL_WHEN_SHIPPING"]').should('exist') - cy.get('[name="MOLLIE_STATUS_SHIPPING"]').should('exist') - cy.get('[name="MOLLIE_STATUS_PARTIAL_REFUND"]').should('exist') - cy.get('[name="MOLLIE_IMAGES"]').should('exist') - cy.get('[name="MOLLIE_CSS"]').should('exist') - cy.get('[id="MOLLIE_TRACKING_URLS__container"]').should('exist') - cy.get('[id="MOLLIE_AS_MAIN_info"]').should('exist') - cy.get('[id="MOLLIE_AS_STATUSES_info"]').should('exist') - cy.get('[name="MOLLIE_DISPLAY_ERRORS"]').should('exist') - cy.get('[name="MOLLIE_DEBUG_LOG"]').should('exist') + cy.advancedSettingsValidation() cy.reload() cy.matchImage(); // let's make a snapshot for visual regression testing later, if UI matches - //cy.window() will check if there are no Errors in console }); it('C688472: Checking the Subscriptions tab, and console errors', () => { cy.visit('/admin1/') @@ -84,10 +58,7 @@ it('C688473: Checking the Subscriptions FAQ, and console errors', () => { cy.visit('/admin1/') cy.OpeningModuleDashboardURL() cy.get('#subtab-AdminMollieSubscriptionFAQ').click() - cy.get(':nth-child(2) > .col-lg-12 > .card').should('be.visible') - cy.get(':nth-child(3) > .col-lg-12 > .card').should('be.visible') - cy.get(':nth-child(4) > .col-lg-12 > .card').should('be.visible') - cy.get(':nth-child(5) > .col-lg-12 > .card').should('be.visible') + cy.subscriptionsUiCheck() cy.matchImage(); // let's make a snapshot for visual regression testing later, if UI matches }); }) diff --git a/cypress/e2e/ps1785/03_mollie.ps1785.PaymentTestsOrdersAPI.js b/cypress/e2e/ps1785/03_mollie.ps1785.PaymentTestsOrdersAPI.js index abdf113d6..9f28a15a3 100755 --- a/cypress/e2e/ps1785/03_mollie.ps1785.PaymentTestsOrdersAPI.js +++ b/cypress/e2e/ps1785/03_mollie.ps1785.PaymentTestsOrdersAPI.js @@ -338,43 +338,43 @@ it('C1860461: Pay with Klarna UK Order Shipping, Refunding [Orders API]', () => }) // TODO - some reported possible bugs in the workflow, but still continuing on completing the tests... it.only('Blik Checkouting [Orders API]', () => { - cy.visit('/en/order-history') - // switching the currency - cy.pause() - cy.contains('Reorder').click() - cy.contains('UK').click({force:true}) - //Billing country LT, DE etc. - cy.get('.clearfix > .btn').click() - cy.get('#js-delivery > .continue').click() - //Payment method choosing - cy.contains('Blik').click({force:true}) - cy.get('.condition-label > .js-terms').click({force:true}) - cy.contains('Place order').click() - cy.get('[value="authorized"]').click() - cy.get('[class="button form__button"]').click() - cy.get('#content-hook_order_confirmation > .card-block').should('be.visible') + cy.visit('/en/order-history') + // switching the currency + cy.pause() + cy.contains('Reorder').click() + cy.contains('UK').click({force:true}) + //Billing country LT, DE etc. + cy.get('.clearfix > .btn').click() + cy.get('#js-delivery > .continue').click() + //Payment method choosing + cy.contains('Blik').click({force:true}) + cy.get('.condition-label > .js-terms').click({force:true}) + cy.contains('Place order').click() + cy.get('[value="authorized"]').click() + cy.get('[class="button form__button"]').click() + cy.get('#content-hook_order_confirmation > .card-block').should('be.visible') }); it.only('Blik Order Shipping, Refunding [Orders API]', () => { - cy.OrderShippingRefundingOrdersAPI() + cy.OrderShippingRefundingOrdersAPI() }) it('TWINT Checkouting [Orders API]', () => { - cy.visit('/en/order-history') - // switching the currency - cy.pause() - cy.contains('Reorder').click() - cy.contains('UK').click({force:true}) - //Billing country LT, DE etc. - cy.get('.clearfix > .btn').click() - cy.get('#js-delivery > .continue').click() - //Payment method choosing - cy.contains('TWINT').click({force:true}) - cy.get('.condition-label > .js-terms').click({force:true}) - cy.contains('Place order').click() - cy.get('[value="authorized"]').click() - cy.get('[class="button form__button"]').click() - cy.get('#content-hook_order_confirmation > .card-block').should('be.visible') + cy.visit('/en/order-history') + // switching the currency + cy.pause() + cy.contains('Reorder').click() + cy.contains('UK').click({force:true}) + //Billing country LT, DE etc. + cy.get('.clearfix > .btn').click() + cy.get('#js-delivery > .continue').click() + //Payment method choosing + cy.contains('TWINT').click({force:true}) + cy.get('.condition-label > .js-terms').click({force:true}) + cy.contains('Place order').click() + cy.get('[value="authorized"]').click() + cy.get('[class="button form__button"]').click() + cy.get('#content-hook_order_confirmation > .card-block').should('be.visible') }); it('TWINT Order Shipping, Refunding [Orders API]', () => { - cy.OrderShippingRefundingOrdersAPI() + cy.OrderShippingRefundingOrdersAPI() }) }) diff --git a/cypress/e2e/ps1785/05_mollie.ps1785.PaymentTestsPaymentsAPI.js b/cypress/e2e/ps1785/05_mollie.ps1785.PaymentTestsPaymentsAPI.js index 2e2c7d7e0..faffc9163 100755 --- a/cypress/e2e/ps1785/05_mollie.ps1785.PaymentTestsPaymentsAPI.js +++ b/cypress/e2e/ps1785/05_mollie.ps1785.PaymentTestsPaymentsAPI.js @@ -14,13 +14,13 @@ describe('PS1785 Tests Suite [Payments API]', { }, }, () => { beforeEach(() => { - cy.viewport(1920,1080) - cy.CachingBOFOPS1785() + cy.viewport(1920,1080) + cy.CachingBOFOPS1785() }) it('C339378: 43 Check if Bancontact QR payment dropdown exists [Payments API]', () => { - cy.visit('/admin1/') - cy.OpeningModuleDashboardURL() - cy.get('[name="MOLLIE_BANCONTACT_QR_CODE_ENABLED"]').should('exist') + cy.visit('/admin1/') + cy.OpeningModuleDashboardURL() + cy.get('[name="MOLLIE_BANCONTACT_QR_CODE_ENABLED"]').should('exist') }) it('C339379: 44 Bancontact Checkouting [Payments API]', () => { cy.navigatingToThePayment() @@ -253,42 +253,42 @@ it('C339402: 67 Bank Transfer BO Refunding, Partial Refunding [Payments API]', ( }); // TODO - some reported possible bugs in the workflow, but still continuing on completing the tests... it.only('Blik Checkouting [Payments API]', () => { - cy.visit('/en/order-history') - // switching the currency - cy.pause() - cy.contains('UK').click({force:true}) - //Billing country LT, DE etc. - cy.get('.clearfix > .btn').click() - cy.get('#js-delivery > .continue').click() - //Payment method choosing - cy.contains('Blik').click({force:true}) - cy.get('.condition-label > .js-terms').click({force:true}) - cy.contains('Place order').click() - cy.get('[value="authorized"]').click() - cy.get('[class="button form__button"]').click() - cy.get('#content-hook_order_confirmation > .card-block').should('be.visible') + cy.visit('/en/order-history') + // switching the currency + cy.pause() + cy.contains('UK').click({force:true}) + //Billing country LT, DE etc. + cy.get('.clearfix > .btn').click() + cy.get('#js-delivery > .continue').click() + //Payment method choosing + cy.contains('Blik').click({force:true}) + cy.get('.condition-label > .js-terms').click({force:true}) + cy.contains('Place order').click() + cy.get('[value="authorized"]').click() + cy.get('[class="button form__button"]').click() + cy.get('#content-hook_order_confirmation > .card-block').should('be.visible') }); it.only('Blik Order Shipping, Refunding [Payments API]', () => { - cy.OrderRefundingPartialPaymentsAPI() + cy.OrderRefundingPartialPaymentsAPI() }) it('TWINT Checkouting [Payments API]', () => { - cy.visit('/en/order-history') - // switching the currency - cy.pause() - cy.contains('Reorder').click() - cy.contains('UK').click({force:true}) - //Billing country LT, DE etc. - cy.get('.clearfix > .btn').click() - cy.get('#js-delivery > .continue').click() - //Payment method choosing - cy.contains('TWINT').click({force:true}) - cy.get('.condition-label > .js-terms').click({force:true}) - cy.contains('Place order').click() - cy.get('[value="authorized"]').click() - cy.get('[class="button form__button"]').click() - cy.get('#content-hook_order_confirmation > .card-block').should('be.visible') + cy.visit('/en/order-history') + // switching the currency + cy.pause() + cy.contains('Reorder').click() + cy.contains('UK').click({force:true}) + //Billing country LT, DE etc. + cy.get('.clearfix > .btn').click() + cy.get('#js-delivery > .continue').click() + //Payment method choosing + cy.contains('TWINT').click({force:true}) + cy.get('.condition-label > .js-terms').click({force:true}) + cy.contains('Place order').click() + cy.get('[value="authorized"]').click() + cy.get('[class="button form__button"]').click() + cy.get('#content-hook_order_confirmation > .card-block').should('be.visible') }); it('TWINT Order Shipping, Refunding [Payments API]', () => { - cy.OrderRefundingPartialPaymentsAPI() + cy.OrderRefundingPartialPaymentsAPI() }) }) diff --git a/cypress/e2e/ps8/01_mollie.ps8.ModuleConfiguration.specs.js b/cypress/e2e/ps8/01_mollie.ps8.ModuleConfiguration.specs.js index ed7d665e7..97238d31e 100755 --- a/cypress/e2e/ps8/01_mollie.ps8.ModuleConfiguration.specs.js +++ b/cypress/e2e/ps8/01_mollie.ps8.ModuleConfiguration.specs.js @@ -41,59 +41,22 @@ it('C339338: Enabling Mollie carriers in Prestashop successfully', () => { cy.get('[id="form-carrier-restrictions-save-button"]').click() }) it('C339339: Checking the Advanced Settings tab, verifying the Front-end components, Saving the form, checking if there are no Errors in Console', () => { - cy.visit('/admin1/') - cy.get('.mi-mollie').click({fore:true}) - cy.get('#subtab-AdminMollieModule').click() + cy.OpeningModuleDashboardURL() cy.get('[href="#advanced_settings"]').click({force:true}) - cy.get('[id="MOLLIE_PAYMENTSCREEN_LOCALE"]').should('be.visible') - cy.get('[id="MOLLIE_SEND_ORDER_CONFIRMATION"]').should('be.visible') - cy.get('[id="MOLLIE_AUTHORIZABLE_PAYMENT_INVOICE_ON_STATUS"]').should('be.visible') - cy.get('[class="help-block"]').should('be.visible') - cy.get('[id="MOLLIE_STATUS_AWAITING"]').should('be.visible') - cy.get('[id="MOLLIE_STATUS_PAID"]').should('be.visible') - cy.get('[name="MOLLIE_MAIL_WHEN_PAID"]').should('exist') - cy.get('[name="MOLLIE_MAIL_WHEN_COMPLETED"]').should('exist') - cy.get('[name="MOLLIE_STATUS_COMPLETED"]').should('exist') - cy.get('[name="MOLLIE_MAIL_WHEN_CANCELED"]').should('exist') - cy.get('[name="MOLLIE_STATUS_CANCELED"]').should('exist') - cy.get('[name="MOLLIE_MAIL_WHEN_EXPIRED"]').should('exist') - cy.get('[name="MOLLIE_STATUS_EXPIRED"]').should('exist') - cy.get('[name="MOLLIE_MAIL_WHEN_REFUNDED"]').should('exist') - cy.get('[name="MOLLIE_STATUS_REFUNDED"]').should('exist') - cy.get('[name="MOLLIE_STATUS_OPEN"]').should('exist') - cy.get('[name="MOLLIE_MAIL_WHEN_SHIPPING"]').should('exist') - cy.get('[name="MOLLIE_STATUS_SHIPPING"]').should('exist') - cy.get('[name="MOLLIE_STATUS_PARTIAL_REFUND"]').should('exist') - cy.get('[name="MOLLIE_IMAGES"]').should('exist') - cy.get('[name="MOLLIE_CSS"]').should('exist') - cy.get('[id="MOLLIE_TRACKING_URLS__container"]').should('exist') - cy.get('[id="MOLLIE_AS_MAIN_info"]').should('exist') - cy.get('[id="MOLLIE_AS_STATUSES_info"]').should('exist') - cy.get('[name="MOLLIE_DISPLAY_ERRORS"]').should('exist') - cy.get('[name="MOLLIE_DEBUG_LOG"]').should('exist') - cy.get('#module_form_submit_btn').click({force:true}) //checking the saving - cy.get('[class="alert alert-success"]').should('be.visible') //checking if saving returns green alert + cy.advancedSettingsValidation() cy.reload() cy.matchImage(); // let's make a snapshot for visual regression testing later, if UI matches - //cy.window() will check if there are no Errors in console }); it('C688472: Checking the Subscriptions tab, and console errors', () => { - cy.visit('/admin1/') - cy.get('.mi-mollie').click({fore:true}) - cy.get('#subtab-AdminMollieModule').click() + cy.OpeningModuleDashboardURL() cy.get('#subtab-AdminMollieSubscriptionOrders').click() cy.get('[id="invertus_mollie_subscription_grid_panel"]').should('be.visible') cy.selectSubscriptionsCarriersCheck() // checking the Subscriptions carriers select and saving }); it('C688473: Checking the Subscriptions FAQ, and console errors', () => { - cy.visit('/admin1/') - cy.get('.mi-mollie').click({fore:true}) - cy.get('#subtab-AdminMollieModule').click() + cy.OpeningModuleDashboardURL() cy.get('#subtab-AdminMollieSubscriptionFAQ').click() - cy.get(':nth-child(3) > .col-lg-12 > .card').should('be.visible') - cy.get(':nth-child(4) > .col-lg-12 > .card').should('be.visible') - cy.get(':nth-child(5) > .col-lg-12 > .card').should('be.visible') - cy.get(':nth-child(6) > .col-lg-12 > .card').should('be.visible') + cy.subscriptionsUiCheck() cy.matchImage(); // let's make a snapshot for visual regression testing later, if UI matches }); }) diff --git a/cypress/e2e/ps8/03_mollie.ps8.PaymentTestsOrdersAPI.js b/cypress/e2e/ps8/03_mollie.ps8.PaymentTestsOrdersAPI.js index b3edf7ab5..529e4ba30 100755 --- a/cypress/e2e/ps8/03_mollie.ps8.PaymentTestsOrdersAPI.js +++ b/cypress/e2e/ps8/03_mollie.ps8.PaymentTestsOrdersAPI.js @@ -308,20 +308,21 @@ it('C1765086: Billie Order Shipping, Refunding [Orders API]', () => { cy.OrderShippingRefundingOrdersAPI() }) it('C1860460: Pay with Klarna UK Checkouting [Orders API]', () => { - cy.visit('/en/order-history') - cy.contains('Reorder').click() - cy.contains('UK').click({force:true}) - //Billing country LT, DE etc. - cy.get('.clearfix > .btn').click() - cy.get('#js-delivery > .continue').click() - //Payment method choosing - cy.contains('Pay with Klarna').click({force:true}) - cy.get('.condition-label > .js-terms').click({force:true}) - cy.contains('Place order').click() - cy.get('[value="authorized"]').click() - cy.get('[class="button form__button"]').click() - cy.get('#content-hook_order_confirmation > .card-block').should('be.visible') + cy.visit('/en/order-history') + cy.contains('Reorder').click() + cy.contains('UK').click({force:true}) + //Billing country LT, DE etc. + cy.get('.clearfix > .btn').click() + cy.get('#js-delivery > .continue').click() + //Payment method choosing + cy.contains('Pay with Klarna').click({force:true}) + cy.get('.condition-label > .js-terms').click({force:true}) + cy.contains('Place order').click() + cy.get('[value="authorized"]').click() + cy.get('[class="button form__button"]').click() + cy.get('#content-hook_order_confirmation > .card-block').should('be.visible') }); it('C1860461: Pay with Klarna UK Order Shipping, Refunding [Orders API]', () => { + cy.OrderShippingRefundingOrdersAPI() }) }) diff --git a/cypress/e2e/ps8/05_mollie.ps8.PaymentTestsPaymentsAPI.js b/cypress/e2e/ps8/05_mollie.ps8.PaymentTestsPaymentsAPI.js index e1b110ae2..d37178d39 100755 --- a/cypress/e2e/ps8/05_mollie.ps8.PaymentTestsPaymentsAPI.js +++ b/cypress/e2e/ps8/05_mollie.ps8.PaymentTestsPaymentsAPI.js @@ -6,13 +6,13 @@ describe('PS8 Tests Suite [Payments API]', { }, }, () => { beforeEach(() => { - cy.viewport(1920,1080) - cy.CachingBOFOPS8() + cy.viewport(1920,1080) + cy.CachingBOFOPS8() }) it('C339378: 43 Check if Bancontact QR payment dropdown exists [Payments API]', () => { - cy.visit('/admin1/') - cy.OpeningModuleDashboardURL() - cy.get('[name="MOLLIE_BANCONTACT_QR_CODE_ENABLED"]').should('exist') + cy.visit('/admin1/') + cy.OpeningModuleDashboardURL() + cy.get('[name="MOLLIE_BANCONTACT_QR_CODE_ENABLED"]').should('exist') }) it('C339379: 44 Bancontact Checkouting [Payments API]', () => { cy.navigatingToThePaymentPS8() diff --git a/cypress/support/commands.js b/cypress/support/commands.js index b135354a7..6f976a0ba 100755 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -42,30 +42,30 @@ import 'cypress-iframe'; // Cypress.Commands.add("login", (email, password) => { ... }) Cypress.Commands.add("ConfOrdersAPI1784", () => { - const paymentMethods = ["applepay", "ideal", "creditcard", "in3", "klarnapaylater", "klarnapaynow", "klarnasliceit", "paypal", "banktransfer", "giftcard", "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"]; - // Iterate through the paymentMethods array using forEach - paymentMethods.forEach(method => { - cy.get(`[name="MOLLIE_METHOD_ENABLED_${method}"]`).select('Yes', { force: true }); - cy.get(`[name="MOLLIE_METHOD_API_${method}"]`).select('Orders API', { force: true }); - cy.get(`[name="MOLLIE_METHOD_DESCRIPTION_${method}"]`).clear({ force: true }).type('text 123 !@#$%^&*', { force: true }); - cy.get(`[name="MOLLIE_METHOD_SURCHARGE_TYPE_${method}"]`).select('3', { force: true }); - cy.get(`[name="MOLLIE_METHOD_SURCHARGE_FIXED_AMOUNT_TAX_INCL_${method}"]`).clear({ force: true }).type('4', { force: true }); - cy.get(`[name="MOLLIE_METHOD_SURCHARGE_FIXED_AMOUNT_TAX_EXCL_${method}"]`).clear({ force: true }).type('5', { force: true }); - cy.get(`[name="MOLLIE_METHOD_TAX_RULES_GROUP_ID_${method}"]`).select('1', { force: true }); - cy.get(`[name="MOLLIE_METHOD_SURCHARGE_PERCENTAGE_${method}"]`).clear({ force: true }).type('22', { force: true }); - cy.get(`[name="MOLLIE_METHOD_SURCHARGE_LIMIT_${method}"]`).clear({ force: true }).type('33', { force: true }); - }); + // Iterate through the paymentMethods array using forEach + paymentMethods.forEach(method => { + cy.get(`[name="MOLLIE_METHOD_ENABLED_${method}"]`).select('Yes', { force: true }); + cy.get(`[name="MOLLIE_METHOD_API_${method}"]`).select('Orders API', { force: true }); + cy.get(`[name="MOLLIE_METHOD_DESCRIPTION_${method}"]`).clear({ force: true }).type('text 123 !@#$%^&*', { force: true }); + cy.get(`[name="MOLLIE_METHOD_SURCHARGE_TYPE_${method}"]`).select('3', { force: true }); + cy.get(`[name="MOLLIE_METHOD_SURCHARGE_FIXED_AMOUNT_TAX_INCL_${method}"]`).clear({ force: true }).type('4', { force: true }); + cy.get(`[name="MOLLIE_METHOD_SURCHARGE_FIXED_AMOUNT_TAX_EXCL_${method}"]`).clear({ force: true }).type('5', { force: true }); + cy.get(`[name="MOLLIE_METHOD_TAX_RULES_GROUP_ID_${method}"]`).select('1', { force: true }); + cy.get(`[name="MOLLIE_METHOD_SURCHARGE_PERCENTAGE_${method}"]`).clear({ force: true }).type('22', { force: true }); + cy.get(`[name="MOLLIE_METHOD_SURCHARGE_LIMIT_${method}"]`).clear({ force: true }).type('33', { force: true }); + }); }) 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"]; - // Iterate through the paymentMethods array using forEach - paymentMethods.forEach(method => { - cy.get(`[name="MOLLIE_METHOD_ENABLED_${method}"]`).select('Yes', {force: true}) - cy.get(`[name="MOLLIE_METHOD_API_${method}"]`).select('Payments API', {force: true}) - }); + // Iterate through the paymentMethods array using forEach + paymentMethods.forEach(method => { + cy.get(`[name="MOLLIE_METHOD_ENABLED_${method}"]`).select('Yes', {force: true}) + cy.get(`[name="MOLLIE_METHOD_API_${method}"]`).select('Payments API', {force: true}) + }); }) Cypress.Commands.add("navigatingToThePaymentPS8", () => { cy.visit('/de/index.php?controller=history') @@ -76,100 +76,100 @@ Cypress.Commands.add("navigatingToThePaymentPS8", () => { cy.get('#js-delivery > .continue').click() }) Cypress.Commands.add("navigatingToThePayment", () => { - cy.visit('/de/index.php?controller=history') - cy.contains('Reorder').click() - cy.contains('NL').click() - //Billing country LT, DE etc. - cy.get('.clearfix > .btn').click() - cy.get('#js-delivery > .continue').click() + cy.visit('/de/index.php?controller=history') + cy.contains('Reorder').click() + cy.contains('NL').click() + //Billing country LT, DE etc. + cy.get('.clearfix > .btn').click() + cy.get('#js-delivery > .continue').click() }) Cypress.Commands.add("OrderRefundingShippingOrdersAPI", () => { cy.visit('/admin1/index.php?controller=AdminOrders') cy.get(':nth-child(1) > .column-payment').click() cy.scrollTo('bottom') // Refunding dropdown in React - cy.get('.btn-group-action > .btn-group > .dropdown-toggle').eq(0).click() - cy.get('[role="button"]').eq(2).click() - cy.get('[class="swal-button swal-button--confirm"]').click() - cy.get('[class="alert alert-success"]').should('be.visible') - //Shipping button in React - cy.get('.btn-group > [title=""]').eq(0).click() - cy.get('[class="swal-button swal-button--confirm"]').click() - cy.get('.swal-modal').should('exist') - cy.get('#input-carrier').clear({force: true}).type('FedEx',{delay:0}) - cy.get('#input-code').clear({force: true}).type('123456',{delay:0}) - cy.get('#input-url').clear({force: true}).type('https://www.invertus.eu',{delay:0}) - cy.get(':nth-child(2) > .swal-button').click() - cy.get('#mollie_order > :nth-child(1) > .alert').contains('Shipment was made successfully!') - cy.get('[class="alert alert-success"]').should('be.visible') - // Add more actions as needed + cy.get('.btn-group-action > .btn-group > .dropdown-toggle').eq(0).click() + cy.get('[role="button"]').eq(2).click() + cy.get('[class="swal-button swal-button--confirm"]').click() + cy.get('[class="alert alert-success"]').should('be.visible') + //Shipping button in React + cy.get('.btn-group > [title=""]').eq(0).click() + cy.get('[class="swal-button swal-button--confirm"]').click() + cy.get('.swal-modal').should('exist') + cy.get('#input-carrier').clear({force: true}).type('FedEx',{delay:0}) + cy.get('#input-code').clear({force: true}).type('123456',{delay:0}) + cy.get('#input-url').clear({force: true}).type('https://www.invertus.eu',{delay:0}) + cy.get(':nth-child(2) > .swal-button').click() + cy.get('#mollie_order > :nth-child(1) > .alert').contains('Shipment was made successfully!') + cy.get('[class="alert alert-success"]').should('be.visible') + // Add more actions as needed }) Cypress.Commands.add("OrderShippingRefundingOrdersAPI", () => { cy.visit('/admin1/index.php?controller=AdminOrders') cy.get(':nth-child(1) > .column-payment').click() cy.scrollTo('bottom') // Shipping button in React - cy.get('.btn-group > [title=""]').eq(0).click() - cy.get('[class="swal-button swal-button--confirm"]').click() - cy.get('.swal-modal').should('exist') - cy.get('#input-carrier').clear({force: true}).type('FedEx',{delay:0}) - cy.get('#input-code').clear({force: true}).type('123456',{delay:0}) - cy.get('#input-url').clear({force: true}).type('https://www.invertus.eu',{delay:0}) - cy.get(':nth-child(2) > .swal-button').click() - cy.get('#mollie_order > :nth-child(1) > .alert').contains('Shipment was made successfully!') - cy.get('[class="alert alert-success"]').should('be.visible') - //Refunding dropdown in React - cy.get('.btn-group-action > .btn-group > .dropdown-toggle').eq(0).click() - cy.get('[role="button"]').eq(2).click() - cy.get('[class="swal-button swal-button--confirm"]').click() - cy.get('[class="alert alert-success"]').should('be.visible') - // Add more actions as needed + cy.get('.btn-group > [title=""]').eq(0).click() + cy.get('[class="swal-button swal-button--confirm"]').click() + cy.get('.swal-modal').should('exist') + cy.get('#input-carrier').clear({force: true}).type('FedEx',{delay:0}) + cy.get('#input-code').clear({force: true}).type('123456',{delay:0}) + cy.get('#input-url').clear({force: true}).type('https://www.invertus.eu',{delay:0}) + cy.get(':nth-child(2) > .swal-button').click() + cy.get('#mollie_order > :nth-child(1) > .alert').contains('Shipment was made successfully!') + cy.get('[class="alert alert-success"]').should('be.visible') + //Refunding dropdown in React + cy.get('.btn-group-action > .btn-group > .dropdown-toggle').eq(0).click() + cy.get('[role="button"]').eq(2).click() + cy.get('[class="swal-button swal-button--confirm"]').click() + cy.get('[class="alert alert-success"]').should('be.visible') + // Add more actions as needed }) Cypress.Commands.add("OrderRefundingPartialPaymentsAPI", () => { cy.visit('/admin1/index.php?controller=AdminOrders') cy.get(':nth-child(1) > .column-payment').click() cy.scrollTo('bottom') - cy.get('#mollie_order > :nth-child(1)').click() - cy.get('.form-inline > :nth-child(1) > .btn').should('exist') - cy.get('.input-group-btn > .btn').should('exist') - cy.get('.sc-htpNat > .panel > .card-body > :nth-child(3)').should('exist') - cy.get('.card-body > :nth-child(6)').should('exist') - cy.get('.card-body > :nth-child(9)').should('exist') - cy.get('#mollie_order > :nth-child(1) > :nth-child(1)').should('exist') - cy.get('.sc-htpNat > .panel > .card-body').should('exist') - cy.get('.sc-bxivhb > .panel > .panel-heading').should('exist') - cy.get('.sc-bxivhb > .panel > .card-body').should('exist') - //Check partial refunding on Payments API - cy.get('.form-inline > :nth-child(2) > .input-group > .form-control').type('1.51',{delay:0}) - cy.get(':nth-child(2) > .input-group > .input-group-btn > .btn').click() - cy.get('.swal-modal').should('exist') - cy.get(':nth-child(2) > .swal-button').click() - cy.get('#mollie_order > :nth-child(1) > .alert').contains('Refund was made successfully!') - cy.get('.form-inline > :nth-child(1) > .btn').click() - cy.get('.swal-modal').should('exist') - cy.get(':nth-child(2) > .swal-button').click() - cy.get('#mollie_order > :nth-child(1) > .alert').contains('Refund was made successfully!') + cy.get('#mollie_order > :nth-child(1)').click() + cy.get('.form-inline > :nth-child(1) > .btn').should('exist') + cy.get('.input-group-btn > .btn').should('exist') + cy.get('.sc-htpNat > .panel > .card-body > :nth-child(3)').should('exist') + cy.get('.card-body > :nth-child(6)').should('exist') + cy.get('.card-body > :nth-child(9)').should('exist') + cy.get('#mollie_order > :nth-child(1) > :nth-child(1)').should('exist') + cy.get('.sc-htpNat > .panel > .card-body').should('exist') + cy.get('.sc-bxivhb > .panel > .panel-heading').should('exist') + cy.get('.sc-bxivhb > .panel > .card-body').should('exist') + //Check partial refunding on Payments API + cy.get('.form-inline > :nth-child(2) > .input-group > .form-control').type('1.51',{delay:0}) + cy.get(':nth-child(2) > .input-group > .input-group-btn > .btn').click() + cy.get('.swal-modal').should('exist') + cy.get(':nth-child(2) > .swal-button').click() + cy.get('#mollie_order > :nth-child(1) > .alert').contains('Refund was made successfully!') + cy.get('.form-inline > :nth-child(1) > .btn').click() + cy.get('.swal-modal').should('exist') + cy.get(':nth-child(2) > .swal-button').click() + cy.get('#mollie_order > :nth-child(1) > .alert').contains('Refund was made successfully!') }) Cypress.Commands.add("EnablingModuleMultistore", () => { - cy.get('#subtab-AdminParentModulesSf > :nth-child(1)').click() - cy.get('#subtab-AdminModulesSf').click().wait(1000) - // enable or upgrade the module - cy.get('[data-name="Mollie"]').then(($body) => { - if ($body.text().includes('Upgrade')) { - // yup, module needs to be upgraded - cy.get('[data-name="Mollie"]').contains('Upgrade').click() - cy.get('.btn-secondary').click() - cy.get('.growl').should('have.text','succeeded.') - } else if ($body.text().includes('Enable')) { - // or just enable the module first - cy.get('[data-name="Mollie"]').contains('Enable').click() - } else { - // nop, just enter the module configuration - cy.get('[data-name="Mollie"]').contains('Configure').click() - } - }) - // back to dashboard - cy.get('#tab-AdminDashboard > .link').click({force:true}) + cy.get('#subtab-AdminParentModulesSf > :nth-child(1)').click() + cy.get('#subtab-AdminModulesSf').click().wait(1000) + // enable or upgrade the module + cy.get('[data-name="Mollie"]').then(($body) => { + if ($body.text().includes('Upgrade')) { + // yup, module needs to be upgraded + cy.get('[data-name="Mollie"]').contains('Upgrade').click() + cy.get('.btn-secondary').click() + cy.get('.growl').should('have.text','succeeded.') + } else if ($body.text().includes('Enable')) { + // or just enable the module first + cy.get('[data-name="Mollie"]').contains('Enable').click() + } else { + // nop, just enter the module configuration + cy.get('[data-name="Mollie"]').contains('Configure').click() + } + }) + // back to dashboard + cy.get('#tab-AdminDashboard > .link').click({force:true}) }) Cypress.Commands.add("OpenModuleDashboard", () => { cy.get('#subtab-AdminParentModulesSf > :nth-child(1)').click() @@ -177,56 +177,56 @@ Cypress.Commands.add("OpenModuleDashboard", () => { cy.get('[data-name="Mollie"]').contains('Configure').click() }) Cypress.Commands.add("CreditCardFillingIframe", () => { - cy.frameLoaded('[name="cardHolder-input"]') - cy.enter('[name="cardHolder-input"]').then(getBody => { - getBody().find('#cardHolder').clear({force: true}).type('TEST TEEESSSTT',{force:true}) - }) - cy.enter('[name="cardNumber-input"]').then(getBody => { - getBody().find('#cardNumber').clear({force: true}).type('5555555555554444',{force:true}) - }) - cy.enter('[name="expiryDate-input"]').then(getBody => { - getBody().find('#expiryDate').clear({force: true}).type('1226',{force:true}) - }) - cy.enter('[name="verificationCode-input"]').then(getBody => { - getBody().find('#verificationCode').clear({force: true}).type('222',{force:true}) - }) + cy.frameLoaded('[name="cardHolder-input"]') + cy.enter('[name="cardHolder-input"]').then(getBody => { + getBody().find('#cardHolder').clear({force: true}).type('TEST TEEESSSTT',{force:true}) + }) + cy.enter('[name="cardNumber-input"]').then(getBody => { + getBody().find('#cardNumber').clear({force: true}).type('5555555555554444',{force:true}) + }) + cy.enter('[name="expiryDate-input"]').then(getBody => { + getBody().find('#expiryDate').clear({force: true}).type('1226',{force:true}) + }) + cy.enter('[name="verificationCode-input"]').then(getBody => { + getBody().find('#verificationCode').clear({force: true}).type('222',{force:true}) + }) }) Cypress.Commands.add("NotSecureCreditCardFillingIframe", () => { - cy.frameLoaded('[name="cardHolder-input"]') - cy.enter('[name="cardHolder-input"]').then(getBody => { - getBody().find('#cardHolder').clear({force: true}).type('TEST TEEESSSTT',{force:true}) - }) - cy.enter('[name="cardNumber-input"]').then(getBody => { - getBody().find('#cardNumber').clear({force: true}).type('4242424242424242',{force:true}) - }) - cy.enter('[name="expiryDate-input"]').then(getBody => { - getBody().find('#expiryDate').clear({force: true}).type('1226',{force:true}) - }) - cy.enter('[name="verificationCode-input"]').then(getBody => { - getBody().find('#verificationCode').clear({force: true}).type('222',{force:true}) - }) + cy.frameLoaded('[name="cardHolder-input"]') + cy.enter('[name="cardHolder-input"]').then(getBody => { + getBody().find('#cardHolder').clear({force: true}).type('TEST TEEESSSTT',{force:true}) + }) + cy.enter('[name="cardNumber-input"]').then(getBody => { + getBody().find('#cardNumber').clear({force: true}).type('4242424242424242',{force:true}) + }) + cy.enter('[name="expiryDate-input"]').then(getBody => { + getBody().find('#expiryDate').clear({force: true}).type('1226',{force:true}) + }) + cy.enter('[name="verificationCode-input"]').then(getBody => { + getBody().find('#verificationCode').clear({force: true}).type('222',{force:true}) + }) }) Cypress.Commands.add("OpeningModuleDashboardURL", () => { - cy.visit('/admin1/index.php?controller=AdminModules&configure=mollie') - cy.get('.btn-continue').click() + cy.visit('/admin1/index.php?controller=AdminModules&configure=mollie') + cy.get('.btn-continue').click() }) Cypress.Commands.add("CachingBOFOPS1785", () => { //Caching the BO and FO session -const login = (MollieBOFOLoggingIn) => { - cy.session(MollieBOFOLoggingIn,() => { - cy.visit('/admin1/') - cy.url().should('contain', 'https').as('Check if HTTPS exists') - cy.get('#email').type('demo@demo.com',{delay: 0, log: false}) - cy.get('#passwd').type('demodemo',{delay: 0, log: false}) - cy.get('#submit_login').click().wait(1000).as('Connection successsful') - cy.visit('/en/my-account') - cy.get('#login-form [name="email"]').eq(0).type('demo@demo.com') - cy.get('#login-form [name="password"]').eq(0).type('demodemo') - cy.get('#login-form [type="submit"]').eq(0).click({force:true}) - cy.get('#history-link > .link-item').click() - }) - } - login('MollieBOFOLoggingIn') + const login = (MollieBOFOLoggingIn) => { + cy.session(MollieBOFOLoggingIn,() => { + cy.visit('/admin1/') + cy.url().should('contain', 'https').as('Check if HTTPS exists') + cy.get('#email').type('demo@demo.com',{delay: 0, log: false}) + cy.get('#passwd').type('demodemo',{delay: 0, log: false}) + cy.get('#submit_login').click().wait(1000).as('Connection successsful') + cy.visit('/en/my-account') + cy.get('#login-form [name="email"]').eq(0).type('demo@demo.com') + cy.get('#login-form [name="password"]').eq(0).type('demodemo') + cy.get('#login-form [type="submit"]').eq(0).click({force:true}) + cy.get('#history-link > .link-item').click() + }) + } + login('MollieBOFOLoggingIn') }) Cypress.Commands.add("CachingBOFOPS8", {cacheAcrossSpecs: true}, () => { //Caching the BO and FO session @@ -266,3 +266,41 @@ Cypress.Commands.add("PsAccountsUI", {cacheAcrossSpecs: true}, () => { cy.wrap(popupDocument).find('body') }); }) +Cypress.Commands.add("advancedSettingsValidation", () => { + cy.get('[id="MOLLIE_PAYMENTSCREEN_LOCALE"]').should('be.visible') + cy.get('[id="MOLLIE_SEND_ORDER_CONFIRMATION"]').should('be.visible') + cy.get('[id="MOLLIE_AUTHORIZABLE_PAYMENT_INVOICE_ON_STATUS"]').should('be.visible') + cy.get('[class="help-block"]').should('be.visible') + cy.get('[id="MOLLIE_STATUS_AWAITING"]').should('be.visible') + cy.get('[id="MOLLIE_STATUS_PAID"]').should('be.visible') + cy.get('[name="MOLLIE_MAIL_WHEN_PAID"]').should('exist') + cy.get('[name="MOLLIE_MAIL_WHEN_COMPLETED"]').should('exist') + cy.get('[name="MOLLIE_STATUS_COMPLETED"]').should('exist') + cy.get('[name="MOLLIE_MAIL_WHEN_CANCELED"]').should('exist') + cy.get('[name="MOLLIE_STATUS_CANCELED"]').should('exist') + cy.get('[name="MOLLIE_MAIL_WHEN_EXPIRED"]').should('exist') + cy.get('[name="MOLLIE_STATUS_EXPIRED"]').should('exist') + cy.get('[name="MOLLIE_MAIL_WHEN_REFUNDED"]').should('exist') + cy.get('[name="MOLLIE_STATUS_REFUNDED"]').should('exist') + cy.get('[name="MOLLIE_STATUS_OPEN"]').should('exist') + cy.get('[name="MOLLIE_MAIL_WHEN_SHIPPING"]').should('exist') + cy.get('[name="MOLLIE_STATUS_SHIPPING"]').should('exist') + cy.get('[name="MOLLIE_STATUS_PARTIAL_REFUND"]').should('exist') + cy.get('[name="MOLLIE_IMAGES"]').should('exist') + cy.get('[name="MOLLIE_CSS"]').should('exist') + cy.get('[id="MOLLIE_TRACKING_URLS__container"]').should('exist') + cy.get('[id="MOLLIE_AS_MAIN_info"]').should('exist') + cy.get('[id="MOLLIE_AS_STATUSES_info"]').should('exist') + cy.get('[name="MOLLIE_DISPLAY_ERRORS"]').should('exist') + cy.get('[name="MOLLIE_DEBUG_LOG"]').should('exist') + cy.get('#module_form_submit_btn').click({force:true}) //checking the saving + cy.get('[class="alert alert-success"]').should('be.visible') //checking if saving returns green alert +}) +Cypress.Commands.add("subscriptionsUiCheck", {cacheAcrossSpecs: true}, () => { + cy.contains('Subscription creation').should('be.visible') + cy.contains('IMPORTANT points').should('be.visible') + cy.contains('IMPORTANT subscription carrier points').should('be.visible') + cy.contains('Cart rules').should('be.visible') + cy.contains('Gift wrapping').should('be.visible') + cy.contains('Recurring order creation').should('be.visible') +}) diff --git a/package-lock.json b/package-lock.json index aa87ce858..cdaa595ef 100755 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "devDependencies": { "@cypress/vue": "^6.0.0", "@frsource/cypress-plugin-visual-regression-diff": "^3.3.10", - "cypress": "^13.7.2", + "cypress": "^13.7.3", "cypress-fail-fast": "^7.0.3", "cypress-iframe": "^1.0.1", "cypress-shadow-dom": "^1.4.1", @@ -984,9 +984,9 @@ "peer": true }, "node_modules/cypress": { - "version": "13.7.2", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.7.2.tgz", - "integrity": "sha512-FF5hFI5wlRIHY8urLZjJjj/YvfCBrRpglbZCLr/cYcL9MdDe0+5usa8kTIrDHthlEc9lwihbkb5dmwqBDNS2yw==", + "version": "13.7.3", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.7.3.tgz", + "integrity": "sha512-uoecY6FTCAuIEqLUYkTrxamDBjMHTYak/1O7jtgwboHiTnS1NaMOoR08KcTrbRZFCBvYOiS4tEkQRmsV+xcrag==", "dev": true, "hasInstallScript": true, "dependencies": { diff --git a/package.json b/package.json index cc6fd5ad6..873153d1f 100755 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "devDependencies": { "@cypress/vue": "^6.0.0", "@frsource/cypress-plugin-visual-regression-diff": "^3.3.10", - "cypress": "^13.7.2", + "cypress": "^13.7.3", "cypress-fail-fast": "^7.0.3", "cypress-iframe": "^1.0.1", "cypress-shadow-dom": "^1.4.1",