B
    3\                 @   s4   d dl mZ ddlmZ dd Zdd Zdd	 Zd
S )    )Keys   )shiftc             C   s   d}| j |S )NzKreturn Jupyter.notebook.get_cells().map(function(c) {return c.get_text();}))browserexecute_script)nbZJS r   ?lib/python3.7/site-packages/notebook/tests/selenium/undelete.pyget_cells_contents   s    r
   c             C   s   | j d d S )Nz!Jupyter.notebook.undelete_cell();)r   r   )r   r   r   r	   undelete   s    r   c             C   s  d}d}d}d}| j d|d | ||| |   t| ||||gksLt| d t| jtj	 | j
d t| ||gkst| d | j
d t| |gkstt|  t| ||gkstt|  t| ||||gkstt|  t| ||||gks
t| d t| jtj	 | j
d t| ||gksDtt|  t| ||||gksft| d	 t| jtj | j
d t| ||gkstt|  t| ||||gkst|d
 | }| d t| jd t| jd t| |||gkstt|  t| ||||gks*t|d
 | }| d	 t| jd t| jd t| |||gksptt|  t| ||||gkst| j d|d | j d|d t| ||||gkst|d
 | }| d | jd t| |||gkstt|  t| ||||gks$t|d
 | }| d	 | jd t| |||gks^tt|  t| ||||gkstd S )Nz
print("a")z
print("b")z
print("c")z
print("d")r   )indexZcontentr   Zddz

jmk   z$Jupyter.notebook.merge_cell_below();z$Jupyter.notebook.merge_cell_above();)Z	edit_cellappendZto_command_moder
   AssertionErrorZ
focus_cellr   r   r   ZDOWNZcurrent_cellZ	send_keysr   ZUPr   )ZnotebookabcdZbcZcdZabr   r   r	   test_undelete_cells   s|    







r   N)Zselenium.webdriver.common.keysr   Zutilsr   r
   r   r   r   r   r   r	   <module>   s   