Skip to content

Slangroom examples ​

db plugin examples ​

read a record from a table ​

gherkin
Rule unknown ignore

Given I connect to 'database' and send record 'id' and send table 'table' and read the record of the table and output into 'result'

Given I have a 'string dictionary' named 'result'
Then print the 'result'
json
{
	"id": 1,
	"table": "table"
}
json
{
	"database": "sqlite://user:password@url/to/your/db"
}

save a variable in a database table ​

gherkin
Rule unknown ignore

Given I have a 'string' named 'database'
Given I have a 'string' named 'table'
When I set 'variable' to 'value to be stored' as 'string'
When I set 'name' to 'key under which save the variable' as 'string'
Then print the 'database'
Then print the 'variable'
Then print the 'name'
Then print the 'table'

Then I connect to 'database' and send variable 'variable' and send name 'name' and send table 'table' and save the variable in the database table
json
{
    "table": "table"
}
json
{
	"database": "sqlite://user:password@url/to/your/db"
}

execute generic sql statements ​

gherkin
Rule unknown ignore

Given I connect to 'database' and send statement 'statement' and execute sql statement and output into 'result'

Given I have a 'string array' named 'result'
Then print all data
json
{
    "statement": "SELECT * FROM table"
}
json
{
	"database": "sqlite://user:password@url/to/your/db"
}

execute generic sql statements with parameters ​

gherkin
Rule unknown ignore

Given I connect to 'database' and send statement 'statement' and send parameters 'parameters'  and execute sql statement with parameters and output into 'result'

Given I have a 'string dictionary' named 'result'
Then print the 'result'
json
{
	"statement": "INSERT INTO table (name) VALUES (?)",
	"params": ["John Doe"]
}
json
{
	"database": "sqlite://user:password@url/to/your/db"
}

ethereum plugin examples ​

complex example ​

gherkin
Rule unknown ignore
Scenario 'ethereum': Store an object on eth

Given I connect to 'ethereum' and send address 'address' and read the ethereum nonce and output into 'ethereum_nonce'
Given I connect to 'ethereum' and read the suggested gas price and output into 'gas_price'

# from slangroom
Given I have a 'ethereum nonce'
Given I have a 'gas price'

# from keys
Given I have the 'keyring'

# from data
Given I have a 'ethereum address' named 'storage contract'
Given I have a 'string' named 'to be stored'
Given I have a 'gas limit'

# create the signed transaction to store the data
When I create the ethereum transaction to 'storage contract'
When I use the ethereum transaction to store 'to be stored'
When I create the signed ethereum transaction for chain 'fabt'

Then print the 'signed ethereum transaction'

Then I connect to 'ethereum' and send transaction 'signed_ethereum_transaction' and read the ethereum transaction id after broadcast and output into 'transaction_id'
json
{
    "gas_limit": "100000",
	"storage_contract": "0x662c4017C01bA23c94257289Dab8C2757b472B81",
	"to_be_srtored": "Some data",
}
json
{
	"ethereum": "http://78.47.38.223:9485",
	"keyring": {
		"ethereum": "078ad84d6c7a50c6dcd983d644da65e30d8cea063d8ea49aeb7ee7f0aaf6a4f7"
	}
}

read the ethereum balance ​

gherkin
Rule unknown ignore

Given I connect to 'ethereum' and send address 'address' and read the ethereum balance and output into 'balance'
Given I connect to 'ethereum' and send addresses 'addresses' and read the ethereum balance and output into 'balances'

Given I have a 'string' named 'balance'
Given I have a 'string array' named 'balances'
Then print the data
json
{
	"address": "0x2D010920b43aFb54f8d5fB51c9354FbC674b28Fc",
	"addresses": [
		"0xc32510251F77382bb9214144D2c488408Ec2047C",
		"0xFf02577F140557190693cFf549025e66119FEA52",
		"0x4743879F5e9dc3fcE41E30380365441E8D14CCEc"
    ]
}
json
{
	"ethereum": "http://78.47.38.223:9485"
}

read the ethereum transaction body ​

gherkin
Rule unknown ignore
Scenario 'ethereum': read transaction

Given I connect to 'ethereum' and send transaction_id 'tag' and read the ethereum bytes and output into 'hex_result'

Given I have a 'hex' named 'hex_result'
When I create the string from the ethereum bytes named 'hex_result'
When I rename the 'string' to 'string_result'
Then print data
json
{
	"tag": "0467636a2557a1ccdaf10ce17ee74340096c510acfa9181c85756d43a8bed522"
}
json
{
	"ethereum": "http://78.47.38.223:9485"
}

