New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@suitest/translate

Package Overview
Dependencies
Maintainers
2
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@suitest/translate - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2

2

dist/condition.js

@@ -1,1 +0,1 @@

var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var a in e=arguments[n])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t}).apply(this,arguments)},__rest=this&&this.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(t);a<r.length;a++)e.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(t,r[a])&&(n[r[a]]=t[r[a]])}return n};!function(t){if("object"==typeof module&&"object"==typeof module.exports){var e=t(require,exports);void 0!==e&&(module.exports=e)}else"function"==typeof define&&define.amd&&define(["require","exports","@suitest/smst","./utils","./comparator"],t)}((function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.translateCondition=e.sortNetworkInfo=e.translateElementProperty=void 0;var n=t("@suitest/smst"),r=t("./utils"),a=t("./comparator");e.translateElementProperty=function(t){switch(t){case"videoUrl":return"video URL";case"url":return"URL";case"color":return"text color";case"zIndex":return"z-index";case"automationId":return"automation ID";case"scaleX":return"scale X";case"scaleY":return"scale Y";case"translationX":return"translation X";case"translationY":return"translation Y";case"pivotX":return"pivot X";case"pivotY":return"pivot Y";case"tagInt":return"tag";case"fontURI":return"font URI";case"proposalURL":return"proposal URL";default:return t.replace(/([A-Z+])/g,(function(t,e){return" "+e.toLowerCase()}))}};var s=function(t,s,l,o,u){var i=function(t,e){var r;if("video"===t.type||(null===(r=t.val)||void 0===r?void 0:r.video))return n.jsx("subject",null,"video");if("psVideo"===t.type)return n.jsx("subject",null,"PlayStation 4 video");if("elementId"in t)return e&&e[t.elementId]?n.jsx("subject",null,e[t.elementId].name):t.name?n.jsx("subject",null,t.name):t.nameHint?n.jsx("subject",null,t.nameHint):n.jsx("fragment",null,"Unknown element (",n.jsx("subject",null,t.elementId.length>12?t.elementId.slice(0,4)+"..."+t.elementId.slice(-4):t.elementId),")");if("apiId"in t)return n.jsx("subject",null,t.apiId);var a=t.val,s=a.ifMultipleFoundReturn,l=__rest(a,["ifMultipleFoundReturn"]),o=Object.keys(l);return 1===o.length?n.jsx("subject",null,l[o[0]]):n.jsx("subject",null,JSON.stringify(__assign(__assign({},l),{index:null!=s?s:1})))}(t.subject,o);switch(t.type){case"exists":return n.jsx("condition",{title:n.jsx("fragment",null,i," exists"),status:r.mapStatus(null==u?void 0:u.result,s)});case"!exists":return n.jsx("condition",{title:n.jsx("fragment",null,i," does not exist"),status:r.mapStatus(null==u?void 0:u.result,s)});case"visible":return n.jsx("condition",{title:n.jsx("fragment",null,i," is visible"),status:r.mapStatus(null==u?void 0:u.result,s)});case"matches":return n.jsx("condition",{title:n.jsx("fragment",null,i," matches JavaScript"),status:r.mapStatus(null==u?void 0:u.result,s)},n.jsx("props",null,r.translateCodeProp(i,t.val,l,a.translateComparator(t.type),r.mapStatus(null==u?void 0:u.result,s))));case"has":return n.jsx("condition",{title:i,status:r.mapStatus(null==u?void 0:u.result,s)},r.shouldElMatchDetailsBeHidden(u)?null:n.jsx("props",null,t.expression.map((function(t,s){var o=u&&"expression"in u?u.expression[s]:void 0,i=o&&"actualValue"in o?o.actualValue:void 0;o&&"message"in o&&"missingProperty"===o.message.code?i="property missing":o&&"message"in o&&"wrongExpression"===o.message.code&&(i="wrong format");var c=t.inherited?o&&"expectedValue"in o?o.expectedValue:"[element repository value]":t.val;return n.jsx("prop",{name:n.jsx("text",null,e.translateElementProperty(t.property)),comparator:a.translateComparator(t.type),expectedValue:r.formatVariables(c+("+-"===t.type?" ± "+t.deviation:""),null==l?void 0:l.configVariables),actualValue:i,status:null==o?void 0:o.result})}))));default:return function(t){throw new Error("Unknown element condition type: "+JSON.stringify(t))}(t)}},l=function(t,e,s){return void 0===s&&(s=[]),function(l){var o=l.name,u=l.compare,i=l.val,c=s.find((function(e){return"noUriFound"!==e.type&&(e.message===(t?"request":"response")&&("name"in e?e.name:"@"+e.type)===o)})),p=n.jsx("prop",{name:n.jsx("fragment",null,t?"request ":"response ",o.startsWith("@")?n.jsx("text",null,o.slice(1)):n.jsx("fragment",null,"header ",r.formatVariables(o,null==e?void 0:e.configVariables))),comparator:a.translateComparator(u),expectedValue:r.formatVariables(String(i),null==e?void 0:e.configVariables)});return s.length>1&&"noUriFound"!==s[0].type&&(p.status=c?"fail":"success"),c&&"noUriFound"!==c.type?("notMatched"===c.reason?p.actualValue=""===c.actualValue?"[EMPTY STRING]":c.actualValue:"notFound"===c.reason?p.actualValue="not found":p.actualValue="unknown",p):p}};e.sortNetworkInfo=function(t,e){return["@method","@status"].includes(t.name)?-1:["@method","@status"].includes(e.name)||"@body"===t.name?1:"@body"===e.name?-1:t.name>e.name?1:-1};e.translateCondition=function(t,o,u,i,c){switch(t.subject.type){case"element":case"video":return s(t,o,u,i,c);case"psVideo":return"hadNoError"===t.type?function(t,e,a){var s=n.jsx("fragment",null,"PlayStation 4 video had no error ","all"===t.searchStrategy?"for any source":"for current source");return n.jsx("condition",{title:s,status:r.mapStatus(null==a?void 0:a.result,e)})}(t,o,c):s(t,o,u,i,c);case"javascript":return function(t,e,s,l){var o;return n.jsx("condition",{title:n.jsx("text",null,"JavaScript expression")},n.jsx("props",null,r.translateCodeProp(n.jsx("text",null,"expression"),null!==(o=t.subject.val)&&void 0!==o?o:"[NOT SPECIFIED]",s,"","JavaScriptError"===(null==l?void 0:l.errorType)?"fail":r.mapStatus(null==l?void 0:l.result)),n.jsx("prop",{name:n.jsx("text",null,"expression result"),expectedValue:t.val?r.formatVariables(t.val,null==s?void 0:s.configVariables):n.jsx("text",null,"[NOT SPECIFIED]"),actualValue:null==l?void 0:l.actualValue,comparator:a.translateComparator(t.type),status:r.mapStatus(null==l?void 0:l.result,e)})))}(t,o,u,c);case"location":return function(t,e,s,l){var o="matches"===t.type;return n.jsx("condition",{title:n.jsx("text",null,"Current location")},n.jsx("props",null,o?r.translateCodeProp(n.jsx("text",null,"current location"),t.val,s,a.translateComparator(t.type),r.mapStatus(null==l?void 0:l.result,e)):n.jsx("prop",{name:n.jsx("text",null,"current location"),expectedValue:r.formatVariables(t.val,null==s?void 0:s.configVariables),comparator:a.translateComparator(t.type),status:r.mapStatus(null==l?void 0:l.result,e),actualValue:null==l?void 0:l.actualValue})))}(t,o,u,c);case"cookie":return function(t,e,s,l){var o=n.jsx("fragment",null,"cookie ",n.jsx("subject",null,t.subject.val));return"exists"===t.type?n.jsx("condition",{title:n.jsx("fragment",null,o," exists")}):"!exists"===t.type?n.jsx("condition",{title:n.jsx("fragment",null,o," does not exist")}):"matches"===t.type?n.jsx("condition",{title:o},n.jsx("props",null,r.translateCodeProp(n.jsx("subject",null,t.subject.val),t.val,s,t.type,r.mapStatus(null==l?void 0:l.result,e)))):n.jsx("condition",{title:o},n.jsx("props",null,n.jsx("prop",{name:n.jsx("subject",null,t.subject.val),comparator:a.translateComparator(t.type),expectedValue:r.formatVariables(t.val,null==s?void 0:s.configVariables),actualValue:null==l?void 0:l.actualValue,status:r.mapStatus(null==l?void 0:l.result,e)})))}(t,o,u,c);case"network":return function(t,s,o,u){var i,c,p,d,m="queryFailed"===(null==u?void 0:u.errorType)&&"errors"in u?u.errors:[],x=null!==(c=null===(i=t.subject.requestInfo)||void 0===i?void 0:i.sort(e.sortNetworkInfo).map(l(!0,o,m)))&&void 0!==c?c:[],v=null!==(d=null===(p=t.subject.responseInfo)||void 0===p?void 0:p.sort(e.sortNetworkInfo).map(l(!1,o,m)))&&void 0!==d?d:[],j=x.concat(v);return n.jsx("condition",{title:n.jsx("text",null,"network request ","made"===t.type?"was made":"was not made"," ","all"===t.searchStrategy?"in entire network log":"excluding previously matched requests")},n.jsx("props",null,n.jsx("prop",{name:n.jsx("text",null,"URL"),comparator:a.translateComparator(t.subject.compare),expectedValue:r.formatVariables(t.subject.val,null==o?void 0:o.configVariables),status:u&&"errors"in u&&u.errors.find((function(t){return"noUriFound"===t.type}))?s?"success":"fail":void 0}),j))}(t,o,u,c);case"application":return function(t,e){return n.jsx("condition",{title:n.jsx("text",null,"Application has exited"),status:r.mapStatus(null==e?void 0:e.result,t)})}(o,c);default:return function(t){throw new Error("Unknown condition subject: "+JSON.stringify(t))}(t.subject)}}}));
var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var a in e=arguments[n])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t}).apply(this,arguments)},__rest=this&&this.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(t);a<r.length;a++)e.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(t,r[a])&&(n[r[a]]=t[r[a]])}return n};!function(t){if("object"==typeof module&&"object"==typeof module.exports){var e=t(require,exports);void 0!==e&&(module.exports=e)}else"function"==typeof define&&define.amd&&define(["require","exports","@suitest/smst","./utils","./comparator"],t)}((function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.translateCondition=e.sortNetworkInfo=e.translateElementProperty=void 0;var n=t("@suitest/smst"),r=t("./utils"),a=t("./comparator");e.translateElementProperty=function(t){switch(t){case"videoUrl":return"video URL";case"url":return"URL";case"color":return"text color";case"zIndex":return"z-index";case"automationId":return"automation ID";case"scaleX":return"scale X";case"scaleY":return"scale Y";case"translationX":return"translation X";case"translationY":return"translation Y";case"pivotX":return"pivot X";case"pivotY":return"pivot Y";case"tagInt":return"tag";case"fontURI":return"font URI";case"proposalURL":return"proposal URL";default:return t.replace(/([A-Z+])/g,(function(t,e){return" "+e.toLowerCase()}))}};var s=function(t,s,l,o,u){var i=function(t,e){var r;if("video"===t.type||(null===(r=t.val)||void 0===r?void 0:r.video))return n.jsx("subject",null,"video");if("psVideo"===t.type)return n.jsx("subject",null,"PlayStation 4 video");if("elementId"in t)return e&&e[t.elementId]?n.jsx("subject",null,e[t.elementId].name):t.name?n.jsx("subject",null,t.name):t.nameHint?n.jsx("subject",null,t.nameHint):n.jsx("fragment",null,"Unknown element (",n.jsx("subject",null,t.elementId.length>12?t.elementId.slice(0,4)+"..."+t.elementId.slice(-4):t.elementId),")");if("apiId"in t)return n.jsx("subject",null,t.apiId);var a=t.val,s=a.ifMultipleFoundReturn,l=__rest(a,["ifMultipleFoundReturn"]),o=Object.keys(l);return 1===o.length?n.jsx("subject",null,l[o[0]]):n.jsx("subject",null,JSON.stringify(__assign(__assign({},l),{index:null!=s?s:1})))}(t.subject,o);switch(t.type){case"exists":return n.jsx("condition",{title:n.jsx("fragment",null,i," exists"),status:r.mapStatus(null==u?void 0:u.result,s)});case"!exists":return n.jsx("condition",{title:n.jsx("fragment",null,i," does not exist"),status:r.mapStatus(null==u?void 0:u.result,s)});case"visible":return n.jsx("condition",{title:n.jsx("fragment",null,i," is visible"),status:r.mapStatus(null==u?void 0:u.result,s)});case"matches":return n.jsx("condition",{title:n.jsx("fragment",null,i," matches JavaScript"),status:r.mapStatus(null==u?void 0:u.result,s)},n.jsx("props",null,r.translateCodeProp(i,t.val,l,a.translateComparator(t.type),r.mapStatus(null==u?void 0:u.result,s))));case"has":return n.jsx("condition",{title:i,status:r.mapStatus(null==u?void 0:u.result,s)},r.shouldElMatchDetailsBeHidden(u)?null:n.jsx("props",null,t.expression.map((function(t,s){var o=u&&"expression"in u?u.expression[s]:void 0,i=o&&"actualValue"in o?o.actualValue:void 0;o&&"message"in o&&"missingProperty"===o.message.code?i="property missing":o&&"message"in o&&"wrongExpression"===o.message.code&&(i="wrong format");var c=t.inherited?o&&"expectedValue"in o?o.expectedValue:"[element repository value]":t.val;return n.jsx("prop",{name:n.jsx("text",null,e.translateElementProperty(t.property)),comparator:a.translateComparator(t.type),expectedValue:r.formatVariables(c+("+-"===t.type?" ± "+t.deviation:""),null==l?void 0:l.configVariables),actualValue:i,status:null==o?void 0:o.result})}))));default:return function(t){throw new Error("Unknown element condition type: "+JSON.stringify(t))}(t)}},l=function(t,e,s){return void 0===s&&(s=[]),function(l){var o=l.name,u=l.compare,i=l.val,c=s.find((function(e){return"noUriFound"!==e.type&&(e.message===(t?"request":"response")&&("name"in e?e.name:"@"+e.type)===o)})),p=n.jsx("prop",{name:n.jsx("fragment",null,t?"request ":"response ",o.startsWith("@")?n.jsx("text",null,o.slice(1)):n.jsx("fragment",null,"header ",r.formatVariables(o,null==e?void 0:e.configVariables))),comparator:a.translateComparator(u),expectedValue:r.formatVariables(String(i),null==e?void 0:e.configVariables)});return s.length>1&&"noUriFound"!==s[0].type&&(p.status=c?"fail":"success"),c&&"noUriFound"!==c.type?("notMatched"===c.reason?p.actualValue=""===c.actualValue?"[EMPTY STRING]":c.actualValue:"notFound"===c.reason?p.actualValue="not found":p.actualValue="unknown",p):p}};e.sortNetworkInfo=function(t,e){return["@method","@status"].includes(t.name)?-1:["@method","@status"].includes(e.name)||"@body"===t.name?1:"@body"===e.name?-1:t.name>e.name?1:-1};e.translateCondition=function(t,o,u,i,c){switch(t.subject.type){case"element":case"video":return s(t,o,u,i,c);case"psVideo":return"hadNoError"===t.type?function(t,e,a){var s=n.jsx("fragment",null,"PlayStation 4 video had no error ","all"===t.searchStrategy?"for any source":"for current source");return n.jsx("condition",{title:s,status:r.mapStatus(null==a?void 0:a.result,e)})}(t,o,c):s(t,o,u,i,c);case"javascript":return function(t,e,s,l){var o;return n.jsx("condition",{title:n.jsx("text",null,"JavaScript expression")},n.jsx("props",null,r.translateCodeProp(n.jsx("text",null,"expression"),null!==(o=t.subject.val)&&void 0!==o?o:"[NOT SPECIFIED]",s,"","JavaScriptError"===(null==l?void 0:l.errorType)?"fail":r.mapStatus(null==l?void 0:l.result)),n.jsx("prop",{name:n.jsx("text",null,"expected result"),expectedValue:t.val?r.formatVariables(t.val,null==s?void 0:s.configVariables):n.jsx("text",null,"[NOT SPECIFIED]"),actualValue:null==l?void 0:l.actualValue,comparator:a.translateComparator(t.type),status:r.mapStatus(null==l?void 0:l.result,e)})))}(t,o,u,c);case"location":return function(t,e,s,l){var o="matches"===t.type;return n.jsx("condition",{title:n.jsx("text",null,"Current location")},n.jsx("props",null,o?r.translateCodeProp(n.jsx("text",null,"current location"),t.val,s,a.translateComparator(t.type),r.mapStatus(null==l?void 0:l.result,e)):n.jsx("prop",{name:n.jsx("text",null,"current location"),expectedValue:r.formatVariables(t.val,null==s?void 0:s.configVariables),comparator:a.translateComparator(t.type),status:r.mapStatus(null==l?void 0:l.result,e),actualValue:null==l?void 0:l.actualValue})))}(t,o,u,c);case"cookie":return function(t,e,s,l){var o=n.jsx("fragment",null,"cookie ",n.jsx("subject",null,t.subject.val));return"exists"===t.type?n.jsx("condition",{title:n.jsx("fragment",null,o," exists")}):"!exists"===t.type?n.jsx("condition",{title:n.jsx("fragment",null,o," does not exist")}):"matches"===t.type?n.jsx("condition",{title:o},n.jsx("props",null,r.translateCodeProp(n.jsx("subject",null,t.subject.val),t.val,s,t.type,r.mapStatus(null==l?void 0:l.result,e)))):n.jsx("condition",{title:o},n.jsx("props",null,n.jsx("prop",{name:n.jsx("subject",null,t.subject.val),comparator:a.translateComparator(t.type),expectedValue:r.formatVariables(t.val,null==s?void 0:s.configVariables),actualValue:null==l?void 0:l.actualValue,status:r.mapStatus(null==l?void 0:l.result,e)})))}(t,o,u,c);case"network":return function(t,s,o,u){var i,c,p,d,m="queryFailed"===(null==u?void 0:u.errorType)&&"errors"in u?u.errors:[],x=null!==(c=null===(i=t.subject.requestInfo)||void 0===i?void 0:i.sort(e.sortNetworkInfo).map(l(!0,o,m)))&&void 0!==c?c:[],v=null!==(d=null===(p=t.subject.responseInfo)||void 0===p?void 0:p.sort(e.sortNetworkInfo).map(l(!1,o,m)))&&void 0!==d?d:[],j=x.concat(v);return n.jsx("condition",{title:n.jsx("text",null,"network request ","made"===t.type?"was made":"was not made"," ","all"===t.searchStrategy?"in entire network log":"excluding previously matched requests")},n.jsx("props",null,n.jsx("prop",{name:n.jsx("text",null,"URL"),comparator:a.translateComparator(t.subject.compare),expectedValue:r.formatVariables(t.subject.val,null==o?void 0:o.configVariables),status:u&&"errors"in u&&u.errors.find((function(t){return"noUriFound"===t.type}))?s?"success":"fail":void 0}),j))}(t,o,u,c);case"application":return function(t,e){return n.jsx("condition",{title:n.jsx("text",null,"Application has exited"),status:r.mapStatus(null==e?void 0:e.result,t)})}(o,c);default:return function(t){throw new Error("Unknown condition subject: "+JSON.stringify(t))}(t.subject)}}}));

