-
-
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
Be consistent with webdriver init kwarg service_log_path #5979
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,16 +25,16 @@ | |
DEFAULT_PORT = 0 | ||
DEFAULT_HOST = None | ||
DEFAULT_LOG_LEVEL = None | ||
DEFAULT_LOG_FILE = None | ||
DEFAULT_SERVICE_LOG_PATH = None | ||
|
||
|
||
class WebDriver(RemoteWebDriver): | ||
""" Controls the IEServerDriver and allows you to drive Internet Explorer """ | ||
|
||
def __init__(self, executable_path='IEDriverServer.exe', capabilities=None, | ||
port=DEFAULT_PORT, timeout=DEFAULT_TIMEOUT, host=DEFAULT_HOST, | ||
log_level=DEFAULT_LOG_LEVEL, log_file=DEFAULT_LOG_FILE, options=None, | ||
ie_options=None, desired_capabilities=None): | ||
log_level=DEFAULT_LOG_LEVEL, service_log_path=DEFAULT_SERVICE_LOG_PATH, options=None, | ||
ie_options=None, desired_capabilities=None, log_file=None): | ||
""" | ||
Creates a new instance of the chrome driver. | ||
|
||
|
@@ -45,19 +45,20 @@ def __init__(self, executable_path='IEDriverServer.exe', capabilities=None, | |
- capabilities: capabilities Dictionary object | ||
- port - port you would like the service to run, if left as 0, a free port will be found. | ||
- log_level - log level you would like the service to run. | ||
- log_file - log file you would like the service to log to. | ||
- service_log_path - target of logging of service, may be "stdout", "stderr" or file path. | ||
- options: IE Options instance, providing additional IE options | ||
- desired_capabilities: alias of capabilities; this will make the signature consistent with RemoteWebDriver. | ||
""" | ||
if log_file: | ||
warnings.warn('use service_log_path instead of log_file', DeprecationWarning) | ||
service_log_path = log_file | ||
if ie_options: | ||
warnings.warn('use options instead of ie_options', DeprecationWarning) | ||
options = ie_options | ||
self.port = port | ||
if self.port == 0: | ||
self.port = utils.free_port() | ||
self.host = host | ||
self.log_level = log_level | ||
self.log_file = log_file | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason to spare There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see a code relevance as to why they are included as instance vars other than the fact that you can check them after setting them since they aren't available on the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But you're right, I don't see them in any other webdrivers. |
||
|
||
# If both capabilities and desired capabilities are set, ignore desired capabilities. | ||
if capabilities is None and desired_capabilities: | ||
|
@@ -77,8 +78,8 @@ def __init__(self, executable_path='IEDriverServer.exe', capabilities=None, | |
executable_path, | ||
port=self.port, | ||
host=self.host, | ||
log_level=self.log_level, | ||
log_file=self.log_file) | ||
log_level=log_level, | ||
log_file=service_log_path) | ||
|
||
self.iedriver.start() | ||
|
||
|
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.
Adding a
stacklevel
here and in the similar instances below, would help make the resultant warnings clearer, since they would reference the offending caller rather than the.warn()
line in these files. I've filed #6274 for this (but it would be good to watch out for this when reviewing future PRs).