Skip to content

Commit

Permalink
Fix help messages for iOS errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
garg3133 committed Apr 17, 2024
1 parent d183d2a commit e572188
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/utils/mobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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
Expand All @@ -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)) {
Expand Down

0 comments on commit e572188

Please sign in to comment.