Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

fix(ExpectedConditions): allow ExpectedConditions to handle missing e… #3972

Closed
wants to merge 1 commit into from

Commits on Jan 13, 2017

  1. fix(ExpectedConditions): allow ExpectedConditions to handle missing e…

    …lements
    
    Expected conditions used `presenceOf` and `visibilityOf` to check that it's
    referencing elements which actually exist on the page, but there is a race
    condition with this strategy: an element could disappear after the
    `presenceOf`/`visibilityOf` check but before other checks, causing an error
    to be thrown.  This PR handles this race condition in two ways:
    
    1. `ElementFinder`'s `isEnabled`, `isDisplayed`, and `isSelected` functions now
       return false if no such element exists, rahter than throwing an error
    2. `ExpectedConditions`'s `textToBePresent` and `textToBePresentInElementValue`
       now check for errors and also return false in those cases
    
    This is a general solution to the problem referenced in
    angular#3777 and
    angular#3958.
    sjelin committed Jan 13, 2017
    Configuration menu
    Copy the full SHA
    b7403bd View commit details
    Browse the repository at this point in the history