示例#1
0
        public static void ExecuteInternal(ITestContext context)
        {
            if (null == context)
            {
                throw new ArgumentNullException("context");
            }

            var actualList = GetActual(context);

            if (string.IsNullOrWhiteSpace(context.Value) && 0 == actualList.Count())
            {
                return;
            }

            var expectedList = context.Value.Split(',');

            if (0 != expectedList.Except(actualList).Count())
            {
                TestCommandHelper.AssertFail(string.Format(
                                                 CultureInfo.CurrentCulture,
                                                 Properties.Resources.AssertExpectedAndActual,
                                                 string.Join(",", expectedList),
                                                 string.Join(",", actualList)));
            }
        }
示例#2
0
        public static void ExecuteInternal(ITestContext context)
        {
            if (null == context)
            {
                throw new ArgumentNullException("context");
            }

            var elements = context.FindElements(context.Target);

            if (0 == elements.Count())
            {
                TestCommandHelper.AssertFail();
            }
        }
        public static void ExecuteInternal(ITestContext context)
        {
            if (null == context)
            {
                throw new ArgumentNullException("context");
            }

            try
            {
                var alert = context.Driver.SwitchTo().Alert();
            }
            catch (OpenQA.Selenium.NoAlertPresentException ex)
            {
                TestCommandHelper.AssertFail(ex.Message);
            }
        }
        public static void ExecuteInternal(ITestContext context)
        {
            if (null == context)
            {
                throw new ArgumentNullException("context");
            }

            var element       = context.FindElement(context.Target);
            var selectElement = new SelectElement(element);

            if (0 < selectElement.AllSelectedOptions.Count)
            {
                return;
            }

            TestCommandHelper.AssertFail();
        }
        public static void ExecuteInternal(ITestContext context)
        {
            if (null == context)
            {
                throw new ArgumentNullException("context");
            }

            var expected = new List <string>()
            {
                context.Value
            };

            var actual = GetActual(context);

            if (0 != expected.Except(actual).Count())
            {
                TestCommandHelper.AssertFail(string.Format(
                                                 CultureInfo.CurrentCulture,
                                                 Properties.Resources.AssertExpectedAndActual,
                                                 expected,
                                                 actual));
            }
        }
示例#6
0
 public void FailTest1()
 {
     TestCommandHelper.AssertFail("ok");
 }
示例#7
0
 public void FailTest()
 {
     TestCommandHelper.AssertFail();
 }