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}'");
                }
            }
        }
예제 #2
0
        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");
            }
        }
예제 #3
0
        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");
            }
        }
예제 #4
0
        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");
        }
예제 #5
0
 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
     }
 }
예제 #6
0
        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();
        }
예제 #7
0
        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}'");
            }
        }