From 4c236bdc37a8a8be81efe988f48a240041a86379 Mon Sep 17 00:00:00 2001 From: Vedanshu Jain Date: Thu, 5 Jan 2023 23:56:08 +0530 Subject: [PATCH] Use more generic selectors for HPOS<>Posts compatibility (#36284) * Use more generic search selector for edit screen. * Use more generic heading text for post<>HPOS compat. --- plugins/woocommerce/changelog/e2e-modify-search-selector | 5 +++++ .../tests/e2e-pw/tests/merchant/order-edit.spec.js | 4 ++-- .../tests/e2e-pw/tests/merchant/order-search.spec.js | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 plugins/woocommerce/changelog/e2e-modify-search-selector diff --git a/plugins/woocommerce/changelog/e2e-modify-search-selector b/plugins/woocommerce/changelog/e2e-modify-search-selector new file mode 100644 index 00000000000..3e918d4a174 --- /dev/null +++ b/plugins/woocommerce/changelog/e2e-modify-search-selector @@ -0,0 +1,5 @@ +Significance: patch +Type: fix +Comment: Minor change in E2E selectory. + + diff --git a/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-edit.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-edit.spec.js index 862c0277575..7cd8c268535 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-edit.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-edit.spec.js @@ -46,8 +46,8 @@ test.describe( 'Edit order', () => { await page.goto( `wp-admin/post.php?post=${ orderId }&action=edit` ); // make sure we're on the order details page - await expect( page.locator( 'h1.components-text' ) ).toContainText( - 'Edit Order' + await expect( page.locator( 'h1.wp-heading-inline' ) ).toContainText( + /Edit [oO]rder/ ); } ); diff --git a/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-search.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-search.spec.js index bb3f7cbb051..a5d9762c4f3 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-search.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-search.spec.js @@ -140,7 +140,7 @@ test.describe( 'WooCommerce Orders > Search orders', () => { test( 'can search for order by order id', async ( { page } ) => { await page.goto( 'wp-admin/edit.php?post_type=shop_order' ); - await page.fill( '#post-search-input', orderId.toString() ); + await page.fill( '[type=search][name=s]', orderId.toString() ); await page.click( '#search-submit' ); await expect( @@ -153,7 +153,7 @@ test.describe( 'WooCommerce Orders > Search orders', () => { page, } ) => { await page.goto( 'wp-admin/edit.php?post_type=shop_order' ); - await page.fill( '#post-search-input', queries[ i ][ 0 ] ); + await page.fill( '[type=search][name=s]', queries[ i ][ 0 ] ); await page.click( '#search-submit' ); await expect(