-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add unit tests for simple argument checks
- Loading branch information
byron
committed
Sep 3, 2019
1 parent
4489e51
commit af86268
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import pytest | ||
from dash.testing.browser import Browser | ||
from dash.testing.consts import SELENIUM_GRID_DEFAULT | ||
|
||
|
||
@pytest.mark.parametrize("browser_type", ("Chrome", "Firefox")) | ||
def test_browser_smoke(browser_type, tmpdir): | ||
|
||
browser = Browser( | ||
browser=browser_type, | ||
remote=False, | ||
remote_url=SELENIUM_GRID_DEFAULT, | ||
headless=True, | ||
options=None, | ||
download_path=tmpdir.mkdir("download").strpath, | ||
percy_finalize=True, | ||
) | ||
assert browser.driver.name == browser_type.lower() | ||
|
||
|
||
def test_browser_use_remote_webdriver(tmpdir): | ||
# test creation with remote=True | ||
with pytest.raises(Exception): | ||
Browser( | ||
browser="Chrome", | ||
remote=True, | ||
remote_url=SELENIUM_GRID_DEFAULT, | ||
headless=True, | ||
options=None, | ||
download_path=tmpdir.mkdir("download").strpath, | ||
percy_finalize=True, | ||
) | ||
|
||
# test creation with remote_url other than default | ||
with pytest.raises(Exception): | ||
Browser( | ||
browser="Chrome", | ||
remote=False, | ||
remote_url="http://token@any.selenium.grid:3333", | ||
headless=True, | ||
options=None, | ||
download_path=tmpdir.mkdir("download").strpath, | ||
percy_finalize=True, | ||
) |