Skip to content

Commit

Permalink
Enable silent= for execute_script
Browse files Browse the repository at this point in the history
  • Loading branch information
Milan Falešník committed Oct 19, 2016
1 parent ff1b159 commit 72e6ec9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/widgetastic/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,8 @@ def move_by_offset(self, x, y):

def execute_script(self, script, *args, **kwargs):
"""Executes a script."""
self.logger.debug('execute_script: %r', script)
if not kwargs.pop('silent', False):
self.logger.debug('execute_script: %r', script)
return self.selenium.execute_script(dedent(script), *args, **kwargs)

def classes(self, *args, **kwargs):
Expand All @@ -377,7 +378,8 @@ def classes(self, *args, **kwargs):
A :py:class:`set` of strings with classes.
"""
return set(self.execute_script(
"return arguments[0].classList;", self.element(*args, **kwargs)))
"return arguments[0].classList;", self.element(*args, **kwargs), silent=True))


def tag(self, *args, **kwargs):
"""Returns the tag name of the element represented by the locator passed.
Expand Down

0 comments on commit 72e6ec9

Please sign in to comment.