diff --git a/.github/workflows/sync-end-to-end.yml b/.github/workflows/sync-end-to-end.yml new file mode 100644 index 000000000000..a2ed4bd2c09d --- /dev/null +++ b/.github/workflows/sync-end-to-end.yml @@ -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' \ No newline at end of file diff --git a/.maestro/shared/open_sync_screen.yaml b/.maestro/shared/open_sync_screen.yaml new file mode 100644 index 000000000000..7e072bc75f5b --- /dev/null +++ b/.maestro/shared/open_sync_screen.yaml @@ -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 diff --git a/.maestro/sync_flows/1_-_create_account.yaml b/.maestro/sync_flows/1_-_create_account.yaml new file mode 100644 index 000000000000..73f8332aae34 --- /dev/null +++ b/.maestro/sync_flows/1_-_create_account.yaml @@ -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" diff --git a/.maestro/sync_flows/2_-_login_account.yaml b/.maestro/sync_flows/2_-_login_account.yaml new file mode 100644 index 000000000000..5cbb197722dd --- /dev/null +++ b/.maestro/sync_flows/2_-_login_account.yaml @@ -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"