Update test

This commit is contained in:
Veljko 2021-03-13 10:56:23 +01:00
parent 70ed073231
commit 88cdb83a55
2 changed files with 3 additions and 5 deletions

View File

@ -24,10 +24,8 @@ const runOrderSearchingTest = () => {
// Create new order for testing // Create new order for testing
await merchant.openNewOrder(), await merchant.openNewOrder(),
await page.waitForSelector('#order_status'), await page.waitForSelector('#order_status'),
await page.select('#order_status', 'Pending payment'),
await page.waitForSelector('#customer_user'),
await page.click('#customer_user'), await page.click('#customer_user'),
await selectOptionInSelect2('Customer', 'input.select2-search__field'), await selectOptionInSelect2('Customer'),
]); ]);
await Promise.all([ await Promise.all([
@ -43,7 +41,7 @@ const runOrderSearchingTest = () => {
await page.keyboard.press('Tab'), await page.keyboard.press('Tab'),
await page.keyboard.press('Tab'), await page.keyboard.press('Tab'),
await page.keyboard.press('Enter'), await page.keyboard.press('Enter'),
await selectOptionInSelect2('New York', 'input.select2-search__field'), await selectOptionInSelect2('New York'),
]); ]);
// Get the post id // Get the post id

View File

@ -206,7 +206,7 @@ const evalAndClick = async ( selector ) => {
const selectOptionInSelect2 = async ( value, selector = 'input.select2-search__field' ) => { const selectOptionInSelect2 = async ( value, selector = 'input.select2-search__field' ) => {
await page.waitForSelector(selector); await page.waitForSelector(selector);
await page.type(selector, value); await page.type(selector, value);
await page.waitFor(2000); // to avoid flakyness, must wait before pressing Enter await page.waitFor(3000); // to avoid flakyness, must wait before pressing Enter
await page.keyboard.press('Enter'); await page.keyboard.press('Enter');
}; };