Improve test and add waits

This commit is contained in:
Veljko 2021-03-05 11:19:43 +01:00
parent c10d03b6ab
commit 7eae2f2fe8
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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 );
};