Exemple #1
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);
        }
Exemple #2
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);
            }
        }