From 9e01d74036c5c388b102ffa197599712587733cd Mon Sep 17 00:00:00 2001 From: Vitalij Mik Date: Thu, 5 Dec 2024 11:17:05 +0100 Subject: [PATCH] NTR: fix pipeline --- .../cypress/e2e/storefront/refund/refund.cy.js | 14 -------------- .../support/actions/admin/AdminOrdersAction.js | 5 ++++- .../admin/orders/OrderDetailsRepository.js | 4 ++++ 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/tests/Cypress/cypress/e2e/storefront/refund/refund.cy.js b/tests/Cypress/cypress/e2e/storefront/refund/refund.cy.js index dbcf1b6c2..627cc68d0 100644 --- a/tests/Cypress/cypress/e2e/storefront/refund/refund.cy.js +++ b/tests/Cypress/cypress/e2e/storefront/refund/refund.cy.js @@ -73,11 +73,7 @@ context("Order Refunds", () => { // now start the partial refund refundManager.fullRefund(REFUND_DESCRIPTION, REFUND_INTERNAL_DESCRIPTION); - cy.wait(5000); // wait for the page to reload - adminOrders.openRefundManager(); - - cy.wait(1500); // // verify that our refund now exists repoRefundManager.getFirstRefundStatusLabel().contains('Pending'); @@ -114,9 +110,6 @@ context("Order Refunds", () => { // now start the partial refund refundManager.partialAmountRefund(2, REFUND_DESCRIPTION); - cy.wait(5000); // wait for the page to reload - - adminOrders.openRefundManager(); // verify that our refund now exists repoRefundManager.getFirstRefundStatusLabel().contains('Pending'); @@ -154,9 +147,7 @@ context("Order Refunds", () => { // now start the partial refund with a custom amount refundManager.partialAmountRefund(2, REFUND_DESCRIPTION); - cy.wait(5000); // wait for the page to reload - adminOrders.openRefundManager(); // ------------------------------------------------------------------------------- @@ -202,9 +193,7 @@ context("Order Refunds", () => { // now start the full refund refundManager.fullRefund(REFUND_DESCRIPTION, ''); - cy.wait(5000); // wait for the page to reload - adminOrders.openRefundManager(); // verify that our refund now exists repoRefundManager.getFirstRefundStatusLabel().contains('Pending'); @@ -222,9 +211,6 @@ context("Order Refunds", () => { // now start another full refund refundManager.fullRefund(REFUND_DESCRIPTION, ''); - cy.wait(5000); // wait for the page to reload - - adminOrders.openRefundManager(); cy.contains(CANCELED_REFUND_STATUS_LABEL).should('not.exist'); diff --git a/tests/Cypress/cypress/support/actions/admin/AdminOrdersAction.js b/tests/Cypress/cypress/support/actions/admin/AdminOrdersAction.js index f1e6096f6..aba55dfe0 100644 --- a/tests/Cypress/cypress/support/actions/admin/AdminOrdersAction.js +++ b/tests/Cypress/cypress/support/actions/admin/AdminOrdersAction.js @@ -44,13 +44,16 @@ export default class AdminOrdersAction { } cy.wait(2000); - repoOrdersDetails.getMollieRefundManagerButton().click({force: true, waitForAnimations: false}); + repoOrdersDetails.getMollieRefundManagerButton().trigger('click');//the normal click, missed somehow the element randomly // here are automatic reloads and things as it seems // I really want to test the real UX, so we just wait like a human cy.wait(4000); + repoOrdersDetails.getMollieRefundManagerDialog().should('be.visible'); } + + /** * * @param status diff --git a/tests/Cypress/cypress/support/repositories/admin/orders/OrderDetailsRepository.js b/tests/Cypress/cypress/support/repositories/admin/orders/OrderDetailsRepository.js index 2ed1851f8..4239ddb17 100644 --- a/tests/Cypress/cypress/support/repositories/admin/orders/OrderDetailsRepository.js +++ b/tests/Cypress/cypress/support/repositories/admin/orders/OrderDetailsRepository.js @@ -151,4 +151,8 @@ export default class OrderDetailsRepository { getOrderDetailsGeneralTab() { return cy.get('.sw-order-detail__tabs .sw-order-detail__tabs-tab-general') } + + getMollieRefundManagerDialog(){ + return cy.get('#modalTitleEl'); + } }