template_0205

This commit is contained in:
Sofio
2026-02-05 13:16:05 +08:00
commit d93e4d9c9f
197 changed files with 52810 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
# flow: run the login flow and then navigate to the demo podcast list screen, favorite a podcast, and then switch the list to only be favorites.
appId: ${MAESTRO_APP_ID}
env:
FAVORITES_TEXT: "Switch on to only show favorites" # en.demoPodcastListScreen.accessibility.switch
onFlowStart:
- runFlow: ../shared/_OnFlowStart.yaml
---
- runFlow: ../shared/_Login.yaml
- tapOn: "Podcast"
- assertVisible: "React Native Radio episodes"
- tapOn:
text: ${FAVORITES_TEXT}
- assertVisible: "This looks a bit empty"
- tapOn:
text: ${FAVORITES_TEXT}
# https://maestro.mobile.dev/troubleshooting/known-issues#android-accidental-double-tap
retryTapIfNoChange: false
- repeat:
times: 2
commands:
- scroll
- copyTextFrom:
text: "RNR .*" # assumes all podcast titles start with RNR
index: 2 # grab the third one, others might not be fully visible
- longPressOn: ${maestro.copiedText}
- scrollUntilVisible:
element:
text: ${FAVORITES_TEXT}
direction: UP
timeout: 50000
speed: 90
visibilityPercentage: 100
- tapOn:
text: ${FAVORITES_TEXT}
- assertVisible: ${maestro.copiedText}

View File

@@ -0,0 +1,13 @@
#flow: Login
#intent:
# Open up our app and use the default credentials to login
# and navigate to the demo screen
appId: ${MAESTRO_APP_ID} # the app id of the app we want to test
# You can find the appId of an Ignite app in the `app.json` file
# as the "package" under the "android" section and "bundleIdentifier" under the "ios" section
onFlowStart:
- runFlow: ../shared/_OnFlowStart.yaml
---
- runFlow: ../shared/_Login.yaml

View File

@@ -0,0 +1,12 @@
#flow: Shared _Login
#intent: shared login flow for any flow that needs to start with a log in.
appId: ${MAESTRO_APP_ID}
---
- assertVisible: "Log In"
- tapOn:
text: "Tap to Log in!"
- assertVisible: "Your app, almost ready for launch!"
- tapOn:
text: "Let's go!"
- assertVisible: "Components to jump start your project!"

View File

@@ -0,0 +1,39 @@
# flow: Shared _OnFlowStart
#intent:
# launch the app with a completely clear state, wait for animations to settle,
# and click through the expo dev screens if needed.
# These conditionals slow the app launch down a little but are necessary because the expo
# dev server and launch screen are only shown when the new architecture is turned off in expo 53.
# So we check to see if we need to connect to the metro server... that loads the app and then we
# check if the dev menu is showing and dismiss it if necessary.
# Then the app is then launched and ready for the maestro tests to run.
#
# This flow should be included in every maestro test header as `onFlowStart` to ensure expo screens
# are bypassed if necessary. Example:
#
# appId: ${MAESTRO_APP_ID}
# onFlowStart:
# - runFlow: ../shared/_OnFlowStart.yaml
# ---
# [your maestro flow]
#
appId: ${MAESTRO_APP_ID}
---
# launch the app with a clean slate
- launchApp:
clearState: true
clearKeychain: true
stopApp: true
- waitForAnimationToEnd
# conditionally run the dev client flow if the words "Development servers" is present.
# this uses the default maestro timeout and moves on if it doesn't see the text.
- runFlow:
when:
visible: 'Development servers'
commands:
# this regex allows for different hosts and ports
- tapOn: "http://.*:.*"
- waitForAnimationToEnd
- tapOn: "Close" # dismiss the bottom sheet