Esempio n. 1
0
        public void Test2([Values("cheese")] string searchQuery, [Values("wikipedia.com")] string site)
        {
            GoogleSearchPage searchPage = new GoogleSearchPage(driver, timeout).Load();

            searchPage.TypeInSearchField($"{searchQuery} site:{site}");
            GoogleSearchResultsPage resultsPage = searchPage.ClickEnterOnSearchField();
            var links   = resultsPage.CollectSearchResultsLinks();
            var results = resultsPage.CollectSearchResultsDescriptions();

            for (int i = 0; i < links.Count; i++)
            {
                Assert.That(links[i].Contains(site));
                Assert.That(results[i].Contains(searchQuery));
            }
        }