get onboarding e2e tests working
This commit is contained in:
@@ -30,13 +30,14 @@ appId: xyz.blueskyweb.app
|
|||||||
- assertVisible: "What are your interests?"
|
- assertVisible: "What are your interests?"
|
||||||
- tapOn:
|
- tapOn:
|
||||||
id: "onboardingContinue"
|
id: "onboardingContinue"
|
||||||
- tapOn:
|
- assertVisible: "Suggested for you"
|
||||||
id: "onboardingContinue"
|
# mock server doesn't have suggestions api
|
||||||
- tapOn:
|
- tapOn: "Skip to next step"
|
||||||
id: "onboardingContinue"
|
- swipe:
|
||||||
- tapOn:
|
direction: "LEFT"
|
||||||
id: "onboardingContinue"
|
- swipe:
|
||||||
- assertVisible: "You're ready to go!"
|
direction: "LEFT"
|
||||||
|
- assertVisible: "Complete onboarding and start using your account"
|
||||||
- tapOn:
|
- tapOn:
|
||||||
id: "onboardingFinish"
|
id: "onboardingFinish"
|
||||||
- tapOn:
|
- tapOn:
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ appId: xyz.blueskyweb.app
|
|||||||
id: "e2eStartOnboarding"
|
id: "e2eStartOnboarding"
|
||||||
- tapOn: "Select an avatar"
|
- tapOn: "Select an avatar"
|
||||||
- waitForAnimationToEnd
|
- waitForAnimationToEnd
|
||||||
- assertVisible: "Search your library…"
|
- assertVisible: "Photos"
|
||||||
|
- assertVisible: "Collections"
|
||||||
- tapOn:
|
- tapOn:
|
||||||
point: "50%,22%"
|
point: "50%,22%"
|
||||||
- waitForAnimationToEnd
|
- waitForAnimationToEnd
|
||||||
@@ -27,7 +28,14 @@ appId: xyz.blueskyweb.app
|
|||||||
- assertVisible: "What are your interests?"
|
- assertVisible: "What are your interests?"
|
||||||
- tapOn:
|
- tapOn:
|
||||||
id: "onboardingContinue"
|
id: "onboardingContinue"
|
||||||
- assertVisible: "You're ready to go!"
|
- assertVisible: "Suggested for you"
|
||||||
|
# mock server doesn't have suggestions api
|
||||||
|
- tapOn: "Skip to next step"
|
||||||
|
- swipe:
|
||||||
|
direction: "LEFT"
|
||||||
|
- swipe:
|
||||||
|
direction: "LEFT"
|
||||||
|
- assertVisible: "Complete onboarding and start using your account"
|
||||||
- tapOn:
|
- tapOn:
|
||||||
id: "onboardingFinish"
|
id: "onboardingFinish"
|
||||||
- tapOn:
|
- tapOn:
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
appId: xyz.blueskyweb.app
|
appId: xyz.blueskyweb.app
|
||||||
---
|
---
|
||||||
- launchApp:
|
- launchApp:
|
||||||
appId: "xyz.blueskyweb.app"
|
appId: "xyz.blueskyweb.app"
|
||||||
clearState: true
|
clearState: true
|
||||||
- waitForAnimationToEnd
|
- waitForAnimationToEnd
|
||||||
- tapOn: "http://localhost:8081"
|
- tapOn: "http://localhost:8081"
|
||||||
- waitForAnimationToEnd
|
- waitForAnimationToEnd
|
||||||
- extendedWaitUntil:
|
- extendedWaitUntil:
|
||||||
visible: "Continue"
|
visible: "Continue"
|
||||||
- swipe:
|
- swipe:
|
||||||
from: "Bluesky"
|
from: "Bluesky"
|
||||||
direction: DOWN
|
direction: DOWN
|
||||||
|
duration: 100
|
||||||
- tapOn:
|
- tapOn:
|
||||||
id: e2eProxyHeaderInput
|
id: e2eProxyHeaderInput
|
||||||
- inputText: ${output.result}
|
- inputText: ${output.result}
|
||||||
- pressKey: Enter
|
- pressKey: Enter
|
||||||
- hideKeyboard
|
|
||||||
|
|||||||
+1
-1
@@ -75,7 +75,7 @@ After you do `yarn ios` and `yarn android` once, you can later just run `yarn we
|
|||||||
|
|
||||||
- Start in various console tabs:
|
- Start in various console tabs:
|
||||||
- `yarn e2e:mock-server`
|
- `yarn e2e:mock-server`
|
||||||
- `yarn e2e:metro`
|
- `yarn e2e:start`
|
||||||
- Run once: `yarn e2e:build`
|
- Run once: `yarn e2e:build`
|
||||||
- Each test run: `yarn e2e:run`
|
- Each test run: `yarn e2e:run`
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ values.
|
|||||||
### Running Maestro tests
|
### Running Maestro tests
|
||||||
|
|
||||||
- In one tab, run `yarn e2e:mock-server`
|
- In one tab, run `yarn e2e:mock-server`
|
||||||
- In a second tab, run `yarn e2e:metro`
|
- In a second tab, run `yarn e2e:build`
|
||||||
- In a third tab, run `yarn e2e:run`
|
- In a third tab, run `yarn e2e:run`
|
||||||
|
|
||||||
## Using Flashlight for Performance Testing
|
## Using Flashlight for Performance Testing
|
||||||
|
|||||||
+3
-2
@@ -46,8 +46,9 @@
|
|||||||
"lint-native:fix": "swiftlint --fix ./modules && ktlint --format ./modules",
|
"lint-native:fix": "swiftlint --fix ./modules && ktlint --format ./modules",
|
||||||
"typecheck": "tsc --project ./tsconfig.check.json",
|
"typecheck": "tsc --project ./tsconfig.check.json",
|
||||||
"e2e:mock-server": "NODE_ENV=development ./jest/dev-infra/with-test-redis-and-db.sh ts-node --project tsconfig.e2e.json __e2e__/mock-server.ts",
|
"e2e:mock-server": "NODE_ENV=development ./jest/dev-infra/with-test-redis-and-db.sh ts-node --project tsconfig.e2e.json __e2e__/mock-server.ts",
|
||||||
"e2e:metro": "EXPO_PUBLIC_ENV=e2e NODE_ENV=test RN_SRC_EXT=e2e.ts,e2e.tsx expo run:ios",
|
"e2e:build": "EXPO_PUBLIC_ENV=e2e NODE_ENV=test RN_SRC_EXT=e2e.ts,e2e.tsx expo run:ios",
|
||||||
"e2e:metro-android": "EXPO_PUBLIC_ENV=e2e NODE_ENV=test RN_SRC_EXT=e2e.ts,e2e.tsx expo run:android",
|
"e2e:build-android": "EXPO_PUBLIC_ENV=e2e NODE_ENV=test RN_SRC_EXT=e2e.ts,e2e.tsx expo run:android",
|
||||||
|
"e2e:start": "EXPO_PUBLIC_ENV=e2e NODE_ENV=test RN_SRC_EXT=e2e.ts,e2e.tsx expo start",
|
||||||
"e2e:run": "maestro test __e2e__",
|
"e2e:run": "maestro test __e2e__",
|
||||||
"perf:test": "NODE_ENV=test maestro test",
|
"perf:test": "NODE_ENV=test maestro test",
|
||||||
"perf:test:run": "NODE_ENV=test maestro test __e2e__/perf-test.yml",
|
"perf:test:run": "NODE_ENV=test maestro test __e2e__/perf-test.yml",
|
||||||
|
|||||||
@@ -330,6 +330,7 @@ function ValueProposition({
|
|||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
<Button
|
<Button
|
||||||
|
testID="onboardingFinish"
|
||||||
disabled={saving}
|
disabled={saving}
|
||||||
key={state.activeStep} // remove focus state on nav
|
key={state.activeStep} // remove focus state on nav
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import {useCallback, useContext, useMemo, useState} from 'react'
|
import {useContext, useMemo, useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type ModerationOpts} from '@atproto/api'
|
import {type ModerationOpts} from '@atproto/api'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
@@ -15,7 +15,6 @@ import {updateProfileShadow} from '#/state/cache/profile-shadow'
|
|||||||
import {useLanguagePrefs} from '#/state/preferences'
|
import {useLanguagePrefs} from '#/state/preferences'
|
||||||
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||||
import {useAgent, useSession} from '#/state/session'
|
import {useAgent, useSession} from '#/state/session'
|
||||||
import {useOnboardingDispatch} from '#/state/shell'
|
|
||||||
import {OnboardingControls} from '#/screens/Onboarding/Layout'
|
import {OnboardingControls} from '#/screens/Onboarding/Layout'
|
||||||
import {Context} from '#/screens/Onboarding/state'
|
import {Context} from '#/screens/Onboarding/state'
|
||||||
import {useSuggestedUsers} from '#/screens/Search/util/useSuggestedUsers'
|
import {useSuggestedUsers} from '#/screens/Search/util/useSuggestedUsers'
|
||||||
@@ -42,7 +41,6 @@ export function StepSuggestedAccounts() {
|
|||||||
const queryClient = useQueryClient()
|
const queryClient = useQueryClient()
|
||||||
|
|
||||||
const {state, dispatch} = useContext(Context)
|
const {state, dispatch} = useContext(Context)
|
||||||
const onboardDispatch = useOnboardingDispatch()
|
|
||||||
|
|
||||||
const [selectedInterest, setSelectedInterest] = useState<string | null>(null)
|
const [selectedInterest, setSelectedInterest] = useState<string | null>(null)
|
||||||
// keeping track of who was followed via the follow all button
|
// keeping track of who was followed via the follow all button
|
||||||
@@ -77,11 +75,6 @@ export function StepSuggestedAccounts() {
|
|||||||
const isEmpty =
|
const isEmpty =
|
||||||
!isLoading && suggestedUsers && suggestedUsers.actors.length === 0
|
!isLoading && suggestedUsers && suggestedUsers.actors.length === 0
|
||||||
|
|
||||||
const skipOnboarding = useCallback(() => {
|
|
||||||
onboardDispatch({type: 'finish'})
|
|
||||||
dispatch({type: 'finish'})
|
|
||||||
}, [onboardDispatch, dispatch])
|
|
||||||
|
|
||||||
const followableDids =
|
const followableDids =
|
||||||
suggestedUsers?.actors
|
suggestedUsers?.actors
|
||||||
.filter(
|
.filter(
|
||||||
@@ -223,8 +216,8 @@ export function StepSuggestedAccounts() {
|
|||||||
<Button
|
<Button
|
||||||
color="secondary"
|
color="secondary"
|
||||||
size="large"
|
size="large"
|
||||||
label={_(msg`Skip this flow`)}
|
label={_(msg`Skip to next step`)}
|
||||||
onPress={skipOnboarding}>
|
onPress={() => dispatch({type: 'next'})}>
|
||||||
<ButtonText>
|
<ButtonText>
|
||||||
<Trans>Skip</Trans>
|
<Trans>Skip</Trans>
|
||||||
</ButtonText>
|
</ButtonText>
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import {useCallback, useContext} from 'react'
|
import {useContext} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||||
import {useOnboardingSuggestedStarterPacksQuery} from '#/state/queries/useOnboardingSuggestedStarterPacksQuery'
|
import {useOnboardingSuggestedStarterPacksQuery} from '#/state/queries/useOnboardingSuggestedStarterPacksQuery'
|
||||||
import {useOnboardingDispatch} from '#/state/shell'
|
|
||||||
import {OnboardingControls} from '#/screens/Onboarding/Layout'
|
import {OnboardingControls} from '#/screens/Onboarding/Layout'
|
||||||
import {Context} from '#/screens/Onboarding/state'
|
import {Context} from '#/screens/Onboarding/state'
|
||||||
import {atoms as a, useBreakpoints} from '#/alf'
|
import {atoms as a, useBreakpoints} from '#/alf'
|
||||||
@@ -22,12 +21,11 @@ export function StepSuggestedStarterpacks() {
|
|||||||
const moderationOpts = useModerationOpts()
|
const moderationOpts = useModerationOpts()
|
||||||
|
|
||||||
const {state, dispatch} = useContext(Context)
|
const {state, dispatch} = useContext(Context)
|
||||||
const onboardDispatch = useOnboardingDispatch()
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: suggestedStarterPacks,
|
data: suggestedStarterPacks,
|
||||||
isLoading,
|
isLoading,
|
||||||
error,
|
isError,
|
||||||
isRefetching,
|
isRefetching,
|
||||||
refetch,
|
refetch,
|
||||||
} = useOnboardingSuggestedStarterPacksQuery({
|
} = useOnboardingSuggestedStarterPacksQuery({
|
||||||
@@ -35,13 +33,6 @@ export function StepSuggestedStarterpacks() {
|
|||||||
overrideInterests: state.interestsStepResults.selectedInterests,
|
overrideInterests: state.interestsStepResults.selectedInterests,
|
||||||
})
|
})
|
||||||
|
|
||||||
const isError = !!error
|
|
||||||
|
|
||||||
const skipOnboarding = useCallback(() => {
|
|
||||||
onboardDispatch({type: 'finish'})
|
|
||||||
dispatch({type: 'finish'})
|
|
||||||
}, [onboardDispatch, dispatch])
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={[a.align_start]} testID="onboardingInterests">
|
<View style={[a.align_start]} testID="onboardingInterests">
|
||||||
<Text style={[a.font_bold, a.text_3xl]}>
|
<Text style={[a.font_bold, a.text_3xl]}>
|
||||||
@@ -105,8 +96,8 @@ export function StepSuggestedStarterpacks() {
|
|||||||
<Button
|
<Button
|
||||||
color="secondary"
|
color="secondary"
|
||||||
size="large"
|
size="large"
|
||||||
label={_(msg`Skip this flow`)}
|
label={_(msg`Skip to next step`)}
|
||||||
onPress={skipOnboarding}>
|
onPress={() => dispatch({type: 'next'})}>
|
||||||
<ButtonText>
|
<ButtonText>
|
||||||
<Trans>Skip</Trans>
|
<Trans>Skip</Trans>
|
||||||
</ButtonText>
|
</ButtonText>
|
||||||
|
|||||||
Reference in New Issue
Block a user