Skip to content

Commit

Permalink
fullscreen option for chrome driver
Browse files Browse the repository at this point in the history
  • Loading branch information
wpjunior committed May 24, 2014
1 parent 34ead6f commit f9a7f36
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
7 changes: 6 additions & 1 deletion splinter/driver/webdriver/chrome.py
Expand Up @@ -14,12 +14,17 @@ class WebDriver(BaseWebDriver):

driver_name = "Chrome"

def __init__(self, user_agent=None, wait_time=2, **kwargs):
def __init__(self, user_agent=None, wait_time=2, fullscreen=False,
**kwargs):

options = Options()

if user_agent is not None:
options.add_argument("--user-agent=" + user_agent)

if fullscreen:
options.add_argument('--kiosk')

self.driver = Chrome(chrome_options=options, **kwargs)

self.element_class = WebDriverElement
Expand Down
19 changes: 19 additions & 0 deletions tests/test_webdriver_chrome.py
Expand Up @@ -51,3 +51,22 @@ def test_attach_file(self):
def test_should_support_with_statement(self):
with Browser('chrome') as internet:
pass


@unittest.skipIf(not chrome_installed(), 'chrome is not installed')
class ChromeBrowserFullscreenTest(WebDriverTests, unittest.TestCase):

@classmethod
def setUpClass(cls):
cls.browser = Browser("chrome", fullscreen=True)

@classmethod
def tearDownClass(cls):
cls.browser.quit()

def setUp(self):
self.browser.visit(EXAMPLE_APP)

def test_should_support_with_statement(self):
with Browser('chrome', fullscreen=True) as internet:
pass

0 comments on commit f9a7f36

Please sign in to comment.