update for feedback, better wait impementation
This commit is contained in:
parent
d67e340548
commit
0d7388e9d4
|
@ -12,7 +12,6 @@ const {
|
||||||
addProductToOrder,
|
addProductToOrder,
|
||||||
evalAndClick,
|
evalAndClick,
|
||||||
} = require( '@woocommerce/e2e-utils' );
|
} = require( '@woocommerce/e2e-utils' );
|
||||||
const { takeScreenshotFor, sendFailedTestScreenshotToSlack } = require( '@woocommerce/e2e-environment' );
|
|
||||||
|
|
||||||
const config = require( 'config' );
|
const config = require( 'config' );
|
||||||
const simpleProductName = config.get( 'products.simple.name' );
|
const simpleProductName = config.get( 'products.simple.name' );
|
||||||
|
|
|
@ -435,11 +435,8 @@ const addProductToOrder = async ( orderId, productName ) => {
|
||||||
await expect( page ).toClick( 'button.add-order-item' );
|
await expect( page ).toClick( 'button.add-order-item' );
|
||||||
await page.waitForSelector( '.wc-backbone-modal-header' );
|
await page.waitForSelector( '.wc-backbone-modal-header' );
|
||||||
await expect( page ).toClick( '.wc-backbone-modal-content .wc-product-search' );
|
await expect( page ).toClick( '.wc-backbone-modal-content .wc-product-search' );
|
||||||
await expect( page ).toFill(
|
await expect( page ).toFill('#wc-backbone-modal-dialog + .select2-container .select2-search__field', productName);
|
||||||
'#wc-backbone-modal-dialog + .select2-container .select2-search__field',
|
await page.waitForSelector( 'li[aria-selected="true"]', { timeout: 10000 } );
|
||||||
productName,
|
|
||||||
{ waitUntil: 'networkidle0' }
|
|
||||||
);
|
|
||||||
await expect( page ).toClick( 'li[aria-selected="true"]' );
|
await expect( page ).toClick( 'li[aria-selected="true"]' );
|
||||||
await page.click( '.wc-backbone-modal-content #btn-ok', { waitUntil: 'networkidle0' } );
|
await page.click( '.wc-backbone-modal-content #btn-ok', { waitUntil: 'networkidle0' } );
|
||||||
|
|
||||||
|
@ -466,7 +463,7 @@ const createCoupon = async ( couponAmount = '5', discountType = 'Fixed cart disc
|
||||||
couponType = 'percent';
|
couponType = 'percent';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return '';
|
couponType = discountType;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fill in coupon code
|
// Fill in coupon code
|
||||||
|
|
|
@ -221,8 +221,8 @@ export const selectOptionInSelect2 = async ( value, selector = 'input.select2-se
|
||||||
export const searchForOrder = async (value, orderId, customerName) => {
|
export const searchForOrder = async (value, orderId, customerName) => {
|
||||||
await clearAndFillInput('#post-search-input', value);
|
await clearAndFillInput('#post-search-input', value);
|
||||||
await expect(page).toMatchElement('#post-search-input', value);
|
await expect(page).toMatchElement('#post-search-input', value);
|
||||||
await expect(page).toClick('#search-submit', { waitUntil: 'networkidle0' } );
|
await expect(page).toClick('#search-submit' );
|
||||||
await page.waitForSelector('#the-list');
|
await page.waitForSelector('#the-list', { timeout: 10000 } );
|
||||||
await expect(page).toMatchElement('.order_number > a.order-view', {text: `#${orderId} ${customerName}`});
|
await expect(page).toMatchElement('.order_number > a.order-view', {text: `#${orderId} ${customerName}`});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue