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 );