artes 1.1.2 → 1.1.4

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.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "The simplest way to automate UI and API tests using Cucumber-style steps.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -128,7 +128,13 @@ class Elements {
128
128
  static resolveVariable(template) {
129
129
  if (typeof template !== "string") return template;
130
130
  return template.replace(/{{\s*(\w+)\s*}}/g, (_, varName) => {
131
- const value = context.vars[varName];
131
+ let value = context.vars[varName];
132
+ if (typeof value === "string") {
133
+ value = value
134
+ .replace(/\n/g, "\\n")
135
+ .replace(/\r/g, "\\r")
136
+ .replace(/\t/g, "\\t");
137
+ }
132
138
  return value !== undefined ? value : `{{${varName}}}`;
133
139
  });
134
140
  }
@@ -123,9 +123,7 @@ async function responseMaker(request, response, duration) {
123
123
  }
124
124
  }
125
125
 
126
- Object.assign(responseObject, {
127
- "Response Time": `${Math.round(duration)} ms`,
128
- });
126
+
129
127
 
130
128
  return responseObject;
131
129
  }
@@ -6,12 +6,12 @@ Given("User sets random word as {string} variable", async (key) => {
6
6
  context.vars[key] = word;
7
7
  });
8
8
 
9
- Given("User sets random word that has {int} character as {string} variable", async (key, count) => {
9
+ Given("User sets random word that has {int} character as {string} variable", async (count, key) => {
10
10
  const word = random.lorem.word(count);
11
11
  context.vars[key] = word;
12
12
  });
13
13
 
14
- Given("User sets random word that has character between {int} and {int} as {string} variable", async (key, from, to) => {
14
+ Given("User sets random word that has character between {int} and {int} as {string} variable", async (from, to, key) => {
15
15
  const word = random.lorem.word({length: { min: from, max: to }});
16
16
  context.vars[key] = word;
17
17
  });
@@ -21,12 +21,12 @@ Given("User sets random words as {string} variable", async (key) => {
21
21
  context.vars[key] = words;
22
22
  });
23
23
 
24
- Given("User sets random {int} words as {string} variable", async (key, count) => {
24
+ Given("User sets random {int} words as {string} variable", async (count, key) => {
25
25
  const words = random.lorem.words({ wordCount: count });
26
26
  context.vars[key] = words;
27
27
  });
28
28
 
29
- Given("User sets random words that range between {int} and {int} as {string} variable", async (key,from,to) => {
29
+ Given("User sets random words that range between {int} and {int} as {string} variable", async (from, to, key) => {
30
30
  const words = random.lorem.words({ min: from, max: to });
31
31
  context.vars[key] = words;
32
32
  });
@@ -1,32 +0,0 @@
1
- name: Node.js Package
2
-
3
- on:
4
- release:
5
- types: [created]
6
-
7
- jobs:
8
- build:
9
- runs-on: ubuntu-latest
10
- outputs:
11
- node-modules-cache: ${{ steps.cache-node-modules.outputs.cache-hit }}
12
- steps:
13
- - uses: actions/checkout@v4
14
- - uses: actions/setup-node@v4
15
- with:
16
- node-version: 20
17
- - run: npm ci
18
- - run: npm test
19
-
20
- publish-npm:
21
- needs: build
22
- runs-on: ubuntu-latest
23
- steps:
24
- - uses: actions/checkout@v4
25
- - uses: actions/setup-node@v4
26
- with:
27
- node-version: 20
28
- registry-url: https://registry.npmjs.org/
29
- - run: npm ci
30
- - run: npm publish
31
- env:
32
- NODE_AUTH_TOKEN: ${{ secrets.npm_token }}