Skip to content

osn-selenium v1.0.0-beta.8

Pre-release
Pre-release

Choose a tag to compare

@oddshellnick oddshellnick released this 24 Jan 06:28
· 5 commits to dev since this release

osn-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:

  1. Semantic Error Handling: Replaced generic Python exceptions with a new, comprehensive custom exception hierarchy located in osn_selenium.exceptions. This includes specific errors such as WebDriverNotStartedError, ProtocolComplianceError, InvalidWindowHandleError, and CDPCommandNotFoundError, allowing for much more precise error catching and debugging.
  2. 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.
  3. 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., separating models from typehints).
  4. 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.
  5. Refined Type Hinting: Consolidated type definitions into dedicated _typehints.py files. Introduced unified hints like PATH_TYPEHINT and ARCHITECTURES_TYPEHINT to ensure consistency in how paths and system architectures are handled throughout the library.
  6. Internal Performance & Logic Tweaks: Optimized internal method lookups by renaming private implementation methods (e.g., suffixing with _impl). Improved the ArrayRule logic in JavaScript fingerprinting by utilizing Pydantic model_validator for more reliable channel cleanup.
  7. Enhanced Path Validation: Introduced a centralized validate_path utility that ensures all browser and WebDriver paths are correctly resolved and validated before use, raising specific PathValidationError when 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.