• Marcel Hoyer's avatar
    Correcting asynchronous testing · 951eb70b
    Marcel Hoyer authored
    removes unnecessary .then() chaining in test.js as selenium-webdriver already queues calls internally
    
    fixed confusing inverted use of idSelector variable
    
    promisified all tests
    
    promisified test.launchBrowser() and global test hooks
    
    promisified test.closeBrowser()
    
    promisified test.createStandardItems()
    
    🛀 streamlined testOps to always return the promise and flattened out the thens
    
    fixed testOps.assertClearCompleteButtonText() to wait for visible clear-complete button before asserting
    
    fixed testOps.assertClearCompleteButtonIsVisible() to lazy wait for visible clear-complete button
    
    renamed testOps.assertFocussedElementId() to .assertFocussedElement() and streamlined code
    
    fixed page.clickMarkAllCompletedCheckBox() to return inner promise
    
    fixed page.enterItem() to return the promise and flattened out the thens
    
    renamed page.getFocussedElementName() with .getFocussedElementIdOrClass()
    
    fixed page.ensureAppIsVisible() to wait for 'new-todo' element instead of 'main' as some frameworks build the contents after DOM-ready
    
    fixed page.clickClearCompleteButton() to wait for actual button to display before clicking
    
    extracted page.waitForVisibleElement() helper function
    951eb70b
test.js 12.5 KB