diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml new file mode 100644 index 00000000..be01d71f --- /dev/null +++ b/.github/workflows/ui-tests.yml @@ -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 diff --git a/.maestro/config.yaml b/.maestro/config.yaml new file mode 100644 index 00000000..42681f9f --- /dev/null +++ b/.maestro/config.yaml @@ -0,0 +1,5 @@ +executionOrder: + continueOnFailure: false # default is true + flowsOrder: + - onboarding + - settings diff --git a/.maestro/onboarding.yaml b/.maestro/onboarding.yaml new file mode 100644 index 00000000..1a4ab9aa --- /dev/null +++ b/.maestro/onboarding.yaml @@ -0,0 +1,6 @@ +appId: com.gemwallet.ios +--- +- launchApp: + clearState: true +- runFlow: onboarding/create.yaml +- runFlow: onboarding/import.yaml diff --git a/.maestro/onboarding/create.yaml b/.maestro/onboarding/create.yaml new file mode 100644 index 00000000..371fa230 --- /dev/null +++ b/.maestro/onboarding/create.yaml @@ -0,0 +1,5 @@ +appId: com.gemwallet.ios +--- +- launchApp +- tapOn: "Create a New Wallet" +- tapOn: "Continue" diff --git a/.maestro/onboarding/import.yaml b/.maestro/onboarding/import.yaml new file mode 100644 index 00000000..89737d23 --- /dev/null +++ b/.maestro/onboarding/import.yaml @@ -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" diff --git a/.maestro/settings.yaml b/.maestro/settings.yaml new file mode 100644 index 00000000..6252c720 --- /dev/null +++ b/.maestro/settings.yaml @@ -0,0 +1,6 @@ +appId: com.gemwallet.ios +--- +- launchApp: + clearState: true +- runFlow: onboarding/import.yaml +- runFlow: settings/currency.yaml diff --git a/.maestro/settings/currency.yaml b/.maestro/settings/currency.yaml new file mode 100644 index 00000000..f23e2ddc --- /dev/null +++ b/.maestro/settings/currency.yaml @@ -0,0 +1,7 @@ +appId: com.gemwallet.ios +--- +- launchApp +- tapOn: "Settings" +- tapOn: "Currency" +- tapOn: "🇺🇸 USD - US Dollar" +- assertVisible: "Settings" diff --git a/Makefile b/Makefile index b3d89a5f..195ec265 100644 --- a/Makefile +++ b/Makefile @@ -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