public override void ElementRun(IRootElement root, IWebBrowser browser, ITestElement elem) { var dis = elem.GetAttribute("disabled"); if (dis == null) { elem.Click(); WaitClient(); } var val = elem.Text.ToDate(); if (Today) { if (val != DateTime.Today) { throw new TestException($"Date mismatch. Actual: '{val}', expected: '{DateTime.Today.ToString("dd.MM.yyyy")}'"); } } else if (!String.IsNullOrEmpty(Date)) { if (val != Date.ToDate()) { throw new TestException($"Date mismatch. Actual: '{val}', expected: '{Date}'"); } } }
public override void ElementRun(IRootElement root, IWebBrowser browser, ITestElement control) { var check = control.GetAttribute("xcheck"); if (check != null) { throw new TestException("The CheckBox is checked"); } }
public override void ElementRun(IRootElement root, IWebBrowser browser, ITestElement control) { var check = control.GetAttribute("xcheck"); if (check?.ToLowerInvariant() != "true") { throw new TestException("The CheckBox is not checked"); } }
public override void ElementRun(IRootElement root, IWebBrowser browser, ITestElement elem) { Thread.Sleep(20); // vue set focus // current pos - input var disabled = elem.GetAttribute("disabled"); if (disabled != null) { return; } throw new TestException("Element is not disabled"); }
public override void ElementRun(IRootElement root, IWebBrowser browser, ITestElement control) { if (Parent is Panel panel) { var cls = control.GetAttribute("class"); if (cls.Contains("expanded")) { return; // already open } var header = control.GetElementByXPath(".//div[contains(@class,'panel-header-slot')]"); header.Click(); Thread.Sleep(50); // Vue } }
public override void ElementRun(IRootElement root, IWebBrowser browser, ITestElement control) { // control is <input> var check = control.GetAttribute("xcheck"); if (check == null) { return; // already unchecked } var elem = control.GetElementByXPath("./parent::label"); elem.Click(); WaitClient(); }
public override void ElementRun(IRootElement root, IWebBrowser browser, ITestElement control) { var cls = control.GetAttribute("class"); if (cls.Contains("expanded")) { return; } var exp = control.GetElementByXPath(".//a[@class='toggle']"); exp.Click(); WaitClient(); browser.WaitForComplete(); WaitClient(); }
public override void ElementRun(IRootElement root, IWebBrowser browser, ITestElement elem) { var dis = elem.GetAttribute("disabled"); if (dis == null) { elem.Click(); WaitClient(); } var val = elem.Text.ToDecimal(); if (val != Number) { throw new TestException($"Number mismatch. Actual: '{val}', expected: '{Number}'"); } }
public override void ElementRun(IRootElement root, IWebBrowser browser, ITestElement elem) { WaitClient(); var tagName = elem.TagName; var txt = elem.Text; if (tagName == "textarea") { txt = elem.GetAttribute("value"); } else if (tagName == "select") { txt = elem.GetElementByXPath("./../div[@class='select-wrapper']")?.Text; } if (txt != Text) { throw new TestException($"Text mismatch. Actual: '{txt}', expected: '{Text}'"); } }