All Projects → cucumber-rs → cucumber

cucumber-rs / cucumber

Licence: other
Cucumber testing framework for Rust. Fully native, no external test runners or dependencies.

Programming Languages

rust
11053 projects
Gherkin
971 projects
Makefile
30231 projects

Projects that are alternatives of or similar to cucumber

Cypress Cucumber Example
An example skeleton with Cypress and Cucumber
Stars: ✭ 57 (-82.3%)
Mutual labels:  tdd, bdd, cucumber
mocha-cakes-2
A BDD plugin for Mocha testing framework
Stars: ✭ 44 (-86.34%)
Mutual labels:  tdd, bdd, cucumber
Cucumber Rust
Cucumber testing framework for Rust. Fully native, no external test runners or dependencies.
Stars: ✭ 210 (-34.78%)
Mutual labels:  tdd, bdd, cucumber
Aruba
Test command-line applications with Cucumber-Ruby, RSpec or Minitest. The most up to date documentation can be found on Cucumber.Pro (https://app.cucumber.pro/projects/aruba)
Stars: ✭ 900 (+179.5%)
Mutual labels:  tdd, bdd, cucumber
Radish
Behavior Driven Development tooling for Python. The root from red to green.
Stars: ✭ 153 (-52.48%)
Mutual labels:  tdd, bdd, cucumber
Gunit
GUnit - Google.Test/Google.Mock/Cucumber on steroids
Stars: ✭ 156 (-51.55%)
Mutual labels:  tdd, bdd, cucumber
Add
Разработка с управляемым качеством на 1С
Stars: ✭ 210 (-34.78%)
Mutual labels:  tdd, bdd, cucumber
karate
Test Automation Made Simple
Stars: ✭ 6,384 (+1882.61%)
Mutual labels:  bdd, cucumber
ginkgo4j
A Java BDD Testing Framework (based on RSpec and Ginkgo)
Stars: ✭ 25 (-92.24%)
Mutual labels:  tdd, bdd
spring-boot-microservice-best-practices
Best practices and integrations available for Spring Boot based Microservice in a single repository.
Stars: ✭ 139 (-56.83%)
Mutual labels:  bdd, cucumber
codeceptjs-bdd
Javascript BDD UI Automation Framework. Exclusive LWC Shadow DOM Support. Playwright, Webdriver.io, Appium, Saucelabs.
Stars: ✭ 35 (-89.13%)
Mutual labels:  bdd, cucumber
Android-Cucumber-BDD-Sample
A sample project that has most of the tests and code written in a Behaviour Driven Development style, using the Cucumber framework.
Stars: ✭ 29 (-90.99%)
Mutual labels:  bdd, cucumber
bdd-for-all
Flexible and easy to use library to enable your behavorial driven development (BDD) teams to easily collaborate while promoting automation, transparency and reporting.
Stars: ✭ 42 (-86.96%)
Mutual labels:  tdd, bdd
tddd-starter
Laravel TDDD Starter App
Stars: ✭ 23 (-92.86%)
Mutual labels:  tdd, bdd
kekiri
A .NET framework that supports writing low-ceremony BDD tests using Gherkin language
Stars: ✭ 19 (-94.1%)
Mutual labels:  bdd, cucumber
showroom
Universal development and automated test environment for web components
Stars: ✭ 89 (-72.36%)
Mutual labels:  tdd, bdd
cucumber6-ts-starter
Starter project to write and debug cucumber-js features in TypeScript language
Stars: ✭ 62 (-80.75%)
Mutual labels:  bdd, cucumber
cucumber-performance
A performance testing framework for cucumber
Stars: ✭ 28 (-91.3%)
Mutual labels:  bdd, cucumber
demo-webdriverio-cucumber
E2E Tests with WebdriverIO and Cucumber
Stars: ✭ 28 (-91.3%)
Mutual labels:  bdd, cucumber
Awesome-Cucumber
A collection of awesome Cucumber and Gherkin-related resources
Stars: ✭ 33 (-89.75%)
Mutual labels:  bdd, cucumber

Cucumber testing framework for Rust

Documentation CI Rust 1.57+ Unsafe Forbidden

An implementation of the Cucumber testing framework for Rust. Fully native, no external test runners or dependencies.

Usage

Describe testing scenarios in .feature files:

Feature: Eating too much cucumbers may not be good for you
    
  Scenario: Eating a few isn't a problem
    Given Alice is hungry
    When she eats 3 cucumbers
    Then she is full

Implement World trait and describe steps:

use std::{convert::Infallible, time::Duration};

use async_trait::async_trait;
use cucumber::{given, then, when, WorldInit};
use tokio::time::sleep;

#[derive(Debug, WorldInit)]
struct World {
    user: Option<String>,
    capacity: usize,
}

#[async_trait(?Send)]
impl cucumber::World for World {
    type Error = Infallible;

    async fn new() -> Result<Self, Self::Error> {
        Ok(Self { user: None, capacity: 0 })
    }
}

#[given(expr = "{word} is hungry")] // Cucumber Expression
async fn someone_is_hungry(w: &mut World, user: String) {
    sleep(Duration::from_secs(2)).await;
    
    w.user = Some(user);
}

#[when(regex = r"^(?:he|she|they) eats? (\d+) cucumbers?$")]
async fn eat_cucumbers(w: &mut World, count: usize) {
    sleep(Duration::from_secs(2)).await;

    w.capacity += count;
    
    assert!(w.capacity < 4, "{} exploded!", w.user.as_ref().unwrap());
}

#[then("she is full")]
async fn is_full(w: &mut World) {
    sleep(Duration::from_secs(2)).await;

    assert_eq!(w.capacity, 3, "{} isn't full!", w.user.as_ref().unwrap());
}

#[tokio::main]
async fn main() {
    World::run("tests/features/readme").await;
}

Add test to Cargo.toml:

[[test]]
name = "readme"
harness = false  # allows Cucumber to print output instead of libtest

For more examples check out the Book (current | edge).

Cargo features

  • macros (default): Enables step attributes and auto-wiring.
  • timestamps: Enables timestamps collecting for all Cucumber events.
  • output-json (implies timestamps): Enables support for outputting in Cucumber JSON format.
  • output-junit (implies timestamps): Enables support for outputting JUnit XML report.

Supporting crates

The full gamut of Cucumber's Gherkin language is implemented by the gherkin crate. Most features of the Gherkin language are parsed already and accessible via the relevant structs.

Known issues

  • Scenario Outline is treated the same as Outline or Example in the parser (gherkin/#19).

License

This project is licensed under either of

at your option.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].