Updated page util method

This commit is contained in:
Veljko 2021-03-05 10:16:55 +01:00
parent a4d6183229
commit c10d03b6ab
1 changed files with 2 additions and 4 deletions

View File

@ -10,10 +10,8 @@ import { pressKeyWithModifier } from '@wordpress/e2e-test-utils';
* @param {string} value
*/
const clearAndFillInput = async ( selector, value ) => {
await page.focus( selector );
await page.waitFor(2000); // avoiding flakiness
await pressKeyWithModifier( 'primary', 'a' );
await page.waitFor(2000); // avoiding flakiness
await page.click(selector ,{ clickCount: 3 });
await page.waitFor(1000); // avoiding flakiness
await page.type( selector, value );
};