Permalink
Browse files

[py] add headless convenience method for Firefox Options

  • Loading branch information...
lmtierney committed Nov 16, 2017
1 parent a70ab21 commit 1d490b4f75cc645f4f15a363f7d31a831f49528d
Showing with 19 additions and 0 deletions.
  1. +19 −0 py/selenium/webdriver/firefox/options.py
@@ -110,6 +110,25 @@ def add_argument(self, argument):
raise ValueError()
self._arguments.append(argument)
@property
def headless(self):
"""
Returns whether or not the headless argument is set
"""
return '-headless' in self._arguments
def set_headless(self, headless=True):
"""
Sets the headless argument
Args:
headless: boolean value indicating to set the headless option
"""
if headless:
self._arguments.append('-headless')
elif '-headless' in self._arguments:
self._arguments.remove('-headless')
def to_capabilities(self):
"""Marshals the Firefox options to a `moz:firefoxOptions`
object.

0 comments on commit 1d490b4

Please sign in to comment.