Skip to content

[E2E] Add Detox tests#4182

Open
m-bert wants to merge 112 commits into
mainfrom
@mbert/e2e
Open

[E2E] Add Detox tests#4182
m-bert wants to merge 112 commits into
mainfrom
@mbert/e2e

Conversation

@m-bert
Copy link
Copy Markdown
Collaborator

@m-bert m-bert commented May 19, 2026

Huge thanks to @relextm19 for investigating this problem and helping with setup ❤️

Description

This PR adds Detox E2E tests to our example app. Sources for examples are placed in common-app/e2e_screens, tests are located in expo-example/e2e. This PR adds only one simple test for Pan gesture, more tests will be added in the follow-ups.

Tests are also run on CI when pushing to main or modifying e2e sources mentioned above.

Since our example app uses expo prebuilds, e2e setup requires additional script on android that will configure app for tests.

Important

You may need to adjust device name in .detoxrc.js file.

Running E2E

This PR also adds few yarn scripts:

  • yarn build-detox-android (also runs preparation script for android)
  • yarn build-detox-ios
  • yarn build-detox (combines both of the above)

To run tests you can use the following command:

  • yarn detox test -c ios.sim.release <test>
  • yarn detox test -c android.emu.release <test>

yarn test:ios and yarn test:android are added, in the future they'll run all tests. For now they just run Pan test.

Note

For now I've only tested release build, but other configurations are left to be checked

Test plan

Well well well...

yarn build-detox
yarn test:ios
yarn test:android

Comment thread package.json
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Needed because yarn suddenly stopped hoisting react-native

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Changed to match root

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Note that I've tested only release configuration. I'll leave the other to be tested later

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 24 changed files in this pull request and generated 9 comments.

Comment thread apps/expo-example/setup-detox-android.js Outdated
Comment on lines +68 to +72
description: 'androidTestImplementation for Detox',
find: ` if (hermesEnabled.toBoolean()) {`,
replace: ` androidTestImplementation('com.wix:detox:+')

if (hermesEnabled.toBoolean()) {`,
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I don't think we have to do this for now

Comment on lines +158 to +164
'<?xml version="1.0" encoding="utf-8"?>',
'<network-security-config>',
' <domain-config cleartextTrafficPermitted="true">',
' <domain includeSubdomains="true">10.0.2.2</domain>',
' <domain includeSubdomains="true">localhost</domain>',
' </domain-config>',
'</network-security-config>',
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This one comes from detox docs

Also, this is for tests

Comment thread apps/common-app/src/e2e_screens/gestures/pan.tsx Outdated
Comment thread apps/expo-example/e2e/__tests__/pan.test.ts Outdated
Comment thread apps/common-app/package.json
Comment thread apps/macos-example/package.json Outdated
Comment thread apps/expo-example/package.json Outdated
Comment thread .github/workflows/e2e.yml Outdated
@m-bert m-bert marked this pull request as ready for review May 22, 2026 10:23
@m-bert m-bert requested a review from j-piasecki May 22, 2026 10:23
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.

3 participants