read the ethereum suggested gas price ​

gherkin
Rule unknown ignore
Scenario 'ethereum': read gas price

Given I connect to 'ethereum' and read the ethereum suggested gas price and output into 'gas_price'

Given I have a 'gas price'
Then print the data
json
{}
json
{
	"ethereum": "http://78.47.38.223:9485"
}

read the ethereum nonce ​

gherkin
Rule unknown ignore
Scenario 'ethereum': read nonce

Given I connect to 'ethereum' and send address 'address' and read the ethereum nonce and output into 'ethereum_nonce'

Given I have a 'ethereum nonce'
Then print the 'ethereum_nonce'
json
{
	"address": "0x7d6df85bDBCe99151c813fd1DDE6BC007c523C27"
}
json
{
	"ethereum": "http://78.47.38.223:9485"
}

read the ethereum transaction id after broadcast ​

gherkin
Rule unknown ignore

Given I connect to 'ethereum' and send transaction 'signed_transaction' and read the ethereum transaction id after broadcast and output into 'transaction_id'

Given I have a 'string' named 'transaction_id'
Then print the data
json
{
    "signed_transaction": "f8ee8085174876e800830493e094e54c7b475644fbd918cfedc57b1c9179939921e680b884b374012b0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003354686973206973206d7920666972737420646174612073746f726564206f6e20657468657265756d20626c6f636b636861696e0000000000000000000000000084ccc2c50ca0776b58c34145c9553b5235fe211a6237c48b90b4784bc6d86660b0236af3bab2a07b57259d71f12666d962eb7a06b2b8332323a614071d0b39c35181b2aee04b8e"
}
json
{
	"ethereum": "http://78.47.38.223:9485"
}

fs plugin examples ​

verify file exists or does not exist ​

gherkin
Rule unknown ignore
Given I send path 'file_path_1' and verify file exists
Given I send path 'file_path_2' and verify file does not exist
Given I have a 'string' named 'file_path_1'
Then print the 'file_path_1'
json
{
	"file_path_1": "path/to/file/that/should/exists/from/FILES_DIR",
	"file_path_2": "path/to/file/that/should/not/exists/from/FILES_DIR"
}
json
{}

list a directory content ​

gherkin
Rule unknown ignore
Given I send path 'directory_path' and list directory content and output into 'directory_content'
Given I have a 'string array' named 'directory_content'
Then print the 'directory_content'
json
{
	"directory_path": "path/to/directory/from/FILES_DIR"
}
json
{}

read json file ​

gherkin
Rule unknown ignore
Given I send path 'file_path' and read file content and output into 'file_content'
Given I have a 'string dictionay' named 'file_content'
Then print the 'file_content'
json
{
	"file_path": "path/to/file/from/FILES_DIR"
}
json
{}

read string file ​

gherkin
Rule unknown ignore
Given I send path 'file_path' and read verbatim file content and output into 'file_content'
Given I have a 'string' named 'file_content'
Then print the 'file_content'
json
{
	"file_path": "path/to/file/from/FILES_DIR"
}
json
{}

store in file ​

gherkin
Rule unknown ignore
Given I have a 'string' named 'file_path'
When I create the random object of '128' bits
Then print the 'random_object'
Then print the 'file_path'
Then I send path 'file_path' and send content 'random_object' and store in file
json
{
	"file_path": "path/to/file/from/FILES_DIR"
}
json
{}

git plugin examples ​

clone repository ​

gherkin
Rule unknown ignore

Given I connect to 'url' and send path 'path' and clone repository

Given I have a 'string' named 'cloned_repository'
Then print the data
json
{
	"cloned_repository": "true"
}
json
{
	"url": "https://github.com/dyne/slangroom",
	"path": "slangroom"
}

create new git commit ​

gherkin
Rule unknown ignore

Given I open 'path' and send commit 'commit' and create new git commit and output into 'commit_hash'

Given I have a 'string' named 'commit hash'
Then print the data
json
{
	"commit": {
		"author": "Jhon Doe",
		"message": "docs: update readme",
		"email": "jhon.doe@example.com",
		"files": [ "README.md" ]
	},
}
json
{
	"path": "slangroom"
}

verify git repository ​

gherkin
Rule unknown ignore

Given I open 'path' and verify git repository

