From 399c51b564b27bbe5dea460c156d3fed81df9ae7 Mon Sep 17 00:00:00 2001 From: Vitalij Mik Date: Wed, 11 Dec 2024 14:02:10 +0100 Subject: [PATCH] NTR: fix tests for sw 6.6.9.0 (#913) Co-authored-by: Vitalij Mik --- .../Cypress/cypress/e2e/storefront/cancel/cancel-item.cy.js | 6 +++--- .../cypress/support/actions/admin/AdminOrdersAction.js | 5 +++-- .../cypress/support/actions/admin/AdminSettingsAction.js | 4 ++-- .../support/actions/storefront/checkout/CheckoutAction.js | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/Cypress/cypress/e2e/storefront/cancel/cancel-item.cy.js b/tests/Cypress/cypress/e2e/storefront/cancel/cancel-item.cy.js index c02e41fd9..ba8c0f8c3 100644 --- a/tests/Cypress/cypress/e2e/storefront/cancel/cancel-item.cy.js +++ b/tests/Cypress/cypress/e2e/storefront/cancel/cancel-item.cy.js @@ -46,7 +46,7 @@ context("Cancel Authorized items", () => { createOrderAndOpenAdmin('Klarna'); - orderDetailsRepository.getLineItemActionsButton(1).should('be.visible').click({force: true}); + orderDetailsRepository.getLineItemActionsButton(1).should('be.visible').trigger('click'); orderDetailsRepository.getLineItemActionsButtonCancelThroughMollie().should('not.have.class', 'is--disabled'); orderDetailsRepository.getLineItemActionsButtonCancelThroughMollie().click({force: true}); @@ -55,7 +55,7 @@ context("Cancel Authorized items", () => { cancelItemRepository.getItemLabel().should('not.be.empty'); cancelItemRepository.getConfirmButton().click({force: true}); orderDetailsRepository.getLineItemCancelled().should('contain.text', 2); - orderDetailsRepository.getLineItemActionsButton(1).click({force: true}); + orderDetailsRepository.getLineItemActionsButton(1).trigger('click'); orderDetailsRepository.getLineItemActionsButtonCancelThroughMollie().should('have.class', 'is--disabled'); }); @@ -64,7 +64,7 @@ context("Cancel Authorized items", () => { createOrderAndOpenAdmin('PayPal'); - orderDetailsRepository.getLineItemActionsButton(1).should('be.visible').click({force: true}); + orderDetailsRepository.getLineItemActionsButton(1).should('be.visible').trigger('click'); orderDetailsRepository.getLineItemActionsButtonCancelThroughMollie().should('have.class', 'is--disabled'); }); diff --git a/tests/Cypress/cypress/support/actions/admin/AdminOrdersAction.js b/tests/Cypress/cypress/support/actions/admin/AdminOrdersAction.js index aba55dfe0..50122e7c4 100644 --- a/tests/Cypress/cypress/support/actions/admin/AdminOrdersAction.js +++ b/tests/Cypress/cypress/support/actions/admin/AdminOrdersAction.js @@ -28,7 +28,8 @@ export default class AdminOrdersAction { * */ openLastOrder() { - repoOrdersList.getLatestOrderNumber().click(forceOption); + repoOrdersList.getLatestOrderNumber().trigger('click'); + cy.wait(2000); } @@ -104,7 +105,7 @@ export default class AdminOrdersAction { cy.wait(2000); - repoOrdersDetails.getLineItemActionsButton(nthItem).click(forceOption) + repoOrdersDetails.getLineItemActionsButton(nthItem).trigger('click') repoOrdersDetails.getLineItemActionsButtonShipThroughMollie().should('not.have.class', 'is--disabled'); diff --git a/tests/Cypress/cypress/support/actions/admin/AdminSettingsAction.js b/tests/Cypress/cypress/support/actions/admin/AdminSettingsAction.js index ff2fa304b..4a997e9c5 100644 --- a/tests/Cypress/cypress/support/actions/admin/AdminSettingsAction.js +++ b/tests/Cypress/cypress/support/actions/admin/AdminSettingsAction.js @@ -12,8 +12,8 @@ export default class AdminSettingsAction { * */ openFirstBusinessEvent() { - cy.get('.sw-data-grid__body .sw-data-grid__row.sw-data-grid__row--0 .sw-context-button__button').click({force: true}); - cy.get('.sw-context-menu-item.sw-entity-listing__context-menu-edit-action').click({force: true}); + cy.get('.sw-data-grid__body .sw-data-grid__row.sw-data-grid__row--0 .sw-context-button__button').trigger('click'); + cy.get('.sw-context-menu-item.sw-entity-listing__context-menu-edit-action').trigger('click'); } } diff --git a/tests/Cypress/cypress/support/actions/storefront/checkout/CheckoutAction.js b/tests/Cypress/cypress/support/actions/storefront/checkout/CheckoutAction.js index 4e7f2a5da..89498de6a 100644 --- a/tests/Cypress/cypress/support/actions/storefront/checkout/CheckoutAction.js +++ b/tests/Cypress/cypress/support/actions/storefront/checkout/CheckoutAction.js @@ -120,7 +120,7 @@ export default class CheckoutAction { cy.get('.address-form-actions:eq(0) button').click(); //since 6.6.8.0 the edit address modal does not close automatically - if(shopware.isVersionGreaterEqual('6.6.8.0')){ + if(shopware.isVersionGreaterEqual('6.6.8.0') && shopware.isVersionLower('6.6.9.0')){ cy.wait(1000); cy.get('.js-pseudo-modal .modal-dialog .btn-close').click(); }