From da0cd7ad6370ae2a9c13f3daaea72d4b49bc31a3 Mon Sep 17 00:00:00 2001 From: Julia Amosova Date: Thu, 27 Dec 2018 21:20:30 +0000 Subject: [PATCH] Remove and address 2 sleep statements --- lib/components/post-editor-sidebar-component.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/components/post-editor-sidebar-component.js b/lib/components/post-editor-sidebar-component.js index f40881228..3eb1665c1 100755 --- a/lib/components/post-editor-sidebar-component.js +++ b/lib/components/post-editor-sidebar-component.js @@ -97,10 +97,10 @@ export default class PostEditorSidebarComponent extends AsyncBaseContainer { const saveCategoryButtonSelector = By.css( 'div.dialog__action-buttons button.is-primary' ); const driver = this.driver; - driver.sleep( 500 ); + await driverHelper.waitTillPresentAndDisplayed( driver, addNewCategoryButtonSelector ); await driverHelper.clickWhenClickable( driver, addNewCategoryButtonSelector ); await driverHelper.waitForFieldClearable( driver, categoryNameInputSelector ); - driver.sleep( 500 ); + await driverHelper.waitTillFocused( driver, categoryNameInputSelector ); await driverHelper.setWhenSettable( driver, categoryNameInputSelector, category ); await driverHelper.clickWhenClickable( driver, saveCategoryButtonSelector ); return await driverHelper.waitTillNotPresent( driver, saveCategoryButtonSelector );