Given I have a 'string' named 'verified_git_repo'
Then print data
json
{
	"verified_git_repo": "true"
}
json
{
    "path": "path/to/repository"
}

helpers plugin examples ​

manipulate and compact ​

gherkin
Rule unknown ignore

Given I send array 'array' and manipulate and compact and output into 'result'

Given I have a 'string array' named 'result'
Then print the data
json
{
	"the_array": [
		0,
		"c",
		false,
		"d",
		""
	]
}
json
{}

manipulate and concat ​

gherkin
Rule unknown ignore

Given I send array 'array' and send values 'values' and manipulate and concat and output into 'result'

Given I have a 'string array' named 'result'
Then print the data
json
{
    "array": [
		"first",
		"second"
	]
}
json
{
	"values": [
		"third",
		"foruth",
		"fifth"
	]
}

manipulate and get ​

gherkin
Rule unknown ignore

Given I send object 'object' and send path 'path' and manipulate and get and output into 'result'

Given I have a 'string' named 'result'
Then print the data
json
{
	"object": {
		"root": {
			"element": "value"
		}
	}
}
json
{
	"the_path": "root.element"
}

manipulate and merge ​

gherkin
Rule unknown ignore

Given I send object 'object' and send sources 'sources' and manipulate and merge and output into 'result'

Given I have a 'string dictionary' named 'result'
Then print the data
json
{
	"object": {
		"names": {
			"first": "Bella",
			"third": "Owen"
		},
		"surnames": {
			"first": "Allen",
			"second": "Briggs"
		}
	}
}
json
{
	"sources": [
		{
			"names": {
				"second": "Jhon"
			}
		},
		{
			"surnames": {
				"third": "Doe"
			}
		}
	]
}

manipulate and omit ​

gherkin
Rule unknown ignore

Given I send object 'object' and send paths 'paths' and manipulate and omit and output into 'result'

Given I have a 'string dictionary' named 'result'
Then print the data
json
{
	"object": {
		"names": {
			"first": "Bella",
			"third": "Owen"
		},
		"surnames": {
			"first": "Allen",
			"second": "Briggs"
		}
	}
}
json
{
	"path": [
		"names.third",
		"surnames.second"
	]
}

manipulate and pick ​

gherkin
Rule unknown ignore

Given I send object 'object' and send properties 'properties' and manipulate and pick and output into 'result'

Given I have a 'string dictionary' named 'result'
Then print the data
json
{
	"object": {
		"name": "Jhon",
		"personal_information": {
			"email": {
				"first": "example@example.org",
				"second": "email@example.org"
			},
			"phone": "3338957823"
		}
	}
}
json
{
	"properties": [
		"name",
		"personal_information.email.first"
	]
}

manipulate and set ​

gherkin
Rule unknown ignore

Given I send object 'object' and send path 'path' and send value 'value' and manipulate and set

Given I have a 'string dictionary' named 'object'
Then print 'mimmo'
json
{
	"value": { "name": "Jhon" },
	"object": {
		"surname": "Doe"
	}
}
json
{
	"path": "root.element"
}

http plugin examples ​

http get ​

gherkin
Rule unknown ignore
Given I connect to 'address' and do get and output into 'result'
Given I have a 'string dictionary' named 'result'
Then print the 'result'
json
{
	"address": "https://dyne.org/slangroom"
}
json
{
	"secret": "foo"
}

http get with headers ​

gherkin
Rule unknown ignore
Given I connect to 'address' and send headers 'headers' and do get and output into 'result'
Given I have a 'string dictionary' named 'result'
Then print the 'result'
json
{
	"headers": {
		"Content-Type": "application/json"
	}
}
json
{
	"address": "https://dyne.org/slangroom"
}

http post ​

gherkin
Rule unknown ignore
Given I connect to 'address' and send object 'body' and do post and output into 'result'
Given I have a 'string dictionary' named 'result'
Then print the 'result'
json
{
	"body": {
		"hello": "world"
	}
}
json
{
	"address": "https://dyne.org/slangroom"
}

http post with header ​

gherkin
Rule unknown ignore
Given I connect to 'address' and send object 'body' and send headers 'headers' and do post and output into 'result'
Given I have a 'string dictionary' named 'result'
Then print the 'result'
json
{
	"body": {
		"hello": "world"
	},
	"headers": {
		"Content-Type": "application/json"
	}
}
json
{
	"address": "https://dyne.org/slangroom"
}

