public ElementStateProvider(By elementLocator, IConditionalWait conditionalWait, IElementFinder elementFinder, LogElementState logElementState)
 {
     this.elementLocator  = elementLocator;
     ConditionalWait      = conditionalWait;
     ElementFinder        = elementFinder;
     this.logElementState = logElementState;
 }
Beispiel #2
0
 public ElementCacheHandler(By locator, string name, ElementState state, IElementFinder finder)
 {
     this.locator  = locator;
     this.name     = name;
     this.state    = state;
     elementFinder = finder;
 }
 public DfcElementFinder(IElementFinder find, IExecutor execute, IWait wait, IWebDriver browser)
 {
     this.execute = execute;
     this.waitFor = wait;
     this.browser = browser;
     this.find    = find;
 }
Beispiel #4
0
        internal static TPage Navigate <TPage>(this IElementFinder finder, IPageNavigator navigator, IWebDriver browser, By by, int waitTimeout = 10)
            where TPage : UiComponent, new()
        {
            var element    = finder.Element(by);
            var resultPage = navigator.To <TPage>(by);

            return(resultPage);
        }
Beispiel #5
0
 public ElementFactory(
     IConditionalWait conditionalWait,
     IElementFinder elementFinder,
     ILocalizationManager localizationManager,
     Func <ISearchContext> searchContextSupplier = null,
     Func <WindowsDriver <WindowsElement> > driverSessionSupplier = null)
     : base(conditionalWait, elementFinder, localizationManager)
 {
     this.searchContextSupplier = searchContextSupplier;
     this.driverSessionSupplier = driverSessionSupplier;
 }
Beispiel #6
0
        internal static TPage NavigateAndWaitForStalenessTo <TPage>(this IElementFinder finder, IPageNavigator navigator, IWebDriver browser, By by, int waitTimeout = 10)
            where TPage : UiComponent, new()
        {
            var element    = finder.Element(by);
            var resultPage = navigator.To <TPage>(by);
            var wait       = new WebDriverWait(browser, TimeSpan.FromSeconds(waitTimeout));

            wait.Until(ExpectedConditions.StalenessOf(element));

            return(resultPage);
        }
 public RelicRewardsScraperJob(IHtmlDocumentFetcher fetcher,
                               IElementFinder finder,
                               IElementParser parser,
                               IDataPersister persister,
                               PrimeContext context)
 {
     _fetcher   = fetcher;
     _finder    = finder;
     _parser    = parser;
     _persister = persister;
     _context   = context;
 }
        public ExceptionAnalysedPage(IElementFinder elementFinder, INavigationService navigationService)
        {
            var exceptionAnalyzedElementFinder =
                new ExceptionAnalyzedElementFinder(
                    elementFinder as ExceptionAnalyzedElementFinder);
            var exceptionAnalyzedNavigationService =
                new ExceptionAnalyzedNavigationService(
                    navigationService as ExceptionAnalyzedNavigationService,
                    exceptionAnalyzedElementFinder.UiExceptionAnalyser);

            ExceptionAnalyser = exceptionAnalyzedElementFinder.UiExceptionAnalyser;
            ElementFinder     = exceptionAnalyzedElementFinder;
            NavigationService = exceptionAnalyzedNavigationService;
        }
Beispiel #9
0
        //private readonly ICamera _camera;

        public Executor(IJavaScriptExecutor javaScriptExecutor, IElementFinder finder)//, ICamera camera)
        {
            if (javaScriptExecutor == null)
            {
                throw new ArgumentNullException(nameof(javaScriptExecutor));
            }
            if (finder == null)
            {
                throw new ArgumentNullException(nameof(finder));
            }
            //if (camera == null) throw new ArgumentNullException(nameof(camera));

            _javaScriptExecutor = javaScriptExecutor;
            _finder             = finder;
            //_camera = camera;
        }
Beispiel #10
0
        public Executor(IJavaScriptExecutor javaScriptExecutor, IElementFinder finder, ICamera camera)
        {
            if (javaScriptExecutor == null)
            {
                throw new ArgumentNullException("javaScriptExecutor");
            }
            if (finder == null)
            {
                throw new ArgumentNullException("finder");
            }
            if (camera == null)
            {
                throw new ArgumentNullException("camera");
            }

            _javaScriptExecutor = javaScriptExecutor;
            _finder             = finder;
            _camera             = camera;
        }
Beispiel #11
0
 public BasePage(IElementFinder elementFinder, INavigationService navigationService)
 {
     this.elementFinder     = elementFinder;
     this.navigationService = navigationService;
 }
