protected override void execute(IWebElement element, IDictionary <string, object> cellValues, IStep step, ITestContext context)
        {
            // TODO -- StoryTeller needs to pull this all inside the Cell
            if (!cellValues.ContainsKey(_cell.Key))
            {
                // already caught as a syntax error
                return;
            }

            var handler       = ElementHandlers.FindHandler(element);
            var expectedValue = cellValues[_cell.Key];

            var matchingHandler = handler as IMatchingHandler ?? new BasicMatchingHandler(handler, context);

            if (matchingHandler.MatchesData(element, expectedValue))
            {
                context.IncrementRights();
            }
            else
            {
                context.ResultsFor(step).MarkFailure(_cell.Key);
                context.IncrementWrongs();
            }

            context.ResultsFor(step).SetActual(_cell.Key, handler.GetData(CurrentContext, element));
        }
Exemple #2
0
        protected override void execute(IWebElement element, IDictionary<string, object> cellValues, IStep step, ITestContext context)
        {
            // TODO -- StoryTeller needs to pull this all inside the Cell
            if (!cellValues.ContainsKey(_cell.Key))
            {
                // already caught as a syntax error
                return;
            }

            var handler = ElementHandlers.FindHandler(element);
            var expectedValue = cellValues[_cell.Key];

            var matchingHandler = handler as IMatchingHandler ?? new BasicMatchingHandler(handler, context);

            if (matchingHandler.MatchesData(element, expectedValue))
            {
                context.IncrementRights();
            }
            else
            {
                context.ResultsFor(step).MarkFailure(_cell.Key);
                context.IncrementWrongs();
            }

            context.ResultsFor(step).SetActual(_cell.Key, handler.GetData(CurrentContext, element));
        }
Exemple #3
0
 private void checkExpectedAgainstActual(object expected, object actual, ITestContext context, IStep step)
 {
     if (context.Matches(expected, actual))
     {
         context.IncrementRights();
     }
     else
     {
         context.ResultsFor(step).MarkFailure(_key);
         context.IncrementWrongs();
     }
 }
 private static void markCounts(ITestContext context, IEnumerable <SetRow> results)
 {
     results.Each(x =>
     {
         if (x.Result == SetMatch.Match)
         {
             context.IncrementRights();
         }
         else
         {
             context.IncrementWrongs();
         }
     });
 }
 private static void markCounts(ITestContext context, IEnumerable<SetRow> results)
 {
     results.Each(x =>
     {
         if (x.Result == SetMatch.Match)
         {
             context.IncrementRights();
         }
         else
         {
             context.IncrementWrongs();
         }
     });
 }