A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cucumber-rs.github.io/cucumber/main/output/intellij.html below:

IntelliJ Rust (libtest) integration - Cucumber Rust Book

Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

IntelliJ Rust (libtest) integration

writer::Libtest (enabled by libtest feature in Cargo.toml) allows IntelliJ Rust plugin to interpret output of cucumber tests similar to unit tests. To use it, just add Cargo configuration (current example uses cargo test --test wait --features libtest command) or run it via Cargo command. This automatically adds --format=json CLI option, which makes the cucumber's output IDE-compatible.

Example below is set up to output with the default writer::Basic if there is no --format=json option, or with writer::Libtest otherwise.

cucumber = { version = "0.20", features = ["libtest"] }
extern crate cucumber;
extern crate tokio;

use cucumber::{World as _, writer};

#[derive(Debug, Default, cucumber::World)]
struct World;

#[tokio::main]
async fn main() {
World::cucumber()
    .with_writer(writer::Libtest::or_basic())
    .run("tests/features/book")
    .await;
}

NOTE: There are currently 2 caveats with IntelliJ Rust integration:

  1. Because of output interpretation issue, current timing reports for individual tests are accurate only for serial tests (or for all in case --concurrency=1 CLI option is used);
  2. Although debugger works, test window may select Step that didn't trigger the breakpoint. To fix this, use --concurrency=1 CLI option.

TIP: In the multi-crate Cargo workspace, to support jump-to-definition in the reported paths (step or its matcher definition) correctly, consider to define CARGO_WORKSPACE_DIR environment variable in the .cargo/config.toml file:

[env]
CARGO_WORKSPACE_DIR = { value = "", relative = true }
libtest support

Only a small subset of libtest harness is supported to integrate with other tools:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4