back

Hardware Mocks & E2E for Biometric Ecosystem

.NET / Playwright / FlaUI / 2024

The Context

Testing a biometric security ecosystem (desktop and web applications) presented a critical bottleneck: E2E tests were hard-coupled to physical biometric scanners. This meant tests could only run sequentially on specific local machines in a lab. CI/CD pipelines were paralyzed, scaling to cloud runners was impossible, and hardware dependencies caused constant flaky test failures.

The Architecture

To unblock CI/CD, I architected a hardware abstraction layer in C# to completely decouple the software from the physical devices. By leveraging Dependency Injection, the test framework (Playwright for Web, FlaUI for Desktop) injects mock scanner payloads during test execution. This allows the pipeline to programmatically simulate complex edge cases (e.g., spoofed reads, hardware disconnects, corrupted biometric data) that are extremely difficult to reproduce manually.


    [Physical Scanner] ---X (Decoupled)

    [Playwright/FlaUI] ---> [Mock Layer (C#)] ---> [System Under Test]
                            |
                Injects valid/invalid
                biometric payloads via DI

The Impact

  • Cloud Execution: Decoupled test execution from physical hardware, enabling 100% parallelization on GitLab cloud runners.
  • Speed: Optimized pipeline workflows, reducing overall deployment time by 50%.
  • Coverage Gates: Enforced strict quality gates, driving unit and integration test coverage to 75% across the engineering team.