Install Rocket Chat meteor app by following this guide.
1.2. Set up detox
Install dependencies by following this guide (only Step 1).
2. Prepare test data
Run Rocket Chat meteor app: meteor npm start (make sure you to run this command from project that you created on Step 1.1.).
Open localhost:3000 in browser.
Sign up as admin.
Create public room detox-public.
Create user with role: user, username: detoxrn, email: YOUR@EMAIL.COM, password: 123.
Create user with role: user, username: YOUR.NAME, email: YOUR.SECOND@EMAIL.COM, password: 123.
In file e2e/data.js change values existingEmail with YOUR.SECOND@EMAIL.COM, existingName with YOUR.NAME.
Login as user detoxrn -> open My Account -> Settings tab -> click Enable 2FA -> copy TTOLP code -> paste TTOLP code into ./e2e/data.js file into field: alternateUserTOTPSecret.
3. Running tests
3.1. iOS
Build app with detox: detox build -c ios.sim.release
Open Simulator which is used in tests (check in package.json under detox section) from Xcode and make sure that software keyboard is being displayed. To toggle keyboard press cmd+K.
Run tests: detox test -c ios.sim.release
3.1. Android
Build app with detox: detox build -c android.emu.debug
Run: react-native start
Run Android emulator with name ANDROID_API_28 via Android studio or cd /Users/USERNAME/Library/Android/sdk/emulator/ && ./emulator -avd ANDROID_API_28
Note: if you need to run tests on different Android emulator then simply change emulator name in ./package.json detox configurations