Skip to content

Instantly share code, notes, and snippets.

@angelovstanton
Created May 24, 2017 16:15
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/215d4cf25ed62c34e0e11e9b3d9c9a06 to your computer and use it in GitHub Desktop.
Save angelovstanton/215d4cf25ed62c34e0e11e9b3d9c9a06 to your computer and use it in GitHub Desktop.
public partial class BingMainPage
{
private readonly IWebDriver _driver;
private readonly string _url = @"http://www.bing.com/";
public BingMainPage(IWebDriver browser)
{
_driver = browser;
}
public BingMainPage Navigate()
{
_driver.Navigate().GoToUrl(_url);
return this;
}
public BingMainPage Search(string textToType)
{
SearchBox.Clear();
SearchBox.SendKeys(textToType);
GoButton.Click();
return this;
}
public BingMainPage ClickImages()
{
ImagesLink.Click();
return this;
}
public BingMainPage SetSize(Sizes size)
{
Sizes.SelectByIndex((int)size);
return this;
}
public BingMainPage SetColor(Colors color)
{
Color.SelectByIndex((int)color);
return this;
}
public BingMainPage SetTypes(Types type)
{
Type.SelectByIndex((int)type);
return this;
}
public BingMainPage SetLayout(Layouts layout)
{
Layout.SelectByIndex((int)layout);
return this;
}
public BingMainPage SetPeople(People people)
{
People.SelectByIndex((int)people);
return this;
}
public BingMainPage SetDate(Dates date)
{
Date.SelectByIndex((int)date);
return this;
}
public BingMainPage SetLicense(Licenses license)
{
License.SelectByIndex((int)license);
return this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment