TestMace
0.0.1-beta.24
0.0.1-beta.24
  • Getting Started
  • Cloud Synchronization
  • Interface
    • The Menu
    • Interface Overview
    • Scratches
    • Node Types
    • Keyboard Shortcuts
  • Node Types
    • Project
    • Folder
    • RequestStep
    • Assertion
      • Compare
      • In range
      • One of set
      • Contains
      • XPath
      • JSONPath
      • Script
      • Link
    • Link
    • API description
      • ApiRootFolder
      • ApiFolder
      • ApiRoute
      • API Description Import
    • Broken
    • Script
  • Variables
    • User-Defined Variables
      • Static Variables
      • Dynamic Variables
    • Default Variables
    • Environment Variables
  • Working with the project
    • Cookie
    • Authorization
  • Settings
    • Proxy
  • Other features
    • Bulk Edit
    • Import & Export
      • Shared
      • cURL
      • Swagger
      • Postman
    • Default HTTP headers
  • CLI
    • Command line tool
Powered by GitBook
On this page
  • How It Works
  • Parent Node
  • Link Node
  • Scenario Example
  • Creating a parent node
  • Creating a scenario
  • Import the Project by URL
  • File Representation

Was this helpful?

  1. Node Types

Link

A Link node allows to reuse another RequestStep (including Assertion) and Folder nodes.

PreviousLinkNextAPI description

Last updated 5 years ago

Was this helpful?

How It Works

A Link node allows to override the values of the running node variables. A Link node runs another node, passing the variables set by a user to it. After the run, dynamic variables of the node are set as dynamic variables of the Link node parent group. Thus the result of the run can be seen from any of the neighboring Link node.

You can refer to:

  • a node;

  • a node.

You can NOT refer to:

  • Another Link node (including self);

  • Any child of a Link node (since it'll cause an endless loop).

A Link node allows to override the variables values of the parent node.

If you delete the link a Link node refers to, the Link node wouldn't run until you provide a proper link.‌

Parent Node

Create a parent node you need to refer to and create all necessary , for example postID. You can leave value fields empty.

Link Node

Create a Link node and specify its parent, and you'll see all the variables you created for the parent earlier. You can use any variables or a static value as an overriden value.

Scenario Example

Creating a parent node

  1. Request type - DELETE.

Creating a scenario

    • Request type: POST;

    • Body: JSON request {"title":"will delete with link node"}

  • Create a Link node named deleteLink.

    • Specify the project/deletePost node as a parent.

    • Set the${$dynamicVar.postId} as an overridden value for the id variable of the parent deletePost node.

    • Request type: GET;

    • 404 is an expected server response.

File Representation

A Link node is a folder with the node name, containing the index.yml file with the following format:

{
  "type": "object",
  "properties": {
    "type": {
      "description": "Type of Link node",
      "const": "Link",
      "type": "string"
    },
    "linkedNode": {
      "$ref": "#/definitions/NodeReference",
      "description": "Link to node"
    },
    "children": {
      "description": "List of children names",
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "variables": {
      "$ref": "#/definitions/NodeVariables",
      "description": "Node variables dictionary"
    },
    "name": {
      "description": "Node name",
      "type": "string"
    }
  },
  "required": [
    "children",
    "linkedNode",
    "name",
    "type",
    "variables"
  ],
  "definitions": {
    "NodeReference": {
      "type": "object",
      "properties": {
        "refNodePath": {
          "description": "Absolute path to node",
          "type": "string"
        },
        "type": {
          "description": "Marker of reference entity",
          "const": "reference",
          "type": "string",
          "default": "reference"
        }
      },
      "required": [
        "refNodePath",
        "type"
      ]
    },
    "NodeVariables": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#"
}

Let's see an example of running a node as a Link node to delete a record.

Create a new node named deletePost.

Use the URL:

Create for this node a id variable without specifying its value.

Create a node named scenario

Add a node named createPost to the scenario:

URL:

Run the request and the id of the created record to the postid of the Scenario node.

Create a node checkIfExists to check if the record was deleted:

URL:

Import the Project

RequestStep
RequestStep
https://testmace-stage.herokuapp.com/posts/${id}
static
Folder
RequestStep
https://testmace-stage.herokuapp.com/posts/
dynamic variable
RequestStep
https://testmace-stage.herokuapp.com/posts/${$dynamicVar.postId}
by URL
RequestStep
Folder
static variables
4KB
link-node-demo.txt
Creating variables of the parent node
Creating a Link node and specifying its parent