0.0.20 • Published 3 years ago

storybook-components v0.0.20

Weekly downloads
5
License
UNLICENSED
Repository
-
Last release
3 years ago

env:

Create a .env.development file in the root directory and fill it with data using the .env.example template. Without this, APIs will not go through, neither will pusher notifications.

Android:

  • Don't forget to create a local.properties file inside the "android" directory. The file should contain the following:

    sdk.dir = /YOUR/PATH/TO/Android/sdk
  • Don't forget to create a keystore.properties file inside the "android" directory. The file should contain the following:

    /YOUR/PATH/TO/Android/keystore.properties.example

You will also need to have keystore.properties within /android. For this you can use the file named keystore.properties.example no new values are needed:

cp android/keysore.properties.example android/keystore.properties

ios:

cd ios && pod install

Running:

Make sure you have your android emulator(s) running:

PATH=$PATH:/path/to/Android/sdk/platform-tools && yarn run android:dev && yarn run ios:dev

Testing:

Testing has multiple parts:

  1. You have to run the app server (Metro bundler) like you usually would. Run it for the platforms you're going to test (or develop) on. Check Running Section above.
  2. Building the app: ONLY IF you're going to test it on emulators different from the ones you have running.
  3. Testing: here you choose the test device, and whether you want to test a debug or a release version of the app.
  • Android:

-Building: If you're going to build and test on a Pixel_2_API_26, run the test script below without the --device-name option. Feel free to replace debug with release:

    yarn run test-android:build-debug --device-name YOUR_EMULATOR_NAME

How to figure out the names of the emulators you have installed?

~/Library/Android/Sdk/tools/bin/avdmanager list avd

This is on Mac, find the path to the avdmanager and replace accordingly if you're on Windows I'm judging you.

-Testing:

You need to precede the test script with the path to your sdk as in the script below. If your emulator is a Pixel_2_API_26, run the test script below without the --device-name option. Feel free to replace debug with release:

ANDROID_SDK_ROOT=~/Library/Android/sdk/ yarn run test:android-debug --device-name YOUR_DEVICE_NAME

This is on Mac, find the path to the Android/sdk and replace accordingly if you're on Windows I'm judging you.

*Refer to building section above to learn how to find emulators' names.

  • iOS:

-Building: If your going to build and test on an iPhone 11, run the following without the --device-name option. Feel free to replace debug with release:

    yarn run test-ios:build-debug --device-name "SIMULATOR NAME"

How to figure out the names of the simulators you have installed?

instruments -s devices

-Testing:

If your going to build and test on an iPhone 11, run the following without the --device-name option. Replace debug with release if needed:

yarn run test:ios-debug --device-name "SIMULATOR NAME"

*Refer to building section above to learn how to find simulators' names.

General Notes For Both Platforms:

  • To test only one file, make sure to add that file's name before any other option on the command line.
  • The --watch and --watchAll options are useful if you want to adjust your tests in real time.
  • If the app is already built on the device, just add the --reuse flag to your test run so the app does not get re-installed. The test will run faster. This shouldn't be used in the CI config, do this locally only!
  • I like to add the --take-screenshots failing option to the script. In case the test fails, it will take a screenshot and store it in a folder called artifacts in the root directory (overridable) in the test config (in package.json).
  • The test looks as if it failed to run sometimes when it actually has finished with one or more of the tests failing. If you see something along the lines of the error below, scroll up to see if there were any tests that failed (you should find an 'x' followed by the name of the test):
detox[27017] ERROR: [cli.js] Error: Command failed: node_modules/.bin/jest --config ./e2e/jest.config.js '--testNamePattern=^((?!:ios:).)*$' --maxWorkers 1 "e2e"

      This error usually happens on android

  • if you get the following error, it means you're using a very old simulator like an iPhone 5, (detox doesn't support old devices that use the 32-bit architecture):
The request was denied by service delegate (SBMainWorkspace) for reason: Unspecified
@apollo/client@react-native-community/async-storage@react-native-community/datetimepicker@react-native-community/hooks@react-native-community/masked-view@react-native-community/netinfo@react-native-firebase/analytics@react-native-firebase/app@react-native-firebase/crashlytics@react-native-firebase/messaging@react-native-firebase/perf@react-native-firebase/remote-config@terrylinla/react-native-sketch-canvas@types/color@types/events@types/glob@types/minimatch@types/node@types/react-i18next@types/react-native-material-dropdown@types/react-native-shareappcenterappcenter-analyticsappcenter-crashescolorcomma-numberdate-fnsgraphqli18nextimmutablejwt-decodelodash.capitalizelodash.groupbypatch-packagereactreact-i18nextreact-nativereact-native-animatablereact-native-bootsplashreact-native-camerareact-native-chart-kitreact-native-clireact-native-code-pushreact-native-configreact-native-country-picker-modalreact-native-dropdown-autocompletereact-native-geolocation-servicereact-native-gesture-handlerreact-native-image-pickerreact-native-image-resizerreact-native-localizereact-native-material-dropdownreact-native-permissionsreact-native-phone-inputreact-native-picker-selectreact-native-qrcode-scannerreact-native-qrcode-svgreact-native-radio-buttonreact-native-reanimatedreact-native-safe-area-contextreact-native-screensreact-native-segmented-control-tabreact-native-sharereact-native-smooth-pincode-inputreact-native-smooth-sliderreact-native-svgreact-native-table-componentreact-native-videoreact-native-video-controlsreact-native-view-shotreact-navigationreact-navigation-stackreact-navigation-tabsreact-reduxreduxredux-immutableredux-thunkreselectvictory-native
0.0.20

3 years ago