mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 04:45:45 +00:00
Bug 1370863 - Remove Marionette.log API from client; r=automatedtester
MozReview-Commit-ID: FjBQ2p1DyLn --HG-- extra : rebase_source : 141b3bd768bbe7c5cce108a8ffefa5514773f366
This commit is contained in:
parent
1ebaf83053
commit
acbfad9780
@ -14,25 +14,6 @@ a related topic about `using the debugger with Marionette`_ on MDN.
|
||||
.. _ones that ship with Gecko: https://developer.mozilla.org/en-US/docs/Tools
|
||||
.. _using the debugger with Marionette: https://developer.mozilla.org/en-US/docs/Marionette/Debugging
|
||||
|
||||
|
||||
Storing Logs on the Server
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
By calling `~Marionette.log` it is possible to store a message on the server.
|
||||
Logs can later be retrieved using `~Marionette.get_logs`. For example::
|
||||
|
||||
try:
|
||||
marionette.log("Sending a click event") # logged at INFO level
|
||||
elem.click()
|
||||
except:
|
||||
marionette.log("Something went wrong!", "ERROR")
|
||||
|
||||
print(marionette.get_logs())
|
||||
|
||||
Disclaimer: Example for illustrative purposes only, don't actually hide
|
||||
tracebacks like that!
|
||||
|
||||
|
||||
Seeing What's on the Page
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
@ -1850,34 +1850,6 @@ class Marionette(object):
|
||||
return HTMLElement(self, el_or_ref)
|
||||
return el_or_ref
|
||||
|
||||
def log(self, msg, level="INFO"):
|
||||
"""Stores a timestamped log message in the Marionette server
|
||||
for later retrieval.
|
||||
|
||||
:param msg: String with message to log.
|
||||
:param level: String with log level (e.g. "INFO" or "DEBUG").
|
||||
Defaults to "INFO".
|
||||
"""
|
||||
body = {"value": msg, "level": level}
|
||||
self._send_message("log", body)
|
||||
|
||||
def get_logs(self):
|
||||
"""Returns the list of logged messages.
|
||||
|
||||
Each log message is an array with three string elements: the level,
|
||||
the message, and a date.
|
||||
|
||||
Usage example::
|
||||
|
||||
marionette.log("I AM INFO")
|
||||
marionette.log("I AM ERROR", "ERROR")
|
||||
logs = marionette.get_logs()
|
||||
assert logs[0][1] == "I AM INFO"
|
||||
assert logs[1][1] == "I AM ERROR"
|
||||
"""
|
||||
return self._send_message("getLogs",
|
||||
key="value" if self.protocol == 1 else None)
|
||||
|
||||
def add_cookie(self, cookie):
|
||||
"""Adds a cookie to your current session.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user