/// <summary> /// Waits, until the <see cref="IWebElement" />'s given style property has met the given condition. /// <para>Exceptions ignored until timeout: <see cref="StaleElementReferenceException" /></para> /// </summary> /// <param name="wait">The <see cref="WebDriverWait" /> instance, that is used to command the browser for wait.</param> /// <param name="stylePropertyName">The style property's name of the <see cref="IWebElement" />.</param> /// <param name="condition"> /// The <see cref="Func{T,TResult}" />, that defines the condition until the browser must /// wait. /// </param> /// <param name="locator"> /// <inheritdoc cref="ISearchContext.FindElement(By)" /> /// </param> /// <exception cref="WebDriverTimeoutException"></exception> /// <exception cref="StaleElementReferenceException"></exception> public static TResult UntilElementStyleProperty <TResult>( [NotNull] this WebDriverWait wait, [NotNull] By locator, [NotNull] ElementPropertyName stylePropertyName, [NotNull] Func <string, TResult> condition) { if (wait == null) { throw new ArgumentNullException(nameof(wait)); } if (locator == null) { throw new ArgumentNullException(nameof(locator)); } if (stylePropertyName == null) { throw new ArgumentNullException(nameof(stylePropertyName)); } if (condition == null) { throw new ArgumentNullException(nameof(condition)); } return(wait.UntilElementStyleProperty(locator, stylePropertyName.PropertyName, condition)); }