artes 1.2.18 → 1.2.20
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/README.md +24 -10
- package/cucumber.config.js +16 -5
- package/docs/functionDefinitions.md +0 -3
- package/docs/stepDefinitions.md +11 -1
- package/executer.js +10 -6
- package/package.json +1 -1
- package/src/helper/contextManager/browserManager.js +1 -1
- package/src/helper/contextManager/requestManager.js +2 -2
- package/src/helper/executers/helper.js +3 -0
- package/src/helper/executers/projectCreator.js +11 -7
- package/src/helper/executers/reportGenerator.js +26 -10
- package/src/helper/imports/commons.js +2 -1
- package/src/helper/stepFunctions/APIActions.js +2 -3
- package/src/hooks/hooks.js +4 -4
- package/src/stepDefinitions/API.steps.js +31 -31
- package/src/stepDefinitions/assertions.steps.js +17 -15
- package/src/stepDefinitions/keyboardActions.steps.js +136 -102
- package/src/stepDefinitions/mouseActions.steps.js +12 -12
- package/src/stepDefinitions/random.steps.js +84 -65
|
@@ -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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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(
|
|
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(
|
|
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(
|
|
86
|
-
|
|
87
|
-
|
|
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(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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(
|
|
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
|
-
|
|
105
|
-
|
|
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(
|
|
110
|
-
|
|
111
|
-
|
|
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(
|
|
115
|
-
|
|
116
|
-
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
})
|
|
148
|
-
|
|
149
|
-
|
|
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,
|
|
167
|
+
const afterDate = now.add(day, "day").format("DD-MM-YYYY");
|
|
152
168
|
context.vars[key] = afterDate;
|
|
153
|
-
})
|
|
169
|
+
});
|
|
154
170
|
|
|
155
|
-
Given(
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
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
|
+
);
|