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

Feat/maestro end-to-end testing #68

Merged
merged 6 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .maestro/auth/login-with-validation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
appId: host.exp.Exponent
---
- launchApp
- tapOn:
text: 'BACA (qa)'
- assertVisible: 'Welcome back'
- assertVisible: 'Remember me'
- tapOn:
text: 'Remember me'
- assertVisible: 'Log in'
- tapOn: 'Log in'
- assertVisible: 'Home'
3 changes: 3 additions & 0 deletions .maestro/categories/categories.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
appId: host.exp.Exponent
---
- assertVisible: 'Categories screen'
30 changes: 30 additions & 0 deletions .maestro/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
flows:
- auth/*
- home/*
- categories/*
- example/*
- settings/*
- profile/*

excludeTags:
- utils

executionOrder:
continueOnFailure: true
flowsOrder:
- login-with-validation
- details
- full-screen-form
- blog
- categories
- application-info
- colors
- components
- typography
- homestack
- data-backend
- test-form
- notifications-helpers
- user-session
- settings
- profile
8 changes: 8 additions & 0 deletions .maestro/example/application-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
appId: host.exp.Exponent
---
- assertVisible: 'Go to ApplicationInfo'
- tapOn: 'Go to ApplicationInfo'
- assertVisible: 'Go back'
- tapOn: 'Go back'
- assertVisible: 'Discard'
- tapOn: 'Discard'
6 changes: 6 additions & 0 deletions .maestro/example/colors.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
appId: host.exp.Exponent
---
- assertVisible: 'Go to Colors'
- tapOn: 'Go to Colors'
- assertVisible: 'Examples'
- tapOn: 'Examples'
42 changes: 42 additions & 0 deletions .maestro/example/components.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
appId: host.exp.Exponent
---
- assertVisible: 'Go to Components'
- tapOn: 'Go to Components'
- assertVisible: 'Test notification'
- tapOn: 'Test notification'
- assertVisible: 'Button primary'
- tapOn: 'Button primary'
# - assertVisible: 'Button with icons'
# - tapOn: 'Button with icons'
- assertVisible: 'Button primary destructive'
- tapOn: 'Button primary destructive'
- assertVisible: 'Button secondary color'
- tapOn: 'Button secondary color'
- assertVisible: 'Button secondary gray'
- tapOn: 'Button secondary gray'
- assertVisible: 'Button secondary destructive'
- tapOn: 'Button secondary destructive'
- assertVisible: 'Button tertiary color'
- tapOn: 'Button tertiary color'
- assertVisible: 'Button tertiary gray'
- tapOn: 'Button tertiary gray'
- assertVisible: 'Button tertiary destructive'
- tapOn: 'Button tertiary destructive'
- assertVisible: 'Button link color'
- tapOn: 'Button link color'
- assertVisible: 'Button link gray'
- tapOn: 'Button link gray'
- assertVisible: 'Button link destructive'
- tapOn: 'Button link destructive'
# - assertVisible: 'Log in with Google'
# - tapOn: 'Log in with Google'
# - assertVisible: 'Log in with Facebook'
# - tapOn: 'Log in with Facebook'
# - assertVisible: 'Log in with Apple'
# - tapOn: 'Log in with Apple'
- assertVisible: 'Remember me'
- doubleTapOn: 'Remember me'
- assertVisible: '31-40'
- tapOn: '31-40'
- assertVisible: 'Examples'
- tapOn: 'Examples'
6 changes: 6 additions & 0 deletions .maestro/example/data-backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
appId: host.exp.Exponent
---
- assertVisible: 'Go to screen with data from BE'
- tapOn: 'Go to screen with data from BE'
- assertVisible: 'Examples'
- tapOn: 'Examples'
14 changes: 14 additions & 0 deletions .maestro/example/homestack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
appId: host.exp.Exponent
env:
Title: 'Post title'
CONTENT: "It is a long established fact that a reader will be distracted by the\
\ readable content of a page when looking at its layout. The point of using Lorem\
\ Ipsum is that it has a more-or-less normal distribution of letters, as opposed\
\ to using"
---
- assertVisible: 'Go to HomeStackDetails'
- tapOn: 'Go to HomeStackDetails'
- assertVisible: 'Open BottomSheetModal'
- tapOn: 'Open BottomSheetModal'
# - assertVisible: 'Example'
# - tapOn: 'Example'
34 changes: 34 additions & 0 deletions .maestro/example/notifications-helpers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
appId: host.exp.Exponent
---
- assertVisible: 'Go to push notifications helpers'
- tapOn: 'Go to push notifications helpers'
- assertVisible: 'Copy push token'
- tapOn: 'Copy push token'
- assertVisible: 'OK'
- tapOn: 'OK'
- assertVisible: 'Check notifications permission status'
- tapOn: 'Check notifications permission status'
- scrollUntilVisible:
element:
text: 'Last push notification data'
direction: DOWN
timeout: 15000
speed: 40
visibilityPercentage: 100
- scrollUntilVisible:
element:
text: 'Scheduled notifications'
direction: DOWN
timeout: 15000
speed: 40
visibilityPercentage: 100
- assertVisible: 'Schedule new push notification - 10 seconds'
- tapOn: 'Schedule new push notification - 10 seconds'
- assertVisible: 'Get list of scheduled notifications'
- tapOn: 'Get list of scheduled notifications'
- assertVisible: 'PUSH TITLE'
- tapOn: 'Ok'
- assertVisible: 'Get list of scheduled notifications'
- tapOn: 'Get list of scheduled notifications'
- assertVisible: 'Examples'
- tapOn: 'Examples'
7 changes: 7 additions & 0 deletions .maestro/example/test-form.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
appId: host.exp.Exponent
---
- assertVisible: 'Go to test form'
- tapOn: 'Go to test form'
- assertVisible: 'Contact data'
- assertVisible: 'Examples'
- tapOn: 'Examples'
21 changes: 21 additions & 0 deletions .maestro/example/typography.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
appId: host.exp.Exponent
---
- assertVisible: 'Go to Typography'
- tapOn: 'Go to Typography'
- scrollUntilVisible:
element:
text: 'Display - MdBold'
direction: DOWN
timeout: 15000
speed: 90
visibilityPercentage: 100
centerElement: true
- scrollUntilVisible:
element:
text: 'Text - XsRegular'
direction: DOWN
timeout: 15000
speed: 90
visibilityPercentage: 100
- assertVisible: 'Examples'
- tapOn: 'Examples'
16 changes: 16 additions & 0 deletions .maestro/example/user-session.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
appId: host.exp.Exponent
---
- assertVisible: 'Go to user session'
- tapOn: 'Go to user session'
- assertVisible: 'Refetch user'
- tapOn: 'Refetch user'
- scrollUntilVisible:
element:
text: 'Try to get new token if needed'
direction: DOWN
timeout: 10000
speed: 50
visibilityPercentage: 100
- tapOn: 'Try to get new token if needed'
- assertVisible: 'Examples'
- tapOn: 'Examples'
5 changes: 5 additions & 0 deletions .maestro/home/blog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
appId: host.exp.Exponent
---
- assertVisible: 'Open blog'
- tapOn: 'Open blog'
- assertVisible: 'Contact data'
12 changes: 12 additions & 0 deletions .maestro/home/details.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
appId: host.exp.Exponent
---
- assertVisible: 'Details'
- tapOn: 'Details'
- assertVisible: 'Open BottomSheetModal'
- tapOn: 'Open BottomSheetModal'
- assertVisible: 'Home'
- tapOn: 'Home'
# - assertVisible: 'Text'
# - tapOn: 'Text'

# NOT ENDED YET
8 changes: 8 additions & 0 deletions .maestro/home/full-screen-form.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
appId: host.exp.Exponent
---
- assertVisible: 'Open full screen form'
- tapOn: 'Open full screen form'
- assertVisible: 'Contact data'
# - tapOn:
# id: 'Name'
# - inputText: 'Olaf'
26 changes: 26 additions & 0 deletions .maestro/profile/profile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
appId: host.exp.Exponent
---
- assertVisible: 'Upload'
- tapOn: 'Upload'
- assertVisible: 'Photos'
- tapOn:
index: 1
- assertVisible: 'Choose'
- tapOn: 'Choose'
- assertVisible: 'First name'
- inputText: 'mattsaa'
- assertVisible: 'Last name'
- inputText: 'mat'
- assertVisible: 'Save'
- tapOn: 'Save'
- scrollUntilVisible:
element:
text: 'Remove account'
direction: DOWN
timeout: 15000
speed: 40
visibilityPercentage: 100
- assertVisible: 'Remove account'
- tapOn: 'Remove account'
- assertVisible: 'Cancel'
- tapOn: 'Cancel'
8 changes: 8 additions & 0 deletions .maestro/settings/settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
appId: host.exp.Exponent
---
- assertVisible: 'light'
- tapOn: 'light'
- assertVisible: 'dark'
- tapOn: 'dark'
- assertVisible: 'system'
- tapOn: 'system'
5 changes: 5 additions & 0 deletions .maestro/utils/hide-keyboard-android.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
appId: ${APP_ID}
tags:
- util
---
- hideKeyboard
6 changes: 6 additions & 0 deletions .maestro/utils/hide-keyboard-ios.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
appId: ${APP_ID}
tags:
- util
---
- tapOn:
id: 'Return' # Keyboard Return
12 changes: 12 additions & 0 deletions .maestro/utils/hide-keyboard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
appId: ${APP_ID}
tags:
- util
---
- runFlow:
when:
platform: iOS
file: ./hide-keyboard-ios.yaml
- runFlow:
when:
platform: Android
file: ./hide-keyboard-android.yaml
22 changes: 22 additions & 0 deletions .maestro/utils/login.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
appId: ${APP_ID}
env:
Name: 'User'
EMAIL: 'user@test.com'
PASSWORD: 'password'
tags:
- util
---
- tapOn:
id: 'name'
- inputText: ${Name}
- tapOn:
id: 'email-input'
- inputText: ${EMAIL}
- runFlow: ../utils/hide-keyboard.yaml
- tapOn:
id: 'password-input'
- inputText: ${PASSWORD}
- runFlow: ../utils/hide-keyboard.yaml
- tapOn:
id: 'login-button'
- assertVisible: 'Typography'
12 changes: 12 additions & 0 deletions .maestro/utils/onboarding-and-login.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
appId: ${APP_ID}
tags:
- util
---
- runFlow:
when:
visible: 'Obytes Starter'
file: onboarding.yaml
- runFlow:
when:
visible: Sign In
file: login.yaml
8 changes: 8 additions & 0 deletions .maestro/utils/onboarding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
appId: ${APP_ID}
tags:
- util
---
- assertVisible: 'Obytes Starter'
- assertVisible: "Let's Get Started "
- tapOn: "Let's Get Started "
- assertVisible: 'Sign In'
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"license": "MIT",
"scripts": {
"android:dev-client": "IS_DEV=1 npx expo run:android",
"baca": "yarn build:baca-cli && node ./scripts/cli/build/scripts/cli",
"android": "expo run:android",
"b": "yarn baca b",
"g": "yarn baca g",
"baca": "yarn build:baca-cli && node ./scripts/cli/build/scripts/cli",
"build:baca-cli": "npx tsc -p ./scripts/cli/tsconfig.cli.json",
"build:production:android": "yarn prepare:production && eas build --platform android --profile production",
"build:production:ios": "yarn prepare:production && eas build --platform ios --profile production",
Expand All @@ -48,13 +48,15 @@
"deploy:staging:ios": "yarn prepare:staging && eas build --platform ios --profile staging --auto-submit --non-interactive",
"deploy:staging": "yarn prepare:staging && eas build --platform all --profile staging --auto-submit --non-interactive",
"eas-build-pre-install": "base64 --help && echo $ANDROID_FIREBASE_CONFIG | base64 --decode > google-services.json && cat google-services.json && echo $IOS_FIREBASE_CONFIG | base64 --decode > GoogleService-Info.plist && cat GoogleService-Info.plist",
"g": "yarn baca g",
"generate:env:production": "scripts/generate_dotenv.sh production",
"generate:env:qa": "scripts/generate_dotenv.sh qa",
"generate:env:staging": "scripts/generate_dotenv.sh staging",
"generate:google-services-config": "./scripts/generate_firebase_config.sh",
"generate:last:publish": "node ./scripts/generate_last_update_id.js",
"generate:query": "yarn orval --config ./orval.config.ts",
"ios:dev-client": "IS_DEV=1 npx expo run:ios",
"ios": "expo run:ios",
"lint:fix": "eslint src --fix",
"lint": "eslint src && yarn tsc",
"postinstall": "patch-package && yarn build:baca-cli",
Expand Down Expand Up @@ -87,9 +89,7 @@
"upload:env": "./scripts/upload_env.sh",
"web:build": "expo export:web",
"web": "cross-env IS_DEV=1 expo start --web",
"whoami": "expo whoami",
"android": "expo run:android",
"ios": "expo run:ios"
"whoami": "expo whoami"
},
"dependencies": {
"@bacons/react-views": "^1.1.3",
Expand Down Expand Up @@ -141,6 +141,7 @@
"i18next": "^23.7.20",
"jotai": "^2.8.1",
"jwt-decode": "^4.0.0",
"maestro": "^2.1.1",
"moti": "^0.25.3",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
Loading
Loading