@mablhq/mabl-cli 1.16.11 → 1.16.32

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.
@@ -24,11 +24,11 @@ class FindAction extends MablAction_1.MablAction {
24
24
  }
25
25
  const findType = mablscriptFind_1.FindType.fromString(actionName);
26
26
  const [selectors, options] = this.getActionArgs();
27
- const error = new Error(`Unexpected arguments for ${findType} action: ${JSON.stringify(this.getActionArgs())}`);
27
+ this.isValid = true;
28
28
  switch (findType) {
29
29
  case mablscriptFind_1.FindType.FIND_ONE:
30
30
  if (!isElementSelector(selectors)) {
31
- throw error;
31
+ this.isValid = false;
32
32
  }
33
33
  const [target, ancestor] = Array.isArray(selectors)
34
34
  ? [...selectors]
@@ -50,7 +50,7 @@ class FindAction extends MablAction_1.MablAction {
50
50
  case mablscriptFind_1.FindType.FIND_ANY:
51
51
  case mablscriptFind_1.FindType.FIND_ALL:
52
52
  if (!mablscriptFind_1.isCssSelector(selectors) && !mablscriptFind_1.isXPathSelector(selectors)) {
53
- throw error;
53
+ this.isValid = false;
54
54
  }
55
55
  this.findDescriptor = {
56
56
  findType,
@@ -59,7 +59,7 @@ class FindAction extends MablAction_1.MablAction {
59
59
  break;
60
60
  case mablscriptFind_1.FindType.FIND_COOKIE:
61
61
  if (!mablscriptFind_1.isCookieSelector(selectors)) {
62
- throw error;
62
+ this.isValid = false;
63
63
  }
64
64
  this.findDescriptor = {
65
65
  findType,
@@ -68,7 +68,7 @@ class FindAction extends MablAction_1.MablAction {
68
68
  break;
69
69
  case mablscriptFind_1.FindType.FIND_EMAIL:
70
70
  if (!mablscriptFind_1.isEmailSelector(selectors)) {
71
- throw error;
71
+ this.isValid = false;
72
72
  }
73
73
  this.findDescriptor = {
74
74
  findType,
@@ -77,7 +77,7 @@ class FindAction extends MablAction_1.MablAction {
77
77
  break;
78
78
  case mablscriptFind_1.FindType.FIND_TAB:
79
79
  if (selectors !== 'initial' && !mablscriptFind_1.isTabSelector(selectors)) {
80
- throw error;
80
+ this.isValid = false;
81
81
  }
82
82
  this.findDescriptor = {
83
83
  findType,
@@ -195,6 +195,9 @@ class FindAction extends MablAction_1.MablAction {
195
195
  throw new Error(`Error generating mablscript: Unexpected find type in ${JSON.stringify(this.findDescriptor)}`);
196
196
  }
197
197
  }
198
+ isValidDescriptor() {
199
+ return this.isValid;
200
+ }
198
201
  }
199
202
  exports.FindAction = FindAction;
200
203
  FindAction.mablScriptStepNames = [