Ejemplo n.º 1
0
        private void Initialise()
        {
            const string resultTileIdentifier = "search_result";

            var results = this.Component.FindElements(SimsBy.AutomationId(resultTileIdentifier));

            foreach (var result in results)
            {
                var resultComponent = new TResultTile {
                    Tile = result
                };

                PageFactory.InitElements(resultComponent, new ElementLocator(result));
                _results.Add(resultComponent);
            }
        }
Ejemplo n.º 2
0
        public SearchListResultsComponent <TResultTile> Search()
        {
            WebDriverWait wait = new WebDriverWait(WebContext.WebDriver, TimeSpan.FromSeconds(10));
            Stopwatch     sw   = new Stopwatch();

            sw.Start();
            AutomationSugar.ClickOn(new ByChained(this._parent.ComponentIdentifier, SimsBy.AutomationId("search_criteria_submit")));
            _logger.LogLine("Waiting and clicking on search button took {0}ms.", sw.ElapsedMilliseconds);
            wait.Until(ExpectedConditions.ElementIsVisible(new ByChained(this._parent.ComponentIdentifier, SimsBy.AutomationId("resultTile"))));
            _logger.LogLine("Waiting search results took {0}ms.", sw.ElapsedMilliseconds);
            SearchListResultsComponent <TResultTile> results = new SearchListResultsComponent <TResultTile>(_parent);

            _logger.LogLine("Binding seach results tool {0}ms.", sw.ElapsedMilliseconds);
            sw.Stop();
            return(results);
        }
Ejemplo n.º 3
0
        public SearchResultsComponent <TResultTile> Search()
        {
            WebDriverWait wait = new WebDriverWait(WebContext.WebDriver, TimeSpan.FromSeconds(100));

            wait.Until(ExpectedConditions.ElementToBeClickable(SimsBy.AutomationId("search_criteria_submit")));

            WebContext.WebDriver.FindElement(By.CssSelector("[data-automation-id='search_criteria_submit']")).SendKeys(Keys.Enter);

            //Let's wait till ajax request is completed
            Wait.WaitTillAllAjaxCallsComplete();

            Thread.Sleep(500);
            SearchResultsComponent <TResultTile> results = new SearchResultsComponent <TResultTile>(_parent);

            return(results);
        }