From 15e4719410bb506a7cf07c2951ca8f6126c6f288 Mon Sep 17 00:00:00 2001 From: Gerardo Date: Wed, 10 May 2023 18:10:05 +0200 Subject: [PATCH 1/2] Mobile - Update E2E config to support an iPad simulator --- .../__device-tests__/helpers/caps.js | 14 ++++++++------ .../__device-tests__/helpers/utils.js | 5 +++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/react-native-editor/__device-tests__/helpers/caps.js b/packages/react-native-editor/__device-tests__/helpers/caps.js index bc776eb8aba20..b9e6f61bd445a 100644 --- a/packages/react-native-editor/__device-tests__/helpers/caps.js +++ b/packages/react-native-editor/__device-tests__/helpers/caps.js @@ -11,18 +11,20 @@ const ios = { }, }; -exports.iosLocal = { +exports.iosLocal = ( { iPadDevice = false } ) => ( { ...ios, - deviceName: 'iPhone 13', + deviceName: ! iPadDevice ? 'iPhone 13' : 'iPad Pro (9.7-inch)', wdaLaunchTimeout: 240000, usePrebuiltWDA: true, -}; +} ); -exports.iosServer = { +exports.iosServer = ( { iPadDevice = false } ) => ( { ...ios, platformVersion: '15.4', // Supported Sauce Labs platforms can be found here: https://saucelabs.com/rest/v1/info/platforms/appium - deviceName: 'iPhone 13 Simulator', -}; + deviceName: ! iPadDevice + ? 'iPhone 13 Simulator' + : 'iPad Pro (9.7 inch) Simulator', +} ); exports.android = { browserName: '', diff --git a/packages/react-native-editor/__device-tests__/helpers/utils.js b/packages/react-native-editor/__device-tests__/helpers/utils.js index 3c08eb381b1fd..8203b56195e89 100644 --- a/packages/react-native-editor/__device-tests__/helpers/utils.js +++ b/packages/react-native-editor/__device-tests__/helpers/utils.js @@ -16,6 +16,7 @@ const AppiumLocal = require( './appium-local' ); // Platform setup. const defaultPlatform = 'android'; const rnPlatform = process.env.TEST_RN_PLATFORM || defaultPlatform; +const iPadDevice = process.env.IPAD; // Environment setup, local environment or Sauce Labs. const defaultEnvironment = 'local'; @@ -115,10 +116,10 @@ const setupDriver = async () => { desiredCaps.app = `sauce-storage:Gutenberg-${ safeBranchName }.apk`; // App should be preloaded to sauce storage, this can also be a URL. } } else { - desiredCaps = { ...iosServer }; + desiredCaps = { ...iosServer( { iPadDevice } ) }; desiredCaps.app = `sauce-storage:Gutenberg-${ safeBranchName }.app.zip`; // App should be preloaded to sauce storage, this can also be a URL. if ( isLocalEnvironment() ) { - desiredCaps = { ...iosLocal }; + desiredCaps = { ...iosLocal( { iPadDevice } ) }; const iosPlatformVersions = getIOSPlatformVersions(); if ( iosPlatformVersions.length === 0 ) { From 535548f267b1caeedea276f6400944033526cc87 Mon Sep 17 00:00:00 2001 From: Gerardo Date: Fri, 12 May 2023 12:36:40 +0200 Subject: [PATCH 2/2] Mobile - E2E utils - Update code to not add an extra object spread --- .../react-native-editor/__device-tests__/helpers/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native-editor/__device-tests__/helpers/utils.js b/packages/react-native-editor/__device-tests__/helpers/utils.js index 8203b56195e89..4591cd4176d25 100644 --- a/packages/react-native-editor/__device-tests__/helpers/utils.js +++ b/packages/react-native-editor/__device-tests__/helpers/utils.js @@ -116,10 +116,10 @@ const setupDriver = async () => { desiredCaps.app = `sauce-storage:Gutenberg-${ safeBranchName }.apk`; // App should be preloaded to sauce storage, this can also be a URL. } } else { - desiredCaps = { ...iosServer( { iPadDevice } ) }; + desiredCaps = iosServer( { iPadDevice } ); desiredCaps.app = `sauce-storage:Gutenberg-${ safeBranchName }.app.zip`; // App should be preloaded to sauce storage, this can also be a URL. if ( isLocalEnvironment() ) { - desiredCaps = { ...iosLocal( { iPadDevice } ) }; + desiredCaps = iosLocal( { iPadDevice } ); const iosPlatformVersions = getIOSPlatformVersions(); if ( iosPlatformVersions.length === 0 ) {