@@ -1,1 +0,1 @@

!function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define(["require","exports","@suitest/smst","./comparator","./condition","./utils"],e)}((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.translateTestLine=void 0;var n=e("@suitest/smst"),s=e("./comparator"),l=e("./condition"),r=e("./utils"),o=function(e,t){var s=e,l=s.condition,o=s.count,a=s.negateCondition,i=s.delay;return!l&&o&&("string"==typeof o||o>1)?n.jsx("fragment",null," exactly ",r.formatCount(o,null==t?void 0:t.configVariables)," every ",r.formatTimeout(null!=i?i:0,null==t?void 0:t.configVariables)):l&&a?n.jsx("text",null," only if condition is met"):l&&!a?n.jsx("fragment",null," until condition is met max ",r.formatCount(null!=o?o:1,null==t?void 0:t.configVariables)," every ",r.formatTimeout(null!=i?i:0,null==t?void 0:t.configVariables)):void 0},a=function(e){switch(e){case"success":return"continue";case"exit":return"stop test";case"fail":return"fail";case"warning":return"warn";default:return function(e){throw new Error('Unknown "then" in assert: '+e)}(e)}},i=function(e,t,s,r,a){var i=function(e,t){return t&&t[e]?n.jsx("subject",null,t[e].name):n.jsx("fragment",null,"(",n.jsx("code",null,e.slice(0,4)+"..."+e.slice(-4)),")")}(e.val,r),u=o(e,t),c=e.excluded?"excluded":null==a?void 0:a.result;return n.jsx("test-line",{title:n.jsx("fragment",null,"Run test ",i,u),status:c,docs:d(e.type,null==a?void 0:a.result)},e.condition?l.translateCondition(e.condition,!1,t,s,a):void 0)},u=function(e){switch(e.type){case"element":return n.jsx("subject",null,"element");case"window":return n.jsx("subject",null,"coordinates"in e?"position":"window");default:return function(e){throw new Error("Unknown target: "+JSON.stringify(e))}(e)}},c=function(e,t,r,o){var a=e.excluded?"excluded":null==o?void 0:o.result,i=e.condition?l.translateCondition(e.condition,!1,t,r,o):void 0;switch(e.browserCommand.type){case"goBack":return n.jsx("test-line",{title:n.jsx("text",null,"Go back"),status:a,docs:d(e.type,null==o?void 0:o.result)},i);case"goForward":return n.jsx("test-line",{title:n.jsx("text",null,"Go forward"),status:a,docs:d(e.type,null==o?void 0:o.result)},i);case"refresh":return n.jsx("test-line",{title:n.jsx("text",null,"Refresh"),status:a,docs:d(e.type,null==o?void 0:o.result)},i);case"setWindowSize":return n.jsx("test-line",{title:n.jsx("text",null,"Resize window"),status:a,docs:d(e.type,null==o?void 0:o.result)},n.jsx("props",null,n.jsx("prop",{name:n.jsx("text",null,"size"),comparator:s.translateComparator("="),expectedValue:n.jsx("text",null,String(e.browserCommand.params.width),"x",String(e.browserCommand.params.height))})),i);case"dismissAlertMessage":return n.jsx("test-line",{title:n.jsx("text",null,"Dismiss modal dialog"),status:a,docs:d(e.type,null==o?void 0:o.result)},i);case"acceptAlertMessage":return n.jsx("test-line",{title:n.jsx("text",null,"Accept modal dialog"),status:a,docs:d(e.type,null==o?void 0:o.result)},i);case"acceptPromptMessage":return n.jsx("test-line",{title:n.jsx("text",null,"Accept modal dialog with message"),status:a,docs:d(e.type,null==o?void 0:o.result)},n.jsx("props",null,n.jsx("prop",{name:n.jsx("text",null,"message"),comparator:s.translateComparator("="),expectedValue:n.jsx("text",null,e.browserCommand.params.text)})),i);default:return function(e){throw new Error("Unknown browser command: "+JSON.stringify(e))}(e.browserCommand)}},d=function(e,t){var s="https://suite.st/docs",l="";switch(e){case"query":l=s+"/docs/suitest-api/chain-types/#query";break;case"wait":case"assert":l=s+"/testing/test-subjects/";break;case"clearAppData":l=s+"/testing/test-operations/clear-app-data-operation/";break;case"takeScreenshot":l=s+"/suitest-api/commands/#takescreenshot";break;case"execCmd":l=s+"/testing/test-operations/execute-command-operation/";break;case"openApp":l=s+"/testing/test-operations/open-app-operation/";break;case"openUrl":l=s+"/testing/test-operations/open-url-operation/";break;case"sleep":l=s+"/testing/test-operations/sleep-operation/";break;case"pollUrl":l=s+"/testing/test-operations/poll-url-operation/";break;case"button":l=s+"/testing/test-operations/press-button-operation/";break;case"runSnippet":l=s+"/testing/test-operations/run-test-operation/";break;case"sendText":l=s+"/testing/test-operations/send-text-operation/";break;case"setText":l=s+"/testing/test-operations/set-text-operation/";break;case"browserCommand":l=s+"/testing/test-operations/browser-command-operation/";break;case"click":l=s+"/testing/test-operations/click-on-operation/";break;case"moveTo":l=s+"/testing/test-operations/move-to-operation/"}return t&&l&&["fail","fatal"].includes(t)?n.jsx("link",{href:l},l):void 0};t.translateTestLine=function(e){var t=e.testLine,p=e.appConfig,x=e.elements,m=e.snippets,v=e.lineResult;switch(t.type){case"query":return function(e,t){var s="";switch(e.subject.type){case"cookie":s='Retrieve value for "'+e.subject.cookieName+'" cookie';break;case"execute":s='Retrieve value of execution "'+e.subject.execute+'"';break;case"location":s="Retrieve value of current location";break;case"elementProps":s="Retrieve info of ",e.subject.selector.video||e.subject.selector.psVideo?s+="video element":s+='"'+Object.values(e.subject.selector).filter(Boolean)[0]+'" element'}var l="error"===(null==t?void 0:t.result)?"fail":null==t?void 0:t.result;return n.jsx("test-line",{title:n.jsx("text",null,s),status:l,docs:d("query",l)})}(t,v);case"assert":case"wait":return function(e,t,s,o){var i=l.translateCondition(e.condition,!(!e.then||"success"===(null==e?void 0:e.then)),t,s,o),u=e.excluded?"excluded":null==o?void 0:o.result;return n.jsx("test-line",{title:n.jsx("fragment",null,"Assert: ",i.title,e.timeout?n.jsx("fragment",null," timeout ",r.formatTimeout(e.timeout,null==t?void 0:t.configVariables)):void 0,e.then&&"success"!==e.then?n.jsx("fragment",null," then ",a(e.then)):void 0),status:u,docs:d(e.type,null==o?void 0:o.result)},i.children)}(t,p,x,v);case"takeScreenshot":return function(e,t){var s="";return"raw"===e.dataFormat?s="take screenshot (raw)":"base64"===e.dataFormat?s="take screenshot (base64)":e.fileName&&(s='save screenshot ("'+e.fileName+'")'),n.jsx("test-line",{title:n.jsx("text",null,s),status:null==t?void 0:t.result,docs:d("clearAppData",null==t?void 0:t.result)})}(t,v);case"clearAppData":return function(e,t){return n.jsx("test-line",{title:n.jsx("text",null,"Clear application data"),status:e.excluded?"excluded":null==t?void 0:t.result,docs:d("clearAppData",null==t?void 0:t.result)})}(t,v);case"execCmd":return function(e,t,s){return n.jsx("test-line",{title:n.jsx("text",null,"Execute JavaScript expression"),status:e.excluded?"excluded":null==s?void 0:s.result,docs:d(e.type,null==s?void 0:s.result)},n.jsx("props",null,r.translateCodeProp(n.jsx("text",null,"JavaScript expression"),e.val,t,"",r.mapStatus(null==s?void 0:s.result))))}(t,p,v);case"openApp":return function(e,t,l){var o=e.excluded?"excluded":null==l?void 0:l.result;if(!e.relativeUrl)return n.jsx("test-line",{title:n.jsx("text",null,"Open application"),status:o,docs:d(e.type,null==l?void 0:l.result)});var a=r.formatVariables(e.relativeUrl,null==t?void 0:t.configVariables);return n.jsx("test-line",{title:n.jsx("text",null,"Open application at relative URL"),status:o,docs:d(e.type,null==l?void 0:l.result)},n.jsx("props",null,n.jsx("prop",{name:n.jsx("text",null,"relative path"),comparator:s.translateComparator("="),expectedValue:a})))}(t,p,v);case"openUrl":return function(e,t,l){var o=r.formatVariables(e.url,null==t?void 0:t.configVariables),a=e.excluded?"excluded":null==l?void 0:l.result;return n.jsx("test-line",{docs:d(e.type,null==l?void 0:l.result),title:n.jsx("text",null,"Open URL"),status:a},n.jsx("props",null,n.jsx("prop",{name:n.jsx("text",null,"URL"),comparator:s.translateComparator("="),expectedValue:o})))}(t,p,v);case"sleep":return function(e,t,s){var l=e.excluded?"excluded":null==s?void 0:s.result,o=n.jsx("fragment",null,"Sleep ",r.formatTimeout(e.timeout,null==t?void 0:t.configVariables));return n.jsx("test-line",{title:o,status:l,docs:d(e.type,null==s?void 0:s.result)})}(t,p,v);case"pollUrl":return function(e,t,l){var o=r.formatVariables(e.response,null==t?void 0:t.configVariables),a=r.formatVariables(e.url,null==t?void 0:t.configVariables),i=e.excluded?"excluded":null==l?void 0:l.result;return n.jsx("test-line",{title:n.jsx("text",null,"Poll URL every 0.5s"),status:i,docs:d(e.type,null==l?void 0:l.result)},n.jsx("props",null,n.jsx("prop",{name:n.jsx("text",null,"poll URL"),comparator:s.translateComparator("="),expectedValue:a,status:r.mapStatus(null==l?void 0:l.result)}),n.jsx("prop",{name:n.jsx("text",null,"until receive"),comparator:s.translateComparator("="),expectedValue:o,status:r.mapStatus(null==l?void 0:l.result)})))}(t,p,v);case"button":return function(e,t,s,r){var a=e.ids.map((function(t,s){return n.jsx("fragment",null,n.jsx("input",null,t),s!==e.ids.length-1?", ":"")})),i=o(e,t),u=e.excluded?"excluded":null==r?void 0:r.result;return n.jsx("test-line",{title:n.jsx("fragment",null,"Press button ",a,i),status:u,docs:d(e.type,null==r?void 0:r.result)},e.condition?l.translateCondition(e.condition,!1,t,s,r):void 0)}(t,p,x,v);case"runSnippet":return i(t,p,x,m,v);case"sendText":return function(e,t,s,a){var i=r.formatVariables(e.val,null==t?void 0:t.configVariables),c=e.excluded?"excluded":null==a?void 0:a.result,p=o(e,t),x=n.jsx("fragment",null,"Send text ",i," to ",u(e.target),p);return n.jsx("test-line",{title:x,status:c,docs:d(e.type,null==a?void 0:a.result)},e.condition?l.translateCondition(e.condition,!1,t,s,a):void 0)}(t,p,x,v);case"setText":return function(e,t,s,a){var i=r.formatVariables(e.val,null==t?void 0:t.configVariables),c=o(e,t),p=e.excluded?"excluded":null==a?void 0:a.result,x=n.jsx("fragment",null,"Set text ",i," to ",u(e.target),c);return n.jsx("test-line",{title:x,status:p,docs:d(e.type,null==a?void 0:a.result)},e.condition?l.translateCondition(e.condition,!1,t,s,a):void 0)}(t,p,x,v);case"browserCommand":return c(t,p,x,v);case"click":return function(e,t,s,r){var a=o(e,t),i=n.jsx("fragment",null,"Click on ",u(e.target),a),c=e.excluded?"excluded":null==r?void 0:r.result;return n.jsx("test-line",{title:i,status:c,docs:d(e.type,null==r?void 0:r.result)},e.condition?l.translateCondition(e.condition,!1,t,s,r):void 0)}(t,p,x,v);case"moveTo":return function(e,t,s,r){var a=o(e,t),i=n.jsx("fragment",null,"Move pointer to ",u(e.target),a),c=e.excluded?"excluded":null==r?void 0:r.result;return n.jsx("test-line",{title:i,status:c,docs:d(e.type,null==r?void 0:r.result)},e.condition?l.translateCondition(e.condition,!1,t,s,r):void 0)}(t,p,x,v);case"comment":return function(e){return n.jsx("test-line",{title:n.jsx("text",null,e.val.split("\n").map((function(e){return!!e.trim()&&"# "+e})).filter(Boolean).join("\n"))})}(t);default:return function(e){throw new Error("Unknown line type: "+JSON.stringify(e))}(t)}}}));
!function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define(["require","exports","@suitest/smst","./comparator","./condition","./utils"],e)}((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.translateTestLine=void 0;var n=e("@suitest/smst"),l=e("./comparator"),s=e("./condition"),r=e("./utils"),a=function(e,t){var l=e,s=l.condition,a=l.count,i=l.negateCondition,o=l.delay;return!s&&a&&("string"==typeof a||a>1)?n.jsx("fragment",null," exactly ",r.formatCount(a,null==t?void 0:t.configVariables)," every ",r.formatTimeout(null!=o?o:0,null==t?void 0:t.configVariables)):s&&i?n.jsx("text",null," only if condition is met"):s&&!i?n.jsx("fragment",null," until condition is met max ",r.formatCount(null!=a?a:1,null==t?void 0:t.configVariables)," every ",r.formatTimeout(null!=o?o:0,null==t?void 0:t.configVariables)):void 0},i=function(e){switch(e){case"success":return"continue";case"exit":return"stop test";case"fail":return"fail";case"warning":return"warn";default:return function(e){throw new Error('Unknown "then" in assert: '+e)}(e)}},o=function(e,t,l,r,i){var o=function(e,t){return t&&t[e]?n.jsx("subject",null,t[e].name):n.jsx("fragment",null,"(",n.jsx("code",null,e.slice(0,4)+"..."+e.slice(-4)),")")}(e.val,r),u=a(e,t),c=e.excluded?"excluded":null==i?void 0:i.result;return n.jsx("test-line",{title:n.jsx("fragment",null,"Run test ",o,u),status:c},e.condition?s.translateCondition(e.condition,!1,t,l,i):void 0)},u=function(e){switch(e.type){case"element":return n.jsx("subject",null,"element");case"window":return n.jsx("subject",null,"coordinates"in e?"position":"window");default:return function(e){throw new Error("Unknown target: "+JSON.stringify(e))}(e)}},c=function(e,t,r,a){var i=e.excluded?"excluded":null==a?void 0:a.result,o=e.condition?s.translateCondition(e.condition,!1,t,r,a):void 0;switch(e.browserCommand.type){case"goBack":return n.jsx("test-line",{title:n.jsx("text",null,"Go back"),status:i},o);case"goForward":return n.jsx("test-line",{title:n.jsx("text",null,"Go forward"),status:i},o);case"refresh":return n.jsx("test-line",{title:n.jsx("text",null,"Refresh"),status:i},o);case"setWindowSize":return n.jsx("test-line",{title:n.jsx("text",null,"Resize window"),status:i},n.jsx("props",null,n.jsx("prop",{name:n.jsx("text",null,"size"),comparator:l.translateComparator("="),expectedValue:n.jsx("text",null,String(e.browserCommand.params.width),"x",String(e.browserCommand.params.height))})),o);case"dismissAlertMessage":return n.jsx("test-line",{title:n.jsx("text",null,"Dismiss modal dialog"),status:i},o);case"acceptAlertMessage":return n.jsx("test-line",{title:n.jsx("text",null,"Accept modal dialog"),status:i},o);case"acceptPromptMessage":return n.jsx("test-line",{title:n.jsx("text",null,"Accept modal dialog with message"),status:i},n.jsx("props",null,n.jsx("prop",{name:n.jsx("text",null,"message"),comparator:l.translateComparator("="),expectedValue:n.jsx("text",null,e.browserCommand.params.text)})),o);default:return function(e){throw new Error("Unknown browser command: "+JSON.stringify(e))}(e.browserCommand)}};t.translateTestLine=function(e){var t=e.testLine,d=e.appConfig,x=e.elements,m=e.snippets,p=e.lineResult;switch(t.type){case"query":return function(e,t){var l="";switch(e.subject.type){case"cookie":l='Retrieve value for "'+e.subject.cookieName+'" cookie';break;case"execute":l='Retrieve value of execution "'+e.subject.execute+'"';break;case"location":l="Retrieve value of current location";break;case"elementProps":l="Retrieve info of ",e.subject.selector.video||e.subject.selector.psVideo?l+="video element":l+='"'+Object.values(e.subject.selector).filter(Boolean)[0]+'" element'}var s="error"===(null==t?void 0:t.result)?"fail":null==t?void 0:t.result;return n.jsx("test-line",{title:n.jsx("text",null,l),status:s})}(t,p);case"assert":case"wait":return function(e,t,l,a){var o=s.translateCondition(e.condition,!(!e.then||"success"===(null==e?void 0:e.then)),t,l,a),u=e.excluded?"excluded":null==a?void 0:a.result;return n.jsx("test-line",{title:n.jsx("fragment",null,"Assert: ",o.title,e.timeout?n.jsx("fragment",null," timeout ",r.formatTimeout(e.timeout,null==t?void 0:t.configVariables)):void 0,e.then&&"success"!==e.then?n.jsx("fragment",null," then ",i(e.then)):void 0),status:u},o.children)}(t,d,x,p);case"takeScreenshot":return function(e,t){var l="";return"raw"===e.dataFormat?l="Take screenshot (raw)":"base64"===e.dataFormat?l="Take screenshot (base64)":e.fileName&&(l='Save screenshot ("'+e.fileName+'")'),n.jsx("test-line",{title:n.jsx("text",null,l),status:null==t?void 0:t.result})}(t,p);case"clearAppData":return function(e,t){return n.jsx("test-line",{title:n.jsx("text",null,"Clear application data"),status:e.excluded?"excluded":null==t?void 0:t.result})}(t,p);case"execCmd":return function(e,t,l){return n.jsx("test-line",{title:n.jsx("text",null,"Execute JavaScript expression"),status:e.excluded?"excluded":null==l?void 0:l.result},n.jsx("props",null,r.translateCodeProp(n.jsx("text",null,"JavaScript expression"),e.val,t,"",r.mapStatus(null==l?void 0:l.result))))}(t,d,p);case"openApp":return function(e,t,s){var a=e.excluded?"excluded":null==s?void 0:s.result;if(!e.relativeUrl)return n.jsx("test-line",{title:n.jsx("text",null,"Open application"),status:a});var i=r.formatVariables(e.relativeUrl,null==t?void 0:t.configVariables);return n.jsx("test-line",{title:n.jsx("text",null,"Open application at relative URL"),status:a},n.jsx("props",null,n.jsx("prop",{name:n.jsx("text",null,"relative path"),comparator:l.translateComparator("="),expectedValue:i})))}(t,d,p);case"openUrl":return function(e,t,s){var a=r.formatVariables(e.url,null==t?void 0:t.configVariables),i=e.excluded?"excluded":null==s?void 0:s.result;return n.jsx("test-line",{title:n.jsx("text",null,"Open URL"),status:i},n.jsx("props",null,n.jsx("prop",{name:n.jsx("text",null,"URL"),comparator:l.translateComparator("="),expectedValue:a})))}(t,d,p);case"sleep":return function(e,t,l){var s=e.excluded?"excluded":null==l?void 0:l.result,a=n.jsx("fragment",null,"Sleep ",r.formatTimeout(e.timeout,null==t?void 0:t.configVariables));return n.jsx("test-line",{title:a,status:s})}(t,d,p);case"pollUrl":return function(e,t,s){var a=r.formatVariables(e.response,null==t?void 0:t.configVariables),i=r.formatVariables(e.url,null==t?void 0:t.configVariables),o=e.excluded?"excluded":null==s?void 0:s.result;return n.jsx("test-line",{title:n.jsx("text",null,"Poll URL every 0.5s"),status:o},n.jsx("props",null,n.jsx("prop",{name:n.jsx("text",null,"poll URL"),comparator:l.translateComparator("="),expectedValue:i,status:r.mapStatus(null==s?void 0:s.result)}),n.jsx("prop",{name:n.jsx("text",null,"until receive"),comparator:l.translateComparator("="),expectedValue:a,status:r.mapStatus(null==s?void 0:s.result)})))}(t,d,p);case"button":return function(e,t,l,r){var i=e.ids.map((function(t,l){return n.jsx("fragment",null,n.jsx("input",null,t),l!==e.ids.length-1?", ":"")})),o=a(e,t),u=e.excluded?"excluded":null==r?void 0:r.result;return n.jsx("test-line",{title:n.jsx("fragment",null,"Press button ",i,o),status:u},e.condition?s.translateCondition(e.condition,!1,t,l,r):void 0)}(t,d,x,p);case"runSnippet":return o(t,d,x,m,p);case"sendText":return function(e,t,l,i){var o=r.formatVariables(e.val,null==t?void 0:t.configVariables),c=e.excluded?"excluded":null==i?void 0:i.result,d=a(e,t),x=n.jsx("fragment",null,"Send text ",o," to ",u(e.target),d);return n.jsx("test-line",{title:x,status:c},e.condition?s.translateCondition(e.condition,!1,t,l,i):void 0)}(t,d,x,p);case"setText":return function(e,t,l,i){var o=r.formatVariables(e.val,null==t?void 0:t.configVariables),c=a(e,t),d=e.excluded?"excluded":null==i?void 0:i.result,x=n.jsx("fragment",null,"Set text ",o," to ",u(e.target),c);return n.jsx("test-line",{title:x,status:d},e.condition?s.translateCondition(e.condition,!1,t,l,i):void 0)}(t,d,x,p);case"browserCommand":return c(t,d,x,p);case"click":return function(e,t,l,r){var i=a(e,t),o=n.jsx("fragment",null,"Click on ",u(e.target),i),c=e.excluded?"excluded":null==r?void 0:r.result;return n.jsx("test-line",{title:o,status:c},e.condition?s.translateCondition(e.condition,!1,t,l,r):void 0)}(t,d,x,p);case"moveTo":return function(e,t,l,r){var i=a(e,t),o=n.jsx("fragment",null,"Move pointer to ",u(e.target),i),c=e.excluded?"excluded":null==r?void 0:r.result;return n.jsx("test-line",{title:o,status:c},e.condition?s.translateCondition(e.condition,!1,t,l,r):void 0)}(t,d,x,p);case"comment":return function(e){return n.jsx("test-line",{title:n.jsx("text",null,e.val.split("\n").map((function(e){return!!e.trim()&&"# "+e})).filter(Boolean).join("\n"))})}(t);default:return function(e){throw new Error("Unknown line type: "+JSON.stringify(e))}(t)}}}));

