The js implimentation of Cucumber-Perf
npm install cucumber-perf
Feature: Beer
Scenario: Jeff drinks a beer
Given: Jeff is of age and has a beer
And: Jeff opens his beer.
When: Jeff takes a sip.
Then: Verify he enjoyed it.
`
These scripts can be used to develop the features themselves but also drive automated tests.
$3
So, you now have a working functional automation test suite.
But you want to run a performance test. This would require either rewriting your existing functional tests or copying a bunch of code.
Also, you would need to create a performance test harness.
Most likely each team will end up with something that is project specific and doesn't use the existing functional code base.
$3
Cucumber Perf provides a level of automation on top of Cucumber.
It’s an implementation of a new concept (as far as I know) called Concurrent Behavior Driven Testing (CBDT).
Cucumber perf provides a means to use your existing functional code without writing a single line of code.
It provides the ability to run performance simulations with support for common load testing features:
* Timed Tests
* Multi-Threading
* Thread Count Limits
* Ramp Up/Down
* Data replacing
* Random Wait
* Reporting
* Logging
It uses a type of script called Salad.
Salad is a reimplementation of Cucumber Gherkin with the focus on performance simulations.
`
Plan: Bar visit
Simulation: Jeff drinks 3 beers.
Group: beer.feature
Runners: 1
Count: 3
`
Plans:
Here is an example plan
`
Plan: test
Simulation: simulation 1
Group test.feature
#slices
#these values will replace property "value out"
|value out|
|changed value 1|
|changed value 2|
#number of threads
Runners: 2
#total number of threads to run.
Count: 2
#a optional random wait mean for before thread runs tests.
#thread will wait between +-50% of this mean
RandomWait: 00:00:02
#Will run all groups for the period below
Simulation Period: simulation 2 period
Group test.feature
|value out|
|changed value |
Threads: 5
#count is ignored in a simulation period
Count: 1
#run time
Time: 00:00:30
RampUp: 00:00:10
RampDown: 00:00:10
``