artes 1.7.21 → 1.7.22

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "artes",
3
- "version": "1.7.21",
3
+ "version": "1.7.22",
4
4
  "description": "The simplest way to automate UI and API tests using Cucumber-style steps.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -402,4 +402,20 @@ When(
402
402
  const fileData = fs.readFileSync(filePath);
403
403
  context.vars[variable] = fileData.toString("base64");
404
404
  },
405
- );
405
+ );
406
+
407
+ Then(
408
+ "User expects that response has {string} field that contains {string} value",
409
+ async (field, value) => {
410
+ extractVarsFromResponse(context.response["Response Body"], field);
411
+ const key = pathToCamelCase(field);
412
+ expect(String(context.vars[key])).toContain(resolveVariable(value));
413
+ },
414
+ );
415
+
416
+
417
+ Then('User expects that response has {string} header with {string} value', async (field, value) => {
418
+ extractVarsFromResponse(context.response["Response Headers"], field);
419
+ const key = pathToCamelCase(field);
420
+ expect(String(context.vars[key])).toBe(resolveVariable(value));
421
+ })