add utils.wait_for_idle in js tests

and use it in execute_cell_then, since there is not always output.