-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[py] removed redundant attributes capabilities
and set_capability
in wpewebkit/options.py
#12169
Conversation
…into different lines
Codecov ReportPatch coverage has no change and project coverage change:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## trunk #12169 +/- ##
==========================================
+ Coverage 56.52% 56.56% +0.04%
==========================================
Files 86 86
Lines 5454 5450 -4
Branches 223 223
==========================================
Hits 3083 3083
+ Misses 2148 2144 -4
Partials 223 223
☔ View full report in Codecov by Sentry. |
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, @sandeepsuryaprasad!
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
Removed redundant methods
capabilities
andset_capability
inwpewebkit/options.py
Since
Options
class inwpewebkit/options.py
inherits fromArgOptions
, I have removed redundant methods which sets and gets capabilities.Replaced
set_capabilities
method with a setter method to add capabilities toself._caps
.Motivation and Context
Since both methods
capabilities
andset_capability
are already implemented in parent classselenium.webdriver.common.options.ArgOptions
, I found that same attributes are being implemented once again inwpewebkit/options.py
.To get the capabilities from internal dictionary
self._caps
we do have a getter method inselenium.webdriver.common.options.Options
class@property
def capabilities(self):
return _caps
And the capabilities are being set through
set_capabilities
method. For the purpose of consistency I haverepalced
set_capabilities()
method inselenium.webdriver.common.options.Options
class to a setter method.@property.setter
def capabilities(self, values):
name, value = values
self._caps[name] = value
so now the capabilities can be set through setter,
self.capabilities
=
("pageLoadStrategy", "normal")
Types of changes
Checklist