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 & BrowserStack CI #808

Draft
wants to merge 34 commits into
base: develop
Choose a base branch
from

Conversation

gmaclennan
Copy link
Member

This adds e2e tests using Detox, plus CI integration with BrowserStack for running tests on real devices.

Unfortunately, right now it's not possible to run the app with any permissions (camera and location) enabled in BrowserStack testing. When testing locally, Detox installs the APK via adb install -g. The -g argument causes the app to be installed with all the permissions already enabled. When running Detox tests on BrowserStack, BrowserStack uses their own mechanism to install the APK, and does not expose an ADB connection.

Using Detox tests, there is no way to respond to a permission dialog in tests, because Detox uses gray box testing.

As a temporary fix, this PR introduces a EXPO_PUBLIC_IS_E2E environment variable, which is set when building for detox. If this variable is set, then the app does not ask for permissions.

This means that all components in the app will be in the "no permissions granted" state.

@gmaclennan gmaclennan self-assigned this Oct 29, 2024
gmaclennan and others added 25 commits October 29, 2024 21:20
… behavior in detoxrc to work on github workflow.
… NDK (Native Development Kit) required by the react-native-mmkv module for native code compilation.
@cimigree
Copy link
Contributor

Instructions:

  1. Need to add some env variables ... talk to Cindy or Gregor about that.
  2. in terminal type npm run test:e2e
  3. You will be given the prompt ?Rebuild app -- choose yes the first time by using the cursor and hit return
  4. You will be given the prompt ? Rebuild beackend -- choose yes the first time by using the cursor and hit return
  5. ? Run tests locally or in the cloud? -- choose cloud with the down cursor and hit enter
  6. You will be given a list of devices. Use the cursor to scroll down, the space key to make a selection (your choice) and then hit enter
  7. The cli will do its thing. It will take quite a while. Your terminal should look like this afterwards
  8. At this point I cannot add you to Browserstack because of our plan, but I am sure you will be able to be added soon!
    Screenshot 2024-11-13 at 5 37 57 PM

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