Follow the React Native development environment setup guide.
One needs to authenticate with our private Package Registry in order to access its packages. To do so create a private access token with the api
scope. Then run the following commands after replacing <your_access_token>
with your private access token:
npm config set @ilt-pse:registry https://gitlab-ext.iosb.fraunhofer.de/api/v4/projects/2563/packages/npm/
npm config set '//gitlab-ext.iosb.fraunhofer.de/api/v4/projects/2563/packages/npm/:_authToken' "<your_access_token>"
- Clone the repository
- Run
npm i
inside thereskueapp
folder
- Enter the
reskueapp
folder - Start an Android emulator / Connect an Android device
- Run
npm run start
(keep it running) - Run
npm run android
...are automatically run by CI.
You can also manually run these test with npm run test
.
The test files are located in the __tests__
directory.
The test coverage of Unit/Integration/Compontent tests can be obtained
by running npm run coverage
.
A pretty HTML based coverage report will be generated.
It can be viewed by opening coverage/lcov-report/index.html
in your favourite webbroweser.
End-to-end (e2e) tests are not automatically run by CI. This is due to their non-trivial setup, speed and them being more prone to flakiness.
- Run the RESKUE Backend in production mode
- Have
admin
andhelper
users with password1234
- Have a Pixel 3a Android R Emulator with the name
Pixel_3a_API_30_x86
. (alternatively add a new configuration to.detoxrc.json
) - Keep
npm run start
running in a terminal - Build a debug test version of the app with
npm run e2e-build-debug
- Run the tests with
npm run e2e-test-debug
NOTE: The .detoxrc.json
file contains platform specific build instructions for testable Android builds. These instructions are executed by npm run e2e-build-debug
and currently Linux specific. Detox doesn't provide a way to make these instructions multi-platform. One might want to add extra Detox configurations for different Platforms such as Windows or MacOS.
The RESKUE app supports multiple configuration environment via react-native-config. Environments are configured using .env
files. Variables placed in .env
files are accessable from JavaScript, native Android and native iOS files.
By default the .env
environment for local development with a locally running backend is used. Other environemnts such as the staging environment (.env.staging
) can be used by setting a ENVFILE
environment variable. For instance use the following command to run the Android app using the staging environment: ENVFILE=.env.staging npx react-native run-android
(Linux).
- Make sure the Apps backeground service is started. This can be done by starting the app once or restarting your device.
- Try resetting the Apps cache from the Android device settings. The app caches the ID of the last shown notification. If the backends database was reset (eg. for development reasons), the app might think the notification was already shown.
- Note that notifcations are not pushed to the sending user.
- Note that expected receivers must be in the adressed group.
Perform the following in order:
- Stop running
npm run start
processes (if any) - Run
npm install
- Run
npx react-native start --reset-cache
(same asnpm run start
but resets cache) - Run
npm run android
Take a look at the "Note" below the Detox setup instructions.