How to use GherkinDocument class of Gherkin.Ast package

Best Gherkin-dotnet code snippet using Gherkin.Ast.GherkinDocument

DeveroomTagParser.cs

Source:DeveroomTagParser.cs Github

copy

Full Screen

...48            parser.ParseAndCollectErrors(fileSnapshot.GetText(), _logger,49                out var gherkinDocument, out var parserErrors);50            var result = new List<DeveroomTag>();51            if (gherkinDocument != null)52                AddGherkinDocumentTags(fileSnapshot, bindingRegistry, gherkinDocument, result);53            foreach (var parserException in parserErrors)54            {55                var line = GetSnapshotLine(parserException.Location, fileSnapshot);56                var startPoint = GetColumnPoint(line, parserException.Location);57                var span = new SnapshotSpan(startPoint, line.End);58                result.Add(new DeveroomTag(DeveroomTagTypes.ParserError,59                    span, parserException.Message));60            }61            return result;62        }63        private void AddGherkinDocumentTags(ITextSnapshot fileSnapshot, ProjectBindingRegistry bindingRegistry,64            DeveroomGherkinDocument gherkinDocument, List<DeveroomTag> result)65        {66            var documentTag = new DeveroomTag(DeveroomTagTypes.Document, new SnapshotSpan(fileSnapshot, 0, fileSnapshot.Length), gherkinDocument);67            result.Add(documentTag);68            if (gherkinDocument.Feature != null)69            {70                var featureTag = GetFeatureTags(fileSnapshot, bindingRegistry, gherkinDocument.Feature);71                result.AddRange(GetAllTags(featureTag));72            }73            if (gherkinDocument.Comments != null)74                foreach (var comment in gherkinDocument.Comments)75                {76                    result.Add(new DeveroomTag(DeveroomTagTypes.Comment,77                        GetTextSpan(fileSnapshot, comment.Location, comment.Text)));78                }...

Full Screen

Full Screen

DeveroomGherkinParser.cs

Source:DeveroomGherkinParser.cs Github

copy

Full Screen

...11{12    public class DeveroomGherkinParser13    {14        private readonly IMonitoringService _monitoringService;15        private IAstBuilder<DeveroomGherkinDocument> _astBuilder;16        public IGherkinDialectProvider DialectProvider { get; }17        internal DeveroomGherkinAstBuilder AstBuilder => _astBuilder as DeveroomGherkinAstBuilder;18        public DeveroomGherkinParser(IGherkinDialectProvider dialectProvider, IMonitoringService monitoringService)19        {20            _monitoringService = monitoringService;21            DialectProvider = dialectProvider;22        }23        public bool ParseAndCollectErrors(string featureFileContent, IDeveroomLogger logger, out DeveroomGherkinDocument gherkinDocument, out List<ParserException> parserErrors)24        {25            var reader = new StringReader(featureFileContent);26            gherkinDocument = null;27            parserErrors = new List<ParserException>();28            try29            {30                gherkinDocument = Parse(reader, "foo.feature"); //TODO: remove unused path31                return true;32            }33            catch (ParserException parserException)34            {35                logger.LogVerbose($"ParserErrors: {parserException.Message}");36                gherkinDocument = GetResultOfInvalid();37                if (parserException is CompositeParserException compositeParserException)38                    parserErrors.AddRange(compositeParserException.Errors);39                else40                    parserErrors.Add(parserException);41            }42            catch (Exception e)43            {44                logger.LogException(_monitoringService, e, "Exception during Gherkin parsing");45                gherkinDocument = GetResult();46            }47            return false;48        }49        private DeveroomGherkinDocument GetResultOfInvalid()50        {51            // trying to "finish" open nodes by sending dummy <endrule> messages up to 5 levels of nesting52            for (int i = 0; i < 10; i++)53            {54                var result = GetResult();55                if (result != null)56                    return result;57                try58                {59                    AstBuilder.EndRule(RuleType.None);60                }61                catch (Exception)62                {63                }64            }65            return null;66        }67        public DeveroomGherkinDocument Parse(TextReader featureFileReader, string sourceFilePath)68        {69            var tokenScanner = (ITokenScanner)new HotfixTokenScanner(featureFileReader);70            var tokenMatcher = new TokenMatcher(DialectProvider);71            _astBuilder = new DeveroomGherkinAstBuilder(sourceFilePath, () => tokenMatcher.CurrentDialect);72            var parser = new InternalParser(_astBuilder, AstBuilder.RecordStateForLine, _monitoringService);73            var gherkinDocument = parser.Parse(tokenScanner, tokenMatcher);74            CheckSemanticErrors(gherkinDocument);75            return gherkinDocument;76        }77        class InternalParser : Parser<DeveroomGherkinDocument>78        {79            private readonly Action<int, int> _recordStateForLine;80            private readonly IMonitoringService _monitoringService;81            public InternalParser(IAstBuilder<DeveroomGherkinDocument> astBuilder, Action<int, int> recordStateForLine, IMonitoringService monitoringService)82                : base(astBuilder)83            {84                _recordStateForLine = recordStateForLine;85                _monitoringService = monitoringService;86            }87            public int NullMatchToken(int state, Token token)88            {89                return MatchToken(state, token, new ParserContext()90                {91                    Errors = new List<ParserException>(),92                    TokenMatcher = new AllFalseTokenMatcher(),93                    TokenQueue = new Queue<Token>(),94                    TokenScanner = new NullTokenScanner()95                });96            }97            protected override int MatchToken(int state, Token token, ParserContext context)98            {99                _recordStateForLine?.Invoke(token.Location.Line, state);100                try101                {102                    return base.MatchToken(state, token, context);103                }104                catch (InvalidOperationException ex)105                {106                    _monitoringService.MonitorError(ex);107                    throw;108                }109            }110        }111        public DeveroomGherkinDocument GetResult()112        {113            return _astBuilder.GetResult();114        }115        #region Semantic Errors116        protected virtual void CheckSemanticErrors(DeveroomGherkinDocument specFlowDocument)117        {118            var errors = new List<ParserException>();119            errors.AddRange(((DeveroomGherkinAstBuilder)_astBuilder).Errors);120            if (specFlowDocument?.Feature != null)121            {122                CheckForDuplicateScenarios(specFlowDocument.Feature, errors);123                CheckForDuplicateExamples(specFlowDocument.Feature, errors);124                CheckForMissingExamples(specFlowDocument.Feature, errors);125                CheckForRulesPreSpecFlow31(specFlowDocument.Feature, errors);126            }127            // collect128            if (errors.Count == 1)129                throw errors[0];130            if (errors.Count > 1)131                throw new CompositeParserException(errors.ToArray());132        }133        private void CheckForRulesPreSpecFlow31(Feature feature, List<ParserException> errors)134        {135            //TODO: Show error when Rule keyword is used in SpecFlow v3.0 or earlier136        }137        private void CheckForDuplicateScenarios(Feature feature, List<ParserException> errors)138        {139            // duplicate scenario name140            var duplicatedScenarios = feature.FlattenScenarioDefinitions().GroupBy(sd => sd.Name, sd => sd).Where(g => g.Count() > 1).ToArray();141            errors.AddRange(142                duplicatedScenarios.Select(g =>143                    new SemanticParserException(144                        $"Feature file already contains a scenario with name '{g.Key}'",145                        g.ElementAt(1).Location)));146        }147        private void CheckForDuplicateExamples(Feature feature, List<ParserException> errors)148        {149            foreach (var scenarioOutline in feature.FlattenScenarioDefinitions().OfType<ScenarioOutline>())150            {151                var duplicateExamples = scenarioOutline.Examples152                                                       .Where(e => !String.IsNullOrWhiteSpace(e.Name))153                                                       .Where(e => e.Tags.All(t => t.Name != "ignore"))154                                                       .GroupBy(e => e.Name, e => e).Where(g => g.Count() > 1);155                foreach (var duplicateExample in duplicateExamples)156                {157                    var message = $"Scenario Outline '{scenarioOutline.Name}' already contains an example with name '{duplicateExample.Key}'";158                    var semanticParserException = new SemanticParserException(message, duplicateExample.ElementAt(1).Location);159                    errors.Add(semanticParserException);160                }161            }162        }163        private void CheckForMissingExamples(Feature feature, List<ParserException> errors)164        {165            foreach (var scenarioOutline in feature.FlattenScenarioDefinitions().OfType<ScenarioOutline>())166            {167                if (DoesntHavePopulatedExamples(scenarioOutline))168                {169                    var message = $"Scenario Outline '{scenarioOutline.Name}' has no examples defined";170                    var semanticParserException = new SemanticParserException(message, scenarioOutline.Location);171                    errors.Add(semanticParserException);172                }173            }174        }175        private static bool DoesntHavePopulatedExamples(ScenarioOutline scenarioOutline)176        {177            return !scenarioOutline.Examples.Any() || scenarioOutline.Examples.Any(x => x.TableBody == null || !x.TableBody.Any());178        }179        #endregion180        #region Expected tokens181        class NullAstBuilder : IAstBuilder<DeveroomGherkinDocument>182        {183            public void Build(Token token)184            {185            }186            public void StartRule(RuleType ruleType)187            {188            }189            public void EndRule(RuleType ruleType)190            {191            }192            public DeveroomGherkinDocument GetResult()193            {194                return null;195            }196            public void Reset()197            {198            }199        }200        class AllFalseTokenMatcher : ITokenMatcher201        {202            public bool Match_EOF(Token token)203            {204                return false;205            }206            public bool Match_Empty(Token token)...

Full Screen

Full Screen

FeatureFileTests.cs

Source:FeatureFileTests.cs Github

copy

Full Screen

...8        [Fact]9        public void Ctor_Initializes_Properties()10        {11            //arrange.12            var gherkinDocument = new Gherkin.Ast.GherkinDocument(null, null);13            //act.14            var sut = new FeatureFile(gherkinDocument);15            //assert.16            Assert.Same(gherkinDocument, sut.GherkinDocument);17        }18        [Fact]19        public void GetScenario_Retrieves_If_Found()20        {21            //arrange.22            var scenarioName = "name exists";23            var sut = new FeatureFile(CreateGherkinDocumentWithScenario(scenarioName));24            //act.25            var scenario = sut.GetScenario(scenarioName);26            //assert.27            Assert.NotNull(scenario);28            Assert.Same(sut.GherkinDocument.Feature.Children.First(), scenario);29        }30        [Fact]31        public void GetScenario_Gives_Null_If_Not_Found()32        {33            //arrange.34            var sut = new FeatureFile(CreateGherkinDocumentWithScenario("existing"));35            //act.36            var scenario = sut.GetScenario("non-existing");37            //assert.38            Assert.Null(scenario);39        }40        [Fact]41        public void GetScenarioOutline_Retrieves_If_Found()42        {43            //arrange.44            var scenarioName = "name exists";45            var sut = new FeatureFile(CreateGherkinDocumentWithScenarioOutline(scenarioName));46            //act.47            var scenario = sut.GetScenarioOutline(scenarioName);48            //assert.49            Assert.NotNull(scenario);50            Assert.Same(sut.GherkinDocument.Feature.Children.First(), scenario);51        }52        [Fact]53        public void GetScenarioOutline_Gives_Null_If_Not_Found()54        {55            //arrange.56            var sut = new FeatureFile(CreateGherkinDocumentWithScenarioOutline("existing"));57            //act.58            var scenario = sut.GetScenarioOutline("non-existing");59            //assert.60            Assert.Null(scenario);61        }62        [Fact]63        public void GetBackground_Retrieves_If_Present()64        {65            var sut = new FeatureFile(CreateGherkinDocumentWithBackground());66            var background = sut.GetBackground();67            Assert.NotNull(background);68        }69        [Fact]70        public void GetBackground_Gives_Null_If_Not_Present()71        {72            var sut = new FeatureFile(CreateGherkinDocumentWithScenario("test"));73            var background = sut.GetBackground();74            Assert.Null(background);75        }76        private static Gherkin.Ast.GherkinDocument CreateGherkinDocumentWithScenario(77            string scenario,78            Gherkin.Ast.StepArgument stepArgument = null)79        {80            return new Gherkin.Ast.GherkinDocument(81                new Gherkin.Ast.Feature(new Gherkin.Ast.Tag[0], null, null, null, null, null, new Gherkin.Ast.ScenarioDefinition[]82                {83                    new Gherkin.Ast.Scenario(84                        new Gherkin.Ast.Tag[0],85                        null,86                        null,87                        scenario,88                        null,89                        new Gherkin.Ast.Step[]{ })90                }),91                new Gherkin.Ast.Comment[0]);92        }93        private static Gherkin.Ast.GherkinDocument CreateGherkinDocumentWithBackground()94        {95            return new Gherkin.Ast.GherkinDocument(96                new Gherkin.Ast.Feature(new Gherkin.Ast.Tag[0], null, null, null, null, null, new Gherkin.Ast.ScenarioDefinition[]97                {98                    new Gherkin.Ast.Background(99                        null,100                        null,101                        null,102                        null,103                        new Gherkin.Ast.Step[]{ })104                }),105                new Gherkin.Ast.Comment[0]);106        }107        private static Gherkin.Ast.GherkinDocument CreateGherkinDocumentWithScenarioOutline(108            string scenario,109            Gherkin.Ast.StepArgument stepArgument = null)110        {111            return new Gherkin.Ast.GherkinDocument(112                new Gherkin.Ast.Feature(new Gherkin.Ast.Tag[0], null, null, null, null, null, new Gherkin.Ast.ScenarioDefinition[]113                {114                    new Gherkin.Ast.ScenarioOutline(115                        new Gherkin.Ast.Tag[0],116                        null,117                        null,118                        scenario,119                        null,120                        new Gherkin.Ast.Step[]{ },121                        new Gherkin.Ast.Examples[]{ })122                }),123                new Gherkin.Ast.Comment[0]);124        }125    }...

Full Screen

Full Screen

SpecFlowMetadataService.cs

Source:SpecFlowMetadataService.cs Github

copy

Full Screen

...9{10    public class SpecFlowMetadataService11    {12        private const string ExcelSearchText = "I want to construct request payload from the 'source' file'";13        private static List<ApiTestCase.TestCaseMetadata> ConstructFeatureDetails(GherkinDocument document, IFileInfo featureFile) => document.Feature.Children14            .OfType<Scenario>()15            .Select(scenario =>16            {17                var steps = scenario.Steps.Select(x => x.Text).ToList();18                var referencedExcelFile = steps.Single(x => x.StartsWith(ExcelSearchText))19                    .Replace(ExcelSearchText, string.Empty)20                    .Replace("", string.Empty);21                return new ApiTestCase.TestCaseMetadata22                {23                    FeatureFile = featureFile,24                    FeatureName = document.Feature.Name,25                    FeatureTags = document.Feature.Tags.Select(x => x.Name.Replace("@", string.Empty)).ToList(),26                    ScenarioName = scenario.Name,27                    Tags = scenario.Tags.Select(x => x.Name.Replace("@", string.Empty)).ToList(),28                    Steps = steps,29                    HasExamples = scenario.Examples.Any(),30                    ExcelFileName = referencedExcelFile31                };32            }).ToList();33        public List<ApiTestCase.TestCaseMetadata> ExtractSpecFlowMetadata(List<IFileInfo> featureFiles)34        {35            return featureFiles36                .SelectMany(featureFile =>37                {38                    //TODO: Poly39                    GherkinDocument gherkinDocument;40                    try41                    {42                        gherkinDocument = new Parser().Parse(featureFile.FullName);43                    }44                    catch45                    {46                        Thread.Sleep(500);47                        gherkinDocument = new Parser().Parse(featureFile.FullName);48                    }49                    return ConstructFeatureDetails(gherkinDocument, featureFile);50                })51                .ToList();52        }53    }...

Full Screen

Full Screen

GherkinEvents.cs

Source:GherkinEvents.cs Github

copy

Full Screen

...19        public IEnumerable<IEvent> iterable (SourceEvent sourceEvent)20        {21            List<IEvent> events = new List<IEvent> ();22            try {23                GherkinDocument gherkinDocument = parser.Parse (new StringReader(sourceEvent.data));24                if (printSource) {25                    events.Add (sourceEvent);26                }27                if (printAst) {28                    events.Add (new GherkinDocumentEvent(sourceEvent.uri, gherkinDocument));29                }30                if (printPickles) {31                    throw new NotSupportedException ("Gherkin.NET doesn't have a pickle compiler yet");32                }33            } catch (CompositeParserException e) {34                foreach (ParserException error in e.Errors) {35                    addErrorAttachment (events, error, sourceEvent.uri);36                }37            } catch (ParserException e) {38                addErrorAttachment (events, e, sourceEvent.uri);39            }40            return events;41        }42        private void addErrorAttachment (List<IEvent> events, ParserException e, String uri)...

Full Screen

Full Screen

FeatureFileRepository.cs

Source:FeatureFileRepository.cs Github

copy

Full Screen

...17                : throw new ArgumentNullException(nameof(featureFileSearchPattern));18        }19        public FeatureFile GetByFilePath(string filePath)20        {21            var gherkinDocument = ParseGherkinDocument(filePath);22            return new FeatureFile(gherkinDocument);23        }24        private static GherkinDocument ParseGherkinDocument(string filePath)25        {26            var parser = new Parser();27            using (var gherkinFile = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read))28            {29                using (var gherkinReader = new StreamReader(gherkinFile))30                {31                    var gherkinDocument = parser.Parse(gherkinReader);32                    return gherkinDocument;33                }34            }35        }3637        public List<string> GetFeatureFilePaths()38        {
...

Full Screen

Full Screen

FeatureFile.cs

Source:FeatureFile.cs Github

copy

Full Screen

...3namespace Xunit.Gherkin.Quick4{5    internal sealed class FeatureFile6    {7        public GherkinDocument GherkinDocument { get; }8        public FeatureFile(GherkinDocument gherkinDocument)9        {10            GherkinDocument = gherkinDocument ?? throw new System.ArgumentNullException(nameof(gherkinDocument));11        }12        public global::Gherkin.Ast.Scenario GetScenario(string scenarioName)13        {14            return GherkinDocument.Feature.Children.FirstOrDefault(s => s.Name == scenarioName) as global::Gherkin.Ast.Scenario;15        }16		public global::Gherkin.Ast.Background GetBackground()17		{18			return GherkinDocument.Feature.Children.OfType<global::Gherkin.Ast.Background>().SingleOrDefault();19		}20        internal ScenarioOutline GetScenarioOutline(string scenarioOutlineName)21        {22            return GherkinDocument.Feature.Children.FirstOrDefault(s => s.Name == scenarioOutlineName) as global::Gherkin.Ast.ScenarioOutline;23        }24    }25}...

Full Screen

Full Screen

Parser.Extensions.cs

Source:Parser.Extensions.cs Github

copy

Full Screen

1using System.IO;2using Gherkin.Ast;3namespace Gherkin4{5    public class Parser : Parser<GherkinDocument>6    {7        public Parser()8        {9        }10        public Parser(IAstBuilder<GherkinDocument> astBuilder)11            : base (astBuilder)12        {13        }14        public GherkinDocument Parse(TextReader reader)15        {16            return Parse(new TokenScanner(reader));17        }18        public GherkinDocument Parse(string sourceFile)19        {20            using (var reader = new StreamReader(sourceFile))21            {22                return Parse(new TokenScanner(reader));23            }24        }25    }26}...

Full Screen

Full Screen

GherkinDocument

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using Gherkin.Ast;7{8    {9        static void Main(string[] args)10        {11            string path = @"C:\Users\user\Desktop\GherkinParser\GherkinParser\Features\Login.feature";12            GherkinParser parser = new GherkinParser();13            GherkinDocument gherkinDocument = parser.Parse(path);14            Feature feature = gherkinDocument.Feature;15            string featureName = feature.Name;16            string featureDescription = feature.Description;17            List<Tag> featureTags = feature.Tags;18            List<FeatureChild> featureChildren = feature.Children;19            Background background = featureChildren.OfType<Background>().FirstOrDefault();20            string backgroundName = background.Name;21            string backgroundDescription = background.Description;22            List<Step> backgroundSteps = background.Steps;23            Scenario scenario = featureChildren.OfType<Scenario>().FirstOrDefault();24            string scenarioName = scenario.Name;25            string scenarioDescription = scenario.Description;26            List<Tag> scenarioTags = scenario.Tags;27            List<Step> scenarioSteps = scenario.Steps;28            List<Examples> scenarioExamples = scenario.Examples;29            ScenarioOutline scenarioOutline = featureChildren.OfType<ScenarioOutline>().FirstOrDefault();30            string scenarioOutlineName = scenarioOutline.Name;31            string scenarioOutlineDescription = scenarioOutline.Description;32            List<Tag> scenarioOutlineTags = scenarioOutline.Tags;33            List<Step> scenarioOutlineSteps = scenarioOutline.Steps;

Full Screen

Full Screen

GherkinDocument

Using AI Code Generation

copy

Full Screen

1using Gherkin.Ast;2{3    {4        static void Main(string[] args)5        {6            var gherkinDocument = new GherkinDocument();7        }8    }9}10using Gherkin;11{12    {13        static void Main(string[] args)14        {15            var gherkinDocument = new GherkinDocument();16        }17    }18}19using Gherkin;20{21    {22        static void Main(string[] args)23        {24            var gherkinDocument = new GherkinDocument();25        }26    }27}28using Gherkin.Ast;29{30    {31        static void Main(string[] args)32        {33            var gherkinDocument = new GherkinDocument();34        }35    }36}37using Gherkin;38{39    {40        static void Main(string[] args)41        {42            var gherkinDocument = new GherkinDocument();43        }44    }45}46using Gherkin;47{48    {49        static void Main(string[] args)50        {51            var gherkinDocument = new GherkinDocument();52        }53    }54}55using Gherkin.Ast;56{57    {58        static void Main(string[] args)59        {60            var gherkinDocument = new GherkinDocument();61        }62    }63}64using Gherkin;65{66    {

Full Screen

Full Screen

GherkinDocument

Using AI Code Generation

copy

Full Screen

1using Gherkin.Ast;2{3    {4        static void Main(string[] args)5        {6            GherkinDocument gherkinDocument = new GherkinDocument();7            gherkinDocument.Feature = new Feature();8        }9    }10}

Full Screen

Full Screen

GherkinDocument

Using AI Code Generation

copy

Full Screen

1using Gherkin.Ast;2using Gherkin.Parser;3using Gherkin.Parser.Gherkin;4using Gherkin.Parser.Gherkin.Ast;5using Gherkin.Pickles;6using Gherkin.Pickles.Compiler;7{8    {9        static void Main(string[] args)10        {11            GherkinDocumentParser parser = new GherkinDocumentParser();12            GherkinDocument gherkinDocument = parser.Parse(@"C:\Users\user\source\repos\ConsoleApp1\ConsoleApp1\Features\Feature1.feature");13            PickleCompiler compiler = new PickleCompiler();14            Pickle pickle = compiler.Compile(gherkinDocument);15            PickleStep pickleStep = pickle.Steps[0];16            PickleLocation pickleLocation = pickleStep.Location;17            Console.WriteLine(pickleLocation.Column);18            Console.WriteLine(pickleLocation.Line);19            Console.ReadLine();20        }21    }22}

Full Screen

Full Screen

GherkinDocument

Using AI Code Generation

copy

Full Screen

1using Gherkin.Ast;2{3    {4        static void Main(string[] args)5        {6            var gherkinDocument = new GherkinDocument(new Feature(new List<Tag>(), "Feature", "Feature description", new List<ScenarioDefinition>()));7        }8    }9}10using Gherkin.Ast;11{12    {13        static void Main(string[] args)14        {15            var gherkinDocument = new GherkinDocument(new Feature(new List<Tag>(), "Feature", "Feature description", new List<ScenarioDefinition>()));16            var featureName = gherkinDocument.Feature.Name;17        }18    }19}20using Gherkin.Ast;21{22    {23        static void Main(string[] args)24        {25            var gherkinDocument = new GherkinDocument(new Feature(new List<Tag>(), "Feature", "Feature description", new List<ScenarioDefinition>()));26            var featureName = gherkinDocument.Feature.Name;27        }28    }29}

Full Screen

Full Screen

GherkinDocument

Using AI Code Generation

copy

Full Screen

1{2    {3        static void Main(string[] args)4        {5";6            GherkinDialectProvider dialectProvider = new GherkinDialectProvider("en");7            GherkinDocumentBuilder builder = new GherkinDocumentBuilder(dialectProvider);8            GherkinDocument gherkinDocument = builder.Build(gherkin);9            Console.WriteLine(gherkinDocument.Feature.Name);10            Console.WriteLine(gherkinDocument.Feature.Children[0].Name);11            Console.WriteLine(gherkinDocument.Feature.Children[0].Steps[0].Text);12            Console.WriteLine(gherkinDocument.Feature.Children[0].Steps[1].Text);13            Console.WriteLine(gherkinDocument.Feature.Children[0].Steps[2].Text);14            Console.ReadLine();15        }16    }17}

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Gherkin-dotnet automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used methods in GherkinDocument

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful