An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

        





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](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>` | | | ✓ | | ✓ |