Random data for gauge projects

Provides steps to generate random data based on the faker library

License

License

Categories

Categories

Data
GroupId

GroupId

com.github.ajoecker
ArtifactId

ArtifactId

gauge-random-data
Last Version

Last Version

0.2.2
Release Date

Release Date

Type

Type

jar
Description

Description

Random data for gauge projects
Provides steps to generate random data based on the faker library
Project URL

Project URL

https://github.com/ajoecker/gauge-random-data
Source Code Management

Source Code Management

http://github.com/ajoecker/gauge-random-data/tree/master

Download gauge-random-data

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.ajoecker/gauge-random-data/ -->
<dependency>
    <groupId>com.github.ajoecker</groupId>
    <artifactId>gauge-random-data</artifactId>
    <version>0.2.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.ajoecker/gauge-random-data/
implementation 'com.github.ajoecker:gauge-random-data:0.2.2'
// https://jarcasting.com/artifacts/com.github.ajoecker/gauge-random-data/
implementation ("com.github.ajoecker:gauge-random-data:0.2.2")
'com.github.ajoecker:gauge-random-data:jar:0.2.2'
<dependency org="com.github.ajoecker" name="gauge-random-data" rev="0.2.2">
  <artifact name="gauge-random-data" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.ajoecker', module='gauge-random-data', version='0.2.2')
)
libraryDependencies += "com.github.ajoecker" % "gauge-random-data" % "0.2.2"
[com.github.ajoecker/gauge-random-data "0.2.2"]

Dependencies

compile (4)

Group / Artifact Type Version
com.github.javafaker : javafaker jar 1.0.1
com.thoughtworks.gauge : gauge-java jar 0.7.2
org.tinylog : tinylog-api jar 2.0.0
org.tinylog : tinylog-impl jar 2.0.0

test (1)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter jar 5.5.2

Project Modules

There are no modules declared in this project.

Gauge Random Data Project

Idea

To have a simple and easy-usable project for creating random data for http://gauge.org based on https://github.com/DiUS/java-faker.

Defining Variables

One can define variables, that can be referenced inside gauge scenarios.

All random data is generated by the java-faker library.

Depending on the gauge project configuration, variables are stored in different scopes.

Based on the gauge_clear_state_level environment variable in a gauge project, the following scopes can be used

gauge_clear_state_level scope
suite getSuiteDataStore
spec getSpecDataStore
scenario getScenarioDataStore

Available Steps

  • Set a variable to a fixed value
* Set <variable> to <value>
  • Create a string of length 8. String contains numbers and characters
* Create a string <variable>
  • Create a string of custom length (max 36 characters long). String contains numbers and characters
* Create a string <variable> with length
  • Create a string for a certain pattern/foramt
* Create a string as <variable> in format <format>

The format can be any string, for which the following replacements are applied

  • %s - will be replaced with a lower case alphabetic character
  • %S - will be replaced with an upper case alphabetic character
  • %d - will be replaced with an one digit integer
  • {n} - is a suffix to any option above, where n is replaced with a number and indicates the length of the pattern ahead.

for example:

abc%S%S-%d%d will result in a string like abcTR-24 or similar

%d{2}%S{2} will create a string with two digits and two uppercase characters.

  • Read in a file and store its content as a string with removed newlines.
Create <variable> from file <file>

Different Locale

As the faker library allows to use different locale, one can define the locale to use in the gauge project via the environment variable gauge.data.locale. The available values are the locale that are mentioned on the faker homepage.

Versions

Version
0.2.2
0.2.1
0.2
0.1