Files
react-native/packages/rn-tester-e2e/e2e-config.js
T
Nicola Corti 45cf6ee7c9 Bump Android compile-sdk to 34 (#38987)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38987

As now we do have the buildTools version 34 in the docker container,
I'm bumping compileSdkVersion for all the targets to 34.

I'm also cleaning up the `test_windows` setup as it had old references
of NDK 20, build tools 33 and was installing the Android SDK but not
actually using it.

Changelog:
[Android] [Changed] - Bump Android compile-sdk to 34

Reviewed By: cipolleschi

Differential Revision: D48311828

fbshipit-source-id: c5b1d20a6183b577fba520af95b33e7656477101
2023-08-15 03:13:35 -07:00

62 lines
1.6 KiB
JavaScript

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
const path = require('path');
type Capabilities = {
platformName: 'Android' | 'iOS',
'appium:platformVersion': string,
'appium:deviceName': string,
'appium:app': string,
'appium:automationName': 'UiAutomator2' | 'XCUITest',
'appium:newCommandTimeout'?: number,
};
let capabilities: Capabilities;
const android = {
platformName: 'Android',
'appium:platformVersion': '14.0',
'appium:deviceName': 'Android Emulator',
'appium:app': path.join(process.cwd(), '/apps/rn-tester.apk'),
'appium:automationName': 'UiAutomator2',
'appium:newCommandTimeout': 240,
};
const ios = {
platformName: 'iOS',
'appium:platformVersion': '16.4',
'appium:deviceName': 'iPhone 14',
'appium:automationName': 'XCUITest',
'appium:app': path.join(process.cwd(), '/apps/rn-tester.app'),
};
// check that E2E_DEVICE exists, is a string and its either "ios" or "android"
if (!process.env.E2E_DEVICE) {
throw new Error('E2E_DEVICE environment variable is not defined');
} else if (typeof process.env.E2E_DEVICE !== 'string') {
throw new Error('E2E_DEVICE environment variable is not a string');
} else if (
process.env.E2E_DEVICE !== 'ios' &&
process.env.E2E_DEVICE !== 'android'
) {
throw new Error('E2E_DEVICE environment variable is not "ios" or "android"');
}
if (process.env.E2E_DEVICE === 'android') {
capabilities = android;
}
if (process.env.E2E_DEVICE === 'ios') {
capabilities = ios;
}
export default capabilities;