artes 1.1.48 → 1.1.50

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.
@@ -348,5 +348,5 @@
348
348
  - User expects `{string}` should not contain `{string}` object properties
349
349
  - User expects `{string}` should not contain `{string}` substring
350
350
  - User expects `{string}` should not match `{string}` regex
351
- - User expects that request should have `{int}` status code
351
+ - User expects that response should have `{int}` status code
352
352
  - User expects that response body should match `{string}` schema
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "artes",
3
- "version": "1.1.48",
3
+ "version": "1.1.50",
4
4
  "description": "The simplest way to automate UI and API tests using Cucumber-style steps.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -821,8 +821,8 @@ Then(
821
821
  "User expects that response has {string} field with {string} value",
822
822
  async (field, value) => {
823
823
  extractVarsFromResponse(context.response["Response Body"], field);
824
-
825
- expect(context.vars[field]).toBe(value);
824
+ const varToString = JSON.stringify(context.vars[field]);
825
+ expect(varToString).toBe(value);
826
826
  },
827
827
  );
828
828
 
@@ -851,4 +851,12 @@ Then(
851
851
  const actualStatusCode = await context.response.Response.status();
852
852
  expect(actualStatusCode).toBe(expectedStatusCode);
853
853
  }
854
+ );
855
+
856
+ Then(
857
+ "User expects that response should have {int} status code",
858
+ async function (expectedStatusCode) {
859
+ const actualStatusCode = await context.response.Response.status();
860
+ expect(actualStatusCode).toBe(expectedStatusCode);
861
+ }
854
862
  );