Skip to content

Instantly share code, notes, and snippets.

@AddressXception
Created April 8, 2016 13:10
Show Gist options
  • Save AddressXception/4c9d404a46ae92dc5befbe5892d5996c to your computer and use it in GitHub Desktop.
Save AddressXception/4c9d404a46ae92dc5befbe5892d5996c to your computer and use it in GitHub Desktop.
using System;
using TechTalk.SpecFlow;
using Xamarin.UITest;
namespace TipCalc.UITest.Shared
{
public abstract class FeatureBase
{
protected IApp App;
protected FeatureBase()
{
}
protected abstract void CreateApp(bool reset = true);
protected abstract void RegisterScreens();
//The SpecFlow's Aspects are called as follows:
// BeforeTestRun -> BeforeFeature -> BeforeScenario -> BeforeScenarioBlock -> BeforeStep
// AfterStep <- AfterScenarioBlock <- AfterScenario <- AfterFeature <- AfterTestRun
/// <summary>
/// automation logic that has to run before
/// the entire test run
/// </summary>
[BeforeTestRun()]
public static void BeforeTestRun()
{
Console.WriteLine("BeforeTestRun_Called");
}
/// <summary>
/// automation logic that has to run before
/// executing each feature
/// </summary>
[BeforeFeature()]
public static void BeforeFeature()
{
Console.WriteLine("BeforeFeature_Called");
}
/// <summary>
/// automation logic that has to run after
/// executing each feature
/// </summary>
[AfterFeature()]
public static void AfterFeature()
{
Console.WriteLine ("AfterFeature_Called");
}
/// <summary>
/// automation logic that has to run after
/// the entire test run
/// </summary>
[AfterTestRun()]
public static void AfterTestRun()
{
Console.WriteLine ("AfterTestRun_Called");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment