diff --git a/CHANGELOG.md b/CHANGELOG.md index b1bd86b201..c01162d74e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,9 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## Unreleased ### Added -- [#967](https://github.com/plotly/dash/pull/967) Adds support for defining +- [#967](https://github.com/plotly/dash/pull/967) Add support for defining clientside JavaScript callbacks via inline strings. +- [#1020](https://github.com/plotly/dash/pull/1020) Allow `visit_and_snapshot` API in `dash.testing.browser` to stay on the page so you can run other checks. ### Fixed - [#1018](https://github.com/plotly/dash/pull/1006) Fix the `dash.testing` **stop** API with process application runner in Python2. Use `kill()` instead of `communicate()` to avoid hanging. diff --git a/dash/testing/browser.py b/dash/testing/browser.py index 44dba546bb..e89b894867 100644 --- a/dash/testing/browser.py +++ b/dash/testing/browser.py @@ -106,7 +106,12 @@ def __exit__(self, exc_type, exc_val, traceback): logger.exception("percy runner failed to finalize properly") def visit_and_snapshot( - self, resource_path, hook_id, wait_for_callbacks=True, assert_check=True + self, + resource_path, + hook_id, + wait_for_callbacks=True, + assert_check=True, + stay_on_page=False ): try: path = resource_path.lstrip("/") @@ -121,7 +126,8 @@ def visit_and_snapshot( assert not self.driver.find_elements_by_css_selector( "div.dash-debug-alert" ), "devtools should not raise an error alert" - self.driver.back() + if not stay_on_page: + self.driver.back() except WebDriverException as e: logger.exception("snapshot at resource %s error", path) raise e