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

[expo-dev-menu][expo-dev-launcher] Disable onboarding popup with URL query param #19024

Merged
merged 4 commits into from
Sep 14, 2022

Conversation

douglowder
Copy link
Contributor

@douglowder douglowder commented Sep 7, 2022

Why

The onboarding popup breaks some UI tests (e.g. Detox), so there should be an easy way to disable it without having to rebuild the app.

How

Add code to check for disableOnboarding in the URL and set DevMenuPreferences.isOnboardingFinished=true before the app launches.

Additionally, if testing in Detox, you can pass in a launch param to disable the onboarding popup in iOS (but not in Android) as in this example:

        await device.launchApp({
          newInstance: true,
          launchArgs: {
            EXDevMenuIsOnboardingFinished: true,
          },
        });

Test Plan

Tested by passing in a URL like http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&disableOnboarding=1 in the dev launcher.

Checklist

@linear
Copy link

linear bot commented Sep 7, 2022

ENG-5957 Make a user facing API to disable the intro pop up

as this gets in the way of testing, and the current mechanism was built for Snack and is not user friendly

Document as well

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Sep 7, 2022
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Sep 8, 2022
@douglowder douglowder force-pushed the doug/eng-5957-make-a-user-facing-api-to-disable-the branch from 5dc8218 to 0ecc284 Compare September 13, 2022 23:39
@douglowder douglowder force-pushed the doug/eng-5957-make-a-user-facing-api-to-disable-the branch from 0ecc284 to faaa4b7 Compare September 14, 2022 07:50
Copy link
Contributor

@ajsmth ajsmth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Personally I think it makes more sense to have a separate flag for disabled rather than turning off isOnboardingFinished in this case, but I don't think it makes much of a difference.

Is there some instructions / plans for documentation around this? I'm not 100% familiar with detox configurations, it might be nice to add some info around this

@@ -84,8 +84,10 @@ public class DevMenuPreferences: NSObject, RCTBridgeModule {

/**
Returns `true` only if the user finished onboarding, `false` otherwise.
This is now public because expo-dev-launcher needs access
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This is now public because expo-dev-launcher needs access
This is public because expo-dev-launcher needs access

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajsmth I am actively working on the docs for this -- had a discussion with @brentvatne yesterday and we are attempting to figure out exactly where this should be in the docs ("Development Builds" and/or "EAS E2E tests").

I'll go ahead and land this and create a separate PR for the doc changes.

@douglowder douglowder merged commit bd5e19b into main Sep 14, 2022
@douglowder douglowder deleted the doug/eng-5957-make-a-user-facing-api-to-disable-the branch September 14, 2022 18:24
lukmccall pushed a commit that referenced this pull request Sep 16, 2022
…query param (#19024)

Add code to check for `disableOnboarding` in the URL and set `DevMenuPreferences.isOnboardingFinished=true` before the app launches.

Additionally, if testing in Detox, you can pass in a launch param to disable the onboarding popup in iOS (but not in Android). Made this change in the `apps/bare-expo` Detox tests.
Ddv0623 pushed a commit to preciofishbone/expo that referenced this pull request Sep 26, 2022
…query param (expo#19024)

Add code to check for `disableOnboarding` in the URL and set `DevMenuPreferences.isOnboardingFinished=true` before the app launches.

Additionally, if testing in Detox, you can pass in a launch param to disable the onboarding popup in iOS (but not in Android). Made this change in the `apps/bare-expo` Detox tests.
@pradeipp
Copy link

Hi @douglowder I saw your description and was wondering - will this change not work on android?

@douglowder
Copy link
Contributor Author

@pradeipp this change works correctly on Android. The issue with Android is just with Detox testing, and is still under investigation.

@pradeipp
Copy link

great, thank you @douglowder is there an issue for it that I can follow?

@douglowder
Copy link
Contributor Author

expo/eas-tests-example#4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: passed checks ExpoBot has nothing to complain about
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants