-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Refactor ChromeDriverFunctionalTest: #14398
Conversation
…tants Removed the CLIPBOARD_READ and CLIPBOARD_WRITE constants from the class level in ChromeDriverFunctionalTest to avoid redundancy. These constants are now defined within the canSetPermission method, reducing unnecessary visibility and improving code cohesion. This change simplifies maintenance and enhances code clarity without altering existing functionality.
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @manuelsblanco!
User description
Remove redundant permission cons…tants
Removed the CLIPBOARD_READ and CLIPBOARD_WRITE constants from the class level in ChromeDriverFunctionalTest to avoid redundancy. These constants are now defined within the canSetPermission method, reducing unnecessary visibility and improving code cohesion.
This change simplifies maintenance and enhances code clarity without altering existing functionality.
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
In this commit, I refactored the ChromeDriverFunctionalTest class by removing the redundant CLIPBOARD_READ and CLIPBOARD_WRITE constants from the class level. These constants are now defined within the canSetPermission method where they are used, which reduces unnecessary visibility and improves the cohesion of the code. This change helps to simplify the structure and readability of the test code without impacting its functionality.
Motivation and Context
The change is required to improve the maintainability and clarity of the ChromeDriverFunctionalTest code. By removing the redundant constants from the class level and defining them within the specific method where they are used, we reduce unnecessary global visibility and enhance the code's cohesion. This refactor makes the code easier to understand and maintain, ensuring that constants are only accessible where they are needed, which is a better practice for clean and organized code.
Types of changes
Checklist
PR Type
enhancement
Description
ChromeDriverFunctionalTest
by removing redundant class-level constantsCLIPBOARD_READ
andCLIPBOARD_WRITE
.canSetPermission
method to improve code cohesion.Changes walkthrough 📝
ChromeDriverFunctionalTest.java
Refactor to remove redundant permission constants
java/test/org/openqa/selenium/chrome/ChromeDriverFunctionalTest.java
CLIPBOARD_READ
andCLIPBOARD_WRITE
.CLIPBOARD_READ
andCLIPBOARD_WRITE
within thecanSetPermission
method.