Skip to content

Commit

Permalink
E2E: fix merchant-orders-full-refund missing order amount (#8319) (#…
Browse files Browse the repository at this point in the history
…8342)

Co-authored-by: Miguel Gasca <[email protected]>
Co-authored-by: deepakpathania <[email protected]>
  • Loading branch information
3 people authored Mar 7, 2024
1 parent a620f9d commit f3feb0c
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions tests/e2e/specs/wcpay/merchant/merchant-orders-full-refund.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,23 @@ describe( 'Order > Full refund', () => {
await expect( page ).toMatch( 'Order received' );

// Get the order ID so we can open it in the merchant view
const orderIdField = await page.$(
'.woocommerce-order-overview__order.order > strong'
);
const ORDER_RECEIVED_ID_SELECTOR =
'.woocommerce-order-overview__order.order > strong';
const orderIdField = await page.$( ORDER_RECEIVED_ID_SELECTOR );
orderId = await orderIdField.evaluate( ( el ) => el.innerText );

// Get the order total so we can verify the refund amount
const ORDER_RECEIVED_AMOUNT_SELECTOR =
'.woocommerce-order-overview__total .woocommerce-Price-amount';
const orderTotalField = await page.$( ORDER_RECEIVED_AMOUNT_SELECTOR );
orderAmount = await orderTotalField.evaluate( ( el ) => el.innerText );

// Login and open the order
await merchant.login();
await merchant.goToOrder( orderId );

// We need to remove any listeners on the `dialog` event otherwise we can't catch the dialog below
await page.removeAllListeners( 'dialog' );

// Get the order price
const priceElement = await page.$( '.woocommerce-Price-amount' );
orderAmount = await page.evaluate(
( el ) => el.textContent,
priceElement
);
} );

afterAll( async () => {
Expand Down

0 comments on commit f3feb0c

Please sign in to comment.