using OpenTap; namespace AddInPlugin { public static class TestStepHelper { public static ITestStep GetPreviousStep(this ITestStep step) { var parent = step.Parent; if (parent == null) { return null; } var list = parent.ChildTestSteps; if (list == null || list.Count <= 0) { return null; } int index = list.IndexOf(step); if (index == 0) { return null; } return list[index - 1]; } public static ITestStep GetNextStep(this ITestStep step) { var parent = step.Parent; if (parent == null) { return null; } var list = parent.ChildTestSteps; if (list == null || list.Count <= 0) { return null; } int index = list.IndexOf(step); if (index == list.Count - 1) { return null; } return list[index + 1]; } } }