···11+# Remove this test when the old onboarding is deprecated
22+appId: xyz.blueskyweb.app
33+---
44+- runScript:
55+ file: ../setupServer.js
66+ env:
77+ SERVER_PATH: "?users"
88+- runFlow:
99+ file: ../setupApp.yml
1010+- tapOn:
1111+ id: "e2eSignInAlice"
1212+- tapOn:
1313+ id: "e2eStartLongboarding"
1414+- tapOn: "Continue to next step"
1515+- tapOn: "Continue to the next step without following any accounts"
1616+- tapOn: Show replies in Following feed
1717+- tapOn: Show quote-posts in Following feed
1818+- tapOn: Show re-posts in Following feed
1919+- tapOn: Show replies in Following feed
2020+- waitForAnimationToEnd
2121+- tapOn: Continue to next step
2222+- waitForAnimationToEnd
2323+- tapOn: "Continue to the next step"
2424+- waitForAnimationToEnd
2525+- tapOn: Continue to next step
2626+- waitForAnimationToEnd
2727+- tapOn: Continue to next step
2828+- waitForAnimationToEnd
2929+- tapOn: "Complete onboarding and start using your account"
3030+- waitForAnimationToEnd
3131+- assertVisible: Following
+22
src/lib/statsig/statsig.tsx
···130130 return gate
131131}
132132133133+/**
134134+ * Debugging tool to override a gate. USE ONLY IN E2E TESTS!
135135+ */
136136+export function useDangerousSetGate(): (
137137+ gateName: Gate,
138138+ value: boolean,
139139+) => void {
140140+ const cache = React.useContext(GateCache)
141141+ if (!cache) {
142142+ throw Error(
143143+ 'useDangerousSetGate() cannot be called outside StatsigProvider.',
144144+ )
145145+ }
146146+ const dangerousSetGate = React.useCallback(
147147+ (gateName: Gate, value: boolean) => {
148148+ cache.set(gateName, value)
149149+ },
150150+ [cache],
151151+ )
152152+ return dangerousSetGate
153153+}
154154+133155function toStatsigUser(did: string | undefined): StatsigUser {
134156 let userID: string | undefined
135157 if (did) {
+18-1
src/view/com/testing/TestCtrls.e2e.tsx
···22import {LogBox, Pressable, View} from 'react-native'
33import {useQueryClient} from '@tanstack/react-query'
4455+import {useDangerousSetGate} from '#/lib/statsig/statsig'
56import {useModalControls} from '#/state/modals'
67import {useSessionApi} from '#/state/session'
78import {useLoggedOutViewControls} from '#/state/shell/logged-out'
···2425 const {openModal} = useModalControls()
2526 const onboardingDispatch = useOnboardingDispatch()
2627 const {setShowLoggedOut} = useLoggedOutViewControls()
2828+ const setGate = useDangerousSetGate()
2729 const onPressSignInAlice = async () => {
2830 await login(
2931 {
···108110 />
109111 <Pressable
110112 testID="e2eStartOnboarding"
111111- onPress={() => onboardingDispatch({type: 'start'})}
113113+ onPress={() => {
114114+ // TODO remove when experiment is over
115115+ setGate('reduced_onboarding_and_home_algo', true)
116116+ onboardingDispatch({type: 'start'})
117117+ }}
118118+ accessibilityRole="button"
119119+ style={BTN}
120120+ />
121121+ {/* TODO remove this entire control when experiment is over */}
122122+ <Pressable
123123+ testID="e2eStartLongboarding"
124124+ onPress={() => {
125125+ // TODO remove when experiment is over
126126+ setGate('reduced_onboarding_and_home_algo', false)
127127+ onboardingDispatch({type: 'start'})
128128+ }}
112129 accessibilityRole="button"
113130 style={BTN}
114131 />