Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

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/90de0d7d6d8f9769d9f6b4e822f68cf6 to your computer and use it in GitHub Desktop.
Save angelovstanton/90de0d7d6d8f9769d9f6b4e822f68cf6 to your computer and use it in GitHub Desktop.
[TestClass]
public class HealthyDietMenuGeneratorTestsFirefox
{
private IWebDriver _driver;
[TestInitialize]
public void SetupTest()
{
_driver = new FirefoxDriver();
_driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(5);
}
[TestCleanup]
public void TeardownTest()
{
_driver.Quit();
}
[TestMethod]
public void FillAwsomeDietTest()
{
_driver.Navigate().GoToUrl(@"http://automatetheplanet.com/healthy-diet-menu-generator/");
var addAdditionalSugarCheckbox = _driver.FindElement(By.Id("ninja_forms_field_18"));
addAdditionalSugarCheckbox.Click();
var ventiCoffeeRadioButton = _driver.FindElement(By.Id("ninja_forms_field_19_1"));
ventiCoffeeRadioButton.Click();
var selectElement = new SelectElement(_driver.FindElement(By.XPath("//*[@id='ninja_forms_field_21']")));
selectElement.SelectByText("7 x BBQ Ranch Burgers");
var smotheredChocolateCakeCheckbox = _driver.FindElement(By.Id("ninja_forms_field_27_2"));
smotheredChocolateCakeCheckbox.Click();
var addSomethingToDietTextArea = _driver.FindElement(By.Id("ninja_forms_field_22"));
addSomethingToDietTextArea.SendKeys(@"Goi cuon- This snack made from pork, shrimp, herbs, rice vermicelli and other ingredients wrapped in rice paper is served at room temperature. It’s “meat light,” with the flavors of refreshing herbs erupting in your mouth.");
var rockStarRating = _driver.FindElement(By.XPath("//*[@id='ninja_forms_field_20_div_wrap']/span/div[11]/a"));
rockStarRating.Click();
var firstNameTextBox = _driver.FindElement(By.Id("ninja_forms_field_23"));
firstNameTextBox.SendKeys("Anton");
var lastNameTextBox = _driver.FindElement(By.Id("ninja_forms_field_24"));
lastNameTextBox.SendKeys("Angelov");
var emailTextBox = _driver.FindElement(By.Id("ninja_forms_field_25"));
emailTextBox.SendKeys("aangelov@yahoo.com");
var awsomeDietSubmitButton = _driver.FindElement(By.Id("ninja_forms_field_28"));
awsomeDietSubmitButton.Click();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment