
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
@cucumber/query
Advanced tools
@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.
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);
cucumber-html-reporter is a package that generates HTML reports from Cucumber JSON output. While it focuses on creating visual reports, @cucumber/query provides a programmatic interface for querying test results, making it more suitable for custom data processing and analysis.
cucumber-junit is a package that converts Cucumber JSON reports into JUnit XML format. It is primarily used for integrating with CI/CD tools that require JUnit format. In contrast, @cucumber/query is used for querying and analyzing test results directly within JavaScript applications.
cucumber-pretty is a package that formats Cucumber output to be more human-readable. While it enhances the readability of test results, @cucumber/query provides a more flexible and detailed approach to accessing and manipulating test data programmatically.
FAQs
Cucumber Query - query messages
We found that @cucumber/query demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.