mattermost-mobile/detox
Jesse Hallam e3e4fe245c
Fix direct message screen showing deactivated accounts (#8795)
* Fix direct message screen showing deactivated accounts

Fixes MM-63374. The create direct message screen was showing deactivated accounts in the user list. Fixed by:
1. Setting allow_inactive: false in userSearchFunction when searching profiles
2. Setting active: true in userFetchFunction when fetching profiles
3. Added a test to verify that deactivated users don't appear in the search results

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix test for deactivated users in DM creation screen

Updated the test to properly handle quotation marks that differ between CI and local environments.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-04-25 10:22:41 -03:00
..
android_emulator fix(e2e): use AOSP Android emulator for Detox test (#7440) 2023-07-10 10:30:36 -04:00
e2e Fix direct message screen showing deactivated accounts (#8795) 2025-04-25 10:22:41 -03:00
utils E2E feature schedule posts (#8709) 2025-04-23 12:10:37 +05:30
.babelrc Barebones code for v2 2020-11-17 14:20:58 -03:00
.detoxrc.json E2E feature schedule posts (#8709) 2025-04-23 12:10:37 +05:30
create_android_emulator.sh E2E feature schedule posts (#8709) 2025-04-23 12:10:37 +05:30
inject-detox-settings.js E2E feature schedule posts (#8709) 2025-04-23 12:10:37 +05:30
package-lock.json E2E feature schedule posts (#8709) 2025-04-23 12:10:37 +05:30
package.json E2E feature schedule posts (#8709) 2025-04-23 12:10:37 +05:30
README.md E2E feature schedule posts (#8709) 2025-04-23 12:10:37 +05:30
save_report.js E2E feature schedule posts (#8709) 2025-04-23 12:10:37 +05:30
tsconfig.json Detox/E2E: Migrate e2e javascript to typescript (#6059) 2022-03-17 17:35:26 -07:00
webhook_server.js Detox/E2E: Migrate e2e javascript to typescript (#6059) 2022-03-17 17:35:26 -07:00

How to Run Detox Tests

This guide will help you set up and run Detox tests for your project.

Install Dependencies

First, navigate to the root directory of your project and install the necessary dependencies by running:

npm install

navigate to the detox folder and run npm install

Android

Build Detox Android App

To build the Detox Android app, navigate to the detox folder and run:

npm run e2e:android-inject-settings

npm run e2e:android-build

The debug apk will be built and available at android/app/build/outputs/apk/debug/app-debug.apk

Run Detox Android Tests

Create emulator

./create_android_emulator.sh SDK_VERSION AVD_NAME

# example ./create_android_emulator.sh 34 pixel_5a_avd
# example ./create_android_emulator.sh 34 pixel_5a_avd --headless
# If we want to see the emulator logs. Run it in debug mode example ./create_android_emulator.sh 34 pixel_5a_avd --debug

To execute the Detox tests on Android, navigate to the detox folder and run:

npm run e2e:android-test

# To run a particular tests

npm run e2e:android-test <path to test file>

iOS

Build iOS Simulator

To build the iOS simulator for Detox, navigate to the detox folder and run:

npm run e2e:ios-build

This will build the Simulor .zip file at the root folder.

Create a folder named mobile-artifacts at the project root. Unzip the zip file and move the mattermost app under mobile-artifacts.

# From project root
mkdir mobile-artifacts

Run iOS Tests

To execute the Detox tests on iOS, navigate to the detox folder and run:

npm run e2e:ios-test

# To run a particular tests

npm run e2e:android-test path to test file.

TIP : For iOS, you can download the simulator from ~Mobile: Test build or ~Release: Mobile Apps channel in the community.

Results

The Local Runs generate artifacts under detox/artifacts/ios-debug-** or detox/artifacts/android-debug-**. You can see the html report, failure screenshot under that folder.