arazzo-runner 0.0.19 → 0.0.21

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Arazzo.js +47 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arazzo-runner",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "description": "A runner to run through Arazzo Document workflows",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/Arazzo.js CHANGED
@@ -400,13 +400,58 @@ class Arazzo extends Document {
400
400
  for (const criteriaObject of this.step.successCriteria) {
401
401
  if (criteriaObject?.type) {
402
402
  if (criteriaObject.type === "regex") {
403
+ this.logger.notice(`Testing: ${criteriaObject.context} matches ${criteriaObject.condition}`)
403
404
  const hasPassedCheck = this.expression.checkRegexExpression(
404
405
  criteriaObject.context,
405
406
  criteriaObject.condition,
406
407
  );
407
408
 
408
- if (hasPassedCheck) hasPassed.push(true);
409
+ if (hasPassedCheck) {
410
+ hasPassed.push(true);
411
+ this.logger.success(`${criteriaObject.condition} passed`);
412
+ } else {
413
+ this.logger.error(`${criteriaObject.condition} failed`);
414
+ }
415
+ } else if (criteriaObject.type === 'jsonpath') {
416
+ this.logger.notice(`Testing jsonPath: ${criteriaObject.context} matches ${criteriaObject.condition}`)
417
+
418
+ const hasPassedCheck = this.expression.checkJSONPathExpression(
419
+ criteriaObject.context,
420
+ criteriaObject.condition,
421
+ );
422
+
423
+ if (hasPassedCheck) {
424
+ hasPassed.push(true);
425
+ this.logger.success(`${criteriaObject.condition} passed`);
426
+ } else {
427
+ this.logger.error(`${criteriaObject.condition} failed`);
428
+ }
429
+ } else if (criteriaObject.type === 'xpath') {
430
+ this.logger.notice(`Testing xPath: ${criteriaObject.context} matches ${criteriaObject.condition}`)
431
+
432
+ const hasPassedCheck = this.expression.checkXPathExpression(
433
+ criteriaObject.context,
434
+ criteriaObject.condition,
435
+ );
436
+
437
+ if (hasPassedCheck) {
438
+ hasPassed.push(true);
439
+ this.logger.success(`${criteriaObject.condition} passed`);
440
+ } else {
441
+ this.logger.error(`${criteriaObject.condition} failed`);
442
+ }
409
443
  } else {
444
+ this.logger.notice(`Checking: ${criteriaObject.condition}`);
445
+ const hasPassedCheck = this.expression.checkSimpleExpression(
446
+ criteriaObject.condition,
447
+ );
448
+
449
+ if (hasPassedCheck) {
450
+ hasPassed.push(true);
451
+ this.logger.success(`${criteriaObject.condition} passed`);
452
+ } else {
453
+ this.logger.error(`${criteriaObject.condition} failed`);
454
+ }
410
455
  }
411
456
  } else {
412
457
  this.logger.notice(`Checking: ${criteriaObject.condition}`);
@@ -511,7 +556,7 @@ class Arazzo extends Document {
511
556
  } else if (whatNext.goto) {
512
557
  this.logger.notice(`${this.step.stepId} onFailure GoTo rule triggered`);
513
558
  await this.gotoRule(whatNext);
514
- } else {
559
+ } else if (whatNext.retry) {
515
560
  if (this.retrySet.has(whatNext.name) === false)
516
561
  this.logger.notice(
517
562
  `${this.step.stepId} onFailure Retry rule triggered`,