Improve code
This commit is contained in:
parent
88cdb83a55
commit
12e417ce71
|
@ -25,7 +25,10 @@ const runOrderSearchingTest = () => {
|
|||
await merchant.openNewOrder(),
|
||||
await page.waitForSelector('#order_status'),
|
||||
await page.click('#customer_user'),
|
||||
await selectOptionInSelect2('Customer'),
|
||||
await page.click('span.select2-search > input.select2-search__field'),
|
||||
await page.type('span.select2-search > input.select2-search__field', 'Customer'),
|
||||
await page.waitFor(2000), // to avoid flakyness
|
||||
await page.keyboard.press('Enter'),
|
||||
]);
|
||||
|
||||
await Promise.all([
|
||||
|
|
|
@ -206,7 +206,7 @@ const evalAndClick = async ( selector ) => {
|
|||
const selectOptionInSelect2 = async ( value, selector = 'input.select2-search__field' ) => {
|
||||
await page.waitForSelector(selector);
|
||||
await page.type(selector, value);
|
||||
await page.waitFor(3000); // to avoid flakyness, must wait before pressing Enter
|
||||
await page.waitFor(2000); // to avoid flakyness, must wait before pressing Enter
|
||||
await page.keyboard.press('Enter');
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue