Skip to content

How to store an array of json objects in a data template? #363

Closed Answered by ASaiAnudeep
binduHR asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @binduHR , have you loaded the data templates into the context of your test execution?

For example, if the data templates are declared in a different file, we need to load them before the start of the test execution.

// template.js

stash.addDataTemplate({
    connectionSecrets: [
      {
        "id": 589,
        "createdAt": "xxx",
        "updatedAt":"xxx"
      },
     {
       "id": 590,
       "createdAt": "xxx",
       "updatedAt":"xxx"
     }
   ]
});
// load template file
require('template.js')

await spec()
  .expectJsonLike('connectionSecrets')

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@binduHR
Comment options

@binduHR
Comment options

Answer selected by binduHR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants