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

Add GH workflow to run critical autofill tests each night #4186

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
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
76 changes: 76 additions & 0 deletions .github/workflows/e2e-nightly-autofill.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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/[email protected]
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'
13 changes: 3 additions & 10 deletions .maestro/autofill/0_all.yaml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 7 additions & 5 deletions .maestro/autofill/1_autofill_shown_in_overflow.yaml
Original file line number Diff line number Diff line change
@@ -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"
- launchApp:
clearState: true
- runFlow: ../shared/onboarding.yaml
- runFlow: steps/access_passwords_screen.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -60,4 +72,9 @@ name: "Autofill: Manually add credentials"
text: "fill.dev"

- assertNotVisible:
text: "fill.dev/example"
text: "fill.dev/example"


- runFlow: steps/search_logins.yaml
- runFlow: steps/manual_update.yaml
- runFlow: steps/delete_logins.yaml
9 changes: 0 additions & 9 deletions .maestro/autofill/2_autofill_reach_creds_management.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"
Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions .maestro/autofill/steps/access_passwords_screen.yaml
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,4 @@ name: "Autofill: Delete credentials"
- tapOn: "Delete"

- assertVisible:
text: "No passwords saved yet"

- tapOn: "Navigate up"
text: "No passwords saved yet"
Loading