-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rb] Add PrintOptions Implementation for Ruby WebDriver #15158
base: trunk
Are you sure you want to change the base?
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
User description
Description
This PR introduces the
PrintOptions
implementation for Ruby WebDriver, aligning it with similar functionality available in Java, .NET, and Python bindings. ThePrintOptions
class (print_options.rb
) provides an interface to define printing configurations, such as page size, orientation, scale, and margins, and converts these configurations into a hash suitable for WebDriver commands.Key Changes
1.
PrintOptions
Class (lib/selenium/webdriver/print_options.rb
):Added a class to manage print configurations with default values:
portrait
1.0
false
Letter
(21.59 cm x 27.94 cm).2. Supports predefined page sizes:
to_h
method generates a hash representation of the options for WebDriver.Unit Tests (
spec/unit/selenium/print_options_spec.rb
):Added tests to ensure:
Testing
Verified functionality through the rspec test suite:
rspec spec/unit/selenium/print_options_spec.rb
- Result: All tests pass successfully.Reference Implementations
This implementation follows the structure and functionality of the
PrintOptions
feature in other languages:PR Type
Enhancement, Tests
Description
Introduced
PrintOptions
class for Ruby WebDriver to manage print configurations.Added support for default, predefined, and custom page sizes.
Implemented
to_h
method to convert configurations into WebDriver-compatible hash.Added comprehensive unit tests for
PrintOptions
functionality.Changes walkthrough 📝
print_options.rb
Introduced `PrintOptions` class for print configurations
rb/lib/selenium/webdriver/print_options.rb
PrintOptions
class to manage print configurations.to_h
method for hash conversion.spec_helper.rb
Added RSpec configuration for tests
rb/spec/spec_helper.rb
PrintOptions
testing.print_options_spec.rb
Added unit tests for `PrintOptions` functionality
rb/spec/unit/selenium/print_options_spec.rb
PrintOptions
class.