Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mobile] - Update E2E config to support an iPad simulator #50528

Merged
merged 3 commits into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions packages/react-native-editor/__device-tests__/helpers/caps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 ) {
Expand Down