mattermost-mobile/detox
Felipe Martin f50056f57b
MM-65085: Support Pre Shared Password on server connect (#9082)
* feat: add shared server password to server setup

* feat: allow editing the sever

* refactor: changed password -> secret, styling and tests

* e2e: draft e2e tests

* chore: lint fix

* feat: also send preauth secret header when using native share

* fix: removed unused server database migration

credentials are being stored in the keychain

* i18n: added missing english translations

* test(e2e): simplified connection tests

* test(e2e): rework

* refactor: remove setBearerToken

* chore: restore migrations the way it was

* chore: reverted file to original state

* chore: removed unneeded test and renamed password to secret

* chore: function version

* chore: updated forms i18n keys

* chore: remove if from test

* chore: unneeded variable

* fix: add missing key on object list

* refactor: swift keychain access to retrieve all credentials in one call

* revert: edit server screen

* refactor: credentials use getGenericCredential

* fix: objc code calling old method

* fix: added scroll to login screen

* chore: variable names

* fix: avoid inline styles

* fix: Improved appVersion positioning

* Update app/screens/server/form.tsx

Co-authored-by: Matthew Birtch <mattbirtch@gmail.com>

* feat: show error message on 403

* Revert "feat: show error message on 403"

This reverts commit f41630c767e10211adf1885321ceefd8a0931e32.

---------

Co-authored-by: Matthew Birtch <mattbirtch@gmail.com>
2025-09-01 11:24:15 +02:00
..
android_emulator fix(e2e): use AOSP Android emulator for Detox test (#7440) 2023-07-10 10:30:36 -04:00
e2e MM-65085: Support Pre Shared Password on server connect (#9082) 2025-09-01 11:24:15 +02: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 Secure Files and preview PDF inline (#8844) 2025-06-19 15:30:56 +08:00
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.