Skip to content

Commit

Permalink
Merge pull request #2035 from plotly/fix-debugger-html
Browse files Browse the repository at this point in the history
Fix debugger html
  • Loading branch information
alexcjohnson authored May 3, 2022
2 parents c3b19b3 + 773ad67 commit 85b955d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).

- [#1976](https://github.com/plotly/dash/pull/1976) Fix [#1962](https://github.com/plotly/dash/issues/1962) in which DatePickerSingle and DatePickerRange are extremely slow when provided a long list of disabled_days.

- [#2035](https://github.com/plotly/dash/pull/2035) Fix [#2033](https://github.com/plotly/dash/issues/2033) In-App error reporting does not render HTML.

### Changed

- [#2016](https://github.com/plotly/dash/pull/2016) Drop the 375px width from default percy_snapshot calls, keep only 1280px
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,10 @@ function UnconnectedErrorContent({error, base}) {
</div>
)}
{/* Backend Error */}
{typeof error.html !== 'string' ? null : error.html.indexOf(
'<!DOCTYPE'
) === 0 ? (
{typeof error.html !== 'string' ? null : error.html
.split()[0]
.toLowerCase()
.startsWith('<!doctype') ? (
<div className='dash-be-error__st'>
<div className='dash-backend-error'>
{/* Embed werkzeug debugger in an iframe to prevent
Expand Down
10 changes: 7 additions & 3 deletions dash/testing/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import logging
import warnings
import percy
import requests

from selenium import webdriver
from selenium.webdriver.support import expected_conditions as EC
Expand Down Expand Up @@ -188,8 +189,14 @@ def percy_snapshot(
"""
)

try:
self.percy_runner.snapshot(name=snapshot_name, widths=widths)
except requests.HTTPError as err:
# Ignore retries.
if err.request.status_code != 400:
raise err

if convert_canvases:
self.driver.execute_script(
"""
const stash = window._canvasStash;
Expand All @@ -204,9 +211,6 @@ def percy_snapshot(
"""
)

else:
self.percy_runner.snapshot(name=snapshot_name, widths=widths)

def take_snapshot(self, name):
"""Hook method to take snapshot when a selenium test fails. The
snapshot is placed under.
Expand Down

0 comments on commit 85b955d

Please sign in to comment.