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

Integrate Maestro #90

Closed
wants to merge 21 commits into from
Closed
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
61 changes: 61 additions & 0 deletions .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: UI Tests

on:
# push:
# branches: ["main"]
pull_request:
branches: ["main"]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"

jobs:
test:
name: Run UI Tests on iPhone Simulator
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3

- name: Install dependencies
run: |
make install-typeshare && make install-toolchains
brew install swiftgen xcbeautify

- name: Install Maestro
run: |
curl -Ls "https://get.maestro.mobile.dev" | bash
brew tap facebook/fb
brew install facebook/fb/idb-companion

- name: Build Core
run: make generate-stone

- name: Build
run: make build

- name: UI Tests
run: make test-ui

# - uses: mobile-dev-inc/action-maestro-cloud@v1
# with:
# api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
# app-file: build/Build/Products/Debug-iphonesimulator/Gem.app
5 changes: 5 additions & 0 deletions .maestro/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
executionOrder:
continueOnFailure: false # default is true
flowsOrder:
- onboarding
- settings
6 changes: 6 additions & 0 deletions .maestro/onboarding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
appId: com.gemwallet.ios
---
- launchApp:
clearState: true
- runFlow: onboarding/create.yaml
- runFlow: onboarding/import.yaml
5 changes: 5 additions & 0 deletions .maestro/onboarding/create.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
appId: com.gemwallet.ios
---
- launchApp
- tapOn: "Create a New Wallet"
- tapOn: "Continue"
9 changes: 9 additions & 0 deletions .maestro/onboarding/import.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
appId: com.gemwallet.ios
---
- launchApp
- tapOn: "Import an Existing Wallet"
- tapOn: "Multi-Coin"
- tapOn: "Secret Recovery Phrase"
- inputText: "brief cinnamon future black note potato green thrive race theory addict bone"
- tapOn: "Import"
- tapOn: "Solana"
6 changes: 6 additions & 0 deletions .maestro/settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
appId: com.gemwallet.ios
---
- launchApp:
clearState: true
- runFlow: onboarding/import.yaml
- runFlow: settings/currency.yaml
7 changes: 7 additions & 0 deletions .maestro/settings/currency.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
appId: com.gemwallet.ios
---
- launchApp
- tapOn: "Settings"
- tapOn: "Currency"
- tapOn: "🇺🇸 USD - US Dollar"
- assertVisible: "Settings"
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,18 @@ generate-swiftgen:
generate-stone:
@./scripts/generate-stone.sh $(BUILD_MODE)

# output file: build/Build/Products/Debug-iphonesimulator/Gem.app
build:
@set -o pipefail && xcodebuild -project Gem.xcodeproj \
-scheme Gem \
-configuration Debug \
-sdk iphonesimulator \
-derivedDataPath ./build \
-destination "platform=iOS Simulator,name=iPhone 15" build | xcbeautify

test-ui:
~/.maestro/bin/maestro start-device --platform=ios --os-version=17
MAESTRO_DRIVER_STARTUP_TIMEOUT=120000 ~/.maestro/bin/maestro test .maestro

.PHONY: build
.PHONY: screenshots
Loading