2018-02-09 19:23:56 +00:00
|
|
|
# Introduction
|
|
|
|
|
|
|
|
This project illustrates how one can use Cucumber / BDD to drive
|
|
|
|
and test homogeneous and heterogeneous Corda networks on a local
|
|
|
|
machine. The framework has built-in support for Dockerised node
|
|
|
|
dependencies so that you easily can spin up a Corda node locally
|
|
|
|
that, for instance, uses a 3rd party database provider such as
|
Corda Behave extensions for CTS (#2968)
* Updated to Corda 3.0, added support for PostgreSQL, added STAGING_ROOT environment variable, incorporating Watch improvements (Maks), Steps Provider interface for auto-scanning of 3rd party steps providers, re-implemented StepBlocks, new ScenarioRunner executable tool, additional Steps definitions (Vault, issue/transfer cash, cordapps), other minor bug fixes and logging improvements.
* Updates incorporating PR review feedback.
* Reverted back to original - will re-test in ENT.
* Removed all SQL Server code (to be included in ENT only)
* Minor updates following second PR review.
* Fixed broken scenario tests.
* Final fix for PostgreSQL scenario test.
2018-04-19 08:56:16 +00:00
|
|
|
Postgres.
|
2018-02-09 19:23:56 +00:00
|
|
|
|
|
|
|
# Structure
|
|
|
|
|
|
|
|
The project is split into three pieces:
|
|
|
|
|
|
|
|
* **Testing Library** (main) - This library contains auxiliary
|
|
|
|
functions that help in configuring and bootstrapping Corda
|
|
|
|
networks on a local machine. The purpose of the library is to
|
|
|
|
aid in black-box testing and automation.
|
|
|
|
|
|
|
|
* **Unit Tests** (test) - These are various tests for the
|
|
|
|
library described above. Note that there's only limited
|
|
|
|
coverage for now.
|
|
|
|
|
|
|
|
* **BDD Framework** (scenario) - This module shows how to use
|
|
|
|
BDD-style frameworks to control the testing of Corda networks;
|
|
|
|
more specifically, using [Cucumber](cucumber.io).
|
|
|
|
|
2018-02-09 12:58:38 +00:00
|
|
|
# Setup
|
|
|
|
|
2018-02-12 10:07:27 +00:00
|
|
|
To get started, please follow the instructions below:
|
2018-02-09 12:58:38 +00:00
|
|
|
|
2018-02-12 10:07:27 +00:00
|
|
|
* Go up to the root directory and build the capsule JAR.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ cd ../../
|
|
|
|
$ ./gradlew install
|
|
|
|
```
|
|
|
|
|
|
|
|
* Come back to this folder and run:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ cd experimental/behave
|
|
|
|
$ ./prepare.sh
|
|
|
|
```
|
2018-02-09 12:58:38 +00:00
|
|
|
|
2018-02-09 19:23:56 +00:00
|
|
|
This script will download necessary database drivers and set up
|
2018-02-09 12:58:38 +00:00
|
|
|
the dependencies directory with copies of the Corda fat-JAR and
|
2018-02-09 19:23:56 +00:00
|
|
|
the network bootstrapping tool.
|
2018-02-12 10:43:54 +00:00
|
|
|
|
|
|
|
# Selective Runs
|
|
|
|
|
|
|
|
If you only want to run tests of a specific tag, you can append
|
|
|
|
the following parameter to the Gradle command:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ ../../gradlew scenario -Ptags="@cash"
|
|
|
|
# or
|
|
|
|
$ ../../gradlew scenario -Ptags="@cash,@logging"
|
|
|
|
```
|