public override void Execute(IStep containerStep, ITestContext context)
        {
            if (_config.BeforeClick != null)
            {
                _config.BeforeClick();
            }


            try
            {
                var element = _config.Finder();

                var values = new Dictionary <string, object>();
                System.Collections.Generic.GenericEnumerableExtensions.Each(GetCells(),
                                                                            cell => cell.ReadArgument(context, containerStep, o => values.Add(cell.Key, o)));

                execute(element, values, containerStep, context);

                _config.AfterClick();
            }
            catch (NoSuchElementException)
            {
                assertCondition(false, NonexistentElementMessage);
            }
        }
Exemple #2
0
        public override IEnumerable <CellResult> Execute(StepValues values, ISpecContext context)
        {
            var element = _config.Finder(SearchContext);

            StoryTellerAssert.Fail(element == null, "Could not find an element w/ description: " + _config.Description);

            try
            {
                return(execute(element, values));
            }
            catch (Exception ex)
            {
                // TODO: Use exception metadata with and add a custom exception formatter to show exception metadata
                //       See: https://github.com/storyteller/Storyteller/issues/400
                // ex.Data.Add("Gesture Description", _config.Description);
                throw new Exception("Gesture failed. [Description: {0}]".ToFormat(_config.Description), ex);
            }
        }