json-schema plugin examples ​

validate json ​

gherkin
Rule unknown ignore

Given I send json_data 'json_data' and send json_schema 'json_schema' and validate json and output into 'result'

Given I have a 'string dictionary' named 'result'
Then print the 'result'
json
{
    "json_data": {
        "first_name": "Jhon",
        "last_name": "Doe"
    }
}
json
{
	"json_schema": {
		"type": "object",
		"properties": {
			"first_name": {
				"type": "string"
			},
			"last_name": {
				"type": "string"
			}
		},
		"required": [
			"first_name",
			"last_name"
		]
	}
}

location plugin examples ​

assign the current location ​

gherkin
Rule unknown ignore

Given I send url 'url' and assign the current location

Given nothing
Then print data
json
{
    "url": "https://example.com"
}
json
{}

go back in history ​

gherkin
Rule unknown ignore

Given I go back in history

Given nothing
Then print data
json
{}
json
{}

go forward in history ​

gherkin
Rule unknown ignore

Given I go forward in history

Given nothing
Then print data
json
{}
json
{}

go to a specific page in history ​

gherkin
Rule unknown ignore

Given send index 'index' and I go to a specific page in history

Given nothing
Then print data
json
{
    "index": -1
}
json
{}

get the history length ​

gherkin
Rule unknown ignore

Given I get the history length and output into 'history_length'

Given I have a 'number' named 'history_length'
Then print data
json
{}
json
{}

get the current location ​

gherkin
Rule unknown ignore

# this reutrn the window.location object
# singular element of location can be obtained by adding
# the reuqest element, i.e. href, protocol, host, hostname, port,
# pathname, search params, hash, after 'location' like
# Given I get the current location href and output into 'result'

Given I get the current location and output into 'location'

Given I have a 'string dictionary' named 'location'
Then print data
json
{}
json
{}

open the url in a new window ​

gherkin
Rule unknown ignore

Given I send url 'url' and open the url in a new window

Given nothing
Then print data
json
{
    "url": "https://example.com"
}
json
{}

redirect to the url ​

gherkin
Rule unknown ignore

Given I send url 'url' and redirect to the url

Given nothing
Then print data
json
{
    "url": "https://example.com"
}
json
{}

reload the page ​

gherkin
Rule unknown ignore

Given I reload the current page

Given nothing
Then print data
json
{}
json
{}

replace the current location ​

gherkin
Rule unknown ignore

Given I send url 'url' and replace the current location

Given nothing
Then print data
json
{
    "url": "https://example.com"
}
json
{}

oauth plugin examples ​

add data to authorization details ​

gherkin
Rule unknown ignore

Given I send request_uri 'request_uri' and send data 'data' and send server_data 'server' and add data to authorization details and output into 'result'

Given I have a 'string array' named 'result'
Then print the 'result'
json
{
	"request_uri": "urn:ietf:params:oauth:request_uri:1719239545ed9f269e652d207b90dec394b87225c92346023b",
	"data": {
		"email": "email@example.com"
	}
}
json
{
	"server_data": {
		"jwk": {
			"kty": "EC",
			"crv": "P-256",
			"alg": "ES256",
			"x": "SVqB4JcUD6lsfvqMr-OKUNUphdNn64Eay60978ZlL74",
			"y": "lf0u0pMj4lGAzZix5u4Cm5CMQIgMNpkwy163wtKYVKI",
			"d": "0g5vAEKzugrXaRbgKG0Tj2qJ5lMP4Bezds1_sTybkfk"
		},
		"url": "https://valid.issuer.url",
		"authentication_url": "https://did.dyne.org/dids/"
	}
}

generate access token ​

gherkin
Rule unknown ignore
Scenario 'http': url encode

Given I have a 'string dictionary' named 'json_body'
Given I have a 'string dictionary' named 'request'

When I create the http get parameters from 'json_body' using percent encoding
When I move 'json_body' to 'body' in 'request'

Then print the 'request'

Then I send request 'request' and send server_data 'server_data' and generate access token and output into 'result'
json
{
	"json_body": {
		"grant_type": "authorization_code",
		"client_id": "did:dyne:sandbox.genericissuer:6Cp8mPUvJmQaMxQPSnNyhb74f9Ga4WqfXCkBneFgikm5",
		"code_verifier": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk",
		"redirect_uri": "https://Wallet.example.org/cb",
		"code": "eyJhbGciOiJFUzI1NiIsImp3ayI6eyJrdHkiOiJFQyIsIngiOiJ0R3hhcWJYR3JsNm92VC11NXNWMU1vUFRESG5ZTEtZbkNpZzM0NW5zSmc4IiwieSI6IlFOT3RBRzd4Sm52cHlGS2lGdmJJdFBxaVBiN2VZSVMtQlRvU0YwaHM3NTgiLCJjcnYiOiJQLTI1NiJ9fQ.eyJzdWIiOiI1NDJiYWNjODAyMDUxZTdhYjBjMWZhNDAxZjAwYzhjNWJjN2Y0NzVhIiwiaWF0IjoxNzE5MjQxMTYzLCJpc3MiOiJodHRwczovL2Rldi5hdXRoei1zZXJ2ZXIxLmZvcmtib21iLmV1L2F1dGh6X3NlcnZlciIsImF1ZCI6ImRpZDpkeW5lOnNhbmRib3guc2lnbnJvb206NEtFeW1XZ0xEVWYxTE5ja2V4WTk2ZGZLejV2SDc5ZGlEZWtnTE1SOUZXcEgiLCJleHAiOjE3MTkyNDQ3NjJ9.1OhQ5FKXuh_QWxm4XMufNqFS2Zkql7bmBzfMuT8GzVEil3HzYM7dAwUo5Zl9shu-w7bEGlKkOIhXssVrMeMlXg"
	},
	"request": {
		"headers": {
			"content-length": 42,
			"Content-Type": "application/x-www-form-urlencoded",
			"DPoP": "eyJhbGciOiJFUzI1NiIsImp3ayI6eyJjcnYiOiJQLTI1NiIsImt0eSI6IkVDIiwieCI6InpKLTR1d0VWVlYxQW9GcW1yZVlzUlh1SjhGbzVHRVVUeTZ0aklBdjdUcFkiLCJ5IjoiVm9YdmEzVEpHc0o5bjlZVzV3MGplMHp6U2hmYnN3QWd6SHI1TEZCSDNsZyJ9LCJ0eXAiOiJkcG9wK2p3dCJ9.eyJodG0iOiJQT1NUIiwiaHR1IjoiaHR0cHM6Ly9kZXYuYXV0aHotc2VydmVyMS5mb3JrYm9tYi5ldS9hdXRoel9zZXJ2ZXIvdG9rZW4iLCJpYXQiOjE3MTkyNDEzMjYsImp0aSI6IkFad0VwZ2tOTlhrbllWT1JZbjNYNW9HVW1iTVp3V3d1UF9xSDNnOFRjbHcifQ.X2sO6h3GUcTu0h_qNyOsXEB2Z3qzPUd1azOJIeMmfH4zIk-Hd8sHm1RG2RaxZ3n22qSDbKjBap2G9U3Kjw5gLA"
		}
	}
}
json
{
	"server_data": {
		"jwk": {
			"kty": "EC",
			"crv": "P-256",
			"alg": "ES256",
			"x": "SVqB4JcUD6lsfvqMr-OKUNUphdNn64Eay60978ZlL74",
			"y": "lf0u0pMj4lGAzZix5u4Cm5CMQIgMNpkwy163wtKYVKI",
			"d": "0g5vAEKzugrXaRbgKG0Tj2qJ5lMP4Bezds1_sTybkfk"
		},
		"url": "https://valid.issuer.url",
		"authentication_url": "https://did.dyne.org/dids/"
	}
}

generate authorization code ​

gherkin
Rule unknown ignore

Given I send request 'request' and send server_data 'server' and generate authorization code and output into 'result'

Given I have a 'string dictionary' named 'result'
Then print the 'result'
json
{
	"request": {
		"body": "client_id=did%3Adyne%3Asandbox%2Egenericissuer%3A6Cp8mPUvJmQaMxQPSnNyhb74f9Ga4WqfXCkBneFgikm5&request_uri=urn%3Aietf%3Aparams%3Aoauth%3Arequest_uri%3A1719239545ed9f269e652d207b90dec394b87225c92346023b",
        "headers": {
            "Authorization": ""
        }
    }
}
json
{
	"server_data": {
		"jwk": {
			"kty": "EC",
			"crv": "P-256",
			"alg": "ES256",
			"x": "SVqB4JcUD6lsfvqMr-OKUNUphdNn64Eay60978ZlL74",
			"y": "lf0u0pMj4lGAzZix5u4Cm5CMQIgMNpkwy163wtKYVKI",
			"d": "0g5vAEKzugrXaRbgKG0Tj2qJ5lMP4Bezds1_sTybkfk"
		},
		"url": "https://valid.issuer.url",
		"authentication_url": "https://did.dyne.org/dids/"
	}
}

generate request uri ​

gherkin
Rule unknown ignore

Given I send request 'request' and send client 'client' and send server_data 'server_data' and send expires_in 'expires_in' and generate request uri and output into 'result'

Given I have a 'string dictionary' named 'result'
Then print the 'result'
json
{
    "client": {
        "id": "did:dyne:sandbox.genericissuer:6Cp8mPUvJmQaMxQPSnNyhb74f9Ga4WqfXCkBneFgikm5",
        "clientSecret": "eyJhbGciOiJFUzI1NiJ9.eyJzdWIiOiJwaXBwbyJ9.hiVPL2JTdmcZY7Vcso95KUBEzcTGvmvQ7wlwkCo0G74Unpzny2drvLsu-HzHWyckKbRjwWox-V5gqqKeka8kEQ",
        "grants": ["authorization_code"],
        "redirectUris": ["https://Wallet.example.org/cb"],
        "scope": ["Auth1"],
        "resource": "http://issuer1.zenswarm.forkbomb.eu/credential_issuer"
    }
}
json
{
	"server_data": {
		"jwk": {
			"kty": "EC",
			"crv": "P-256",
			"alg": "ES256",
			"x": "SVqB4JcUD6lsfvqMr-OKUNUphdNn64Eay60978ZlL74",
			"y": "lf0u0pMj4lGAzZix5u4Cm5CMQIgMNpkwy163wtKYVKI",
			"d": "0g5vAEKzugrXaRbgKG0Tj2qJ5lMP4Bezds1_sTybkfk"
		},
		"url": "https://valid.issuer.url",
		"authentication_url": "https://did.dyne.org/dids/"
	},
	"expires_in": 500,
	"request": {
		"body": "response_type=code&client_id=did:dyne:sandbox.genericissuer:6Cp8mPUvJmQaMxQPSnNyhb74f9Ga4WqfXCkBneFgikm5&state=xyz&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&code_challenge_method=S256&redirect_uri=https%3A%2F%2FWallet.example.org%2Fcb&authorization_details=%5B%7B%22type%22%3A%20%22openid_credential%22%2C%20%22credential_configuration_id%22%3A%20%22Auth1%22%2C%22locations%22%3A%20%5B%22http%3A%2F%2Fissuer1.zenswarm.forkbomb.eu%3A3100%2Fcredential_issuer%2F%22%5D%7D%5D",
		"headers": {
			"Authorization": ""
		}
	}
}

get authorization details ​

gherkin
Rule unknown ignore

Given I send token 'token' and send server_data 'server' and get authorization details from token and output into 'result'

Given I have a 'string array' named 'result'
Then print data
json
{
    "token": "eyJhbGciOiJFUzI1NiIsImp3ayI6eyJrdHkiOiJFQyIsIngiOiJ0R3hhcWJYR3JsNm92VC11NXNWMU1vUFRESG5ZTEtZbkNpZzM0NW5zSmc4IiwieSI6IlFOT3RBRzd4Sm52cHlGS2lGdmJJdFBxaVBiN2VZSVMtQlRvU0YwaHM3NTgiLCJjcnYiOiJQLTI1NiJ9fQ.eyJzdWIiOiJjYzA3N2Y4MTcwMWU3NDIxNTQ5ZmU0MjBiNDFiNTUxMjVlZDljNmZlIiwiaWF0IjoxNzE5MjQxMzI3LCJpc3MiOiJodHRwczovL2Rldi5hdXRoei1zZXJ2ZXIxLmZvcmtib21iLmV1L2F1dGh6X3NlcnZlciIsImF1ZCI6ImRpZDpkeW5lOnNhbmRib3guc2lnbnJvb206NEtFeW1XZ0xEVWYxTE5ja2V4WTk2ZGZLejV2SDc5ZGlEZWtnTE1SOUZXcEgiLCJleHAiOjE3MTkyNDQ5Mjd9.xLWyO9DkLnSU-9w_4kzmI-znQAwlYJnBbZXpKqmHNpwnFwJUdK26hmVgIQSy2HcHujKyaXX6unjmFe1P5HyK9A"
}
json
{
	"server": {
		"url": "https://valid.issuer.url"
	}
}

