Created
May 23, 2019 17:57
-
-
Save batmi02/bc2eb2fb8168985824ba4ba2933b96f3 to your computer and use it in GitHub Desktop.
Excerpt from MercuryHealthAppTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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