artes 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -270,6 +270,7 @@
270
270
  # Debugging / Console Output
271
271
 
272
272
  - User wants to see saved variables
273
+ - User wants to see {string} variable
273
274
  - User wants to see request body
274
275
  - User wants to see response body
275
276
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "artes",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "The simplest way to automate UI and API tests using Cucumber-style steps.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -483,8 +483,12 @@ const api = {
483
483
 
484
484
  context.response = await response;
485
485
  },
486
- vars: () => {
487
- return context.vars;
486
+ vars: (variable) => {
487
+ if(!variable){
488
+ return context.vars;
489
+ }else{
490
+ return { [variable]: context.vars[variable] };
491
+ }
488
492
  },
489
493
  };
490
494
 
@@ -5,6 +5,7 @@ const {
5
5
  saveVar,
6
6
  time,
7
7
  random,
8
+ moduleConfig,
8
9
  } = require("../helper/imports/commons");
9
10
  const { api } = require("../helper/stepFunctions/exporter");
10
11
  const path = require("path");
@@ -222,7 +223,11 @@ When(
222
223
  );
223
224
 
224
225
  When("User wants to see saved variables", async function () {
225
- console.log("\nVariables:", api.vars(), "\n");
226
+ console.log("\nVariables:", api.vars(null), "\n");
227
+ });
228
+
229
+ When("User wants to see {string} variable", async function (variable) {
230
+ console.log(api.vars(variable), "\n");
226
231
  });
227
232
 
228
233
  When("User wants to see request body", async function () {