JSON Format - nricheton/tdm GitHub Wiki

Layout

Example

{
	"tdm:format": "multi",
	"customer": [
		{
			"tdm:name": "cust",
			"firstName": "John",
			"lastName": "Doe",
			"enabled": true,
			"password": "password",
			"groups": [
				"user"
			],
			"address": {
				"street": "514 S. Magnolia St.",
				"city": "Orlando",
				"postalCode": "FL 32806"
			}
		},
		{
			"tdm:name": "cust2",
			"tdm:from-template": "customer/mikeAdmin"
		}
	],
	"order": [
		{
			"customer": "tdm:id-of:cust",
			"product": "Computer",
			"count": 2,
			"dateOfPurchase": "2018-01-05"
		},
		{
			"customer": "tdm:id-of:cust2",
			"product": "Computer",
			"count": 3,
			"dateOfPurchase": "tdm:date:-5w"
		},
		{
			"customer": "tdm:id-of:cust",
			"product": "Computer",
			"count": 6,
			"dateOfPurchase": "tdm:date:now"
		}
	]
}

Supported attributes

  • "tdm:format" : 2 formats are supported
    • simple : a single object
    • multi : multiple objects in a single file. Allows to create complex data sets.
  • "tdm:name" : set a custom name for the object. Can be referred to for other objects and within your tests.
  • "tdm:from-template" : get data from another object of your data set.

Supported values

  • "tdm:id-of:cust" : replaced by the generated ID returned by your application. Allows to link objects.
  • "tdm:date:-5w" : dynamic dates. Supported values: "now", and relative references : -/+, number, interval type (d,m,w,y)