public string[] GetTestClasses() { var model = new SeleniumTestModel(); var classes = model.EnumTestClass(); return(classes.Select(c => c.Name).ToArray()); }
public override void Perform(SeleniumSideModel tests, SeleniumTestModel test, SeleniumCommandModel comand) { var element = SearchElement(comand); element .Should() .NotBeNull(); }
public string Post(string baseUrl, DriverType driverType = DriverType.Chrome, string className = null, string methodName = null) { var model = new SeleniumTestModel(); var rootPath = HostingEnvironment.MapPath("~/"); var basePath = model.GetPath(rootPath); var id = model.TestStart(driverType, basePath, baseUrl, className, methodName); return(id); }
public override void Perform(SeleniumSideModel tests, SeleniumTestModel test, SeleniumCommandModel comand) { var size = comand.Target.Split('x'); if (size.Length > 1) { Current.Driver.Manage().Window.Size = new Size(size[0].ToInt(), size[1].ToInt()); } }
public string[] GetTestMethoedes(string className) { var model = new SeleniumTestModel(); var classes = model.EnumTestClass(); var type = classes.FirstOrDefault(c => c.Name == className); var methods = model.EnumTestMethods(type); return(methods.Select(c => c.Name).ToArray()); }
public override void Perform(SeleniumSideModel tests, SeleniumTestModel test, SeleniumCommandModel comand) { Current.LastAlert .Should() .NotBeNull(); Current.LastAlert .Should() .Be(comand.Target); }
public TestResultInfo Get(string id) { var model = new SeleniumTestModel(); var rootPath = HostingEnvironment.MapPath("~/"); var basePath = model.GetPath(rootPath); var r = model.GetTestResult(basePath, id); var filesPath = HostingEnvironment.MapPath($"~/Content/Results/{id}/"); r.Files = Directory.EnumerateFiles(filesPath, "*.png").Select(c => Path.GetFileName(c)).ToArray(); return(r); }
public override void Perform(SeleniumSideModel tests, SeleniumTestModel test, SeleniumCommandModel comand) { var alert = Current.Driver.SwitchTo().Alert(); alert .Should() .NotBeNull(); Current.LastAlert = alert.Text; alert.Dismiss(); }
public override void Perform(SeleniumSideModel tests, SeleniumTestModel test, SeleniumCommandModel comand) { Wait(1000 * 2); if (!comand.Target.ContainsText("=")) { return; } var index = comand.Target.Split('=')[1].ToInt(); Current.Driver.SwitchTo().Frame(frameIndex: index); }
private void PerformCommand(SeleniumSideModel tests, Context context, SeleniumTestModel test, SeleniumCommandModel command) { var current = CommandFactory.Create(context, command.Command); if (!(current is INextCommand)) { current.Perform(tests, test, command); } if (context.LastCommand is INextCommand) { context.LastCommand.Perform(tests, test, command); } context.LastCommand = current; }
// GET: TestResult public ActionResult Index() { var model = new SeleniumTestModel(); var rootPath = HostingEnvironment.MapPath("~/"); var basePath = model.GetPath(rootPath); var ids = model.EnumResultIds(basePath); var results = ids .OrderByDescending(c => c) .Take(50) .Select(c => model.GetTestResult(basePath, c)) .ToArray(); return(View(results)); }
public override void Perform(SeleniumSideModel tests, SeleniumTestModel test, SeleniumCommandModel comand) { var element = SearchElement(comand); element .Should() .NotBeNull(); var preventDefault = false; var customEvent = GetCustomEvent <ClickCommandDelegate>(); customEvent?.Invoke(tests, test, comand, element, ref preventDefault); if (!preventDefault) { element.Click(); } }
public override void Perform(SeleniumSideModel tests, SeleniumTestModel test, SeleniumCommandModel comand) { Current.Driver.Close(); }
public abstract void Perform(SeleniumSideModel tests, SeleniumTestModel test, SeleniumCommandModel comand);
public override void Perform(SeleniumSideModel tests, SeleniumTestModel test, SeleniumCommandModel comand) { }
public override void Perform(SeleniumSideModel tests, SeleniumTestModel test, SeleniumCommandModel comand) { Current.Driver.Navigate().GoToUrl(tests.Url + comand.Target); }