diff --git a/.github/workflows/e2e-nightly-autofill.yml b/.github/workflows/e2e-nightly-autofill.yml new file mode 100644 index 000000000000..c2b590eb28f8 --- /dev/null +++ b/.github/workflows/e2e-nightly-autofill.yml @@ -0,0 +1,76 @@ +name: Autofill Feature Critical Path End-to-End tests + +on: + schedule: + - cron: '30 6 * * *' # run at 6.30 AM UTC + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + instrumentation_tests: + runs-on: ubuntu-latest + name: Autofill Critical Path End-to-End Tests + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + 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 APK which does not require auth to use Autofill + uses: gradle/gradle-build-action@v2 + with: + arguments: assemblePlayRelease -Pautofill-disable-auth-requirement -Pforce-default-variant -x lint + + - name: Move APK to new folder + if: always() + run: find . -name "*.apk" -exec mv '{}' apk/release.apk \; + + - name: Autofill Critical Path E2E Flows + uses: mobile-dev-inc/action-maestro-cloud@v1.6.0 + with: + api-key: ${{ secrets.MOBILE_DEV_API_KEY }} + name: ${{ github.sha }} + app-file: apk/release.apk + android-api-level: 30 + workspace: .maestro + include-tags: autofillNoAuthTests + + - name: Create Asana task when workflow failed + if: ${{ failure() }} + id: create-failure-task + uses: duckduckgo/native-github-asana-sync@v1.1 + 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 - Autofill Critical Path E2E Flows + asana-task-description: Autofill critical path tests have 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/autofill/0_all.yaml b/.maestro/autofill/0_all.yaml index 0c5fd4b85e27..cd46b59351b2 100644 --- a/.maestro/autofill/0_all.yaml +++ b/.maestro/autofill/0_all.yaml @@ -1,19 +1,12 @@ appId: com.duckduckgo.mobile.android name: "Autofill: Run all tests" -tags: - - autofillNoAuthTests --- # Pre-requisite: the app is installed on an autofill-eligible device with a special build flag set to bypass device-authentication requirement +# This should only be run locally, as Maestro cloud will likely timeout trying to run them all as one flow. - launchApp: clearState: true - runFlow: ../shared/onboarding.yaml - runFlow: 1_autofill_shown_in_overflow.yaml - - # Everything below requires a device has device-level authentication set (e.g., a PIN/Password etc...) -- runFlow: 2_autofill_reach_creds_management.yaml -- runFlow: 3_autofill_manually_add_cred.yaml -- runFlow: 4_search_logins.yaml -- runFlow: 5_autofill_manually_updating_an_existing_credential.yaml -- runFlow: 6_delete_logins.yaml -- runFlow: 7_autofill_prompted_to_save_creds_on_form.yaml +- runFlow: 2_autofill_add_search_update_delete_creds.yaml +- runFlow: 3_autofill_prompted_to_save_creds_on_form.yaml \ No newline at end of file diff --git a/.maestro/autofill/1_autofill_shown_in_overflow.yaml b/.maestro/autofill/1_autofill_shown_in_overflow.yaml index 5a5544a6ce0c..ee5e95b38629 100644 --- a/.maestro/autofill/1_autofill_shown_in_overflow.yaml +++ b/.maestro/autofill/1_autofill_shown_in_overflow.yaml @@ -1,9 +1,11 @@ appId: com.duckduckgo.mobile.android name: "Autofill: Autofill screen is reachable from overflow menu" +tags: + - autofillNoAuthTests --- -# Pre-requisite: the user has cleared onboarding and is on the new tab page +# Pre-requisite: None (can be run whether auth is required or not) -- tapOn: - id: "com.duckduckgo.mobile.android:id/browserMenuImageView" -- assertVisible: "Passwords" -- tapOn: "Passwords" \ No newline at end of file +- launchApp: + clearState: true +- runFlow: ../shared/onboarding.yaml +- runFlow: steps/access_passwords_screen.yaml \ No newline at end of file diff --git a/.maestro/autofill/3_autofill_manually_add_cred.yaml b/.maestro/autofill/2_autofill_add_search_update_delete_creds.yaml similarity index 74% rename from .maestro/autofill/3_autofill_manually_add_cred.yaml rename to .maestro/autofill/2_autofill_add_search_update_delete_creds.yaml index 7ffab13246e3..3ef054cce02b 100644 --- a/.maestro/autofill/3_autofill_manually_add_cred.yaml +++ b/.maestro/autofill/2_autofill_add_search_update_delete_creds.yaml @@ -1,9 +1,21 @@ appId: com.duckduckgo.mobile.android name: "Autofill: Manually add credentials" +tags: + - autofillNoAuthTests --- -# Pre-requisite: the user is viewing the password manager screen with no saved passwords, on an autofill-eligible device +# Pre-requisite: on an autofill-eligible device -- runScript: 3_script.js +- launchApp: + clearState: true +- runFlow: ../shared/onboarding.yaml +- runFlow: steps/access_passwords_screen.yaml + +- assertVisible: + text: "No passwords saved yet" +- assertNotVisible: + id: searchLogins + +- runScript: steps/2_script.js - repeat: while: @@ -60,4 +72,9 @@ name: "Autofill: Manually add credentials" text: "fill.dev" - assertNotVisible: - text: "fill.dev/example" \ No newline at end of file + text: "fill.dev/example" + + +- runFlow: steps/search_logins.yaml +- runFlow: steps/manual_update.yaml +- runFlow: steps/delete_logins.yaml \ No newline at end of file diff --git a/.maestro/autofill/2_autofill_reach_creds_management.yaml b/.maestro/autofill/2_autofill_reach_creds_management.yaml deleted file mode 100644 index 6c9f78cdb1c7..000000000000 --- a/.maestro/autofill/2_autofill_reach_creds_management.yaml +++ /dev/null @@ -1,9 +0,0 @@ -appId: com.duckduckgo.mobile.android -name: "Autofill: Password manager screen when no passwords saved" ---- -# Pre-requisite: the user is viewing the password manager screen with no saved passwords, on an autofill-eligible device - -- assertVisible: - text: "No passwords saved yet" -- assertNotVisible: - id: searchLogins diff --git a/.maestro/autofill/7_autofill_prompted_to_save_creds_on_form.yaml b/.maestro/autofill/3_autofill_prompted_to_save_creds_on_form.yaml similarity index 75% rename from .maestro/autofill/7_autofill_prompted_to_save_creds_on_form.yaml rename to .maestro/autofill/3_autofill_prompted_to_save_creds_on_form.yaml index 55186a5709e3..224e1bde0db3 100644 --- a/.maestro/autofill/7_autofill_prompted_to_save_creds_on_form.yaml +++ b/.maestro/autofill/3_autofill_prompted_to_save_creds_on_form.yaml @@ -1,10 +1,16 @@ appId: com.duckduckgo.mobile.android name: "Autofill: Prompted to save and update credentials on web form" +tags: + - autofillNoAuthTests --- -# Pre-requisite: the user is viewing the new tab screen, on an autofill-eligible device +# Pre-requisite: on an autofill-eligible device + +- launchApp: + clearState: true +- runFlow: ../shared/onboarding.yaml - tapOn: - text: "search or type URL" + id: "omnibarTextInput" - eraseText - inputText: "fill.dev/form/login-simple" - pressKey: enter @@ -32,9 +38,9 @@ name: "Autofill: Prompted to save and update credentials on web form" text: "Login" - assertVisible: "Update Password" - tapOn: "Update Password" -- tapOn: - id: "browserMenu" -- tapOn: "Passwords" + +- runFlow: steps/access_passwords_screen.yaml + - tapOn: "user" - tapOn: id: "internal_password_icon" diff --git a/.maestro/autofill/3_script.js b/.maestro/autofill/steps/2_script.js similarity index 100% rename from .maestro/autofill/3_script.js rename to .maestro/autofill/steps/2_script.js diff --git a/.maestro/autofill/steps/access_passwords_screen.yaml b/.maestro/autofill/steps/access_passwords_screen.yaml new file mode 100644 index 000000000000..5a5544a6ce0c --- /dev/null +++ b/.maestro/autofill/steps/access_passwords_screen.yaml @@ -0,0 +1,9 @@ +appId: com.duckduckgo.mobile.android +name: "Autofill: Autofill screen is reachable from overflow menu" +--- +# Pre-requisite: the user has cleared onboarding and is on the new tab page + +- tapOn: + id: "com.duckduckgo.mobile.android:id/browserMenuImageView" +- assertVisible: "Passwords" +- tapOn: "Passwords" \ No newline at end of file diff --git a/.maestro/autofill/6_delete_logins.yaml b/.maestro/autofill/steps/delete_logins.yaml similarity index 90% rename from .maestro/autofill/6_delete_logins.yaml rename to .maestro/autofill/steps/delete_logins.yaml index 43401ca10ae4..2c98a0251696 100644 --- a/.maestro/autofill/6_delete_logins.yaml +++ b/.maestro/autofill/steps/delete_logins.yaml @@ -25,6 +25,4 @@ name: "Autofill: Delete credentials" - tapOn: "Delete" - assertVisible: - text: "No passwords saved yet" - -- tapOn: "Navigate up" \ No newline at end of file + text: "No passwords saved yet" \ No newline at end of file diff --git a/.maestro/autofill/5_autofill_manually_updating_an_existing_credential.yaml b/.maestro/autofill/steps/manual_update.yaml similarity index 100% rename from .maestro/autofill/5_autofill_manually_updating_an_existing_credential.yaml rename to .maestro/autofill/steps/manual_update.yaml diff --git a/.maestro/autofill/4_search_logins.yaml b/.maestro/autofill/steps/search_logins.yaml similarity index 100% rename from .maestro/autofill/4_search_logins.yaml rename to .maestro/autofill/steps/search_logins.yaml