verify request parameters ​

gherkin
Rule unknown ignore

Given I have a 'string' named 'client_id'
Given I have a 'string' named 'request_uri'
Given I have a 'string dictionary' named 'request'

When I set 'body' to 'client_id=' as 'string'
When I append the 'client_id' to 'body'
When I append the string '&request_uri=' to 'body'
When I append the 'request_uri' to 'body'
When I move 'body' in 'request'

Then print the 'request'

Then I send request 'request' and send server_data 'server_data' and verify request parameters
json
{
	"client_id": "did:dyne:sandbox.genericissuer:6Cp8mPUvJmQaMxQPSnNyhb74f9Ga4WqfXCkBneFgikm5",
	"request_uri": "urn:ietf:params:oauth:request_uri:1719239545ed9f269e652d207b90dec394b87225c92346023b",
    "request": {
        "headers": {
            "Authorization": ""
        }
    }
}
json
{
	"server_data": {
		"jwk": {
			"kty": "EC",
			"crv": "P-256",
			"alg": "ES256",
			"x": "SVqB4JcUD6lsfvqMr-OKUNUphdNn64Eay60978ZlL74",
			"y": "lf0u0pMj4lGAzZix5u4Cm5CMQIgMNpkwy163wtKYVKI",
			"d": "0g5vAEKzugrXaRbgKG0Tj2qJ5lMP4Bezds1_sTybkfk"
		},
		"url": "https://valid.issuer.url",
		"authentication_url": "https://did.dyne.org/dids/"
	}
}

pocketbase plugin examples ​

create a record ​

gherkin
Rule unknown ignore

Given I connect to 'pb_address' and start pb client
Given I send my_credentials 'my_credentials' and login

Given I send create_parameters 'create_parameters' and send record_parameters 'record_parameters' and create record and output into 'result'

Given I have a 'string dictionary' named 'result'
Then print the 'result'
json
{
	"create_parameters": {
		"collection": "organizations",
		"record": {
			"name": "Jhon org"
		}
	},
	"record_parameters": {
		"requestKey": "testCreate"
	}
}
json
{
	"pb_address": "http://127.0.0.1:8090",
	"my_credentials": {
		"email": "test@test.eu",
		"password": "testtest"
	}
}

delete a record ​

gherkin
Rule unknown ignore

Given I connect to 'pb_address' and start pb client
Given I send my_credentials 'my_credentials' and login

Given I send delete_parameters 'delete_parameters' and delete record and output into 'result'

Given I have a 'string' named 'result'
Then print the 'result'
json
{
	"delete_parameters": {
		"collection": "organizations",
		"id": "q3vijjsacrn32tk"
	}
}
json
{
	"pb_address": "http://127.0.0.1:8090",
	"my_credentials": {
		"email": "test@test.eu",
		"password": "testtest"
	}
}

get one record ​

gherkin
Rule unknown ignore

Given I connect to 'pb_address' and start pb client

Given I send show_parameters 'show_parameters' and get one record and output into 'result'

Given I have a 'string dictionary' named 'result'
Then print the 'result'
json
{
	"show_parameters": {
		"collection": "organizations",
		"id": "p7viyzsihrn52uj",
		"fields": "name"
	}
}
json
{
	"pb_address": "http://127.0.0.1:8090"
}

get some records ​

gherkin
Rule unknown ignore

Given I connect to 'pb_address' and start pb client

Given I send list_parameters 'list_parameters' and get some records and output into 'result'

Given I have a 'string dictionary' named 'result'
Then print the 'result'
json
{
	"list_parameters": {
		"type": "list",
		"pagination": {
			"page": 2,
			"perPage": 20
		},
		"collection": "organizations"
	}
}
json
{
	"pb_address": "http://127.0.0.1:8090"
}

login ​

gherkin
Rule unknown ignore

Given I connect to 'pb_address' and start pb client

Given I send my_credentials 'my_credentials' and login and output into 'result'

Given I have a 'string' named 'result'
Then print the 'result'
json
{
	"my_credentials": {
		"email": "test@test.eu",
		"password": "testtest"
	}
}
json
{
	"pb_address": "http://127.0.0.1:8090"
}

password reset ​

gherkin
Rule unknown ignore

Given I connect to 'pb_address' and start pb client
Given I send my_credentials 'my_credentials' and login

Given I send email 'email' and ask password reset and output into 'result'

