Revert changes and add waits

This commit is contained in:
Veljko 2021-03-06 12:09:12 +01:00
parent e6fe91ee02
commit 94f83cb859
2 changed files with 3 additions and 6 deletions

View File

@ -19,6 +19,7 @@ const runSingleProductPageTest = require( './shopper/front-end-single-product.te
const runVariableProductUpdateTest = require( './shopper/front-end-variable-product-updates.test' );
// Merchant tests
const runOrderSearchingTest = require( './merchant/wp-admin-order-searching.test' );
const runCreateCouponTest = require( './merchant/wp-admin-coupon-new.test' );
const runCreateOrderTest = require( './merchant/wp-admin-order-new.test' );
const runEditOrderTest = require( './merchant/wp-admin-order-edit.test' );
@ -32,7 +33,6 @@ const runOrderApplyCouponTest = require( './merchant/wp-admin-order-apply-coupon
const runProductEditDetailsTest = require( './merchant/wp-admin-product-edit-details.test' );
const runProductSearchTest = require( './merchant/wp-admin-product-search.test' );
const runMerchantOrdersCustomerPaymentPage = require( './merchant/wp-admin-order-customer-payment-page.test' );
const runOrderSearchingTest = require( './merchant/wp-admin-order-searching.test' );
// REST API tests
const runExternalProductAPITest = require( './api/external-product.test' );

View File

@ -28,7 +28,6 @@ const runOrderSearchingTest = () => {
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
@ -39,17 +38,15 @@ const runOrderSearchingTest = () => {
await clearAndFillInput('#_shipping_address_2', 'Linwood Ave');
await clearAndFillInput('#_shipping_city', 'Buffalo');
await clearAndFillInput('#_shipping_postcode', '14201');
await page.waitFor(1000); // to avoid flakiness
await page.keyboard.press('Tab');
await page.waitFor(1000); // to avoid flakiness
await page.keyboard.press('Tab');
await page.waitFor(1000); // to avoid flakiness
await page.keyboard.press('Enter');
await page.waitFor(1000); // to avoid flakiness
await selectOptionInSelect2('New York', 'input.select2-search__field');
// Save new order
await page.waitFor(1000); // to avoid flakiness
await page.click('button.save_order');
await page.waitFor(2000); // to avoid flakiness
await page.waitForSelector('#message');
// Get the post id