Beispiel #12
0
 public ElementFactory(IConditionalWait conditionalWait, IElementFinder elementFinder, ILocalizationManager localizationManager)
     : base(conditionalWait, elementFinder, localizationManager)
 {
 }
        public IEnumerable <Tuple <string, AutomationElement> > FindElements(AutomationElement automationElement, IElementFinder finder, CancellationToken cancellationToken)
        {
            return(finder.Find(automationElement, cancellationToken)
                   .Distinct()
                   .Select(found =>
            {
                if (_cacheReversed.TryGetValue(found, out var id))
                {
                    return new Tuple <string, AutomationElement>(id, found);
                }

                return new Tuple <string, AutomationElement>(GetNextElementId(), found);
            }));
        }
Beispiel #14
0
 internal static IWebElement OptionalElementNoWait(this IElementFinder finder, By by)
 {
     return(finder is DfcElementFinder dfcElementFinder?dfcElementFinder.OptionalElementNoExplicitWait(by) : finder.OptionalElement(by));
 }
 public BingMainPage(
     IElementFinder elementFinder,
     INavigationService navigationService) :
     base(elementFinder, navigationService)
 {
 }
Beispiel #16
0
 public static TElement FindByInnerTextContaining <TElement>(
     this IElementFinder finder, string innerText)
     where TElement : class, IElement
 {
     return(finder.Find <TElement>(AdvancedBy.InnerTextContains(innerText)));
 }
Beispiel #17
0
 public static TElement FindByLinkTextContaining <TElement>(
     this IElementFinder finder, string linkTextContaining)
     where TElement : class, IElement
 {
     return(finder.Find <TElement>(AdvancedBy.LinkTextContaining(linkTextContaining)));
 }
 public ElementAssert(IElementFinder find)
 {
     Find = find;
 }
Beispiel #19
0
 public PageReader(IExecutor executor, IElementFinder elementFinder, IComponentFactory componentFactory)
 {
     _executor         = executor;
     _elementFinder    = elementFinder;
     _componentFactory = componentFactory;
 }
 public ExceptionAnalyzedElementFinder(IElementFinder elementFinder, IUiExceptionAnalyser exceptionAnalyser)
 {
     ElementFinder       = elementFinder;
     UiExceptionAnalyser = exceptionAnalyser;
 }
Beispiel #21
0
 public PageWriter(IElementFinder elementFinder, IComponentFactory componentFactory)
 {
     _elementFinder    = elementFinder;
     _componentFactory = componentFactory;
 }
 public ElementStateProvider(By elementLocator, IConditionalWait conditionalWait, IElementFinder elementFinder, LogElementState logElementState)
     : base(elementLocator, conditionalWait, elementFinder, logElementState)
 {
 }
Beispiel #23
0
 public LikeService(IWebDriver driver, IImageFetcher fetch, IElementFinder elementFinder)
 {
     this._driver        = driver;
     this._fetch         = fetch;
     this._elementFinder = elementFinder;
 }
Beispiel #24
0
 public static TElement FindByValueEndingWith <TElement>(
     this IElementFinder finder, string valueEnding)
     where TElement : class, IElement
 {
     return(finder.Find <TElement>(AdvancedBy.ValueEndingWith(valueEnding)));
 }
Beispiel #25
0
 public static TElement FindByXpath <TElement>(
     this IElementFinder finder, string xpath)
     where TElement : class, IElement
 {
     return(finder.Find <TElement>(AdvancedBy.Xpath(xpath)));
 }
Beispiel #26
0
 public ElementAssert(IElementFinder find)
 {
     Find = find;
 }
Beispiel #27
0
 public static TElement FindByClassContaining <TElement>(
     this IElementFinder finder, string cssClassContaining)
     where TElement : class, IElement
 {
     return(finder.Find <TElement>(AdvancedBy.CssClassContaining(cssClassContaining)));
 }
Beispiel #28
0
 public ElementParser(IElementFinder finder)
 {
     _finder = finder;
 }
Beispiel #29
0
 public static TElement FindByNameEndingWith <TElement>(
     this IElementFinder finder, string name)
     where TElement : class, IElement
 {
     return(finder.Find <TElement>(AdvancedBy.NameEndingWith(name)));
 }
 public IEnumerable <Tuple <string, AutomationElement> > FindElements(IElementFinder finder, CancellationToken cancellationToken)
 {
     return(FindElements(AutomationElement, finder, cancellationToken));
 }
Beispiel #31
0
 public static SelectElement DropDown(this IElementFinder finder, By.jQueryBy by,
                                      TimeSpan maxWait = default(TimeSpan))
 {
     return(new SelectElement(finder.Element(@by, maxWait)));
 }
 public ElementAssert(ICamera camera, IElementFinder find)
 {
     _camera = camera;
     Find = find;
 }