Skip to content

Commit

Permalink
Sync: Maestro (#3297)
Browse files Browse the repository at this point in the history
<!--
Note: This checklist is a reminder of our shared engineering
expectations.
The items in Bold are required
If your PR involves UI changes:
1. Upload screenshots or screencasts that illustrate the changes before
/ after
2. Add them under the UI changes section (feel free to add more columns
if needed)
If your PR does not involve UI changes, you can remove the **UI
changes** section

At a minimum, make sure your changes are tested in API 23 and one of the
more recent API levels available.
-->

Task/Issue URL:
https://app.asana.com/0/1201493110486074/1205182950038768/f

### Description
Critical path tests for Sync

### Steps to test this PR

Run maestro tests for sync: 
`maestro test .maestro/sync_flows`
  • Loading branch information
malmstein committed Aug 11, 2023
1 parent a9db970 commit 650c3c5
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/sync-end-to-end.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Sync Feature End-to-End tests

on:
workflow_dispatch:

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

jobs:
instrumentation_tests:
runs-on: ubuntu-latest
name: End-to-End tests

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'

- name: Create folder
if: always()
run: mkdir apk

- name: Decode keys
uses: davidSchuppa/base64Secret-toFile-action@v2
with:
secret: ${{ secrets.FAKE_RELEASE_PROPERTIES }}
fileName: ddg_android_build.properties
destination-path: $HOME/jenkins_static/com.duckduckgo.mobile.android/

- name: Decode key file
uses: davidSchuppa/base64Secret-toFile-action@v2
with:
secret: ${{ secrets.FAKE_RELEASE_KEY }}
fileName: android
destination-path: $HOME/jenkins_static/com.duckduckgo.mobile.android/

- name: Assemble release APK
uses: gradle/gradle-build-action@v2
with:
arguments: assembleInternalRelease -Pforce-default-variant

- name: Move APK to new folder
if: always()
run: find . -name "*.apk" -exec mv '{}' apk/release.apk \;

- name: Sync Flows
uses: mobile-dev-inc/action-maestro-cloud@v1.4.1
with:
api-key: ${{ secrets.MOBILE_DEV_API_KEY }}
name: ${{ github.sha }}
app-file: apk/release.apk
workspace: .maestro/sync_flows

- name: Create Asana task when workflow failed
if: ${{ failure() }}
uses: malmstein/github-asana-action@master
with:
asana-pat: ${{ secrets.GH_ASANA_SECRET }}
asana-project: ${{ vars.GH_ANDROID_APP_PROJECT_ID }}
asana-section: ${{ vars.GH_ANDROID_APP_INCOMING_SECTION_ID }}
asana-task-name: GH Workflow Failure - Sync E2E Flows
asana-task-description: The Sync Flows end to end workflow has failed. See https://github.com/duckduckgo/Android/actions/runs/${{ github.run_id }}
action: 'create-asana-task'
8 changes: 8 additions & 0 deletions .maestro/shared/open_sync_screen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
appId: com.duckduckgo.mobile.android.debug
---
- tapOn:
id: "com.duckduckgo.mobile.android.debug:id/browserMenuImageView"
- tapOn: "Settings"
- tapOn:
id: "com.duckduckgo.mobile.android.debug:id/item_container"
index: 8
14 changes: 14 additions & 0 deletions .maestro/sync_flows/1_-_create_account.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
appId: com.duckduckgo.mobile.android.debug
---
- launchApp:
clearState: true
stopApp: true
- runFlow: ../shared/onboarding.yaml
- runFlow: ../shared/open_sync_screen.yaml
- tapOn:
id: "com.duckduckgo.mobile.android.debug:id/trailingSwitch"
- tapOn: "Turn On Sync"
- tapOn: "Not Now"
- tapOn: "Not Now"
- assertVisible:
id: "com.duckduckgo.mobile.android.debug:id/qrCodeImageView"
41 changes: 41 additions & 0 deletions .maestro/sync_flows/2_-_login_account.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
appId: com.duckduckgo.mobile.android.debug
---
- launchApp:
clearState: true
stopApp: true
- runFlow: ../shared/onboarding.yaml
- runFlow: ../shared/open_sync_screen.yaml
- tapOn:
id: "com.duckduckgo.mobile.android.debug:id/trailingSwitch"
- tapOn: "Turn On Sync"
- tapOn: "Not Now"
- tapOn: "Not Now"
- scrollUntilVisible:
element:
id: "com.duckduckgo.mobile.android.debug:id/item_container"
direction: DOWN
- tapOn:
id: "com.duckduckgo.mobile.android.debug:id/item_container"
index: 2
- tapOn: "Copy Code"
- tapOn: "Navigate up"
- tapOn:
id: "com.duckduckgo.mobile.android.debug:id/trailingSwitch"
- tapOn: "Turn Off"
- tapOn:
id: "com.duckduckgo.mobile.android.debug:id/trailingSwitch"
- tapOn: "Recover Your Synced Data"
- tapOn:
text: "While using the app"
optional: true
- scrollUntilVisible:
element:
id: "com.duckduckgo.mobile.android.debug:id/item_container"
direction: DOWN
- tapOn:
id: "com.duckduckgo.mobile.android.debug:id/item_container"
- tapOn: "Paste Code"
- tapOn: "Next"
- tapOn: "Not Now"
- assertVisible:
id: "com.duckduckgo.mobile.android.debug:id/qrCodeImageView"

0 comments on commit 650c3c5

Please sign in to comment.