Beispiel #1
0
def runnotebook(ctx, nbname):
    br = ctx.browser
    om = ctx.feature.om
    br.visit(ctx.feature.jynb_url)
    nb = Notebook(br)
    # FIXME sometimes it takes long for the nb to appear. why?
    nb.open_notebook(nbname, retry=10)
    nb.run_all_cells(wait=True)
    nb.save_notebook()
    assert not br.is_text_present('Error')
    assert not br.is_text_present('Exception')
    assert not br.is_text_present('failed')
    assert not br.is_text_present('MissingSchema')
    assert not br.is_text_present('error')
Beispiel #2
0
def runnotebook(ctx, nbname):
    br = ctx.browser
    om = ctx.feature.om
    userid = getattr(om.runtime.auth, 'userid', '')
    br.visit(jburl(ctx.feature.jynb_url, userid, nbstyle='tree'))
    nb = Notebook(br)
    # FIXME sometimes it takes long for the nb to appear. why?
    nb.open_notebook(nbname, retry=10)
    nb.run_all_cells(wait=True)
    nb.save_notebook()
    assert not br.is_text_present('Error')
    assert not br.is_text_present('Exception')
    assert not br.is_text_present('failed')
    assert not br.is_text_present('MissingSchema')
    assert not br.is_text_present('error')
Beispiel #3
0
def create_notebook(ctx):
    br = ctx.browser
    nb = Notebook(br)
    nb.create_notebook()
    nb.save_notebook()
    assert not br.is_text_present('error while saving')
    # test code execution
    code = """
    print('hello')
    """.strip()
    nb.current_cell_exec(code)
    sleep(1)
    assert nb.current_cell_output() == 'hello'
    nb.save_notebook()
    assert not br.is_text_present('error while saving')