Giter Site home page Giter Site logo

cucumber-rust-example's Introduction

Cucumber tests written in Rust

ci

Description

This test project aims to cover at least the following scenarios:

  • Connect to a exchange (let's call it X-Change) public API
    • Retrieve a server time and validate response;
    • Retrieve some trading pair and validate response;
  • Connect to a private API
    • Correctly handle 2fa requirements;
    • Retrieve open orders on the account and validate response;
  • Report test results

Project structure

Cucumber feature files are located in ./tests/features directory. Cucumber main function is defined under ./tests/xchange.rs

Environment variables

You need to set a number of env vars in order to make tests work. You can use ./.env.example file as a template (cp ./.env.example .env)

  • API_URL - API url, e.g. https://api.xchange.com
  • API_KEY- your API key
  • PRIV_KEY - your API private key
  • TFA_PASSWORD - a static 2fa password for API calls

Running tests locally

Unit tests

cargo test --lib

Cucumber tests

cargo test --test xchange

Running tests using Docker compose

The project is Dockerized so it is also possible to run tests using Docker compose. In addition a Allure report is generated with tests results.

Assuming you have .env file set up in your project's root folder run the following command (note docker-compose can read .env files):

docker-compose up --build

Thus you will execute all Cucumber tests and Allure server will be launched. Now you can navigate to http://localhost:8080 to check the report.

CI pipeline

A Github Actions workflow is also configured for a project. Here you will find a status of latest runs.

cucumber-rust-example's People

Contributors

serzhshakur avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.