diff --git a/tests/e2e/specs/wcpay/merchant/merchant-orders-full-refund.spec.js b/tests/e2e/specs/wcpay/merchant/merchant-orders-full-refund.spec.js index 3b0258423dd..2e24ca985b6 100644 --- a/tests/e2e/specs/wcpay/merchant/merchant-orders-full-refund.spec.js +++ b/tests/e2e/specs/wcpay/merchant/merchant-orders-full-refund.spec.js @@ -82,28 +82,21 @@ describe( 'Order > Full refund', () => { await page.waitForNavigation( { waitUntil: 'networkidle0' } ); - await page.waitForSelector( '#woocommerce-order-notes', { - timeout: 10000, + // Verify the product line item shows the refunded amount + await expect( page ).toMatchElement( '.line_cost .refunded', { + text: `-${ orderAmount }`, + timeout: 5000, + } ); + // Verify the refund shows in the list with the amount + await expect( page ).toMatchElement( '.refund > .line_cost', { + text: `-${ orderAmount }`, + timeout: 5000, + } ); + // Verify system note was added + await expect( page ).toMatchElement( '.system-note', { + text: `A refund of ${ orderAmount } was successfully processed using WooPayments. Reason: No longer wanted`, + timeout: 5000, } ); - await Promise.all( [ - // Verify the product line item shows the refunded amount - expect( page ).toMatchElement( '.line_cost .refunded', { - text: `-${ orderAmount }`, - timeout: 5000, - } ), - - // Verify the refund shows in the list with the amount - expect( page ).toMatchElement( '.refund > .line_cost', { - text: `-${ orderAmount }`, - timeout: 5000, - } ), - - // Verify system note was added - expect( page ).toMatchElement( '.system-note', { - text: `A refund of ${ orderAmount } was successfully processed using WooPayments. Reason: No longer wanted`, - timeout: 5000, - } ), - ] ); await takeScreenshot( 'merchant-orders-full-refund_refunded' ); } );