Class Augmenter


  • @Beta
    public class Augmenter
    extends java.lang.Object
    Enhance the interfaces implemented by an instance of the WebDriver based on the returned Capabilities of the driver. Note: this class is still experimental. Use at your own risk.
    • Constructor Detail

      • Augmenter

        public Augmenter()
    • Method Detail

      • addDriverAugmentation

        public <X> Augmenter addDriverAugmentation​(java.lang.String capabilityName,
                                                   java.lang.Class<X> implementThis,
                                                   java.util.function.BiFunction<Capabilities,​ExecuteMethod,​X> usingThis)
      • addDriverAugmentation

        public <X> Augmenter addDriverAugmentation​(java.util.function.Predicate<Capabilities> whenThisMatches,
                                                   java.lang.Class<X> implementThis,
                                                   java.util.function.BiFunction<Capabilities,​ExecuteMethod,​X> usingThis)
      • augment

        public WebDriver augment​(WebDriver driver)
        Enhance the interfaces implemented by this instance of WebDriver iff that instance is a RemoteWebDriver. The WebDriver that is returned may well be a dynamic proxy. You cannot rely on the concrete implementing class to remain constant.
        Parameters:
        driver - The driver to enhance
        Returns:
        A class implementing the described interfaces.