@suitest/translate
Advanced tools
Comparing version 4.14.0 to 4.15.0
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.translateTestLineResult=exports.translateResultErrorMessage=void 0;var smst_1=require("@suitest/smst"),testLine_1=require("./testLine"),condition_1=require("./condition"),utils_1=require("./utils"),baseScreenshotPath="https://the.suite.st",conditionWasMetMessage=smst_1.jsx("text",null,"Condition was met"),conditionWasNotMetMessage=smst_1.jsx("text",null,"Condition was not met"),simpleErrorMap={failedStart:smst_1.jsx("text",null,"Failed to open application"),appRunning:smst_1.jsx("text",null,"App is still running"),appNotRunning:smst_1.jsx("text",null,"App is not running"),missingApp:smst_1.jsx("text",null,"Application is not installed on the device"),initPlatformFailed:smst_1.jsx("text",null,"Failed to bootstrap platform on this device"),packageNotFound:smst_1.jsx("text",null,"Selected configuration does not contain an app package. Upload a package on your app`s configuration page before continuing"),missingPackage:smst_1.jsx("text",null,"Application package was not found on the target device"),internalError:smst_1.jsx("text",null,"Internal error occurred"),serverError:smst_1.jsx("text",null,"Internal error occurred"),ILInternalError:smst_1.jsx("text",null,"Internal error occurred"),invalidCredentials:smst_1.jsx("text",null,"Credentials for this device were changed"),ActionNotAvailable:smst_1.jsx("text",null,"This test command is not supported by the current app configuration"),conditionNotSatisfied:smst_1.jsx("text",null,"Maximum amount of key presses reached. Condition was not satisfied"),wrongApp:smst_1.jsx("text",null,"Wrong app ID detected"),driverException:smst_1.jsx("text",null,"Unexpected exception occurred on connected device. Please, contact support@suite.st if you see this often"),noHasLines:smst_1.jsx("text",null,"No assertion properties defined"),appCrashed:smst_1.jsx("text",null,"App seems to have crashed"),timeLimitExceeded:smst_1.jsx("text",null,"Test execution limit exceeded (based on your subscription)"),notResponding:smst_1.jsx("text",null,"Device stopped responding"),suitestifyError:smst_1.jsx("text",null,"Suitestify failed to start. Check your Suitestify settings"),suitestifyRequired:smst_1.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:smst_1.jsx("text",null,"App seems to have exited correctly but something went wrong when loading the Suitest channel autostart application"),wrongAppDetected:smst_1.jsx("text",null,"App seems to have exited correctly, however another app has been opened"),notExpectedResponse:smst_1.jsx("text",null,"Unexpected response received while polling URL"),noConnection:smst_1.jsx("text",null,"Could not connect to server while polling URL"),lateManualLaunch:smst_1.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:smst_1.jsx("text",null,"Identical scheduling aborted"),deviceIsBusy:smst_1.jsx("text",null,"Identical scheduling aborted"),notActiveDeveloperMode:smst_1.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:smst_1.jsx("text",null,"Application could not be launched. Please verify you have provided URL for this configuration"),invalidOpenAppOverrideReference:smst_1.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:smst_1.jsx("text",null,"Command executed successfully"),NoSuchElement:smst_1.jsx("text",null,"Element was not found"),NoSuchFrame:smst_1.jsx("text",null,"Cannot switch to frame"),UnknownCommand:smst_1.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:smst_1.jsx("text",null,"Element is no longer inside DOM"),ElementNotVisible:smst_1.jsx("text",null,"Element is not currently visible"),InvalidElementState:smst_1.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:smst_1.jsx("text",null,"Element is not selectable"),UnknownError:smst_1.jsx("text",null,"An unknown server-side error occurred while processing the command"),XPathLookupError:smst_1.jsx("text",null,"An error occurred while searching for an element by XPath"),Timeout:smst_1.jsx("text",null,"This command takes too long to execute"),NoSuchWindow:smst_1.jsx("text",null,"A request to switch to a different window could not be satisfied because the window could not be found"),InvalidCookieDomain:smst_1.jsx("text",null,"Cannot set a cookie on a domain different from the current page"),UnableToSetCookie:smst_1.jsx("text",null,"Cannot set the specified cookie value"),UnexpectedAlertOpen:smst_1.jsx("text",null,"A modal dialog was open, blocking this operation"),NoAlertOpenError:smst_1.jsx("text",null,"There was no modal dialog on page"),ScriptTimeout:smst_1.jsx("text",null,"A script takes too long to execute"),InvalidElementCoordinates:smst_1.jsx("text",null,"The coordinates provided to an interactions operation are invalid"),IMENotAvailable:smst_1.jsx("text",null,"IME was not available"),IMEEngineActivationFailed:smst_1.jsx("text",null,"An IME engine could not be started"),InvalidSelector:smst_1.jsx("text",null,"Element selector is malformed"),ElementNotInteractable:smst_1.jsx("text",null,"Element is not currently interactable and may not be manipulated"),JavaScriptError:smst_1.jsx("text",null,"An error occurred while executing user supplied JavaScript"),unknownWebDriverKey:smst_1.jsx("text",null,"This key is not supported on the target device"),unfocusableElement:smst_1.jsx("text",null,"Element can't receive focus to enter text"),unclickableElement:smst_1.jsx("text",null,"Element click is obstructed by different element"),deviceConnectionError:smst_1.jsx("text",null,"Failed to initialize device control"),controllerNotConnected:smst_1.jsx("text",null,"Please check that all corresponding control units are working."),appOnBackgroundError:smst_1.jsx("text",null,"Cannot process line, application is not active"),testIsNotStarted:smst_1.jsx("text",null,"Cannot continue with the current test anymore because of previous errors or bad initialization"),signInRequired:smst_1.jsx("text",null,"Account needs to be signed in on target device"),connectionNotAuthorized:smst_1.jsx("text",null,"Connection not authorized. Debug mode is not allowed on the device, please make sure it is enabled"),higherOSVersionRequired:smst_1.jsx("text",null,"The app package requires higher OS version"),appleError65:smst_1.jsx("text",null,"Failed to launch app: Apple ID account error. https://suite.st/docs/devices/apple-tv/#apple-id-account-error"),appleError70:smst_1.jsx("text",null,"Failed to launch app: Xcode error. https://suite.st/docs/devices/apple-tv/#xcode-error"),appleAppSignError:smst_1.jsx("text",null,"Failed to launch app: App code sign error. https://suite.st/docs/devices/apple-tv/#app-code-sign-error"),missingPSSDK:smst_1.jsx("text",null,"Please make sure that you have the PlayStation SDK installed"),packageInstallationFailed:smst_1.jsx("text",null,"Application installation on the device failed"),targetManagerBusy:smst_1.jsx("text",null,"Device is busy, please try again later. Open Neighborhood (PS4) or Target Manager (PS5) app for more details"),missingDotNet:smst_1.jsx("text",null,"Please make sure you have the .NET Framework installed. https://suite.st/docs/troubleshooting/playstation/#net-framework-not-installed"),bootstrapAppNotDetected:smst_1.jsx("text",null,"The Suitest bootstrap application was not detected"),activationExpired:smst_1.jsx("text",null,"Could not open the app because the DevKit/TestKit expired"),missingCpp:smst_1.jsx("text",null,"Make sure you have Microsoft Visual C++ Redistributable installed. https://suite.st/docs/devices/playstation"),outOfMemory:smst_1.jsx("text",null,"Failed to open the app. Device is out of memory, please restart the device"),networkError:smst_1.jsx("text",null,"Network request matching given conditions was not made. https://suite.st/docs/faq/surprises/#network-request-condition-never-matches"),instrumentationFailed:smst_1.jsx("text",null,"Suitest was unable to automatically insert the instrumentation library"),packageCorrupted:smst_1.jsx("text",null,"Failed to open the app. Please make sure that your app is working correctly"),unknownElementProperty:smst_1.jsx("text",null,"Unknown element property"),configuratorError:smst_1.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:smst_1.jsx("text",null,"SuitestDrive can't launch NetworkLog service on Mac"),appStoreBuild:smst_1.jsx("text",null,"Can’t install App Store distribution build"),outdatedLibraryWarning:smst_1.jsx("text",null,"We have detected that your instrumentation library is outdated, the package can still be opened. Consider updating"),cyclicReference:smst_1.jsx("text",null,"Cyclic reference detected"),ioError:smst_1.jsx("fragment",null,"Problem with storing data. Please check that there is enough disk space and that permissions are not limited. Contact ",smst_1.jsx("link",{href:"mailto:support@suite.st"},"support")," if problem persists"),netError:smst_1.jsx("fragment",null,"Downloading of the driver failed, please check your internet connection and try again later. Contact ",smst_1.jsx("link",{href:"mailto:support@suite.st"},"support")," if problem persists"),sdComponentFailed:smst_1.jsx("fragment",null,"Downloading of the driver failed, please try again later. Contact ",smst_1.jsx("link",{href:"mailto:support@suite.st"},"support")," if problem persists"),MoveTargetOutOfBounds:smst_1.jsx("text",null,"Move target is outside of the visible area of the screen"),ElementClickIntercepted:smst_1.jsx("text",null,"Click on the element was intercepted by another element"),unsupportedOSVersion:smst_1.jsx("fragment",null,"Unsupported OS version, please see our ",smst_1.jsx("link",{href:"https://suite.st/docs/devices/playstation/#sdk-650-or-system-software-701-or-lower"},"docs")),targetManagerUnsupportedVersion:smst_1.jsx("fragment",null,"Unsupported Target Manager Server, please see our ",smst_1.jsx("link",{href:"https://suite.st/docs/devices/playstation/#sdk-650-or-system-software-701-or-lower"},"docs")),systemOutdated:smst_1.jsx("text",null,"System software version mismatch. New version of system software is required"),noSpaceLeftOnDevice:smst_1.jsx("text",null,"App installation failed. No space left on the device."),invalidDeveloperIP:smst_1.jsx("fragment",null,"Host PC IP does not match control unit IP, please see our ",smst_1.jsx("link",{href:"https://suite.st/docs/devices/samsung-tizen/#set-up-developer-ip-on-the-target-device"},"docs"),"."),instrumentationFailedPrivilege:smst_1.jsx("text",null,"Auto-instrumentation works for app packages with public or partner privileges only. Please use manual instrumentation instead"),releaseMode:smst_1.jsx("text",null,"Device is in the Release Mode, please switch it to the Assist Mode (Debug Settings / Boot Parameters / Release Check Mode)"),unsupportedPatchPackage:smst_1.jsx("text",null,"Patch package is not supported. You need to use a fully standalone application package"),deviceLabException:smst_1.jsx("text",null,"Suitest device lab - you do not have permission for this action under the current circumstances"),longPressNotSupported:smst_1.jsx("text",null,"This device does not support long-press feature"),notSupportedApplicationType:smst_1.jsx("text",null,"Application type inside the selected configuration is not supported on the device you are connected to"),deepLinkFormatError:smst_1.jsx("text",null,"Defined deep link is not valid"),invalidCertificate:smst_1.jsx("text",null,"Invalid SSL certificate. See troubleshooting section for this platform"),authorCertificateMismatch:smst_1.jsx("text",null,"The app with the same app ID is already installed. Please uninstall the app manually or use a different app ID."),appCertificateExpired:smst_1.jsx("text",null,"Certificate in signature expired. Please create a new package"),misconfiguredDevice:smst_1.jsx("fragment",null,"In order to install an app with partner privileges, you must ",smst_1.jsx("link",{href:"https://suite.st/docs/devices/samsung-tizen/#certificates-and-privileges"},"configure your device")),invalidSignatureTamper:smst_1.jsx("text",null,"Invalid signature. Please create a new package"),invalidSignaturePartner:smst_1.jsx("text",null,"Mismatched privilege level. Use at least partner signatured certificate and create a new package"),invalidSignaturePlatform:smst_1.jsx("text",null,"Mismatched privilege level. Use at least platform signatured certificate and create a new package"),installAppFailure:smst_1.jsx("text",null,"Failed to install the app. Make sure that the Smart Hub is working correctly. Restart of the device could help"),openAppFailure:smst_1.jsx("text",null,"Failed to open the app, please try again. Restart of the device could help"),urlOverrideNotSupported:smst_1.jsx("fragment",null,"Only AppId used - the device does not support URL override. Please look into ",smst_1.jsx("link",{href:"https://suite.st/docs/application/setting-up-vidaa-apps#specify-the-application"},"our user documentation")," for more details."),devToolsNotSupported:smst_1.jsx("fragment",null,"The device has DevTools protocol disabled. Please look into ",smst_1.jsx("link",{href:"https://suite.st/docs/devices/vidaa#enable-devtools-protocol"},"our user documentation")," for more details."),deviceNotPaired:smst_1.jsx("text",null,"You need to pair the device first."),appNotFound:smst_1.jsx("text",null,"The application not found. Please make sure that you have entered a valid AppId."),rokuUpdateNeeded:smst_1.jsx("fragment",null,"The device needs to be updated manually. See ",smst_1.jsx("link",{href:"https://suite.st/docs/troubleshooting/roku/#system-update-needed"},"our user documentation")),vizioAppNotFound:smst_1.jsx("text",null,"Failed to open the application. Please make sure that the application configuration is set correctly."),osUpdateNeeded:smst_1.jsx("text",null,"The device needs to be updated manually."),skySoftCatAppMissing:smst_1.jsx("text",null,'App launch blocked, typically caused by missing entitlements or app not appearing in SoftCat. Try toggling "Force all apps launchable" from the "Settings" menu.')},translateQueryFailedResults=function(e){switch(e.message.code){case"invalidApp":return smst_1.jsx("text",null,"Wrong app ID detected");case"applicationError":return smst_1.jsx("text",null,"Application thrown unexpected error while executing command");case"missingSubject":return smst_1.jsx("text",null,"Subject does not exist");case"existingSubject":return smst_1.jsx("text",null,"Subject exists");case"orderErr":return smst_1.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 smst_1.jsx("text",null,"Suitest instrumentation library is outdated. Please download and install the newest version");case"wrongExpression":return smst_1.jsx("text",null,"Wrong expression");case"notFunction":return smst_1.jsx("text",null,"Specified code is not a function");case"psImplicitVideo":return smst_1.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 smst_1.jsx("text",null,'Exception was thrown: "',e.message.info.exception,'"');case"invalidUrl":var t=e;return smst_1.jsx("text",null,"App loaded ",t.actualValue," instead of the expected ",t.expectedValue,". Consider updating the app URL in settings");case"devToolsRequired":return smst_1.jsx("text",null,e.message.info.exception);default:var s=e.message;console.warn("queryFailed message was not handled",JSON.stringify(s))}return conditionWasNotMetMessage},translateInvalidInputError=function(e){var t=smst_1.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 smst_1.jsx("text",null,"This test command is not supported by the current app configuration");case"elementNotSupported":return smst_1.jsx("text",null,"This test command is unsupported by this element");case"wrongExpression":return t;case"wrongDirection":return smst_1.jsx("fragment",null,"Invalid direction. See ",smst_1.jsx("link",{href:"https://suite.st/docs/suitest-api/test-operations/#scroll"},"our docs")," for more information");default:var n=s.code;console.warn("invalidInput code was not handled",JSON.stringify(n))}return t},translateSyntaxError=function(e){var t,s=smst_1.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 smst_1.jsx("text",null,"Body field value is exceeding 4KB limit");case"WrongDelay":return smst_1.jsx("text",null,"Test command received invalid input. Delay value is invalid");case"wrongUrl":return smst_1.jsx("text",null,"This does not look like a valid URL");default:var n=e.message.code;console.warn("syntaxError message was not handled",JSON.stringify(n))}return s},translateQueryTimeoutError=function(e){var t=smst_1.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 smst_1.jsx("text",null,"The wait time exceeded ",String(s)," ",1===s?"second":"seconds");default:var n=e.message.code;console.warn("queryTimeout message was not handled",JSON.stringify(n))}return t},translateDeviceError=function(e){var t=e.message;return"unsupportedSelector"===t.code&&"xpathNotSupported"===t.info.reason?smst_1.jsx("text",null,"Element cannot be found, because this device does not support XPath lookups"):"deviceFailure"===t.code&&"cssSelectorInvalid"===t.info.reason?smst_1.jsx("text",null,"CSS selector is invalid"):"deviceFailure"===t.code&&"xpathNotValid"===t.info.reason?smst_1.jsx("text",null,"XPath selector is invalid"):["videoAdapterInvalidOutput","videoAdapterNotFunction","videoAdapterThrownError"].includes(t.code)?smst_1.jsx("text",null,"Video adapter error: ",t.info.reason):simpleErrorMap.internalError},translateUnsupportedButtonError=function(e){var t,s=null===(t=e.message)||void 0===t?void 0:t.info.buttonIds;return s?smst_1.jsx("text",null,"Specified buttons are not supported on this device: [",s.join(", "),"]"):smst_1.jsx("text",null,"Specified buttons are not supported on this device")},translateAbortedError=function(e){var t;return"manualActionRequired"===(null===(t=e.message)||void 0===t?void 0:t.info.reason)?smst_1.jsx("text",null,"Manual actions are not supported"):smst_1.jsx("text",null,"Test execution was aborted")},translateInvalidVariableError=function(e){var t,s,n=null!==(s=null===(t=e.args)||void 0===t?void 0:t.variables)&&void 0!==s?s:[];if(0===n.length)return smst_1.jsx("text",null,"Variable is not defined in the app configuration");var r=n.join(", ");return smst_1.jsx("text",null,1===n.length?"Variable "+r+" is":"Variables "+r+" are"," not defined in the app configuration")},translateInvalidValueError=function(e){var t;return(null===(t=e.args)||void 0===t?void 0:t.propertyName)?smst_1.jsx("text",null,"Invalid value provided for ",e.args.propertyName):smst_1.jsx("text",null,"Invalid value provided")},translateInvalidResultError=function(e){var t,s=smst_1.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 smst_1.jsx("text",null,"Response exceeded the size limit of 4KB");default:var n=e.message.code;console.warn("invalidResult code was not handled",JSON.stringify(n))}return s},translateOpenAppOverrideFailedError=function(){return smst_1.jsx("text",null,"Open app override failed")},translateInvalidReferenceError=function(e){var t="Could not start execution because";return"snippetLineNumber"in e?smst_1.jsx("text",null,t,' "Run Test" command refers to non-existing test or referred test has it\'s own references to non-existing tests'):smst_1.jsx("text",null,t,' test definition contains "Run Test" lines that refer to non-existing test')},translateADBError=function(e){return e.message&&"code"in e.message&&"certificateError"===e.message.code?smst_1.jsx("text",null,e.message.code):e.message&&"code"in e.message&&"installationRestricted"===e.message.code?smst_1.jsx("fragment",null,"Application installation is forbidden. See ",smst_1.jsx("link",{href:"https://suite.st/docs/troubleshooting/android/#application-installation-is-forbidden-on-xiaomi"},"our docs")," for more information"):e.message&&"info"in e.message?smst_1.jsx("text",null,e.message.info.reason):smst_1.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")},translateInvalidPackageError=function(e){var t,s=smst_1.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 smst_1.jsx("text",null,"An Apple TV app package cannot be launched on simulator device");case"appleTvSimPackageOnDevice":return smst_1.jsx("text",null,"An Apple TV app simulator package cannot be launched on real device");default:var n=e.message.code;return console.warn("invalidPackage code was not handled",JSON.stringify(n)),s}},translateOutdatedLibraryError=function(e){var t=smst_1.jsx("text",null,"We have detected that your instrumentation library is outdated");switch(e.message.code){case"major":return smst_1.jsx("text",null,"We have detected that your instrumentation library is outdated and the package cannot be opened. Update required");case"minor":return smst_1.jsx("text",null,"We have detected that your instrumentation library is outdated, the package can still be opened. Consider updating")}return t},translateInvalidRepositoryReference=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 "+condition_1.translateElementProperty(e.message.property);break;default:var s=e.message;console.warn("invalidRepositoryReference unknown message: ",JSON.stringify(s))}return smst_1.jsx("text",null,t)},translateNotAllowedPrivileges=function(e){return smst_1.jsx("fragment",null,"Application requires privileges not allowed on Suitest lab devices (",e.message.notAllowedPrivileges.join(", "),"). Read more in our ",smst_1.jsx("link",{href:"https://suite.st/docs/devices/device-lab"},"docs"),".")},isSimpleErrorResult=function(e){return e.errorType in simpleErrorMap},unknownErrorMessage=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."),smst_1.jsx("text",null,"Unknown error occurred")};exports.translateResultErrorMessage=function(e){if(isSimpleErrorResult(e))return simpleErrorMap[e.errorType];switch(e.errorType){case"queryFailed":return"message"in e?translateQueryFailedResults(e):conditionWasNotMetMessage;case"invalidInput":return translateInvalidInputError(e);case"syntaxError":return translateSyntaxError(e);case"queryTimeout":return translateQueryTimeoutError(e);case"deviceError":return translateDeviceError(e);case"unsupportedButton":case"illegalButton":return translateUnsupportedButtonError(e);case"aborted":return translateAbortedError(e);case"invalidVariable":return translateInvalidVariableError(e);case"invalidValue":return translateInvalidValueError(e);case"invalidResult":return translateInvalidResultError(e);case"openAppOverrideFailed":return translateOpenAppOverrideFailedError();case"invalidReference":return translateInvalidReferenceError(e);case"adbError":return translateADBError(e);case"invalidPackage":return translateInvalidPackageError(e);case"outdatedLibrary":case"outdatedLibraryConnected":return translateOutdatedLibraryError(e);case"invalidRepositoryReference":return translateInvalidRepositoryReference(e);case"notAllowedPrivileges":return translateNotAllowedPrivileges(e);default:return unknownErrorMessage(e)}};var getScreenshotUrl=function(e){return e?baseScreenshotPath+e:void 0},getInvertedResultMessage=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?conditionWasMetMessage:conditionWasNotMetMessage},getQueryLineError=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 smst_1.jsx("text",null,s)},getLineResultMessage=function(e,t){var s;if("query"===(null===(s=t)||void 0===s?void 0:s.contentType))return getQueryLineError(e,t);var n=getInvertedResultMessage(e,t);if(n)return n;if(t&&"success"!==t.result){if("excluded"===t.result)return smst_1.jsx("text",null,"Line was not executed");if("aborted"===t.result)return smst_1.jsx("text",null,"Execution was aborted.");if("runSnippet"!==e.type||t.errorType)return exports.translateResultErrorMessage(t)}};exports.translateTestLineResult=function(e){var t,s,n,r=e.lineResult,o=e.testLine,i=utils_1.getDocsLink(o);return r&&"contentType"in r&&"query"===r.contentType?smst_1.jsx("test-line-result",{status:"fail",message:getLineResultMessage(e.testLine,r),docs:i},testLine_1.translateTestLine(e)):smst_1.jsx("test-line-result",{status:null!==(s=null===(t=r)||void 0===t?void 0:t.result)&&void 0!==s?s:"success",message:getLineResultMessage(e.testLine,r),screenshot:getScreenshotUrl(null===(n=r)||void 0===n?void 0:n.screenshot),docs:i},testLine_1.translateTestLine(e))}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.translateTestLineResult=exports.translateResultErrorMessage=void 0;var smst_1=require("@suitest/smst"),testLine_1=require("./testLine"),condition_1=require("./condition"),utils_1=require("./utils"),baseScreenshotPath="https://the.suite.st",conditionWasMetMessage=smst_1.jsx("text",null,"Condition was met"),conditionWasNotMetMessage=smst_1.jsx("text",null,"Condition was not met"),simpleErrorMap={failedStart:smst_1.jsx("text",null,"Failed to open application"),appRunning:smst_1.jsx("text",null,"App is still running"),appNotRunning:smst_1.jsx("text",null,"App is not running"),missingApp:smst_1.jsx("text",null,"Application is not installed on the device"),initPlatformFailed:smst_1.jsx("text",null,"Failed to bootstrap platform on this device"),packageNotFound:smst_1.jsx("text",null,"Selected configuration does not contain an app package. Upload a package on your app`s configuration page before continuing"),missingPackage:smst_1.jsx("text",null,"Application package was not found on the target device"),internalError:smst_1.jsx("text",null,"Internal error occurred"),serverError:smst_1.jsx("text",null,"Internal error occurred"),ILInternalError:smst_1.jsx("text",null,"Internal error occurred"),invalidCredentials:smst_1.jsx("text",null,"Credentials for this device were changed"),ActionNotAvailable:smst_1.jsx("text",null,"This test command is not supported by the current app configuration"),conditionNotSatisfied:smst_1.jsx("text",null,"Maximum amount of key presses reached. Condition was not satisfied"),wrongApp:smst_1.jsx("text",null,"Wrong app ID detected"),driverException:smst_1.jsx("text",null,"Unexpected exception occurred on connected device. Please, contact support@suite.st if you see this often"),noHasLines:smst_1.jsx("text",null,"No assertion properties defined"),appCrashed:smst_1.jsx("text",null,"App seems to have crashed"),timeLimitExceeded:smst_1.jsx("text",null,"Test execution limit exceeded (based on your subscription)"),notResponding:smst_1.jsx("text",null,"Device stopped responding"),suitestifyError:smst_1.jsx("text",null,"Suitestify failed to start. Check your Suitestify settings"),suitestifyRequired:smst_1.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:smst_1.jsx("text",null,"App seems to have exited correctly but something went wrong when loading the Suitest channel autostart application"),wrongAppDetected:smst_1.jsx("text",null,"App seems to have exited correctly, however another app has been opened"),notExpectedResponse:smst_1.jsx("text",null,"Unexpected response received while polling URL"),noConnection:smst_1.jsx("text",null,"Could not connect to server while polling URL"),lateManualLaunch:smst_1.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:smst_1.jsx("text",null,"Identical scheduling aborted"),deviceIsBusy:smst_1.jsx("text",null,"Identical scheduling aborted"),notActiveDeveloperMode:smst_1.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:smst_1.jsx("text",null,"Application could not be launched. Please verify you have provided URL for this configuration"),invalidOpenAppOverrideReference:smst_1.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:smst_1.jsx("text",null,"Command executed successfully"),NoSuchElement:smst_1.jsx("text",null,"Element was not found"),NoSuchFrame:smst_1.jsx("text",null,"Cannot switch to frame"),UnknownCommand:smst_1.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:smst_1.jsx("text",null,"Element is no longer inside DOM"),ElementNotVisible:smst_1.jsx("text",null,"Element is not currently visible"),InvalidElementState:smst_1.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:smst_1.jsx("text",null,"Element is not selectable"),UnknownError:smst_1.jsx("text",null,"An unknown server-side error occurred while processing the command"),XPathLookupError:smst_1.jsx("text",null,"An error occurred while searching for an element by XPath"),Timeout:smst_1.jsx("text",null,"This command takes too long to execute"),NoSuchWindow:smst_1.jsx("text",null,"A request to switch to a different window could not be satisfied because the window could not be found"),InvalidCookieDomain:smst_1.jsx("text",null,"Cannot set a cookie on a domain different from the current page"),UnableToSetCookie:smst_1.jsx("text",null,"Cannot set the specified cookie value"),UnexpectedAlertOpen:smst_1.jsx("text",null,"A modal dialog was open, blocking this operation"),NoAlertOpenError:smst_1.jsx("text",null,"There was no modal dialog on page"),ScriptTimeout:smst_1.jsx("text",null,"A script takes too long to execute"),InvalidElementCoordinates:smst_1.jsx("text",null,"The coordinates provided to an interactions operation are invalid"),IMENotAvailable:smst_1.jsx("text",null,"IME was not available"),IMEEngineActivationFailed:smst_1.jsx("text",null,"An IME engine could not be started"),InvalidSelector:smst_1.jsx("text",null,"Element selector is malformed"),ElementNotInteractable:smst_1.jsx("text",null,"Element is not currently interactable and may not be manipulated"),JavaScriptError:smst_1.jsx("text",null,"An error occurred while executing user supplied JavaScript"),unknownWebDriverKey:smst_1.jsx("text",null,"This key is not supported on the target device"),unfocusableElement:smst_1.jsx("text",null,"Element can't receive focus to enter text"),unclickableElement:smst_1.jsx("text",null,"Element click is obstructed by different element"),deviceConnectionError:smst_1.jsx("text",null,"Failed to initialize device control"),controllerNotConnected:smst_1.jsx("text",null,"Please check that all corresponding control units are working."),appOnBackgroundError:smst_1.jsx("text",null,"Cannot process line, application is not active"),testIsNotStarted:smst_1.jsx("text",null,"Cannot continue with the current test anymore because of previous errors or bad initialization"),signInRequired:smst_1.jsx("text",null,"Account needs to be signed in on target device"),connectionNotAuthorized:smst_1.jsx("text",null,"Connection not authorized. Debug mode is not allowed on the device, please make sure it is enabled"),higherOSVersionRequired:smst_1.jsx("text",null,"The app package requires higher OS version"),appleError65:smst_1.jsx("text",null,"Failed to launch app: Apple ID account error. https://suite.st/docs/devices/apple-tv/#apple-id-account-error"),appleError70:smst_1.jsx("text",null,"Failed to launch app: Xcode error. https://suite.st/docs/devices/apple-tv/#xcode-error"),appleAppSignError:smst_1.jsx("text",null,"Failed to launch app: App code sign error. https://suite.st/docs/devices/apple-tv/#app-code-sign-error"),missingPSSDK:smst_1.jsx("text",null,"Please make sure that you have the PlayStation SDK installed"),packageInstallationFailed:smst_1.jsx("text",null,"Application installation on the device failed"),targetManagerBusy:smst_1.jsx("text",null,"Device is busy, please try again later. Open Neighborhood (PS4) or Target Manager (PS5) app for more details"),missingDotNet:smst_1.jsx("text",null,"Please make sure you have the .NET Framework installed. https://suite.st/docs/troubleshooting/playstation/#net-framework-not-installed"),bootstrapAppNotDetected:smst_1.jsx("text",null,"The Suitest bootstrap application was not detected"),activationExpired:smst_1.jsx("text",null,"Could not open the app because the DevKit/TestKit expired"),missingCpp:smst_1.jsx("text",null,"Make sure you have Microsoft Visual C++ Redistributable installed. https://suite.st/docs/devices/playstation"),outOfMemory:smst_1.jsx("text",null,"Failed to open the app. Device is out of memory, please restart the device"),networkError:smst_1.jsx("text",null,"Network request matching given conditions was not made. https://suite.st/docs/faq/surprises/#network-request-condition-never-matches"),instrumentationFailed:smst_1.jsx("text",null,"Suitest was unable to automatically insert the instrumentation library"),packageCorrupted:smst_1.jsx("text",null,"Failed to open the app. Please make sure that your app is working correctly"),unknownElementProperty:smst_1.jsx("text",null,"Unknown element property"),configuratorError:smst_1.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:smst_1.jsx("text",null,"SuitestDrive can't launch NetworkLog service on Mac"),appStoreBuild:smst_1.jsx("text",null,"Can’t install App Store distribution build"),outdatedLibraryWarning:smst_1.jsx("text",null,"We have detected that your instrumentation library is outdated, the package can still be opened. Consider updating"),cyclicReference:smst_1.jsx("text",null,"Cyclic reference detected"),ioError:smst_1.jsx("fragment",null,"Problem with storing data. Please check that there is enough disk space and that permissions are not limited. Contact ",smst_1.jsx("link",{href:"mailto:support@suite.st"},"support")," if problem persists"),netError:smst_1.jsx("fragment",null,"Downloading of the driver failed, please check your internet connection and try again later. Contact ",smst_1.jsx("link",{href:"mailto:support@suite.st"},"support")," if problem persists"),sdComponentFailed:smst_1.jsx("fragment",null,"Downloading of the driver failed, please try again later. Contact ",smst_1.jsx("link",{href:"mailto:support@suite.st"},"support")," if problem persists"),MoveTargetOutOfBounds:smst_1.jsx("text",null,"Move target is outside of the visible area of the screen"),ElementClickIntercepted:smst_1.jsx("text",null,"Click on the element was intercepted by another element"),unsupportedOSVersion:smst_1.jsx("fragment",null,"Unsupported OS version, please see our ",smst_1.jsx("link",{href:"https://suite.st/docs/devices/playstation/#sdk-650-or-system-software-701-or-lower"},"docs")),targetManagerUnsupportedVersion:smst_1.jsx("fragment",null,"Unsupported Target Manager Server, please see our ",smst_1.jsx("link",{href:"https://suite.st/docs/devices/playstation/#sdk-650-or-system-software-701-or-lower"},"docs")),systemOutdated:smst_1.jsx("text",null,"System software version mismatch. New version of system software is required"),noSpaceLeftOnDevice:smst_1.jsx("text",null,"App installation failed. No space left on the device."),invalidDeveloperIP:smst_1.jsx("fragment",null,"Host PC IP does not match control unit IP, please see our ",smst_1.jsx("link",{href:"https://suite.st/docs/devices/samsung-tizen/#set-up-developer-ip-on-the-target-device"},"docs"),"."),instrumentationFailedPrivilege:smst_1.jsx("text",null,"Auto-instrumentation works for app packages with public or partner privileges only. Please use manual instrumentation instead"),releaseMode:smst_1.jsx("text",null,"Device is in the Release Mode, please switch it to the Assist Mode (Debug Settings / Boot Parameters / Release Check Mode)"),unsupportedPatchPackage:smst_1.jsx("text",null,"Patch package is not supported. You need to use a fully standalone application package"),deviceLabException:smst_1.jsx("text",null,"Suitest device lab - you do not have permission for this action under the current circumstances"),longPressNotSupported:smst_1.jsx("text",null,"This device does not support long-press feature"),notSupportedApplicationType:smst_1.jsx("text",null,"Application type inside the selected configuration is not supported on the device you are connected to"),deepLinkFormatError:smst_1.jsx("text",null,"Defined deep link is not valid"),invalidCertificate:smst_1.jsx("text",null,"Invalid SSL certificate. See troubleshooting section for this platform"),authorCertificateMismatch:smst_1.jsx("text",null,"The app with the same app ID is already installed. Please uninstall the app manually or use a different app ID."),appCertificateExpired:smst_1.jsx("text",null,"Certificate in signature expired. Please create a new package"),misconfiguredDevice:smst_1.jsx("fragment",null,"In order to install an app with partner privileges, you must ",smst_1.jsx("link",{href:"https://suite.st/docs/devices/samsung-tizen/#certificates-and-privileges"},"configure your device")),invalidSignatureTamper:smst_1.jsx("text",null,"Invalid signature. Please create a new package"),invalidSignaturePartner:smst_1.jsx("text",null,"Mismatched privilege level. Use at least partner signatured certificate and create a new package"),invalidSignaturePlatform:smst_1.jsx("text",null,"Mismatched privilege level. Use at least platform signatured certificate and create a new package"),installAppFailure:smst_1.jsx("text",null,"Failed to install the app. Make sure that the Smart Hub is working correctly. Restart of the device could help"),openAppFailure:smst_1.jsx("text",null,"Failed to open the app, please try again. Restart of the device could help"),urlOverrideNotSupported:smst_1.jsx("fragment",null,"Only AppId used - the device does not support URL override. Please look into ",smst_1.jsx("link",{href:"https://suite.st/docs/application/setting-up-vidaa-apps#specify-the-application"},"our user documentation")," for more details."),devToolsNotSupported:smst_1.jsx("fragment",null,"The device has DevTools protocol disabled. Please look into ",smst_1.jsx("link",{href:"https://suite.st/docs/devices/vidaa#enable-devtools-protocol"},"our user documentation")," for more details."),deviceNotPaired:smst_1.jsx("text",null,"You need to pair the device first."),appNotFound:smst_1.jsx("text",null,"The application not found. Please make sure that you have entered a valid AppId."),rokuUpdateNeeded:smst_1.jsx("fragment",null,"The device needs to be updated manually. See ",smst_1.jsx("link",{href:"https://suite.st/docs/troubleshooting/roku/#system-update-needed"},"our user documentation")),vizioAppNotFound:smst_1.jsx("text",null,"Failed to open the application. Please make sure that the application configuration is set correctly."),osUpdateNeeded:smst_1.jsx("text",null,"The device needs to be updated manually."),catalogueAppMissing:smst_1.jsx("text",null,'App launch blocked, typically caused by missing entitlements or app not appearing in SoftCat. Try toggling "Force all apps launchable" from the "Settings" menu.')},translateQueryFailedResults=function(e){switch(e.message.code){case"invalidApp":return smst_1.jsx("text",null,"Wrong app ID detected");case"applicationError":return smst_1.jsx("text",null,"Application thrown unexpected error while executing command");case"missingSubject":return smst_1.jsx("text",null,"Subject does not exist");case"existingSubject":return smst_1.jsx("text",null,"Subject exists");case"orderErr":return smst_1.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 smst_1.jsx("text",null,"Suitest instrumentation library is outdated. Please download and install the newest version");case"wrongExpression":return smst_1.jsx("text",null,"Wrong expression");case"notFunction":return smst_1.jsx("text",null,"Specified code is not a function");case"psImplicitVideo":return smst_1.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 smst_1.jsx("text",null,'Exception was thrown: "',e.message.info.exception,'"');case"invalidUrl":var t=e;return smst_1.jsx("text",null,"App loaded ",t.actualValue," instead of the expected ",t.expectedValue,". Consider updating the app URL in settings");case"devToolsRequired":return smst_1.jsx("text",null,e.message.info.exception);default:var s=e.message;console.warn("queryFailed message was not handled",JSON.stringify(s))}return conditionWasNotMetMessage},translateInvalidInputError=function(e){var t=smst_1.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 smst_1.jsx("text",null,"This test command is not supported by the current app configuration");case"elementNotSupported":return smst_1.jsx("text",null,"This test command is unsupported by this element");case"wrongExpression":return t;case"wrongDirection":return smst_1.jsx("fragment",null,"Invalid direction. See ",smst_1.jsx("link",{href:"https://suite.st/docs/suitest-api/test-operations/#scroll"},"our docs")," for more information");default:var n=s.code;console.warn("invalidInput code was not handled",JSON.stringify(n))}return t},translateSyntaxError=function(e){var t,s=smst_1.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 smst_1.jsx("text",null,"Body field value is exceeding 4KB limit");case"WrongDelay":return smst_1.jsx("text",null,"Test command received invalid input. Delay value is invalid");case"wrongUrl":return smst_1.jsx("text",null,"This does not look like a valid URL");default:var n=e.message.code;console.warn("syntaxError message was not handled",JSON.stringify(n))}return s},translateQueryTimeoutError=function(e){var t=smst_1.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 smst_1.jsx("text",null,"The wait time exceeded ",String(s)," ",1===s?"second":"seconds");default:var n=e.message.code;console.warn("queryTimeout message was not handled",JSON.stringify(n))}return t},translateDeviceError=function(e){var t=e.message;return"unsupportedSelector"===t.code&&"xpathNotSupported"===t.info.reason?smst_1.jsx("text",null,"Element cannot be found, because this device does not support XPath lookups"):"deviceFailure"===t.code&&"cssSelectorInvalid"===t.info.reason?smst_1.jsx("text",null,"CSS selector is invalid"):"deviceFailure"===t.code&&"xpathNotValid"===t.info.reason?smst_1.jsx("text",null,"XPath selector is invalid"):["videoAdapterInvalidOutput","videoAdapterNotFunction","videoAdapterThrownError"].includes(t.code)?smst_1.jsx("text",null,"Video adapter error: ",t.info.reason):simpleErrorMap.internalError},translateUnsupportedButtonError=function(e){var t,s=null===(t=e.message)||void 0===t?void 0:t.info.buttonIds;return s?smst_1.jsx("text",null,"Specified buttons are not supported on this device: [",s.join(", "),"]"):smst_1.jsx("text",null,"Specified buttons are not supported on this device")},translateAbortedError=function(e){var t;return"manualActionRequired"===(null===(t=e.message)||void 0===t?void 0:t.info.reason)?smst_1.jsx("text",null,"Manual actions are not supported"):smst_1.jsx("text",null,"Test execution was aborted")},translateInvalidVariableError=function(e){var t,s,n=null!==(s=null===(t=e.args)||void 0===t?void 0:t.variables)&&void 0!==s?s:[];if(0===n.length)return smst_1.jsx("text",null,"Variable is not defined in the app configuration");var r=n.join(", ");return smst_1.jsx("text",null,1===n.length?"Variable "+r+" is":"Variables "+r+" are"," not defined in the app configuration")},translateInvalidValueError=function(e){var t;return(null===(t=e.args)||void 0===t?void 0:t.propertyName)?smst_1.jsx("text",null,"Invalid value provided for ",e.args.propertyName):smst_1.jsx("text",null,"Invalid value provided")},translateInvalidResultError=function(e){var t,s=smst_1.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 smst_1.jsx("text",null,"Response exceeded the size limit of 4KB");default:var n=e.message.code;console.warn("invalidResult code was not handled",JSON.stringify(n))}return s},translateOpenAppOverrideFailedError=function(){return smst_1.jsx("text",null,"Open app override failed")},translateInvalidReferenceError=function(e){var t="Could not start execution because";return"snippetLineNumber"in e?smst_1.jsx("text",null,t,' "Run Test" command refers to non-existing test or referred test has it\'s own references to non-existing tests'):smst_1.jsx("text",null,t,' test definition contains "Run Test" lines that refer to non-existing test')},translateADBError=function(e){return e.message&&"code"in e.message&&"certificateError"===e.message.code?smst_1.jsx("text",null,e.message.code):e.message&&"code"in e.message&&"installationRestricted"===e.message.code?smst_1.jsx("fragment",null,"Application installation is forbidden. See ",smst_1.jsx("link",{href:"https://suite.st/docs/troubleshooting/android/#application-installation-is-forbidden-on-xiaomi"},"our docs")," for more information"):e.message&&"info"in e.message?smst_1.jsx("text",null,e.message.info.reason):smst_1.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")},translateInvalidPackageError=function(e){var t,s=smst_1.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 smst_1.jsx("text",null,"An Apple TV app package cannot be launched on simulator device");case"appleTvSimPackageOnDevice":return smst_1.jsx("text",null,"An Apple TV app simulator package cannot be launched on real device");default:var n=e.message.code;return console.warn("invalidPackage code was not handled",JSON.stringify(n)),s}},translateOutdatedLibraryError=function(e){var t=smst_1.jsx("text",null,"We have detected that your instrumentation library is outdated");switch(e.message.code){case"major":return smst_1.jsx("text",null,"We have detected that your instrumentation library is outdated and the package cannot be opened. Update required");case"minor":return smst_1.jsx("text",null,"We have detected that your instrumentation library is outdated, the package can still be opened. Consider updating")}return t},translateInvalidRepositoryReference=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 "+condition_1.translateElementProperty(e.message.property);break;default:var s=e.message;console.warn("invalidRepositoryReference unknown message: ",JSON.stringify(s))}return smst_1.jsx("text",null,t)},translateNotAllowedPrivileges=function(e){return smst_1.jsx("fragment",null,"Application requires privileges not allowed on Suitest lab devices (",e.message.notAllowedPrivileges.join(", "),"). Read more in our ",smst_1.jsx("link",{href:"https://suite.st/docs/devices/device-lab"},"docs"),".")},isSimpleErrorResult=function(e){return e.errorType in simpleErrorMap},unknownErrorMessage=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."),smst_1.jsx("text",null,"Unknown error occurred")};exports.translateResultErrorMessage=function(e){if(isSimpleErrorResult(e))return simpleErrorMap[e.errorType];switch(e.errorType){case"queryFailed":return"message"in e?translateQueryFailedResults(e):conditionWasNotMetMessage;case"invalidInput":return translateInvalidInputError(e);case"syntaxError":return translateSyntaxError(e);case"queryTimeout":return translateQueryTimeoutError(e);case"deviceError":return translateDeviceError(e);case"unsupportedButton":case"illegalButton":return translateUnsupportedButtonError(e);case"aborted":return translateAbortedError(e);case"invalidVariable":return translateInvalidVariableError(e);case"invalidValue":return translateInvalidValueError(e);case"invalidResult":return translateInvalidResultError(e);case"openAppOverrideFailed":return translateOpenAppOverrideFailedError();case"invalidReference":return translateInvalidReferenceError(e);case"adbError":return translateADBError(e);case"invalidPackage":return translateInvalidPackageError(e);case"outdatedLibrary":case"outdatedLibraryConnected":return translateOutdatedLibraryError(e);case"invalidRepositoryReference":return translateInvalidRepositoryReference(e);case"notAllowedPrivileges":return translateNotAllowedPrivileges(e);default:return unknownErrorMessage(e)}};var getScreenshotUrl=function(e){return e?baseScreenshotPath+e:void 0},getInvertedResultMessage=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?conditionWasMetMessage:conditionWasNotMetMessage},getQueryLineError=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 smst_1.jsx("text",null,s)},getLineResultMessage=function(e,t){var s;if("query"===(null===(s=t)||void 0===s?void 0:s.contentType))return getQueryLineError(e,t);var n=getInvertedResultMessage(e,t);if(n)return n;if(t&&"success"!==t.result){if("excluded"===t.result)return smst_1.jsx("text",null,"Line was not executed");if("aborted"===t.result)return smst_1.jsx("text",null,"Execution was aborted.");if("runSnippet"!==e.type||t.errorType)return exports.translateResultErrorMessage(t)}};exports.translateTestLineResult=function(e){var t,s,n,r=e.lineResult,o=e.testLine,i=utils_1.getDocsLink(o);return r&&"contentType"in r&&"query"===r.contentType?smst_1.jsx("test-line-result",{status:"fail",message:getLineResultMessage(e.testLine,r),docs:i},testLine_1.translateTestLine(e)):smst_1.jsx("test-line-result",{status:null!==(s=null===(t=r)||void 0===t?void 0:t.result)&&void 0!==s?s:"success",message:getLineResultMessage(e.testLine,r),screenshot:getScreenshotUrl(null===(n=r)||void 0===n?void 0:n.screenshot),docs:i},testLine_1.translateTestLine(e))}; |
{ | ||
"name": "@suitest/translate", | ||
"version": "4.14.0", | ||
"version": "4.15.0", | ||
"description": "A module that translate Suitest server messages to human readable strings", | ||
@@ -32,3 +32,3 @@ "homepage": "https://suite.st/", | ||
"@suitest/smst": "^4.13.0", | ||
"@suitest/types": "^4.14.0" | ||
"@suitest/types": "^4.15.0" | ||
}, | ||
@@ -39,3 +39,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "6064fc9425b6510056447dcebf7356a4db3e7c0b" | ||
"gitHead": "b3ad27a81aaf8ebd1a84edc9a925fc2a479b0aa4" | ||
} |
97085
Updated@suitest/types@^4.15.0