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

chore: Add Detox e2e tests for RN SDK. #376

Merged
merged 33 commits into from
Feb 23, 2024
Merged

Conversation

yusinto
Copy link
Contributor

@yusinto yusinto commented Feb 9, 2024

Runs e2e tests for iOS. Android will follow in a separate PR. Only contains basic eval and variation tests right now.

Simulator_Screenshot_-iPhone_Xs-_2024-02-12_at_14_04_12

Copy link

This pull request has been linked to Shortcut Story #228487: Detox in CI.

@yusinto yusinto marked this pull request as draft February 9, 2024 19:48
Comment on lines +19 to +20
"detox-build-ios": "detox build -c ios.sim.release",
"detox-run-ios": "detox test -c ios.sim.release --cleanup --headless",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use release builds for e2e tests instead of debug builds.

@@ -12,11 +17,5 @@ yarn expo-prebuild
echo "===== Delete .xcode.env.local"
rm -rf ./ios/.xcode.env.local

echo "===== Start metro in background"
yarn start &

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metro no longer needed in release builds when running e2e.

Comment on lines +31 to +33
<ScrollView style={{ flexGrow: 0.2, backgroundColor: 'black', maxHeight: 200 }}>
<Text style={{ color: 'orange' }}>Logging: {JSON.stringify(context, null, 2)}</Text>
</ScrollView>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace Text with a ScrollView so ui elements don't shift when the json string gets displayed. The shitfing affects UI elements positioning and hence tapping/clicking fails.

},
"packageManager": "[email protected]",
"installConfig": {
"hoistingLimits": "workspaces"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Force example app to use its own copies of deps, except for @launchdarkly/* deps. Without this, different versions of the a package like event-target-shim will conflict and result in cryptic metro compilation errors.

@yusinto yusinto marked this pull request as ready for review February 20, 2024 07:24
@yusinto yusinto enabled auto-merge (squash) February 20, 2024 15:20
@yusinto
Copy link
Contributor Author

yusinto commented Feb 20, 2024

@kinyoklion @louis-launchdarkly This also fixes the RN SDK example app which is broken right now because of conflicting monorepo versions of event-target-shim. See my comments here.

@yusinto yusinto requested a review from tanderson-ld February 23, 2024 18:26
@yusinto yusinto merged commit eba7284 into main Feb 23, 2024
17 checks passed
@yusinto yusinto deleted the yus/sc-228487/detox-in-ci branch February 23, 2024 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants