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

Switch to using maestro action #3783

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
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
56 changes: 50 additions & 6 deletions .github/workflows/end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
name: End to end Tests
needs: build-end-to-end-tests
runs-on: macos-15
timeout-minutes: 90
timeout-minutes: 240
strategy:
matrix:
test-tag: [release, privacy, securityTest, adClick]
Expand All @@ -87,13 +87,57 @@ jobs:
name: duckduckgo-ios-app
path: DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app

- name: Install Maestro
run: |
export MAESTRO_VERSION=1.39.1; curl -Ls "https://get.maestro.mobile.dev" | bash

- name: End to End tests
id: upload
uses: mobile-dev-inc/action-maestro-cloud@v1.9.7
with:
api-key: ${{ secrets.ROBIN_API_KEY }}
project-id: ${{ secrets.ROBIN_PROJECT_KEY }}
name: ${{ matrix.test-tag }}_${{ github.sha }}
timeout: 5
app-file: DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app
workspace: .maestro
include-tags: ${{ matrix.test-tag }}
env: ONBOARDING_COMPLETED=true
ios-version: 17

- name: Process Robin Results
if: always()
run: |
export PATH="$PATH":"$HOME/.maestro/bin"; maestro cloud --apiKey ${{ secrets.ROBIN_API_KEY }} --project-id ${{ secrets.ROBIN_PROJECT_KEY }} -e ONBOARDING_COMPLETED=true --fail-on-timeout=true --fail-on-cancellation=true --timeout=150 --ios-version=17 --include-tags=${{ matrix.test-tag }} DerivedData/Build/Products/Debug-iphonesimulator/DuckDuckGo.app .maestro/
echo "Debug: MAESTRO_CLOUD_UPLOAD_STATUS = "
echo "${{ steps.upload.outputs.MAESTRO_CLOUD_UPLOAD_STATUS }}"

echo "Debug: MAESTRO_CLOUD_FLOW_RESULTS = "
echo "${{ steps.upload.outputs.MAESTRO_CLOUD_FLOW_RESULTS }}"

# Parse the JSON string
RESULTS='${{ steps.upload.outputs.MAESTRO_CLOUD_FLOW_RESULTS }}'

# Check if RESULTS is empty or null
if [ -z "$RESULTS" ]; then
echo "Error: No results found"
exit 1
fi

# Check if any flow was not successful
NON_SUCCESS_FLOWS=$(echo "$RESULTS" | jq -r '[.[] | select(.status != "SUCCESS")]')
NON_SUCCESS_COUNT=$(echo "$NON_SUCCESS_FLOWS" | jq -r 'length')

# Check if NON_SUCCESS_COUNT is a number
if ! [[ "$NON_SUCCESS_COUNT" =~ ^[0-9]+$ ]]; then
echo "Error: Invalid non-success count"
exit 1
fi

if [ "$NON_SUCCESS_COUNT" -gt 0 ]; then
echo "Error: Some flows were not successful"
echo "Details of non-successful flows:"
echo "$NON_SUCCESS_FLOWS" | jq '.'
exit 1
else
echo "All flows were successful"
fi
shell: bash

# notify-failure:
# name: Notify on failure
Expand Down
Loading