-
-
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.
Merge pull request #894 from plotly/remote-grid
Remote grid
- Loading branch information
Showing
5 changed files
with
105 additions
and
21 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
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
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 @@ | ||
SELENIUM_GRID_DEFAULT = "http://localhost:4444/wd/hub" |
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
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, | ||
) |