Skip to content

cucumber/query

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Cucumber Query

Given one Cucumber Message, find another

npm maven-central build backers sponsors

Overview

The different message types in cucumber-messages have references to each other using id fields. It's a bit similar to rows in a relational database, with primary and foreign keys.

Consumers of these messages may want to query the messages for certain information. For example, cucumber-react needs to know the status of a Step as it is rendering the GherkinDocument

The Query library makes this easy by providing a function to look up the status of a step, a scenario or an entire file.

API

Query function .NET Go Java Ruby TypeScript
getStepResults(uri: string, lineNumber: number): messages.ITestResult[]
getScenarioResults(uri: string, lineNumber: number): messages.ITestResult[]
getDocumentResults(uri: string): messages.ITestResult[]
getStepMatchArguments(uri: string, lineNumber: number): messages.IStepMatchArgument[]
getGherkinStep(gherkinStepId: string): messages.GherkinDocument.Feature.IStep
countMostSevereTestStepResultStatus(): Map<TestStepResultStatus, Long>
countTestCasesStarted(): int
findAllPickles(): List<Pickle>
findAllPickleSteps(): List<PickleStep>
`findAllTestCaseStarted(): List
findAllTestCaseStartedGroupedByFeature(): Map<Optional<Feature>, List<TestCaseStarted>>
findAllTestSteps(): List<TestStep>
findFeatureBy(TestCaseStarted): Optional<Feature>
findMostSevereTestStepResulBy(TestCaseStarted): Optional<TestStepResult>
findNameOf(Pickle, NamingStrategy): String
findPickleBy(TestCaseStarted): Optional<Pickle>
findPickleStepBy(TestStep testStep): Optional<PickleStep>
findStepBy(PickleStep pickleStep): Optional<Step>
findTestCaseBy(TestCaseStarted): Optional<TestCase>
findTestCaseDurationBy(TestCaseStarted): Optional<Duration>
findTestCaseFinishedBy(TestCaseStarted): Optional<TestCaseFinished>
findTestRunDuration(): Optional<Duration>
findTestRunFinished(): Optional<TestRunFinished>
findTestRunStarted(): Optional<TestRunStarted>
findTestStepBy(TestStepFinished): Optional<TestStep>
findTestStepsFinishedBy(TestCaseStarted): List<TestStepFinished>
findTestStepFinishedAndTestStepBy(TestCaseStarted): List<Entry<TestStepFinished, TestStep>>