Repository navigation
osn-selenium v1.0.0-beta.8
Pre-releaseosn-selenium v1.0.0-beta.8 - Global Refactor & Custom Error Architecture
This release introduces a major structural overhaul of the library, focusing on establishing a clean public API, implementing a robust custom exception hierarchy, and improving internal code documentation. v1.0.0-beta.8 moves the library closer to a stable release by enforcing strict visibility rules and improving developer experience through comprehensive docstrings and semantic error handling.
Key Improvements in v1.0.0-beta.8:
- Semantic Error Handling: Replaced generic Python exceptions with a new, comprehensive custom exception hierarchy located in
osn_selenium.exceptions. This includes specific errors such asWebDriverNotStartedError,ProtocolComplianceError,InvalidWindowHandleError, andCDPCommandNotFoundError, allowing for much more precise error catching and debugging. - Clean Public API Enforcement: Implemented
__all__exports across the entire codebase. This strictly defines which classes and methods are part of the public API and hides internal utility functions, preventing IDE pollution and ensuring a more stable interface for end-users. - Codebase Reorganization and Renaming: Performed a global refactor of internal modules. Utility files have been renamed (e.g.,
_functions.py,_typehints.py,_validators.py) to follow consistent internal naming conventions, and logic has been moved to more appropriate namespaces (e.g., separatingmodelsfromtypehints). - Comprehensive Documentation: Extensively added and updated docstrings for nearly all modules, classes, and methods. This significantly improves the integrated help within IDEs and provides clearer guidance on parameter types and expected behaviors.
- Refined Type Hinting: Consolidated type definitions into dedicated
_typehints.pyfiles. Introduced unified hints likePATH_TYPEHINTandARCHITECTURES_TYPEHINTto ensure consistency in how paths and system architectures are handled throughout the library. - Internal Performance & Logic Tweaks: Optimized internal method lookups by renaming private implementation methods (e.g., suffixing with
_impl). Improved theArrayRulelogic in JavaScript fingerprinting by utilizing Pydanticmodel_validatorfor more reliable channel cleanup. - Enhanced Path Validation: Introduced a centralized
validate_pathutility that ensures all browser and WebDriver paths are correctly resolved and validated before use, raising specificPathValidationErrorwhen issues occur.
Putting It All Together:
v1.0.0-beta.8 is a "developer-first" update. While the core functionality remains familiar, the underlying architecture is now significantly more professional and robust. By switching to custom exceptions and a strict public API, we've made the library easier to extend, simpler to debug, and much more predictable for large-scale automation projects.