From 33ca649b0b4e8957936e513e269f63dba46c481a Mon Sep 17 00:00:00 2001 From: M Pacer Date: Fri, 23 Mar 2018 11:04:25 -0700 Subject: [PATCH] add get_rendered_contents helper function --- notebook/tests/selenium/test_markdown.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/notebook/tests/selenium/test_markdown.py b/notebook/tests/selenium/test_markdown.py index 053942e77..c79da273a 100644 --- a/notebook/tests/selenium/test_markdown.py +++ b/notebook/tests/selenium/test_markdown.py @@ -13,6 +13,15 @@ def notebook(authenticated_browser): return Notebook.new_notebook(authenticated_browser) +def get_rendered_contents(nb): + cl = ["text_cell", "render"] + rendered_cells = [cell.find_element_by_class_name("text_cell_render") + for cell in nb.cells + if all([c in cell.get_attribute("class") for c in cl])] + return [x.get_attribute('innerHTML').strip() + for x in rendered_cells + if x is not None] + def test_markdown_cell(notebook): nb = notebook nb[:] = ["# Foo"]