Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(tests): end to end testing again #11428

Draft
wants to merge 31 commits into
base: main
Choose a base branch
from
Draft

Conversation

brainbicycle
Copy link
Contributor

This PR resolves []

Description

PR Checklist

  • I have tested my changes on iOS and Android.
  • I hid my changes behind a feature flag, or they don't need one.
  • I have included screenshots or videos, or I have not changed the UI.
  • I have added tests, or my changes don't require any.
  • I added an app state migration, or my changes do not require one.
  • I have documented any follow-up work that this PR will require, or it does not require any.
  • I have added a changelog entry below, or my changes do not require one.

To the reviewers 👀

  • I would like at least one of the reviewers to run this PR on the simulator or device.
Changelog updates

Changelog updates

Cross-platform user-facing changes

iOS user-facing changes

Android user-facing changes

Dev changes

Need help with something? Have a look at our docs, or get in touch with us.

@brainbicycle brainbicycle self-assigned this Jan 22, 2025
@brainbicycle brainbicycle marked this pull request as draft January 22, 2025 14:41
@artsy-peril
Copy link
Contributor

artsy-peril bot commented Jan 24, 2025

react-native-launch-arguments

Author: iamolegga

Description: React Native module for getting launch arguments

Homepage: https://github.com/iamolegga/react-native-launch-arguments#readme

Createdover 4 years ago
Last Updated1 day ago
LicenseMIT
Maintainers1
Releases20
Keywordsreact, native, react-native, launch and arguments
README

react-native-launch-arguments

React Native module to get launch arguments.

Makes passing parameters from testing libraries and debugs tools to
react-native super easy.

Install

npm i react-native-launch-arguments
cd ios && pod install && cd ..

Usage

In you code

Javascript

import { LaunchArguments } from "react-native-launch-arguments";
LaunchArguments.value();

Typescript

import { LaunchArguments } from "react-native-launch-arguments";
interface MyExpectedArgs {
  authToken?: string;
  skipAuth?: boolean;
}
LaunchArguments.value<MyExpectedArgs>();

Integrating with End-to-end testing tools and debuggers

The intended use is with end-to-end tools like Detox.

Detox

Appium

Maestro

XCode

  • XCode Launch Args
  • In XCode add launch arguments on the "Arguments" tab in the "Run" section of the Scheme editor:
    • Product -> Scheme -> Edit Scheme... -> Run -> Arguments tab -> Arguments Passed On Launch
    • Set each arg witha preceding -.
    • For example if you want to set arg hello to "world" to receive a LaunchArgs instance of{ "hello":"world" }, you would enter the following into the entry space for the arg:
    -hello "world"
    

Platform-specific Notes

iOS

It takes data from [[NSProcessInfo processInfo] arguments]

Verifying install on iPhone simulator

You can use xcrun to boot your app on the simulator.

The following command-line will load your app on the booted iOS simulator. Just
replace com.MyAppBundleId with your Bundle Identifier, and the params with
your params.

xcrun simctl launch booted com.MyAppBundleId -noParams -param "hello"

Android

It takes data from currentActivity.getIntent().getBundleExtra("launchArgs") for detox and intent.getExtras() for ADB params

Caveats on Android

React-Native

Due to React Native issue #37518, on Android, the module force-waits for the Android activity to reach the RESUMED state, before moving foward with native-modules initialization completion. While commonly the wait is scarce (the activity is already in the resumed state at this point), until the RN issue is fixed, the module may introduce delays in app loading time in some edge cases.

Expo

There is know expo bug with empty passed arguments.

New dependencies added: react-native-launch-arguments.

Generated by 🚫 dangerJS against 4ebaf9f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant