froth-webdriverio-framework 4.0.11 → 4.0.13

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.
@@ -125,7 +125,9 @@ async function updateExecuitonDetails(frothUrl, token, id, resultdetails) {
125
125
  formData.append('updated_through_bot', true)
126
126
  formData.append('run_id', process.env.CICD_RUN_ID)
127
127
  if (resultdetails.comments != null)
128
- formData.append('comments', JSON.stringify(resultdetails.comments))
128
+ formData.append('comments', resultdetails.comments.join('<br>'))
129
+
130
+ // formData.append('comments', JSON.stringify(resultdetails.comments))
129
131
 
130
132
  console.log("Report URL:" + BUFFER.getItem("REPORT_URL"))
131
133
 
@@ -78,6 +78,7 @@ async function RNDDECIMAL(minOrLength, max, decimalPlaces) {
78
78
 
79
79
  // Random string based on regex pattern
80
80
  async function RNDREGEX(regex) {
81
+ console.log("inside random regex", regex);
81
82
  return new RandExp(regex).gen();
82
83
  }
83
84
 
@@ -121,7 +122,8 @@ async function RANDOM(template, datatype) {
121
122
 
122
123
  const parts = content.split(/[\[\]]/).filter(Boolean); // Split by square brackets
123
124
  const type = parts[0];
124
-
125
+ console.log("type is :" + type);
126
+ console.log("parts are :" + parts);
125
127
  switch (type) {
126
128
  case 'RND':
127
129
  if (parts.length === 1) {
@@ -149,17 +151,33 @@ async function RANDOM(template, datatype) {
149
151
 
150
152
  case 'RANDOMTEXT':
151
153
  return await RANDOMTEXT(parseInt(parts[1])); // {RANDOMTEXT[length]}
152
-
154
+ break;
153
155
  case 'CTMSTMP':
156
+ console.log("inside CTMSTMP",Date.now());
154
157
  return Date.now(); // Current timestamp
158
+ break;
155
159
 
156
160
  case 'RANDOMREGEX':
157
- const regexString = content.match(/"(.+?)"/)?.[1];
158
- return await RNDREGEX(regexString); // Generate random string based on regex
161
+ let regexPattern;
162
+ if (parts.length === 3) {
163
+ regexPattern = `[${parts[1]}]{${parts[2]}}`; // {RANDOMREGEX[pattern][length]}
164
+ console.log("regex pattern is :" + regexPattern);
165
+ } else if (parts.length === 2) {
166
+ regexPattern = `[${parts[1]}]{10}`; // {RANDOMREGEX[pattern][length]}
167
+ console.log("regex pattern is :" + regexPattern);
168
+ }
169
+ let regex = new RegExp(regexPattern);
170
+ return await RNDREGEX(regex); // Generate random string based on regex
171
+ break;
172
+
159
173
  case 'RNDDATE':
160
174
  return await RNDDATE(parseInt(parts[1]), parseInt(parts[2])); // Generate random date of birth
175
+ break;
176
+
161
177
  default:
162
178
  return match[0]; // If no match found, return original template string
179
+ break;
180
+
163
181
  }
164
182
  }));
165
183
 
@@ -187,10 +205,15 @@ async function RANDOM(template, datatype) {
187
205
  // Example function to test the template replacement
188
206
  async function main() {
189
207
 
190
- let template = "SUBHRASUBUDHI {RNDDATE[1994][2002][YYMMDD]} @GMAQIL.COM";
208
+ let template = "SUBHRASUBUDHI {CTMSTMP} @GMAQIL.COM";
191
209
  let result = await RANDOM(template, 'STRING');
192
210
  console.log(result);
193
211
  console.log(typeof result);
212
+ // template = "{RANDOMREGEX[\\\\d{5}(-\\\\\d{4})?][10]}";
213
+ // result = await RANDOM(template, 'STRING');
214
+ // console.log(result);
215
+ // console.log(typeof result);
216
+
194
217
  }
195
218
 
196
219
  main();
@@ -142,7 +142,6 @@ const commonconfig = {
142
142
 
143
143
  if (passed) {
144
144
  scriptresult = "PASSED"
145
- // if (!resultdetails.comments.some(comment => typeof comment === 'string' && comment.includes(test.title)))
146
145
  resultdetails.comments.push(`${test.title} - passed`);
147
146
  }
148
147
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froth-webdriverio-framework",
3
- "version": "4.0.11",
3
+ "version": "4.0.13",
4
4
 
5
5
  "readme": "WebdriverIO Integration",
6
6
  "description": "WebdriverIO and BrowserStack App Automate",