https://github.com/cucumber/query
A query API for https://github.com/cucumber/messages
https://github.com/cucumber/query
java javascript polyglot-release tidelift
Last synced: 3 months ago
JSON representation
A query API for https://github.com/cucumber/messages
- Host: GitHub
- URL: https://github.com/cucumber/query
- Owner: cucumber
- Created: 2022-11-21T22:26:28.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-13T12:42:00.000Z (about 1 year ago)
- Last Synced: 2024-04-14T02:37:57.686Z (about 1 year ago)
- Topics: java, javascript, polyglot-release, tidelift
- Language: Java
- Homepage:
- Size: 1.63 MB
- Stars: 1
- Watchers: 8
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
![]()
Cucumber Query
Given one Cucumber Message, find another## 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](https://github.com/cucumber/cucumber-react) needs to know the status of
a [Step](../cucumber-messages/messages.md#io.cucumber.messages.GherkinDocument.Feature.Step) as it
is rendering the [GherkinDocument](../cucumber-messages/messages.md#io.cucumber.messages.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` | | | ✓ | | ✓ |
| `countTestCasesStarted(): int` | | | ✓ | | ✓ |
| `findAllPickles(): List` | | | ✓ | | ✓ |
| `findAllPickleSteps(): List` | | | ✓ | | ✓ |
| `findAllTestCaseStarted(): List` | | | ✓ | | ✓ |
| `findAllTestCaseStartedGroupedByFeature(): Map, List>` | | | ✓ | | ✓ |
| `findAllTestSteps(): List` | | | ✓ | | ✓ |
| `findAttachmentsBy(TestStepFinished): List` | | | ✓ | | ✓ |
| `findFeatureBy(TestCaseStarted): Optional` | | | ✓ | | ✓ |
| `findHookBy(TestStep): Optional` | | | ✓ | | ✓ |
| `findMeta(): Optional` | | | ✓ | | ✓ |
| `findMostSevereTestStepResulBy(TestCaseStarted): Optional` | | | ✓ | | ✓ |
| `findNameOf(Pickle, NamingStrategy): String` | | | ✓ | | ✓ |
| `findPickleBy(TestCaseStarted): Optional` | | | ✓ | | ✓ |
| `findPickleStepBy(TestStep testStep): Optional` | | | ✓ | | ✓ |
| `findStepBy(PickleStep pickleStep): Optional` | | | ✓ | | ✓ |
| `findTestCaseBy(TestCaseStarted): Optional` | | | ✓ | | ✓ |
| `findTestCaseDurationBy(TestCaseStarted): Optional` | | | ✓ | | ✓ |
| `findTestCaseFinishedBy(TestCaseStarted): Optional` | | | ✓ | | ✓ |
| `findTestRunDuration(): Optional` | | | ✓ | | ✓ |
| `findTestRunFinished(): Optional` | | | ✓ | | ✓ |
| `findTestRunStarted(): Optional` | | | ✓ | | ✓ |
| `findTestStepBy(TestStepFinished): Optional` | | | ✓ | | ✓ |
| `findTestStepsFinishedBy(TestCaseStarted): List` | | | ✓ | | ✓ |
| `findTestStepFinishedAndTestStepBy(TestCaseStarted): List>` | | | ✓ | | ✓ |