Improve test and add waits
This commit is contained in:
parent
c10d03b6ab
commit
7eae2f2fe8
|
@ -23,8 +23,11 @@ const runOrderSearchingTest = () => {
|
|||
|
||||
// Create new order for testing
|
||||
await merchant.openNewOrder();
|
||||
await page.waitForSelector('#order_status');
|
||||
await page.select('#order_status', 'Pending payment');
|
||||
await page.waitForSelector('#customer_user');
|
||||
await page.click('#customer_user');
|
||||
await page.waitForSelector('input.select2-search__field');
|
||||
await selectOptionInSelect2('Customer', 'input.select2-search__field');
|
||||
|
||||
// Change the shipping data
|
||||
|
|
|
@ -10,8 +10,9 @@ import { pressKeyWithModifier } from '@wordpress/e2e-test-utils';
|
|||
* @param {string} value
|
||||
*/
|
||||
const clearAndFillInput = async ( selector, value ) => {
|
||||
await page.click(selector ,{ clickCount: 3 });
|
||||
await page.waitFor(1000); // avoiding flakiness
|
||||
await page.waitForSelector( selector );
|
||||
await page.focus( selector );
|
||||
await pressKeyWithModifier( 'primary', 'a' );
|
||||
await page.type( selector, value );
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue