[PR #6159] [MERGED] [PM-28086] Add testharness for Credential Manager and Autofill testing #12511

Closed
opened 2026-04-11 03:44:43 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/6159
Author: @SaintPatrck
Created: 11/11/2025
Status: Merged
Merged: 11/21/2025
Merged by: @SaintPatrck

Base: mainHead: testharness-app


📝 Commits (10+)

  • 634aa91 Add testharness module for Credential Manager and Autofill e2e testing
  • 89f4090 Fix testharness screen layouts on small displays
  • d70615b Refactor and expand CredentialTestManager tests
  • 2f970ee Add @OmitFromCoverage to testharness navigation files
  • 646c2ac Extract WebAuthn JSON building logic into dedicated builder
  • 53d0f44 Suppress unused exception variable warnings
  • a5db63e Add @OmitFromCoverage to WebAuthnJsonBuilder
  • 0e5fc1a Refactor exception handling in CredentialTestManagerImpl to follow style guide
  • 39f8529 Use localized string for Autofill back button description
  • e840bec Refactor testharness to separate presentation from data layer

📊 Changes

67 files changed (+7836 additions, -0 deletions)

View changed files

📝 build.gradle.kts (+2 -0)
📝 settings.gradle.kts (+1 -0)
testharness/.gitignore (+9 -0)
testharness/README.md (+79 -0)
testharness/build.gradle.kts (+117 -0)
testharness/proguard-rules.pro (+23 -0)
testharness/src/main/AndroidManifest.xml (+30 -0)
testharness/src/main/kotlin/com/bitwarden/testharness/MainActivity.kt (+58 -0)
testharness/src/main/kotlin/com/bitwarden/testharness/MainViewModel.kt (+55 -0)
testharness/src/main/kotlin/com/bitwarden/testharness/TestHarnessApplication.kt (+14 -0)
testharness/src/main/kotlin/com/bitwarden/testharness/data/manager/CredentialTestManager.kt (+80 -0)
testharness/src/main/kotlin/com/bitwarden/testharness/data/manager/CredentialTestManagerImpl.kt (+262 -0)
testharness/src/main/kotlin/com/bitwarden/testharness/data/manager/di/CredentialTestManagerModule.kt (+35 -0)
testharness/src/main/kotlin/com/bitwarden/testharness/data/model/CredentialTestResult.kt (+29 -0)
testharness/src/main/kotlin/com/bitwarden/testharness/data/util/WebAuthnJsonBuilder.kt (+102 -0)
testharness/src/main/kotlin/com/bitwarden/testharness/ui/platform/feature/autofill/AutofillPlaceholderNavigation.kt (+58 -0)
testharness/src/main/kotlin/com/bitwarden/testharness/ui/platform/feature/autofill/AutofillPlaceholderScreen.kt (+73 -0)
testharness/src/main/kotlin/com/bitwarden/testharness/ui/platform/feature/autofill/AutofillPlaceholderViewModel.kt (+45 -0)
testharness/src/main/kotlin/com/bitwarden/testharness/ui/platform/feature/createpasskey/CreatePasskeyNavigation.kt (+36 -0)
testharness/src/main/kotlin/com/bitwarden/testharness/ui/platform/feature/createpasskey/CreatePasskeyScreen.kt (+191 -0)

...and 47 more files

📄 Description

🎟️ Tracking

PM-28086

📔 Objective

This PR introduces a new :testharness module - a standalone Android application for validating Bitwarden's Credential Manager provider implementation.

Purpose:
The test harness allows developers to exercise and verify all Credential Manager API operations that the Bitwarden app supports as a credential provider:

  • Password Operations: Create and retrieve password credentials via CreatePasswordRequest and GetPasswordOption
  • Passkey Operations: Create and retrieve passkeys via CreatePublicKeyCredentialRequest and GetPublicKeyCredentialOption
  • Combined Operations: Test hybrid flows that accept both passwords and passkeys

Architecture:
The module follows the same patterns as :app and :authenticator:

  • MVVM + UDF architecture with BaseViewModel
  • Hilt dependency injection throughout
  • Jetpack Compose UI with Material 3
  • Comprehensive unit test coverage (ViewModels, Screens, and data layer)

Integration:
The test harness acts as a credential consumer client, triggering the system credential picker and allowing selection of Bitwarden as the provider. This enables end-to-end validation of credential flows without relying on external websites or apps.

Build Configuration:
Added :testharness to detekt (static analysis) and kover (code coverage) configurations in root build.gradle.kts.

Requirements: API 28+ (uses AndroidX Credentials library with Play Services compatibility)

📸 Screenshots

Coming soon!

Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/6159 **Author:** [@SaintPatrck](https://github.com/SaintPatrck) **Created:** 11/11/2025 **Status:** ✅ Merged **Merged:** 11/21/2025 **Merged by:** [@SaintPatrck](https://github.com/SaintPatrck) **Base:** `main` ← **Head:** `testharness-app` --- ### 📝 Commits (10+) - [`634aa91`](https://github.com/bitwarden/android/commit/634aa91e860d59bbc3333116ea89befe4578c5a9) Add testharness module for Credential Manager and Autofill e2e testing - [`89f4090`](https://github.com/bitwarden/android/commit/89f40903614bcf716786c163e689040e2a030b6a) Fix testharness screen layouts on small displays - [`d70615b`](https://github.com/bitwarden/android/commit/d70615b1c6a778ab8833c367cd0d44a73f6af5f7) Refactor and expand CredentialTestManager tests - [`2f970ee`](https://github.com/bitwarden/android/commit/2f970eed2dc9d83b1759127118b77099683f2d0e) Add @OmitFromCoverage to testharness navigation files - [`646c2ac`](https://github.com/bitwarden/android/commit/646c2acefb97148cd7fbb7108e447389d3f09163) Extract WebAuthn JSON building logic into dedicated builder - [`53d0f44`](https://github.com/bitwarden/android/commit/53d0f4475183862ec5178bb55183ba64e514be56) Suppress unused exception variable warnings - [`a5db63e`](https://github.com/bitwarden/android/commit/a5db63ec64867a2c7095a9af31a55e3b00742309) Add @OmitFromCoverage to WebAuthnJsonBuilder - [`0e5fc1a`](https://github.com/bitwarden/android/commit/0e5fc1a88f49ed0afc3cc0d425a37f41cbf9f164) Refactor exception handling in CredentialTestManagerImpl to follow style guide - [`39f8529`](https://github.com/bitwarden/android/commit/39f852981a792ad0cf4d58c5edcd6b8278323243) Use localized string for Autofill back button description - [`e840bec`](https://github.com/bitwarden/android/commit/e840bec26baacae9b09d3b807025336fd3eef9a4) Refactor testharness to separate presentation from data layer ### 📊 Changes **67 files changed** (+7836 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `build.gradle.kts` (+2 -0) 📝 `settings.gradle.kts` (+1 -0) ➕ `testharness/.gitignore` (+9 -0) ➕ `testharness/README.md` (+79 -0) ➕ `testharness/build.gradle.kts` (+117 -0) ➕ `testharness/proguard-rules.pro` (+23 -0) ➕ `testharness/src/main/AndroidManifest.xml` (+30 -0) ➕ `testharness/src/main/kotlin/com/bitwarden/testharness/MainActivity.kt` (+58 -0) ➕ `testharness/src/main/kotlin/com/bitwarden/testharness/MainViewModel.kt` (+55 -0) ➕ `testharness/src/main/kotlin/com/bitwarden/testharness/TestHarnessApplication.kt` (+14 -0) ➕ `testharness/src/main/kotlin/com/bitwarden/testharness/data/manager/CredentialTestManager.kt` (+80 -0) ➕ `testharness/src/main/kotlin/com/bitwarden/testharness/data/manager/CredentialTestManagerImpl.kt` (+262 -0) ➕ `testharness/src/main/kotlin/com/bitwarden/testharness/data/manager/di/CredentialTestManagerModule.kt` (+35 -0) ➕ `testharness/src/main/kotlin/com/bitwarden/testharness/data/model/CredentialTestResult.kt` (+29 -0) ➕ `testharness/src/main/kotlin/com/bitwarden/testharness/data/util/WebAuthnJsonBuilder.kt` (+102 -0) ➕ `testharness/src/main/kotlin/com/bitwarden/testharness/ui/platform/feature/autofill/AutofillPlaceholderNavigation.kt` (+58 -0) ➕ `testharness/src/main/kotlin/com/bitwarden/testharness/ui/platform/feature/autofill/AutofillPlaceholderScreen.kt` (+73 -0) ➕ `testharness/src/main/kotlin/com/bitwarden/testharness/ui/platform/feature/autofill/AutofillPlaceholderViewModel.kt` (+45 -0) ➕ `testharness/src/main/kotlin/com/bitwarden/testharness/ui/platform/feature/createpasskey/CreatePasskeyNavigation.kt` (+36 -0) ➕ `testharness/src/main/kotlin/com/bitwarden/testharness/ui/platform/feature/createpasskey/CreatePasskeyScreen.kt` (+191 -0) _...and 47 more files_ </details> ### 📄 Description ## 🎟️ Tracking PM-28086 ## 📔 Objective This PR introduces a new `:testharness` module - a standalone Android application for validating Bitwarden's Credential Manager provider implementation. **Purpose:** The test harness allows developers to exercise and verify all Credential Manager API operations that the Bitwarden app supports as a credential provider: - **Password Operations**: Create and retrieve password credentials via `CreatePasswordRequest` and `GetPasswordOption` - **Passkey Operations**: Create and retrieve passkeys via `CreatePublicKeyCredentialRequest` and `GetPublicKeyCredentialOption` - **Combined Operations**: Test hybrid flows that accept both passwords and passkeys **Architecture:** The module follows the same patterns as `:app` and `:authenticator`: - MVVM + UDF architecture with `BaseViewModel` - Hilt dependency injection throughout - Jetpack Compose UI with Material 3 - Comprehensive unit test coverage (ViewModels, Screens, and data layer) **Integration:** The test harness acts as a credential consumer client, triggering the system credential picker and allowing selection of Bitwarden as the provider. This enables end-to-end validation of credential flows without relying on external websites or apps. **Build Configuration:** Added `:testharness` to detekt (static analysis) and kover (code coverage) configurations in root `build.gradle.kts`. **Requirements:** API 28+ (uses AndroidX Credentials library with Play Services compatibility) ## 📸 Screenshots Coming soon! ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-11 03:44:43 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#12511