Exemple #1
0
        public static void Main(string[] args)
        {
            using (var firefox = new FirefoxDriver())
            {
                var mainPage = firefox.GoTo<MainPage>("https://github.com");
                mainPage.SearchBox.TypeText("Seleno");

                var searchPage = mainPage.Go(x => x.SearchBox.SendEnter()).To<SearchPage>();
                searchPage.Results.ToList().ForEach(x => Console.WriteLine(x.Text));

                searchPage = searchPage.Go(x => x.SearchForm.Search("selenol")).To<SearchPage>();

                var repoPage = searchPage.Go(x => x.Results.First().Click()).To<RepositoryPage>();

                Debug.Assert(string.Equals("pbakshy", repoPage.Author.Text), "Wrong author");
                Debug.Assert(string.Equals("Selenol", repoPage.RepositoryName.Text), "Wrong repo");

                if (Debugger.IsAttached)
                {
                    Console.ReadLine();
                }
            }
        }