From 94d74c125673eb849bc8b55bc145b76cfe30bb5e Mon Sep 17 00:00:00 2001 From: Priyansh Garg Date: Wed, 17 Apr 2024 21:19:08 +0530 Subject: [PATCH] Fix command to run during iOS errors. (#4189) --- lib/utils/mobile.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/utils/mobile.js b/lib/utils/mobile.js index b019fa2fce..9d2a662114 100644 --- a/lib/utils/mobile.js +++ b/lib/utils/mobile.js @@ -172,7 +172,7 @@ class RealIosDeviceIdError extends Error { `Pass ${Logger.colors.green('deviceId')} in the command (for e.g : ${Logger.colors.cyan('--deviceId 00008030-00024C2C3453402E')})`, `Or pass ${Logger.colors.green('safari:deviceUDID')} capability in config`, `To verify the deviceId run, ${Logger.colors.cyan('system_profiler SPUSBDataType | sed -n \'/iPhone/,/Serial/p\' | grep \'Serial Number:\' | awk -F \': \' \'{print $2}')}`, - `For more help, run: ${Logger.colors.cyan('npx run @nightwatch/mobile-helper ios')}\n` + `For more help, run: ${Logger.colors.cyan('npx @nightwatch/mobile-helper ios')}\n` ]; this.stack = false; } @@ -275,7 +275,7 @@ class IosSessionNotCreatedError extends Error { // 'The session timed out while connecting to a Safari instance.' help = [ 'Re-run the test command', - `If it doesn't work, try running: ${Logger.colors.cyan('npx run @nightwatch/mobile-helper ios')}` + `If it doesn't work, try running: ${Logger.colors.cyan('npx @nightwatch/mobile-helper ios')}` ]; } else if (this.message.includes('not find any session hosts') || this.message.includes('Some devices were found')) { // Could not find any session hosts that match the requested capabilities @@ -284,21 +284,21 @@ class IosSessionNotCreatedError extends Error { help = [ `Run command to get device list: ${Logger.colors.cyan('xcrun simctl list devices')}`, `Update the ${Logger.colors.cyan('safari:platformVersion')} and/or ${Logger.colors.cyan('safari:platforName')} in Nightwatch configuration accordingly`, - `If it doesn't work, try running: ${Logger.colors.cyan('npx run @nightwatch/mobile-helper ios')}` + `If it doesn't work, try running: ${Logger.colors.cyan('npx @nightwatch/mobile-helper ios')}` ]; } else { help = [ `Make sure you have passed correct ${Logger.colors.green('deviceId')} in the command (for e.g : ${Logger.colors.cyan('--deviceId 00008030-00024C2C3453402E')})`, `Or pass ${Logger.colors.green('safari:deviceUDID')} capability in config`, `To verify the deviceId run, ${Logger.colors.cyan('system_profiler SPUSBDataType | sed -n \'/iPhone/,/Serial/p\' | grep \'Serial Number:\' | awk -F \': \' \'{print $2}')}`, - `For more help, run: ${Logger.colors.cyan('npx run @nightwatch/mobile-helper ios')}\n` + `For more help, run: ${Logger.colors.cyan('npx @nightwatch/mobile-helper ios')}\n` ]; } } else if (this.desiredCapabilities['safari:deviceUDID']) { help = [ `Verify the UDID of the device set in Nightwatch configuration (look for ${Logger.colors.cyan('safari:deviceUDID')} capability) or pass the correct UDID using ${Logger.colors.cyan('--deviceId')} flag in the test command.`, 'Re-run the test command', - `If it doesn't work, try running: ${Logger.colors.cyan('npx run @nightwatch/mobile-helper ios')}` + `If it doesn't work, try running: ${Logger.colors.cyan('npx @nightwatch/mobile-helper ios')}` ]; if (isRealIos(this.desiredCapabilities)) {