-
-
Notifications
You must be signed in to change notification settings - Fork 597
chore(e2e): detox config general cleanup and ios management #3412
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
Changes from all commits
8cc9c45
fe083d3
18d4c8f
44a73b6
12d4b57
03d413b
ab2b235
8fe0271
3fbdad3
eec4e70
3f5ee0d
9000905
77e2519
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,3 +64,5 @@ android/.settings | |
| # Local environment (direnv) | ||
| .envrc | ||
|
|
||
| # e2e | ||
| *Example/artifacts | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| const utils = require('../scripts/detox-utils.cjs'); | ||
| const utils = require('../scripts/e2e/detox-utils.cjs'); | ||
| module.exports = utils.commonDetoxConfigFactory('ScreensExample'); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| const utils = require('../scripts/detox-utils.cjs'); | ||
| const utils = require('../scripts/e2e/detox-utils.cjs'); | ||
| module.exports = utils.commonDetoxConfigFactory('FabricExample'); | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| const DEFAULT_APPLE_DEVICE = 'iPhone 17'; | ||
| const DEFAULT_IOS_VERSION = 'iOS 26.2'; | ||
|
|
||
| /** | ||
| * @return {string} | ||
| */ | ||
| function getAppleDevice() { | ||
| const envVariableKey = 'RNS_E2E_APPLE_SIM_NAME'; | ||
| const passedDevice = process.env[envVariableKey]; | ||
| if (passedDevice) { | ||
| if (/^(iPhone|iPad)\s.+/.test(passedDevice)) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: I haven't made up my mind, but we'll have a rather fixed number of checks; therefore, I'm wondering if |
||
| return passedDevice; | ||
| } else { | ||
| throw new Error(`Environment variable ${envVariableKey} should be "iPhone xyz" or "iPad xyz".`); | ||
| } | ||
| } | ||
| return process.env.RNS_E2E_APPLE_SIM_NAME || DEFAULT_APPLE_DEVICE; | ||
t0maboro marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| /** | ||
| * @return {`iOS ${string}`} requested version of ios, or default if not specified | ||
| */ | ||
| function getIOSVersion() { | ||
| const envVariableKey = 'RNS_E2E_IOS_VERSION'; | ||
| const passedVersion = process.env[envVariableKey]; | ||
| if (passedVersion) { | ||
| if (/^(iOS)\s.+/.test(passedVersion)) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: I haven't made up my mind, but we'll have a rather fixed number of checks; therefore, I'm wondering if |
||
| return /** @type {`iOS ${string}`} */ (passedVersion); | ||
| } else { | ||
| throw new Error(`Environment variable ${envVariableKey} should be "iOS xyz".`); | ||
| } | ||
| } | ||
| return DEFAULT_IOS_VERSION; | ||
| } | ||
|
|
||
| /** | ||
| * @typedef {Object} AppleDevice - represents Detox's config for an Apple device | ||
| * @property {string} type - a string which represents a model of an iPhone | ||
| * @property {`iOS ${string}`} os - operation system version | ||
| */ | ||
|
|
||
| /** | ||
| * @satisfies {AppleDevice} | ||
| * @readonly | ||
| * */ | ||
| const iosDevice = { | ||
| type: getAppleDevice(), | ||
| os: getIOSVersion(), | ||
| }; | ||
|
|
||
| module.exports = { | ||
| iosDevice, | ||
| }; | ||
Uh oh!
There was an error while loading. Please reload this page.