Skip to content

Instantly share code, notes, and snippets.

@angelovstanton
Created May 24, 2017 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angelovstanton/841fd5ff9fa75a231967a4165ca3fc3b to your computer and use it in GitHub Desktop.
Save angelovstanton/841fd5ff9fa75a231967a4165ca3fc3b to your computer and use it in GitHub Desktop.
[TestClass]
public class BingTests
{
private IWebDriver _driver;
[TestInitialize]
public void SetupTest()
{
_driver = new FirefoxDriver();
_driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(30);
}
[TestCleanup]
public void TeardownTest()
{
_driver.Quit();
}
[TestMethod]
public void SearchTextInBing_First()
{
var bingMainPage = new BingMainPage(_driver);
bingMainPage.Navigate();
bingMainPage.Search("Automate The Planet");
bingMainPage.AssertResultsCount("236,000 RESULTS");
}
[TestMethod]
public void SearchTextInBing_UseElementsDirectly()
{
var bingMainPage = new BingMainPage(_driver);
bingMainPage.Navigate();
bingMainPage.SearchBox = "Automate The Planet";
bingMainPage.GoButton.Click();
Assert.AreEqual(bingMainPage.ResultsCountDiv, "236,000 RESULTS");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment