/// <summary> /// Create an instance of ICommand object and ready to be execute /// </summary> /// <param name="testStep"></param> /// <param name="driver"></param> /// <returns></returns> public static IWebCommand Activate(TestStep testStep) { if (string.IsNullOrWhiteSpace(testStep.Action)) throw new Exception(testStep.Action + " is not a valid command."); var key = testStep.Action.Trim().ToLower(); if (!_commands.ContainsKey(key)) throw new Exception(testStep.Action + " is not a valid command."); Assembly assembly = typeof (IWebCommand).Assembly; var className = _commands[key]; return (IWebCommand) Activator.CreateInstance(assembly.GetType(className), testStep); }
/// <summary> /// Adding test step to form a complete test case /// </summary> /// <param name="testStep"></param> /// <returns></returns> public TestCase Add(TestStep testStep) { this.steps.Add(testStep); return this; }
protected AbstractCommand(TestStep testStep) { this.TestStep = testStep; }
public static IWebCommand Activate(TestStep testStep, IWebDriver driver) { return Activate(testStep).SetDriver(driver); }