Skip to content

Commit

Permalink
test: E2E tests require supported iOS version
Browse files Browse the repository at this point in the history
Appium 1 does not support newer versions of iOS. This improves automatic
simulator selection logic to avoid loading incompatible iOS simulators
and provide helpful error messages during compatibility failures.

This logic can be removed or simplified once we upgrade to Appium 2.
  • Loading branch information
dcalhoun committed Sep 23, 2023
1 parent a46a5d9 commit 2079f26
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/react-native-editor/__device-tests__/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ const getIOSPlatformVersions = () => {
childProcess.execSync( 'xcrun simctl list runtimes --json' ).toString()
);

return runtimes
.reverse()
.filter(
( { name, isAvailable } ) => name.startsWith( 'iOS' ) && isAvailable
);
return runtimes.reverse().filter(
( { name, isAvailable, version } ) =>
name.startsWith( 'iOS' ) &&
/15(\.\d+)+/.test( version ) && // Appium 1 does not support newer iOS versions
isAvailable
);
};

// Initialises the driver and desired capabilities for appium.
Expand Down Expand Up @@ -122,7 +123,7 @@ const setupDriver = async () => {
const iosPlatformVersions = getIOSPlatformVersions();
if ( iosPlatformVersions.length === 0 ) {
throw new Error(
'No iOS simulators available! Please verify that you have iOS simulators installed.'
'No compatible iOS simulators available! Please verify that you have iOS 15 simulators installed.'
);
}
// eslint-disable-next-line no-console
Expand Down

0 comments on commit 2079f26

Please sign in to comment.