Given I have a 'string dictionary' named 'result'
Then print the 'result'
json
{
	"email": "test@test.eu"
}
json
{
	"pb_address": "http://127.0.0.1:8090",
	"my_credentials": {
		"email": "test@test.eu",
		"password": "testtest"
	}
}

send request ​

gherkin
Rule unknown ignore

Given I connect to 'pb_address' and start pb client

Given I send url 'url' and send send_parameters 'send_parameters' and send request and output into 'result'

Given I have a 'string dictionary' named 'result'
Then print the 'result'
json
{
	"url": "/api/hello/user",
	"send_parameters": {}
}
json
{
	"pb_address": "http://127.0.0.1:8090"
}

start pb client ​

gherkin
Rule unknown ignore

Given I connect to 'pb_address' and start pb client and output into 'result'
# for mobile contracts use instead
# Given I connect to 'pb_address' and start capacitor pb client and output into 'result'

Given I have a 'string' named 'result'
Then print the 'result'
json
{}
json
{
	"pb_address": "http://127.0.0.1:8090"
}

update a record ​

gherkin
Rule unknown ignore

Given I connect to 'pb_address' and start pb client
Given I send my_credentials 'my_credentials' and login

Given I send update_parameters 'update_parameters' and send record_parameters 'record_parameters' and update record and output into 'result'

Given I have a 'string dictionary' named 'result'
Then print the 'result'
json
{
	"update_parameters": {
		"id": "q3vijjsacrn32tk",
		"collection": "organizations",
		"record": {
			"name": "new value for name"
		}
	},
	"record_parameters": {
		"fields": "id, name"
	}
}
json
{
	"pb_address": "http://127.0.0.1:8090",
	"my_credentials": {
		"email": "test@test.eu",
		"password": "testtest"
	}
}

qrcode plugin examples ​

create qr code ​

gherkin
Rule unknown ignore

Given I send text 'text' and create qr code and output into 'result'

Given I have a 'string' named 'result'
Then print the 'result'
json
{
    "text": "Hello World!"
}
json
{}

redis plugin examples ​

delete key from redis ​

gherkin
Rule unknown ignore

Given I connect to 'redis' and send key 'key' and delete key from redis and output into 'result'

Given I have a 'number' named 'result'
Then print the 'result'
json
{
	"key": "some key"
}
json
{
	"redis": "redis://localhost:6379"
}

read key from redis ​

gherkin
Rule unknown ignore

Given I connect to 'redis' and send key 'key' and read key from redis and output into 'result'

Given I have a 'string dictionary' named 'result'
Then print the 'result'
json
{
	"key": "some key"
}
json
{
	"redis": "redis://localhost:6379"
}

write object into key in redis ​

gherkin
Rule unknown ignore

Given I connect to 'redis' and send key 'key' and send object 'object' and write object into key in redis and outpuit into 'result'

Given I have a 'string' named 'result'
Then print the 'result'
json
{
	"key": "some key",
	"object": {
		"foo": "bar",
		"baz": "qux"
	}
}
json
{
	"redis": "redis://localhost:6379"
}

shell plugin examples ​

execute in shell ​

gherkin
Rule unknown ignore

Given I send command 'command' and execute in shell and output into 'result'

Given I have a 'string' named 'result'
Then print the 'result'
json
{
	"command": "ls -a"
}
json
{}

timestamp plugin examples ​

fetch the local timestamp ​

gherkin
Rule unknown ignore

Given I fetch the local timestamp in seconds and output into 'result_in_seconds'
Given I fetch the local timestamp in milliseconds and output into 'result_in_milliseconds'

Given I have a 'string' named 'result_in_seconds'
Given I have a 'string' named 'result_in_milliseconds'
Then print the 'result_in_seconds'
Then print the 'result_in_milliseconds'
json
{}
json
{}

zencode plugin examples ​

execute zencode ​

gherkin
Rule unknown ignore

Given I send keys 'keys' and send data 'data' and send script 'script' and execute zencode and output into 'result'

Given I have a 'string dictionary' named 'result'
Then print the 'result'
json
{
	"keys": {
		"keyring": {
			"ecdh": "FJ5Esc1koLSH+9pKSdI65tcyH2HowzXMe0UdsqktmZU="
		}
	}
}
json
{
	"zencode": "Scenario 'ecdh': Create the public key\nGiven I have the 'keyring'\nWhen I create the ecdh public key\nThen print the 'ecdh public key'\n",
	"data": {}
}