@@ -1,1 +0,1 @@

!function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define(["require","exports","@suitest/smst","./testLine","./condition"],e)}((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.translateTestLineResult=t.translateResultErrorMessage=void 0;var n=e("@suitest/smst"),s=e("./testLine"),o=e("./condition"),r=n.jsx("text",null,"Condition was met"),i=n.jsx("text",null,"Condition was not met"),a={failedStart:n.jsx("text",null,"Failed to open application"),appRunning:n.jsx("text",null,"App is still running"),appNotRunning:n.jsx("text",null,"App is not running"),missingApp:n.jsx("text",null,"Application is not installed on the device"),initPlatformFailed:n.jsx("text",null,"Failed to bootstrap platform on this device"),packageNotFound:n.jsx("text",null,"Selected configuration does not contain an app package. Upload a package on your app`s configuration page before continuing"),missingPackage:n.jsx("text",null,"Application package was not found on the target device"),internalError:n.jsx("text",null,"Internal error occurred"),serverError:n.jsx("text",null,"Internal error occurred"),ILInternalError:n.jsx("text",null,"Internal error occurred"),invalidCredentials:n.jsx("text",null,"Credentials for this device were changed"),ActionNotAvailable:n.jsx("text",null,"This test command is not supported by the current app configuration"),conditionNotSatisfied:n.jsx("text",null,"Maximum amount of key presses reached. Condition was not satisfied"),wrongApp:n.jsx("text",null,"Wrong app ID detected"),driverException:n.jsx("text",null,"Unexpected exception occurred on connected device. Please, contact support@suite.st if you see this often"),noHasLines:n.jsx("text",null,"No assertion properties defined"),appCrashed:n.jsx("text",null,"App seems to have crashed"),timeLimitExceeded:n.jsx("text",null,"Test execution limit exceeded (based on your subscription)"),notResponding:n.jsx("text",null,"Device stopped responding"),suitestifyError:n.jsx("text",null,"Suitestify failed to start. Check your Suitestify settings"),suitestifyRequired:n.jsx("text",null,"This assertion only works with Suitestify. You can configure your app to use Suitestify in the app settings. Please note that Suitestify is not available for all platforms"),bootstrapPageNotDetected:n.jsx("text",null,"App seems to have exited correctly but something went wrong when loading the Suitest channel autostart application"),wrongAppDetected:n.jsx("text",null,"App seems to have exited correctly, however another app has been opened"),notExpectedResponse:n.jsx("text",null,"Unexpected response received while polling URL"),noConnection:n.jsx("text",null,"Could not connect to server while polling URL"),lateManualLaunch:n.jsx("text",null,'In this configuration the "open app" commands inside the test are not supported. You may however start the test with "open app" command'),launchExpired:n.jsx("text",null,"Identical scheduling aborted"),deviceIsBusy:n.jsx("text",null,"Identical scheduling aborted"),notActiveDeveloperMode:n.jsx("text",null,'Failed to launch application. Is "developer mode" turned on? https://suite.st/docs/devices/lg-webos/#enable-developer-mode-on-the-device'),invalidUrl:n.jsx("text",null,"Application could not be launched. Please verify you have provided URL for this configuration"),invalidOpenAppOverrideReference:n.jsx("text",null,"Could not start execution, please check open app override setting. https://suite.st/docs/application/more-configuration-options/#open-app-override-test"),Success:n.jsx("text",null,"Command executed successfully"),NoSuchElement:n.jsx("text",null,"Element was not found"),NoSuchFrame:n.jsx("text",null,"Cannot switch to frame"),UnknownCommand:n.jsx("text",null,"The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource"),StaleElementReference:n.jsx("text",null,"Element is no longer inside DOM"),ElementNotVisible:n.jsx("text",null,"Element is not currently visible"),InvalidElementState:n.jsx("text",null,"Cannot perform operation with element because this element is in an invalid state (e.g. attempting to click a disabled element)"),ElementIsNotSelectable:n.jsx("text",null,"Element is not selectable"),UnknownError:n.jsx("text",null,"An unknown server-side error occurred while processing the command"),XPathLookupError:n.jsx("text",null,"An error occurred while searching for an element by XPath"),Timeout:n.jsx("text",null,"This command takes too long to execute"),NoSuchWindow:n.jsx("text",null,"A request to switch to a different window could not be satisfied because the window could not be found"),InvalidCookieDomain:n.jsx("text",null,"Cannot set a cookie on a domain different from the current page"),UnableToSetCookie:n.jsx("text",null,"Cannot set the specified cookie value"),UnexpectedAlertOpen:n.jsx("text",null,"A modal dialog was open, blocking this operation"),NoAlertOpenError:n.jsx("text",null,"There was no modal dialog on page"),ScriptTimeout:n.jsx("text",null,"A script takes too long to execute"),InvalidElementCoordinates:n.jsx("text",null,"The coordinates provided to an interactions operation are invalid"),IMENotAvailable:n.jsx("text",null,"IME was not available"),IMEEngineActivationFailed:n.jsx("text",null,"An IME engine could not be started"),InvalidSelector:n.jsx("text",null,"Element selector is malformed"),ElementNotInteractable:n.jsx("text",null,"Element is not currently interactable and may not be manipulated"),JavaScriptError:n.jsx("text",null,"An error occurred while executing user supplied JavaScript"),unknownWebDriverKey:n.jsx("text",null,"This key is not supported on the target device"),unfocusableElement:n.jsx("text",null,"Element can't receive focus to enter text"),unclickableElement:n.jsx("text",null,"Element click is obstructed by different element"),deviceConnectionError:n.jsx("text",null,"Failed to initialize device control"),testIsNotStarted:n.jsx("text",null,"Cannot continue with the current test anymore because of previous errors or bad initialization"),signInRequired:n.jsx("text",null,"Account needs to be signed in on target device"),connectionNotAuthorized:n.jsx("text",null,"Connection not authorized. Debug mode is not allowed on the device, please make sure it is enabled"),higherOSVersionRequired:n.jsx("text",null,"The app package requires higher OS version"),appleError65:n.jsx("text",null,"Failed to launch app: Apple ID account error. https://suite.st/docs/devices/apple-tv/#apple-id-account-error"),appleError70:n.jsx("text",null,"Failed to launch app: Xcode error. https://suite.st/docs/devices/apple-tv/#xcode-error"),appleAppSignError:n.jsx("text",null,"Failed to launch app: App code sign error. https://suite.st/docs/devices/apple-tv/#app-code-sign-error"),missingPSSDK:n.jsx("text",null,"Please make sure that you have the PlayStation SDK installed. https://suite.st/docs/troubleshooting/playstation/#playstation-sdk-not-installed"),targetManagerBusy:n.jsx("text",null,"Please try again in a few minutes"),missingDotNet:n.jsx("text",null,"Please make sure you have the .NET Framework installed. https://suite.st/docs/troubleshooting/playstation/#net-framework-not-installed"),bootstrapAppNotDetected:n.jsx("text",null,"The Suitest bootstrap application was not detected"),activationExpired:n.jsx("text",null,"Could not open the app because the DevKit/TestKit expired"),missingCpp:n.jsx("text",null,"Make sure you have Microsoft Visual C++ Redistributable installed. https://suite.st/docs/devices/playstation"),outOfMemory:n.jsx("text",null,"Failed to open the app. Device is out of memory, please restart the device"),networkError:n.jsx("text",null,"Network request matching given conditions was not made. https://suite.st/docs/faq/surprises/#network-request-condition-never-matches"),instrumentationFailed:n.jsx("text",null,"Suitest was unable to automatically insert the instrumentation library"),packageCorrupted:n.jsx("text",null,"Failed to open the app. Please make sure that your app is working correctly"),unknownElementProperty:n.jsx("text",null,"Unknown element property"),configuratorError:n.jsx("text",null,"Make sure that Apple Configurator 2 and Automation Tools are installed. https://suite.st/docs/devices/apple-tv/#installing-apple-configurator-2"),appleNetworkLogsError:n.jsx("text",null,"SuitestDrive can't launch NetworkLog service on Mac"),appStoreBuild:n.jsx("text",null,"Can’t install App Store distribution build"),outdatedLibraryWarning:n.jsx("text",null,"We have detected that your instrumentation library is outdated, the package can still be opened. Consider updating"),cyclicReference:n.jsx("text",null,"Cyclic reference detected"),ioError:n.jsx("fragment",null,"Problem with storing data. Please check that there is enough disk space and that permissions are not limited. Contact ",n.jsx("link",{href:"mailto:support@suite.st"},"support")," if problem persists"),netError:n.jsx("fragment",null,"Downloading of the driver failed, please check your internet connection and try again later. Contact ",n.jsx("link",{href:"mailto:support@suite.st"},"support")," if problem persists"),sdComponentFailed:n.jsx("fragment",null,"Downloading of the driver failed, please try again later. Contact ",n.jsx("link",{href:"mailto:support@suite.st"},"support")," if problem persists"),MoveTargetOutOfBounds:n.jsx("text",null,"Move target is outside of the visible area of the screen"),ElementClickIntercepted:n.jsx("text",null,"Click on the element was intercepted by another element"),unsupportedOSVersion:n.jsx("fragment",null,"Unsupported OS version, please see our ",n.jsx("link",{href:"https://suite.st/docs/devices/playstation/#sdk-650-or-system-software-701-or-lower"},"docs")),targetManagerUnsupportedVersion:n.jsx("fragment",null,"Unsupported Target Manager Server, please see our ",n.jsx("link",{href:"https://suite.st/docs/devices/playstation/#sdk-650-or-system-software-701-or-lower"},"docs")),systemOutdated:n.jsx("text",null,"System software version mismatch. New version of system software is required")};t.translateResultErrorMessage=function(e){if(function(e){return e.errorType in a}(e))return a[e.errorType];switch(e.errorType){case"queryFailed":return"message"in e?function(e){switch(e.message.code){case"invalidApp":return n.jsx("text",null,"Wrong app ID detected");case"applicationError":return n.jsx("text",null,"Application thrown unexpected error while executing command");case"missingSubject":return n.jsx("text",null,"Subject does not exist");case"existingSubject":return n.jsx("text",null,"Subject exists");case"orderErr":return n.jsx("text",null,"Suitest instrumentation library should be placed as the first script in your HTML file. Loading the instrumentation library dynamically or after other scripts have loaded may cause many unusual errors");case"updateAlert":return n.jsx("text",null,"Suitest instrumentation library is outdated. Please download and install the newest version");case"wrongExpression":return n.jsx("text",null,"Wrong expression");case"notFunction":return n.jsx("text",null,"Specified code is not a function");case"psImplicitVideo":return n.jsx("text",null,'The "video" subject on the PlayStation platform is inconsistent, we recommend using the "native video" or "element" subject instead');case"exprException":return n.jsx("text",null,'Exception was thrown: "',e.message.info.exception,'"');case"invalidUrl":var t=e;return n.jsx("text",null,"App loaded ",t.actualValue," instead of the expected ",t.expectedValue,". Consider updating the app URL in settings");default:var s=e.message;console.warn("queryFailed message was not handled",JSON.stringify(s))}return i}(e):i;case"invalidInput":return function(e){var t=n.jsx("text",null,"Test command received invalid input"),s="message"in e?e.message:void 0;if(!s)return t;switch(s.code){case"lineTypeNotSupported":return n.jsx("text",null,"This test command is not supported by the current app configuration");case"elementNotSupported":return n.jsx("text",null,"This test command is unsupported by this element");case"wrongExpression":return t;default:var o=s.code;console.warn("invalidInput code was not handled",JSON.stringify(o))}return t}(e);case"syntaxError":return function(e){var t,s=n.jsx("text",null,"Test command received invalid input");if(!(null===(t=e.message)||void 0===t?void 0:t.code))return s;switch(e.message.code){case"wrongBody":return n.jsx("text",null,"Body field value is exceeding 4KB limit");case"WrongDelay":return n.jsx("text",null,"Test command received invalid input. Delay value is invalid");case"wrongUrl":return n.jsx("text",null,"This does not look like a valid URL");default:var o=e.message.code;console.warn("syntaxError message was not handled",JSON.stringify(o))}return s}(e);case"queryTimeout":return function(e){var t=n.jsx("text",null,"Application did not respond for 60 seconds");if(!e.message)return t;switch(e.message.code){case"missingIlResponse":var s=e.message.info.timeout/1e3;return n.jsx("text",null,"The wait time exceeded ",String(s)," ",1===s?"second":"seconds");default:var o=e.message.code;console.warn("queryTimeout message was not handled",JSON.stringify(o))}return t}(e);case"deviceError":return function(e){var t=e.message;return"unsupportedSelector"===t.code&&"xpathNotSupported"===t.info.reason?n.jsx("text",null,"Element cannot be found, because this device does not support XPath lookups"):"deviceFailure"===t.code&&"cssSelectorInvalid"===t.info.reason?n.jsx("text",null,"CSS selector is invalid"):["videoAdapterInvalidOutput","videoAdapterNotFunction","videoAdapterThrownError"].includes(t.code)?n.jsx("text",null,"Video adapter error: ",t.info.reason):a.internalError}(e);case"unsupportedButton":case"illegalButton":return function(e){var t,s=null===(t=e.message)||void 0===t?void 0:t.info.buttonIds;return s?n.jsx("text",null,"Specified buttons are not supported on this device: [",s.join(", "),"]"):n.jsx("text",null,"Specified buttons are not supported on this device")}(e);case"aborted":return function(e){var t;return"manualActionRequired"===(null===(t=e.message)||void 0===t?void 0:t.info.reason)?n.jsx("text",null,"Manual actions are not supported"):n.jsx("text",null,"Test execution was aborted")}(e);case"invalidVariable":return function(e){var t,s,o=null!==(s=null===(t=e.args)||void 0===t?void 0:t.variables)&&void 0!==s?s:[];if(0===o.length)return n.jsx("text",null,"Variable is not defined in the app configuration");var r=o.join(", ");return n.jsx("text",null,1===o.length?"Variable "+r+" is":"Variables "+r+" are"," not defined in the app configuration")}(e);case"invalidValue":return function(e){var t;return(null===(t=e.args)||void 0===t?void 0:t.propertyName)?n.jsx("text",null,"Invalid value provided for ",e.args.propertyName):n.jsx("text",null,"Invalid value provided")}(e);case"invalidResult":return function(e){var t,s=n.jsx("text",null,"Unexpected response received");if(!(null===(t=e.message)||void 0===t?void 0:t.code))return s;switch(e.message.code){case"resultTooLong":return n.jsx("text",null,"Response exceeded the size limit of 4KB");default:var o=e.message.code;console.warn("invalidResult code was not handled",JSON.stringify(o))}return s}(e);case"openAppOverrideFailed":return n.jsx("text",null,"Open app override failed");case"invalidReference":return function(e){var t="Could not start execution because";return"snippetLineNumber"in e?n.jsx("text",null,t,' "Run Test" command refers to non-existing test or referred test has it\'s own references to non-existing tests'):n.jsx("text",null,t,' test definition contains "Run Test" lines that refer to non-existing test')}(e);case"adbError":return function(e){return e.message&&"code"in e.message&&"certificateError"===e.message.code?n.jsx("text",null,e.message.code):e.message&&"info"in e.message?n.jsx("text",null,e.message.info.reason):n.jsx("text",null,"ADB communication with the device has failed. Make sure your device is set up correctly and it can be connected to using ADB")}(e);case"invalidPackage":return function(e){var t,s=n.jsx("text",null,"Package cannot be launched on simulator device");if(!(null===(t=e.message)||void 0===t?void 0:t.code))return s;switch(e.message.code){case"appleTvDevicePackageOnSim":return n.jsx("text",null,"An Apple TV app package cannot be launched on simulator device");case"appleTvSimPackageOnDevice":return n.jsx("text",null,"An Apple TV app simulator package cannot be launched on real device");default:var o=e.message.code;return console.warn("invalidPackage code was not handled",JSON.stringify(o)),s}}(e);case"outdatedLibrary":case"outdatedLibraryConnected":return function(e){var t=n.jsx("text",null,"We have detected that your instrumentation library is outdated");switch(e.message.code){case"major":return n.jsx("text",null,"We have detected that your instrumentation library is outdated and the package cannot be opened. Update required");case"minor":return n.jsx("text",null,"We have detected that your instrumentation library is outdated, the package can still be opened. Consider updating")}return t}(e);case"invalidRepositoryReference":return function(e){var t="Element was not found in the repository";if(e.message)switch(e.message.code){case"notExistingElement":break;case"notExistingPlatform":t="Element is not defined for the selected platform";break;case"unknownProperty":t="Element does not support property "+o.translateElementProperty(e.message.property);break;default:var s=e.message;console.warn("invalidRepositoryReference unknown message: ",JSON.stringify(s))}return n.jsx("text",null,t)}(e);default:return function(e){return console.warn("Error message not implemented for: "+JSON.stringify(e)+". Make sure you are using the latest version of the @suitest/translate library."),n.jsx("text",null,"Unknown error occurred")}(e)}};var l=function(e,s){var o;if("query"===(null===(o=s)||void 0===o?void 0:o.contentType))return function(e,t){var s="";if("notExistingElement"===t.error)s="Element was not found in the repository";else if(!1===t.elementExists)s="Element was not found";else if(t.cookieExists)s="Cookie was not found";else if(t.executeThrowException)s='Execution thrown exception "'+t.executeExceptionMessage+'}"';else if(t.errorMessage)s=t.errorMessage;else switch(s="Error occurred while ",e.subject.type){case"execute":s+="executing script on device";break;case"cookie":s+="retrieving cookie";break;case"elementProps":s+="retrieving element";break;case"location":s+="retrieving current location"}return n.jsx("text",null,s)}(e,s);var a=function(e,t){if(!(!t||"assert"!==e.type&&"wait"!==e.type||!("then"in e)||"success"===e.then||t.errorType&&"queryFailed"!==t.errorType&&"appRunning"!==t.errorType))return t.result===e.then?r:i}(e,s);if(a)return a;if(s&&"success"!==s.result){if("excluded"===s.result)return n.jsx("text",null,"Line was not executed");if("aborted"===s.result)return n.jsx("text",null,"Execution was aborted.");if("runSnippet"!==e.type||s.errorType)return t.translateResultErrorMessage(s)}};t.translateTestLineResult=function(e){var t,o,r,i,a=e.lineResult;return a&&"contentType"in a&&"query"===a.contentType?n.jsx("test-line-result",{status:"fail",message:l(e.testLine,a)},s.translateTestLine(e)):n.jsx("test-line-result",{status:null!==(o=null===(t=a)||void 0===t?void 0:t.result)&&void 0!==o?o:"success",message:l(e.testLine,a),screenshot:(i=null===(r=a)||void 0===r?void 0:r.screenshot,i?"https://the.suite.st"+i:void 0)},s.translateTestLine(e))}}));
!function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define(["require","exports","@suitest/smst","./testLine","./condition"],e)}((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.translateTestLineResult=t.translateResultErrorMessage=void 0;var n=e("@suitest/smst"),s=e("./testLine"),o=e("./condition"),r=n.jsx("text",null,"Condition was met"),i=n.jsx("text",null,"Condition was not met"),a={failedStart:n.jsx("text",null,"Failed to open application"),appRunning:n.jsx("text",null,"App is still running"),appNotRunning:n.jsx("text",null,"App is not running"),missingApp:n.jsx("text",null,"Application is not installed on the device"),initPlatformFailed:n.jsx("text",null,"Failed to bootstrap platform on this device"),packageNotFound:n.jsx("text",null,"Selected configuration does not contain an app package. Upload a package on your app`s configuration page before continuing"),missingPackage:n.jsx("text",null,"Application package was not found on the target device"),internalError:n.jsx("text",null,"Internal error occurred"),serverError:n.jsx("text",null,"Internal error occurred"),ILInternalError:n.jsx("text",null,"Internal error occurred"),invalidCredentials:n.jsx("text",null,"Credentials for this device were changed"),ActionNotAvailable:n.jsx("text",null,"This test command is not supported by the current app configuration"),conditionNotSatisfied:n.jsx("text",null,"Maximum amount of key presses reached. Condition was not satisfied"),wrongApp:n.jsx("text",null,"Wrong app ID detected"),driverException:n.jsx("text",null,"Unexpected exception occurred on connected device. Please, contact support@suite.st if you see this often"),noHasLines:n.jsx("text",null,"No assertion properties defined"),appCrashed:n.jsx("text",null,"App seems to have crashed"),timeLimitExceeded:n.jsx("text",null,"Test execution limit exceeded (based on your subscription)"),notResponding:n.jsx("text",null,"Device stopped responding"),suitestifyError:n.jsx("text",null,"Suitestify failed to start. Check your Suitestify settings"),suitestifyRequired:n.jsx("text",null,"This assertion only works with Suitestify. You can configure your app to use Suitestify in the app settings. Please note that Suitestify is not available for all platforms"),bootstrapPageNotDetected:n.jsx("text",null,"App seems to have exited correctly but something went wrong when loading the Suitest channel autostart application"),wrongAppDetected:n.jsx("text",null,"App seems to have exited correctly, however another app has been opened"),notExpectedResponse:n.jsx("text",null,"Unexpected response received while polling URL"),noConnection:n.jsx("text",null,"Could not connect to server while polling URL"),lateManualLaunch:n.jsx("text",null,'In this configuration the "open app" commands inside the test are not supported. You may however start the test with "open app" command'),launchExpired:n.jsx("text",null,"Identical scheduling aborted"),deviceIsBusy:n.jsx("text",null,"Identical scheduling aborted"),notActiveDeveloperMode:n.jsx("text",null,'Failed to launch application. Is "developer mode" turned on? https://suite.st/docs/devices/lg-webos/#enable-developer-mode-on-the-device'),invalidUrl:n.jsx("text",null,"Application could not be launched. Please verify you have provided URL for this configuration"),invalidOpenAppOverrideReference:n.jsx("text",null,"Could not start execution, please check open app override setting. https://suite.st/docs/application/more-configuration-options/#open-app-override-test"),Success:n.jsx("text",null,"Command executed successfully"),NoSuchElement:n.jsx("text",null,"Element was not found"),NoSuchFrame:n.jsx("text",null,"Cannot switch to frame"),UnknownCommand:n.jsx("text",null,"The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource"),StaleElementReference:n.jsx("text",null,"Element is no longer inside DOM"),ElementNotVisible:n.jsx("text",null,"Element is not currently visible"),InvalidElementState:n.jsx("text",null,"Cannot perform operation with element because this element is in an invalid state (e.g. attempting to click a disabled element)"),ElementIsNotSelectable:n.jsx("text",null,"Element is not selectable"),UnknownError:n.jsx("text",null,"An unknown server-side error occurred while processing the command"),XPathLookupError:n.jsx("text",null,"An error occurred while searching for an element by XPath"),Timeout:n.jsx("text",null,"This command takes too long to execute"),NoSuchWindow:n.jsx("text",null,"A request to switch to a different window could not be satisfied because the window could not be found"),InvalidCookieDomain:n.jsx("text",null,"Cannot set a cookie on a domain different from the current page"),UnableToSetCookie:n.jsx("text",null,"Cannot set the specified cookie value"),UnexpectedAlertOpen:n.jsx("text",null,"A modal dialog was open, blocking this operation"),NoAlertOpenError:n.jsx("text",null,"There was no modal dialog on page"),ScriptTimeout:n.jsx("text",null,"A script takes too long to execute"),InvalidElementCoordinates:n.jsx("text",null,"The coordinates provided to an interactions operation are invalid"),IMENotAvailable:n.jsx("text",null,"IME was not available"),IMEEngineActivationFailed:n.jsx("text",null,"An IME engine could not be started"),InvalidSelector:n.jsx("text",null,"Element selector is malformed"),ElementNotInteractable:n.jsx("text",null,"Element is not currently interactable and may not be manipulated"),JavaScriptError:n.jsx("text",null,"An error occurred while executing user supplied JavaScript"),unknownWebDriverKey:n.jsx("text",null,"This key is not supported on the target device"),unfocusableElement:n.jsx("text",null,"Element can't receive focus to enter text"),unclickableElement:n.jsx("text",null,"Element click is obstructed by different element"),deviceConnectionError:n.jsx("text",null,"Failed to initialize device control"),testIsNotStarted:n.jsx("text",null,"Cannot continue with the current test anymore because of previous errors or bad initialization"),signInRequired:n.jsx("text",null,"Account needs to be signed in on target device"),connectionNotAuthorized:n.jsx("text",null,"Connection not authorized. Debug mode is not allowed on the device, please make sure it is enabled"),higherOSVersionRequired:n.jsx("text",null,"The app package requires higher OS version"),appleError65:n.jsx("text",null,"Failed to launch app: Apple ID account error. https://suite.st/docs/devices/apple-tv/#apple-id-account-error"),appleError70:n.jsx("text",null,"Failed to launch app: Xcode error. https://suite.st/docs/devices/apple-tv/#xcode-error"),appleAppSignError:n.jsx("text",null,"Failed to launch app: App code sign error. https://suite.st/docs/devices/apple-tv/#app-code-sign-error"),missingPSSDK:n.jsx("text",null,"Please make sure that you have the PlayStation SDK installed. https://suite.st/docs/troubleshooting/playstation/#playstation-sdk-not-installed"),packageInstallationFailed:n.jsx("text",null,"Application installation on the device failed"),targetManagerBusy:n.jsx("text",null,"Please try again in a few minutes"),missingDotNet:n.jsx("text",null,"Please make sure you have the .NET Framework installed. https://suite.st/docs/troubleshooting/playstation/#net-framework-not-installed"),bootstrapAppNotDetected:n.jsx("text",null,"The Suitest bootstrap application was not detected"),activationExpired:n.jsx("text",null,"Could not open the app because the DevKit/TestKit expired"),missingCpp:n.jsx("text",null,"Make sure you have Microsoft Visual C++ Redistributable installed. https://suite.st/docs/devices/playstation"),outOfMemory:n.jsx("text",null,"Failed to open the app. Device is out of memory, please restart the device"),networkError:n.jsx("text",null,"Network request matching given conditions was not made. https://suite.st/docs/faq/surprises/#network-request-condition-never-matches"),instrumentationFailed:n.jsx("text",null,"Suitest was unable to automatically insert the instrumentation library"),packageCorrupted:n.jsx("text",null,"Failed to open the app. Please make sure that your app is working correctly"),unknownElementProperty:n.jsx("text",null,"Unknown element property"),configuratorError:n.jsx("text",null,"Make sure that Apple Configurator 2 and Automation Tools are installed. https://suite.st/docs/devices/apple-tv/#installing-apple-configurator-2"),appleNetworkLogsError:n.jsx("text",null,"SuitestDrive can't launch NetworkLog service on Mac"),appStoreBuild:n.jsx("text",null,"Can’t install App Store distribution build"),outdatedLibraryWarning:n.jsx("text",null,"We have detected that your instrumentation library is outdated, the package can still be opened. Consider updating"),cyclicReference:n.jsx("text",null,"Cyclic reference detected"),ioError:n.jsx("fragment",null,"Problem with storing data. Please check that there is enough disk space and that permissions are not limited. Contact ",n.jsx("link",{href:"mailto:support@suite.st"},"support")," if problem persists"),netError:n.jsx("fragment",null,"Downloading of the driver failed, please check your internet connection and try again later. Contact ",n.jsx("link",{href:"mailto:support@suite.st"},"support")," if problem persists"),sdComponentFailed:n.jsx("fragment",null,"Downloading of the driver failed, please try again later. Contact ",n.jsx("link",{href:"mailto:support@suite.st"},"support")," if problem persists"),MoveTargetOutOfBounds:n.jsx("text",null,"Move target is outside of the visible area of the screen"),ElementClickIntercepted:n.jsx("text",null,"Click on the element was intercepted by another element"),unsupportedOSVersion:n.jsx("fragment",null,"Unsupported OS version, please see our ",n.jsx("link",{href:"https://suite.st/docs/devices/playstation/#sdk-650-or-system-software-701-or-lower"},"docs")),targetManagerUnsupportedVersion:n.jsx("fragment",null,"Unsupported Target Manager Server, please see our ",n.jsx("link",{href:"https://suite.st/docs/devices/playstation/#sdk-650-or-system-software-701-or-lower"},"docs")),systemOutdated:n.jsx("text",null,"System software version mismatch. New version of system software is required")};t.translateResultErrorMessage=function(e){if(function(e){return e.errorType in a}(e))return a[e.errorType];switch(e.errorType){case"queryFailed":return"message"in e?function(e){switch(e.message.code){case"invalidApp":return n.jsx("text",null,"Wrong app ID detected");case"applicationError":return n.jsx("text",null,"Application thrown unexpected error while executing command");case"missingSubject":return n.jsx("text",null,"Subject does not exist");case"existingSubject":return n.jsx("text",null,"Subject exists");case"orderErr":return n.jsx("text",null,"Suitest instrumentation library should be placed as the first script in your HTML file. Loading the instrumentation library dynamically or after other scripts have loaded may cause many unusual errors");case"updateAlert":return n.jsx("text",null,"Suitest instrumentation library is outdated. Please download and install the newest version");case"wrongExpression":return n.jsx("text",null,"Wrong expression");case"notFunction":return n.jsx("text",null,"Specified code is not a function");case"psImplicitVideo":return n.jsx("text",null,'The "video" subject on the PlayStation platform is inconsistent, we recommend using the "native video" or "element" subject instead');case"exprException":return n.jsx("text",null,'Exception was thrown: "',e.message.info.exception,'"');case"invalidUrl":var t=e;return n.jsx("text",null,"App loaded ",t.actualValue," instead of the expected ",t.expectedValue,". Consider updating the app URL in settings");default:var s=e.message;console.warn("queryFailed message was not handled",JSON.stringify(s))}return i}(e):i;case"invalidInput":return function(e){var t=n.jsx("text",null,"Test command received invalid input"),s="message"in e?e.message:void 0;if(!s)return t;switch(s.code){case"lineTypeNotSupported":return n.jsx("text",null,"This test command is not supported by the current app configuration");case"elementNotSupported":return n.jsx("text",null,"This test command is unsupported by this element");case"wrongExpression":return t;default:var o=s.code;console.warn("invalidInput code was not handled",JSON.stringify(o))}return t}(e);case"syntaxError":return function(e){var t,s=n.jsx("text",null,"Test command received invalid input");if(!(null===(t=e.message)||void 0===t?void 0:t.code))return s;switch(e.message.code){case"wrongBody":return n.jsx("text",null,"Body field value is exceeding 4KB limit");case"WrongDelay":return n.jsx("text",null,"Test command received invalid input. Delay value is invalid");case"wrongUrl":return n.jsx("text",null,"This does not look like a valid URL");default:var o=e.message.code;console.warn("syntaxError message was not handled",JSON.stringify(o))}return s}(e);case"queryTimeout":return function(e){var t=n.jsx("text",null,"Application did not respond for 60 seconds");if(!e.message)return t;switch(e.message.code){case"missingIlResponse":var s=e.message.info.timeout/1e3;return n.jsx("text",null,"The wait time exceeded ",String(s)," ",1===s?"second":"seconds");default:var o=e.message.code;console.warn("queryTimeout message was not handled",JSON.stringify(o))}return t}(e);case"deviceError":return function(e){var t=e.message;return"unsupportedSelector"===t.code&&"xpathNotSupported"===t.info.reason?n.jsx("text",null,"Element cannot be found, because this device does not support XPath lookups"):"deviceFailure"===t.code&&"cssSelectorInvalid"===t.info.reason?n.jsx("text",null,"CSS selector is invalid"):["videoAdapterInvalidOutput","videoAdapterNotFunction","videoAdapterThrownError"].includes(t.code)?n.jsx("text",null,"Video adapter error: ",t.info.reason):a.internalError}(e);case"unsupportedButton":case"illegalButton":return function(e){var t,s=null===(t=e.message)||void 0===t?void 0:t.info.buttonIds;return s?n.jsx("text",null,"Specified buttons are not supported on this device: [",s.join(", "),"]"):n.jsx("text",null,"Specified buttons are not supported on this device")}(e);case"aborted":return function(e){var t;return"manualActionRequired"===(null===(t=e.message)||void 0===t?void 0:t.info.reason)?n.jsx("text",null,"Manual actions are not supported"):n.jsx("text",null,"Test execution was aborted")}(e);case"invalidVariable":return function(e){var t,s,o=null!==(s=null===(t=e.args)||void 0===t?void 0:t.variables)&&void 0!==s?s:[];if(0===o.length)return n.jsx("text",null,"Variable is not defined in the app configuration");var r=o.join(", ");return n.jsx("text",null,1===o.length?"Variable "+r+" is":"Variables "+r+" are"," not defined in the app configuration")}(e);case"invalidValue":return function(e){var t;return(null===(t=e.args)||void 0===t?void 0:t.propertyName)?n.jsx("text",null,"Invalid value provided for ",e.args.propertyName):n.jsx("text",null,"Invalid value provided")}(e);case"invalidResult":return function(e){var t,s=n.jsx("text",null,"Unexpected response received");if(!(null===(t=e.message)||void 0===t?void 0:t.code))return s;switch(e.message.code){case"resultTooLong":return n.jsx("text",null,"Response exceeded the size limit of 4KB");default:var o=e.message.code;console.warn("invalidResult code was not handled",JSON.stringify(o))}return s}(e);case"openAppOverrideFailed":return n.jsx("text",null,"Open app override failed");case"invalidReference":return function(e){var t="Could not start execution because";return"snippetLineNumber"in e?n.jsx("text",null,t,' "Run Test" command refers to non-existing test or referred test has it\'s own references to non-existing tests'):n.jsx("text",null,t,' test definition contains "Run Test" lines that refer to non-existing test')}(e);case"adbError":return function(e){return e.message&&"code"in e.message&&"certificateError"===e.message.code?n.jsx("text",null,e.message.code):e.message&&"info"in e.message?n.jsx("text",null,e.message.info.reason):n.jsx("text",null,"ADB communication with the device has failed. Make sure your device is set up correctly and it can be connected to using ADB")}(e);case"invalidPackage":return function(e){var t,s=n.jsx("text",null,"Package cannot be launched on simulator device");if(!(null===(t=e.message)||void 0===t?void 0:t.code))return s;switch(e.message.code){case"appleTvDevicePackageOnSim":return n.jsx("text",null,"An Apple TV app package cannot be launched on simulator device");case"appleTvSimPackageOnDevice":return n.jsx("text",null,"An Apple TV app simulator package cannot be launched on real device");default:var o=e.message.code;return console.warn("invalidPackage code was not handled",JSON.stringify(o)),s}}(e);case"outdatedLibrary":case"outdatedLibraryConnected":return function(e){var t=n.jsx("text",null,"We have detected that your instrumentation library is outdated");switch(e.message.code){case"major":return n.jsx("text",null,"We have detected that your instrumentation library is outdated and the package cannot be opened. Update required");case"minor":return n.jsx("text",null,"We have detected that your instrumentation library is outdated, the package can still be opened. Consider updating")}return t}(e);case"invalidRepositoryReference":return function(e){var t="Element was not found in the repository";if(e.message)switch(e.message.code){case"notExistingElement":break;case"notExistingPlatform":t="Element is not defined for the selected platform";break;case"unknownProperty":t="Element does not support property "+o.translateElementProperty(e.message.property);break;default:var s=e.message;console.warn("invalidRepositoryReference unknown message: ",JSON.stringify(s))}return n.jsx("text",null,t)}(e);default:return function(e){return console.warn("Error message not implemented for: "+JSON.stringify(e)+". Make sure you are using the latest version of the @suitest/translate library."),n.jsx("text",null,"Unknown error occurred")}(e)}};var l=function(e,s){var o;if("query"===(null===(o=s)||void 0===o?void 0:o.contentType))return function(e,t){var s="";if("notExistingElement"===t.error)s="Element was not found in the repository";else if(!1===t.elementExists)s="Element was not found";else if(t.cookieExists)s="Cookie was not found";else if(t.executeThrowException)s='Execution thrown exception "'+t.executeExceptionMessage+'}"';else if(t.errorMessage)s=t.errorMessage;else switch(s="Error occurred while ",e.subject.type){case"execute":s+="executing script on device";break;case"cookie":s+="retrieving cookie";break;case"elementProps":s+="retrieving element";break;case"location":s+="retrieving current location"}return n.jsx("text",null,s)}(e,s);var a=function(e,t){if(!(!t||"assert"!==e.type&&"wait"!==e.type||!("then"in e)||"success"===e.then||t.errorType&&"queryFailed"!==t.errorType&&"appRunning"!==t.errorType))return t.result===e.then?r:i}(e,s);if(a)return a;if(s&&"success"!==s.result){if("excluded"===s.result)return n.jsx("text",null,"Line was not executed");if("aborted"===s.result)return n.jsx("text",null,"Execution was aborted.");if("runSnippet"!==e.type||s.errorType)return t.translateResultErrorMessage(s)}},u={clearAppData:"/testing/test-operations/clear-app-data-operation/",takeScreenshot:"/suitest-api/commands/#takescreenshot",execCmd:"/testing/test-operations/execute-command-operation/",openApp:"/testing/test-operations/open-app-operation/",openUrl:"/testing/test-operations/open-url-operation/",sleep:"/testing/test-operations/sleep-operation/",pollUrl:"/testing/test-operations/poll-url-operation/",button:"/testing/test-operations/press-button-operation/",runSnippet:"/testing/test-operations/run-test-operation/",sendText:"/testing/test-operations/send-text-operation/",setText:"/testing/test-operations/set-text-operation/",browserCommand:"/testing/test-operations/browser-command-operation/",click:"/testing/test-operations/click-on-operation/",moveTo:"/testing/test-operations/move-to-operation/",comment:null},c={application:"/testing/test-subjects/application-subject/",cookie:"/testing/test-subjects/cookie-subject/",element:"/testing/test-subjects/view-element-subject/",elementProps:"/testing/test-subjects/view-element-subject/",javascript:"/testing/test-subjects/javascript-expression-subject/",execute:"/testing/test-subjects/javascript-expression-subject/",location:"/testing/test-subjects/current-location-subject/",network:"/testing/test-subjects/network-request-subject/",psVideo:"/testing/test-subjects/video-subject/#playstation-4-webmaf-video",video:"/testing/test-subjects/video-subject/"};t.translateTestLineResult=function(e){var t,o,r,i,a,d,p=e.lineResult,x=e.testLine,m=(a="query"===(i=x).type?c[i.subject.type]:"wait"===i.type||"assert"===i.type?c[i.condition.subject.type]:u[i.type])?"https://suite.st/docs"+a:void 0;return p&&"contentType"in p&&"query"===p.contentType?n.jsx("test-line-result",{status:"fail",message:l(e.testLine,p),docs:m},s.translateTestLine(e)):n.jsx("test-line-result",{status:null!==(o=null===(t=p)||void 0===t?void 0:t.result)&&void 0!==o?o:"success",message:l(e.testLine,p),screenshot:(d=null===(r=p)||void 0===r?void 0:r.screenshot,d?"https://the.suite.st"+d:void 0),docs:m},s.translateTestLine(e))}}));
{
"name": "@suitest/translate",
"version": "4.0.1",
"version": "4.0.2",
"description": "A module that translate Suitest server messages to human readable strings",

@@ -31,9 +31,9 @@ "homepage": "https://suite.st/",

"dependencies": {
"@suitest/smst": "^4.0.0",
"@suitest/types": "^4.0.1"
"@suitest/smst": "^4.0.2",
"@suitest/types": "^4.0.2"
},
"devDependencies": {
"@suitest/smst-to-html": "^4.0.1",
"@suitest/smst-to-text": "^4.0.1"
"@suitest/smst-to-html": "^4.0.2",
"@suitest/smst-to-text": "^4.0.2"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc