Skip to content

Commit 5567397

Browse files
authored
update selenium tests after new branca version (#1585)
1 parent c091b36 commit 5567397

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/selenium/test_selenium.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,17 @@ def __init__(self):
7070
def handle_starttag(self, tag, attrs):
7171
if tag == 'iframe':
7272
attrs = dict(attrs)
73-
if 'data-html' in attrs:
73+
if 'srcdoc' in attrs:
74+
html_bytes = attrs['srcdoc'].encode()
75+
elif 'data-html' in attrs: # legacy
7476
data_html = attrs['data-html']
7577
if '%' in data_html[:20]:
7678
# newest branca version: data-html is percent-encoded
7779
html_bytes = unquote(data_html).encode()
7880
else:
7981
# legacy branca version: data-html is base64 encoded
8082
html_bytes = base64.b64decode(data_html)
81-
else: # legacy, can be removed when all notebooks have `data-html`.
83+
else: # legacy
8284
src = attrs['src']
8385
html_base64 = src.split(',')[-1]
8486
html_bytes = base64.b64decode(html_base64)

0 commit comments

Comments
 (0)