get e2e tests working on Android

This commit is contained in:
Samuel Newman
2026-03-04 14:23:05 +02:00
parent a0ce96fb2d
commit a698990c73
7 changed files with 42 additions and 18 deletions
+5
View File
@@ -15,6 +15,11 @@ appId: xyz.blueskyweb.app
- tapOn:
id: "customServerTextInput"
- inputText: "http://localhost:3000"
- runFlow:
when:
platform: Android
commands:
- hideKeyboard
- tapOn: "Done"
- tapOn:
id: "loginUsernameInput"
+18 -4
View File
@@ -5,13 +5,27 @@ appId: xyz.blueskyweb.app
clearState: true
arguments:
"-EXDevMenuIsOnboardingFinished": true
- openLink: "exp+bluesky://expo-development-client/?url=http%3A%2F%2Flocalhost%3A8081"
- runFlow:
when:
visible: 'Open in "Bluesky"'
platform: iOS
commands:
- tapOn: Open
- waitForAnimationToEnd
- openLink: "exp+bluesky://expo-development-client/?url=http%3A%2F%2Flocalhost%3A8081"
- runFlow:
when:
visible: 'Open in "Bluesky"'
commands:
- tapOn: Open
- runFlow:
when:
platform: Android
commands:
- tapOn: 'http://localhost:8081'
- runFlow:
label: "Dismiss Expo dev menu"
when:
visible: "Continue"
commands:
- back
- tapOn:
id: e2eProxyHeaderInput
- inputText: ${output.result}
+8
View File
@@ -9,6 +9,14 @@ values.
2. You can write Maestro tests in `/.maestro/flows/` directory by creating a new `.yml` file or by modifying an existing one.
3. You can also use [Maestro Studio](https://maestro.mobile.dev/getting-started/maestro-studio) which automatically generates commands by recording your actions on the app. Therefore, you can create realistic tests without having to manually write any code. Use the `maestro studio` command to start recording your actions.
### Running on Android
You will need to allow your device access to the port that the mock server is running on.
```
adb reverse tcp:3000 tcp:3000
```
### Running Maestro tests
- In one tab, run `yarn e2e:mock-server`
+1 -1
View File
@@ -85,7 +85,7 @@
"@braintree/sanitize-url": "^6.0.2",
"@bsky.app/alf": "^0.1.7",
"@bsky.app/expo-image-crop-tool": "^0.5.0",
"@bsky.app/expo-translate-text": "^0.2.4",
"@bsky.app/expo-translate-text": "^0.2.7",
"@bsky.app/react-native-mmkv": "2.12.5",
"@discord/bottom-sheet": "bluesky-social/react-native-bottom-sheet",
"@emoji-mart/data": "^1.2.1",
+1
View File
@@ -57,6 +57,7 @@ export function LoggedOut({onDismiss}: {onDismiss?: () => void}) {
const agent = useAgent()
useEffect(() => {
const actors = accounts.map(acc => acc.did)
if (actors.length === 0) return
void queryClient.prefetchQuery({
queryKey: profilesQueryKey(actors),
staleTime: STALE.MINUTES.FIVE,
+5 -9
View File
@@ -25,6 +25,7 @@ export function TestCtrls() {
const onboardingDispatch = useOnboardingDispatch()
const {setShowLoggedOut} = useLoggedOutViewControls()
const onPressSignInAlice = async () => {
console.info('[E2E] Signing in as Alice')
await login(
{
service: 'http://localhost:3000',
@@ -36,6 +37,7 @@ export function TestCtrls() {
setShowLoggedOut(false)
}
const onPressSignInBob = async () => {
console.info('[E2E] Signing in as Bob')
await login(
{
service: 'http://localhost:3000',
@@ -54,6 +56,9 @@ export function TestCtrls() {
accessibilityHint="Enter proxy header"
testID="e2eProxyHeaderInput"
onChangeText={val => setProxyHeader(val as any)}
autoComplete="off"
autoCorrect={false}
autoCapitalize="none"
onSubmitEditing={() => {
const header = `${proxyHeader}#bsky_appview`
BLUESKY_PROXY_HEADER.set(header)
@@ -135,15 +140,6 @@ export function TestCtrls() {
accessibilityRole="button"
style={BTN}
/>
{/* TODO remove this entire control when experiment is over */}
<Pressable
testID="e2eStartLongboarding"
onPress={() => {
onboardingDispatch({type: 'start'})
}}
accessibilityRole="button"
style={BTN}
/>
</View>
)
}
+4 -4
View File
@@ -3731,10 +3731,10 @@
resolved "https://registry.yarnpkg.com/@bsky.app/expo-image-crop-tool/-/expo-image-crop-tool-0.5.0.tgz#4308fbde5c15e6be9122601797bc3d9549c95e31"
integrity sha512-gmhQr2HWTRFyPO00fn5OmtiEVtikXusHMrN5Zoq26pu1VZX3zVE+aoc668etTqrvsQcm2Qu8fo96k5F3Wu+6wg==
"@bsky.app/expo-translate-text@^0.2.4":
version "0.2.4"
resolved "https://registry.yarnpkg.com/@bsky.app/expo-translate-text/-/expo-translate-text-0.2.4.tgz#6e7f20f286111ee4d550c0c84f57393fc215a675"
integrity sha512-7mvFggNfkJEufI5A3WnjfjdN3H9P6Dpx7CpDkA9npWqA8Cb2icXq3k3nz3MaXGrVKTYiJnytAffYtos7mPoeOg==
"@bsky.app/expo-translate-text@^0.2.7":
version "0.2.7"
resolved "https://registry.yarnpkg.com/@bsky.app/expo-translate-text/-/expo-translate-text-0.2.7.tgz#e34811d0f0300f8808762e5676aa50790ca5d5e8"
integrity sha512-J9zctP9hLxX0eustTKk5CBnCkk6cEdlu1s7GzUnpT65qkCSNbYqbbUCpcU2Z2S2dN/1+w6L/iHb+vmCEbZMOaQ==
"@bsky.app/react-native-mmkv@2.12.5":
version "2.12.5"