New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cucumber/query

Package Overview
Dependencies
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cucumber/query

Cucumber Query - query messages

13.1.0
Source
npm
Version published
Maintainers
2
Created

What is @cucumber/query?

@cucumber/query is a JavaScript library that provides a query interface for Cucumber's test results. It allows users to filter and retrieve information about test runs, scenarios, steps, and their outcomes. This package is particularly useful for analyzing and reporting on Cucumber test results programmatically.

What are @cucumber/query's main functionalities?

Querying Test Results

This feature allows users to query and filter test results based on various criteria, such as status, tags, or names. The code sample demonstrates how to retrieve all scenarios that have passed.

const { Query } = require('@cucumber/query');
const query = new Query();

// Example: Retrieve all scenarios with a specific status
const scenarios = query.getScenarios().filter(scenario => scenario.status === 'passed');

Aggregating Test Data

Users can aggregate test data to get insights, such as counting the number of failed steps. This feature is useful for generating summaries and reports of test outcomes.

const { Query } = require('@cucumber/query');
const query = new Query();

// Example: Count the number of failed steps
const failedStepsCount = query.getSteps().filter(step => step.status === 'failed').length;

Accessing Detailed Test Information

This feature provides access to detailed information about specific test scenarios, steps, and their execution details. It is useful for debugging and understanding test failures.

const { Query } = require('@cucumber/query');
const query = new Query();

// Example: Get detailed information about a specific scenario
const scenarioId = 'some-scenario-id';
const scenarioDetails = query.getScenarioById(scenarioId);

Other packages similar to @cucumber/query

Keywords

cucumber

FAQs

Package last updated on 14 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts