From ec33f8fb2e0bd5aa677f9603a9cc8180f159478a Mon Sep 17 00:00:00 2001 From: Tung Du Date: Fri, 5 Aug 2022 16:37:44 +0700 Subject: [PATCH] Fix: flaky tests related to setMaxPrice (#6856) --- tests/e2e/specs/shopper/filter-products-by-price.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/e2e/specs/shopper/filter-products-by-price.test.ts b/tests/e2e/specs/shopper/filter-products-by-price.test.ts index ef9e6092cfb..87062c4e5f7 100644 --- a/tests/e2e/specs/shopper/filter-products-by-price.test.ts +++ b/tests/e2e/specs/shopper/filter-products-by-price.test.ts @@ -52,10 +52,10 @@ const goToShopPage = () => const setMaxPrice = async () => { await page.waitForSelector( selectors.frontend.priceMaxAmount ); await page.focus( selectors.frontend.priceMaxAmount ); - await page.$eval( - selectors.frontend.priceMaxAmount, - ( el ) => ( ( el as HTMLInputElement ).value = '' ) - ); + await page.keyboard.down( 'Shift' ); + await page.keyboard.press( 'Home' ); + await page.keyboard.up( 'Shift' ); + await page.keyboard.press( 'Backspace' ); await page.keyboard.type( '1.99' ); await page.keyboard.press( 'Tab' ); };