예제 #1
0
        public static StubbornWebElement ClickButtonToOpen(this StubbornWebElement element, By expectedPopupElement,
                                                           Func <IWebElement, bool> predicate = null)
        {
            element.ClickButton(webElement => ElementIsVisible(webElement().Driver(), expectedPopupElement, predicate));

            return(new StubbornWebElement(expectedPopupElement, element));
        }
예제 #2
0
 public static void ClickButtonToClose(this StubbornWebElement element, By expectedMissingElement = null)
 {
     if (expectedMissingElement == null)
     {
         expectedMissingElement = element.Selector;
     }
     element.ClickButton(_ => ExpectedConditions.InvisibilityOfElementLocated(expectedMissingElement));
 }
예제 #3
0
        public static StubbornWebElement ClickToOpenFirstOf(this StubbornWebElement element, params By[] expectedPopupElements)
        {
            element.Click(webElement => expectedPopupElements.Any(selector => IsDisplayedSafe(() => webElement().Driver().FindElement(selector))));

            var displayedPopupElement = expectedPopupElements.First(selector => IsDisplayedSafe(() => GetDriver(element).FindElement(selector)));

            return(new StubbornWebElement(displayedPopupElement, element));
        }
예제 #4
0
 public static StubbornWebElement RightClickToAppear(this StubbornWebElement element, By expectedPopupElement,
                                                     Func <IWebElement, bool> predicate = null)
 {
     return(RightClickToOpen(element, expectedPopupElement, predicate));
 }
예제 #5
0
 public static StubbornWebElement ClickToOpen(this StubbornWebElement element, By expectedPopupElement,
                                              Func <IWebElement, bool> predicate = null, WaitTime waitTime = WaitTime.Short)
 {
     element.Click(webElement => ElementIsVisible(webElement().Driver(), expectedPopupElement, predicate), waitTime: waitTime);
     return(new StubbornWebElement(expectedPopupElement, element));
 }
예제 #6
0
 public StubbornWebElement(By selector, StubbornWebElement parent, int elementIndex = 1, StubbornConfiguration configuration = null)
     : this(selector, parent._browser, parent._browser, null, elementIndex, configuration)
 {
 }