public void OpenPageHistory(string browserType)
 {
     _browser = _browserFactory.GetBrowser(browserType);
     _browser.Maximize();
     _browser.GotoPage("main-page");
     var currPage = _browser.GetPage();
     currPage.Click("view-history-anchor");
     _browser.WaitForPageChange();
     var newPage = _browser.GetPage();
     Assert.That(newPage.Handle.Equals("view-history-page"),
         String.Format("Landed on wrong page: {0}"), newPage.Handle);
 }
 public void PerformValidMainPageSearch(string browserType)
 {
     _browser = _browserFactory.GetBrowser(browserType);
     _browser.Maximize();
     _browser.GotoPage("main-page");
     var currPage = _browser.GetPage();
     currPage.SetText("search-box", "archery");
     currPage.Click("search-button");
     var pageChanged = _browser.WaitForPageChange();
     Assume.That(pageChanged, "Page never changed from main search page");
     var newPage = _browser.GetPage();
     Assert.That(newPage.Handle.Equals("archery-page"), "error message");
 }
 public void OpenBrowser()
 {
     var p = ConfigurationManager.AppSettings["WebPrefix"];
     _br = _browserFactory.GetBrowser("firefox");
     _br.Maximize();
     _br.GotoPage("main-page");
     Thread.Sleep(TimeSpan.FromSeconds(3));
     _br.GetPage().SetText("search-box", "archery");
     
     _br.GetPage().Click("search-button");
     //_br.GetPage().Click("dummy-button");
     Thread.Sleep(TimeSpan.FromSeconds(3));
     Assert.That(_br.GetPage().IsCurrentHandle("archery-page"), "not archery");
     Thread.Sleep(TimeSpan.FromSeconds(3));
     _br.Close();
 }
 public void FilterHistoryPageListEntries(string browser, 
     string subjectPage, string anchorToClick, int expectedCount)
 {
     //open browser
     _browser = _browserFactory.GetBrowser(browser);
     _browser.Maximize();
     //go to expected page
     _browser.GotoPage(subjectPage);
     //click history tab
     _browser.GetPage().Click("view-history-anchor");
     //click a limit amount
     var currPage = _browser.GetPage();
     currPage.Click(anchorToClick);
     //count limit amount displayed rows
     var listItems = currPage.GetWebList("page-history-list");
     var count = listItems.Count;
     Assert.That(count == expectedCount, String.Format("Wrong number of items. Expected {0}, Found {1}",
         expectedCount, count));
 }
        public void TopBar()
        {
            var p = ConfigurationManager.AppSettings["WebPrefix"];
            _br = _browserFactory.GetBrowser("firefox");
            _br.GotoPage("main-page");
            _br.GetPage().Click("create-account-anchor");
            Thread.Sleep(TimeSpan.FromSeconds(2));

            _br.GotoPage("main-page");
            _br.GetPage().Click("talk-anchor");
            Thread.Sleep(TimeSpan.FromSeconds(2));

            _br.GotoPage("main-page");
            _br.GetPage().Click("contributions-anchor");
            Thread.Sleep(TimeSpan.FromSeconds(2));

            _br.GotoPage("main-page");
            _br.GetPage().Click("login-anchor");
            Thread.Sleep(TimeSpan.FromSeconds(2));

            _br.Close();
        }
 public void HistoryOrderNewest()
 {
     _browser = _browserFactory.GetBrowser("chrome");
     _browser.Maximize();
     _browser.GotoPage("main-page");
     _browser.GetPage().Click("view-history-anchor");
     var currPage = _browser.GetPage();
     var listItems = currPage.GetWebList("page-history-list");
     var dateList = new List<DateTime>();
     foreach (var el in listItems)
     {
         var d = el.FindSubElement("a[class=\"mw-changeslist-date\"]").GetElementText();
         dateList.Add(DateHelper.ConvertWikipediaHistoryDateString(d));
     }
     var error = "";
     for (var i = 1; i < dateList.Count; i++)
     {
         var compare = DateTime.Compare(dateList[i - 1], dateList[i]);
         if (compare < 0)
             error += String.Format("Dates out of order. upper date: {0}, lower date {1}",
                 dateList[i - 1], dateList[i]);
     }
     Assert.That(error.Length.Equals(0), error);
 }