From 9b477cd63ec58c7f97b90abe7c408e902b5fe89e Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Mon, 9 Dec 2024 15:35:40 -0500 Subject: [PATCH] ci: Catch and log driver setup errors --- .../__device-tests__/helpers/utils.js | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/packages/react-native-editor/__device-tests__/helpers/utils.js b/packages/react-native-editor/__device-tests__/helpers/utils.js index 101b2bd7bbfb6b..63d3e019c50c00 100644 --- a/packages/react-native-editor/__device-tests__/helpers/utils.js +++ b/packages/react-native-editor/__device-tests__/helpers/utils.js @@ -170,17 +170,24 @@ const setupDriver = async () => { ? serverConfigs.local : serverConfigs.sauce; - const driver = await remote( { - ...serverConfig, - logLevel: 'error', - // Mitigate driver setup instability by doubling the default timeout - connectionRetryTimeout: 240000, - capabilities: { - platformName: PLATFORM_NAME, - ...prefixKeysWithAppium( desiredCaps ), - ...sauceOptionsConfig, - }, - } ); + let driver; + try { + driver = await remote( { + ...serverConfig, + logLevel: 'error', + // Mitigate driver setup instability by doubling the default timeout + connectionRetryTimeout: 240000, + capabilities: { + platformName: PLATFORM_NAME, + ...prefixKeysWithAppium( desiredCaps ), + ...sauceOptionsConfig, + }, + } ); + } catch ( error ) { + // eslint-disable-next-line no-console + console.error( 'Error setting up the driver:', error ); + throw error; + } await driver.setOrientation( 'PORTRAIT' ); return driver;