Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Excerpt from MercuryHealthAppTests.cs
[TestMethod]
[TestCategory("UITests")]
public void Add1stDonutTest()
{
var webApp = HomePage.Launch(_applitoolsApiKey,
_applitoolsBatchName,
_applitoolsBatchId,
"Add 1st Donut Test",
_browserType);
try
{
// browse to home page of app
webApp.BrowseToHomePage(_homePageUrl)
.VerifyHomePageReached()
.TakeVisualPicture<HomePage>("Home Page")
//go to nutrition page
.ClickNutritionLink()
.VerifyNutritionPageReached()
// clean up and delete all donuts, take a picture of cleaned up nutrition page
.RemoveAllFood("Donut")
.TakeVisualPicture<NutritionPage>("Nutrition Page")
// click create new link to add new food
.ClickCreateNewLink()
.VerifyCreatePageReached()
.TakeVisualPicture<CreatePage>("Create Page")
// add donut as a food item and click the add button
.SetDescription("Donut")
.ClickCreateButton()
.VerifyNutritionPageReached()
.VerifyFoodInTable("Donut", 1)
.TakeVisualPicture<NutritionPage>("Nutrition Page After Adding Donut")
// clean up and delete all donuts
.RemoveAllFood("Donut")
.TakeVisualPicture<NutritionPage>("Nutrition Paqge After Removing All Donuts");
}
catch (Exception e)
{
Assert.Fail("Exception occured during test run: " + e);
}
finally
{
webApp.Close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.