artes 1.2.18 → 1.2.19

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.
@@ -27,13 +27,10 @@ Given("User sets random words as {string}", async (key) => {
27
27
  context.vars[key] = words;
28
28
  });
29
29
 
30
- Given(
31
- "User sets random {int} words as {string}",
32
- async (key, count) => {
33
- const words = random.lorem.words({ wordCount: count });
34
- context.vars[key] = words;
35
- },
36
- );
30
+ Given("User sets random {int} words as {string}", async (key, count) => {
31
+ const words = random.lorem.words({ wordCount: count });
32
+ context.vars[key] = words;
33
+ });
37
34
 
38
35
  Given(
39
36
  "User sets random words that range between {int} and {int} as {string}",
@@ -43,7 +40,7 @@ Given(
43
40
  },
44
41
  );
45
42
 
46
- Given('User sets random number as {string}', async (key) => {
43
+ Given("User sets random number as {string}", async (key) => {
47
44
  const randomNumber = random.number.int();
48
45
  context.vars[key] = randomNumber;
49
46
  });
@@ -77,83 +74,105 @@ Given("User sets random email as {string}", (key) => {
77
74
  context.vars[key] = email;
78
75
  });
79
76
 
80
- Given('User sets random url as {string}', (urlName) => {
77
+ Given("User sets random url as {string}", (urlName) => {
81
78
  const randomUrl = random.internet.url();
82
79
  context.vars[urlName] = randomUrl;
83
- })
80
+ });
84
81
 
85
- Given('User sets random sentences that has {int} paragraph as {string}', (count, variable) => {
86
- const sentences = random.lorem.paragraph(count);
87
- context.vars[variable] = sentences;
88
- })
82
+ Given(
83
+ "User sets random sentences that has {int} paragraph as {string}",
84
+ (count, variable) => {
85
+ const sentences = random.lorem.paragraph(count);
86
+ context.vars[variable] = sentences;
87
+ },
88
+ );
89
89
 
90
- Given("User sets random value from given {string} array as {string}", async (array, key) => {
91
- const parsedArray = JSON.parse(array.replace(/'/g, '"'));
92
- const randomValue = parsedArray[Math.floor(Math.random() * parsedArray.length)];
93
- context.vars[key] = randomValue;
94
- });
90
+ Given(
91
+ "User sets random value from given {string} array as {string}",
92
+ async (array, key) => {
93
+ const parsedArray = JSON.parse(array.replace(/'/g, '"'));
94
+ const randomValue =
95
+ parsedArray[Math.floor(Math.random() * parsedArray.length)];
96
+ context.vars[key] = randomValue;
97
+ },
98
+ );
95
99
 
96
- Given('User sets random paragraph as {string}', async (key) => {
100
+ Given("User sets random paragraph as {string}", async (key) => {
97
101
  const randomParagraph = random.lorem.paragraph();
98
102
  context.vars[key] = randomParagraph;
99
103
  });
100
104
 
101
105
  Given(
102
- "User sets random paragraph that range between {int} and {int} as {string}",
103
- async (from, to, key) => {
104
- const words = random.lorem.paragraph({ min: from, max: to });
105
- context.vars[key] = words;
106
- },
106
+ "User sets random paragraph that range between {int} and {int} as {string}",
107
+ async (from, to, key) => {
108
+ const words = random.lorem.paragraph({ min: from, max: to });
109
+ context.vars[key] = words;
110
+ },
107
111
  );
108
112
 
109
- Given('User sets random characters from {string} as {string}', async (chars, key) => {
110
- const randomCharacters = random.string.fromCharacters(chars,10);
111
- context.vars[key] = randomCharacters;
112
- })
113
+ Given(
114
+ "User sets random characters from {string} as {string}",
115
+ async (chars, key) => {
116
+ const randomCharacters = random.string.fromCharacters(chars, 10);
117
+ context.vars[key] = randomCharacters;
118
+ },
119
+ );
113
120
 
114
- Given('User sets random alphanumeric in range from {int} to {int} as {string}', async (from,to, key) => {
115
- const randomWords = await random.string.alphanumeric({ min: from, max: to })
116
- context.vars[key] = randomWords;
117
- })
121
+ Given(
122
+ "User sets random alphanumeric in range from {int} to {int} as {string}",
123
+ async (from, to, key) => {
124
+ const randomWords = await random.string.alphanumeric({
125
+ min: from,
126
+ max: to,
127
+ });
128
+ context.vars[key] = randomWords;
129
+ },
130
+ );
118
131
 
119
- Given('User sets random fullname as {string}', async (key) => {
120
- const randomFirstName = await random.person.firstName()
121
- const randomLastName = await random.person.lastName()
122
- context.vars[key] = `${randomFirstName} ${randomLastName}`
123
- })
132
+ Given("User sets random fullname as {string}", async (key) => {
133
+ const randomFirstName = await random.person.firstName();
134
+ const randomLastName = await random.person.lastName();
135
+ context.vars[key] = `${randomFirstName} ${randomLastName}`;
136
+ });
124
137
 
125
- Given('User sets random first name as {string}', async (key) => {
126
- const randomFirstName = await random.person.firstName()
138
+ Given("User sets random first name as {string}", async (key) => {
139
+ const randomFirstName = await random.person.firstName();
127
140
  context.vars[key] = randomFirstName;
128
- })
141
+ });
129
142
 
130
- Given('User sets random last name as {string}', async (key) => {
131
- const randomLastName = await random.person.lastName()
143
+ Given("User sets random last name as {string}", async (key) => {
144
+ const randomLastName = await random.person.lastName();
132
145
  context.vars[key] = randomLastName;
133
- })
146
+ });
134
147
 
135
- Given('User sets random middle name as {string}', async (key) => {
136
- const randomMiddleName = await random.person.middleName()
148
+ Given("User sets random middle name as {string}", async (key) => {
149
+ const randomMiddleName = await random.person.middleName();
137
150
  context.vars[key] = randomMiddleName;
138
- })
139
-
140
- Given('User sets random date between {int} and {int} as {string}', async (fromYear, toYear, key) => {
141
- const year = Math.floor(Math.random() * (toYear - fromYear + 1)) + fromYear
142
- const month = Math.floor(Math.random() * 12) + 1
143
- const day = Math.floor(Math.random() * 28) + 1
144
- const pad = (num) => num.toString().padStart(2, '0')
145
- const dateStr = `${pad(day)}.${pad(month)}.${year}`
146
- context.vars[key] = dateStr;
147
- })
148
-
149
- Given('User sets date {int} days after today as {string}', async (day, key) => {
151
+ });
152
+
153
+ Given(
154
+ "User sets random date between {int} and {int} as {string}",
155
+ async (fromYear, toYear, key) => {
156
+ const year = Math.floor(Math.random() * (toYear - fromYear + 1)) + fromYear;
157
+ const month = Math.floor(Math.random() * 12) + 1;
158
+ const day = Math.floor(Math.random() * 28) + 1;
159
+ const pad = (num) => num.toString().padStart(2, "0");
160
+ const dateStr = `${pad(day)}.${pad(month)}.${year}`;
161
+ context.vars[key] = dateStr;
162
+ },
163
+ );
164
+
165
+ Given("User sets date {int} days after today as {string}", async (day, key) => {
150
166
  const now = new time();
151
- const afterDate = now.add(day, 'day').format("DD-MM-YYYY");
167
+ const afterDate = now.add(day, "day").format("DD-MM-YYYY");
152
168
  context.vars[key] = afterDate;
153
- })
169
+ });
154
170
 
155
- Given('User sets date {int} days before today as {string}', async (day, key) => {
156
- const now = new time();
157
- const beforeDate = now.subtract(day, 'day').format("DD-MM-YYYY");
158
- context.vars[key] = beforeDate;
159
- })
171
+ Given(
172
+ "User sets date {int} days before today as {string}",
173
+ async (day, key) => {
174
+ const now = new time();
175
+ const beforeDate = now.subtract(day, "day").format("DD-MM-YYYY");
176
+ context.vars[key] = beforeDate;
177
+ },
178
+ );