void TestBrowser(IWebDriver driver)
{
try {
driver.Navigate().GoToUrl(_siteUrl);
var selectAllCheckbox = driver.FindElement(By.XPath("//label[text()='SELECT ALL']"));
selectAllCheckbox.Click();
var runButton = driver.FindElement(By.ClassName("run-button"));
runButton.Click();
var currentSpecCount = driver.FindElement(By.XPath("//div[@class='spec-counter']/span[@class='current']"));
var totalSpecCount = driver.FindElement(By.XPath("//div[@class='spec-counter']/span[@class='total']"));
var stopwatch = new Stopwatch();
stopwatch.Start();
while(stopwatch.ElapsedMilliseconds < _maxTimeout.TotalMilliseconds) {
Thread.Sleep(_checkInterval);
CheckTestResults(driver, currentSpecCount, totalSpecCount);
}
Assert.Fail("Test timed out");
} finally {
driver.Quit();
}
}