$ show atata-framework/atata
The Atata Framework is a full-featured C#/.NET test automation framework primarily designed for web UI testing via Selenium WebDriver. It implements a fluent page object model where test pages are represented as typed classes with controls declared as properties, configured through attributes for element location (FindByLabel, FindByCss, etc.), interaction behaviors (ClickBehaviorAttribute, ValueSetBehaviorAttribute), and lifecycle triggers (WaitForAttribute, VerifyTitleAttribute). The framework goes beyond WebDriver integration to provide a universal testing infrastructure including session management with borrowing and pooling, an event bus for lifecycle hooks (AtataContext init/deinit, session events), configurable logging with nested sections and secret masking, and a verification system with should/expect/wait strategies that support retrying assertions. The architecture is builder-driven: AtataContextBuilder configures the test context (culture, timeouts, events), while WebDriverSessionBuilder sets up browser drivers (Chrome, Firefox, Edge, etc.) with screenshot and page snapshot strategies. The system is designed to be extensible through custom attributes, event handlers, log consumers, and strategy implementations. External dependencies include Selenium.WebDriver, and optional adapters for NUnit, xUnit, MSTest, and Reqnroll. The included test application (Atata.TestApp) is a Razor Pages fixture used by integration tests, not a production artifact.
The LLM identified 4 files worth highlighting for reuse:
A synchronized event bus implementing publish/subscribe with support for both synchronous and asynchronous handlers. Handlers are registered with generic event types and invoked in order. Uses a lock for thread safety and supports conditional handlers. This component is isolated (depends only on EventSubscriptionItem and interfaces), demonstrates non-obvious concurrency handling, and could be extracted into any .NET project needing decoupled event-driven communication.
Resolves term casing (e.g., camelCase, PascalCase, kebab-case, snake_case) using a chain of formatter strategies registered in a dictionary. Each formatter (PascalTermFormatter, CamelTermFormatter, etc.) implements ITermFormatter and applies a specific transformation. The resolver selects and applies the appropriate formatter based on TermCase enum. This component is completely self-contained (no internal Atata dependencies), demonstrates a clean strategy pattern, and is reusable for any project requiring flexible string formatting.
Base class for test subject providers that supports lazy evaluation, dynamic object sources, and chained transformations (ResultOf, SubjectOf, DynamicSubjectOf). Provides act/arrange/invoking methods and integrates with the verification system via Should and ExpectTo. Demonstrates a sophisticated fluent builder pattern with generic type tracking (TObject, TSubject) and deferred execution. While somewhat coupled to IObjectProvider and verification interfaces, its core pattern of wrapping a value with transformation and assertion chaining is highly reusable in test libraries and data validation contexts.
A generic retry mechanism with configurable timeout, interval, and exception filtering. Supports both synchronous and asynchronous invocations, optional logging of retry attempts, and a predicate to stop retrying based on caught exceptions. Uses a stopwatch-based loop without Thread.Sleep (instead Task.Delay for async, and a short spin-wait for sync). The implementation is self-contained (only uses System and System.Threading.Tasks) and demonstrates careful handling of timeouts, overflow protection, and cancellation. It can be extracted directly into any .NET project needing robust retry logic.