예제 #1
0
def test_add_many():
    todomvc.visit()

    todomvc.add('a', 'b')

    todomvc.should_have('a', 'b')
    todomvc.should_have_items_left(2)
예제 #2
0
def test_add_few():
    todomvc.visit()

    todomvc.add('a', 'b', 'c')

    todomvc.should_have('a', 'b', 'c')
    todomvc.should_have_items_left(3)
예제 #3
0
def test_complete():
    todomvc.visit()
    todomvc.add('a', 'b', 'c', 'd', 'e')

    todomvc.toggle('a', 'c', 'e')

    todomvc.should_have_active('b', 'd')
    todomvc.should_have_completed_count(3)
예제 #4
0
def test_edit_by_focus_change():
    todomvc.visit()
    todomvc.add('a', 'b', 'c')

    todomvc.edit_by_focus_change('b', 'b edited')

    todomvc.should_have('a', 'b edited', 'c')
    todomvc.should_have_items_left(3)
예제 #5
0
def test_cancel_editing():
    todomvc.visit()
    todomvc.add('a', 'b', 'c')

    todomvc.cancel_editing('c', ' to be canceled')

    todomvc.should_have('a', 'b', 'c')
    todomvc.should_have_items_left(3)
예제 #6
0
def test_items_left_count_decrement():
    todomvc.visit()
    todomvc.add('a', 'b', 'c')
    todomvc.should_have_items_left(3)

    todomvc.toggle('a').delete('c')

    todomvc.should_have_items_left(1)
예제 #7
0
def test_delete_by_edit_to_empty():
    todomvc.visit()
    todomvc.add('a', 'b', 'c')

    todomvc.edit('b', '')

    todomvc.should_have('a', 'c')
    todomvc.should_have_items_left(2)
예제 #8
0
def test_delete_last_one():
    todomvc.visit()
    todomvc.add('a')

    todomvc.delete('a')

    todomvc.should_have()
    todomvc.should_have_footer_hidden()
예제 #9
0
def test_delete():
    todomvc.visit()
    todomvc.add('a', 'b', 'c')

    todomvc.delete('b')

    todomvc.should_have('a', 'c')
    todomvc.should_have_items_left(2)
예제 #10
0
def test_edit_and_submit_by_loose_focus():
    todomvc.visit()
    todomvc.add('a', 'b', 'c')
    todomvc.should_have_items_left(3)

    todomvc.edit_and_submit_by_loose_focus('b', 'b edited')

    todomvc.should_have('a', 'b edited', 'c')
    todomvc.should_have_items_left(3)
예제 #11
0
def test_add_first_one():
    todomvc.visit().add()
    todomvc.should_have()
    todomvc.should_have_footer_hidden()

    todomvc.add('a')

    todomvc.should_have('a')
    todomvc.should_have_items_left(1)
예제 #12
0
def test_edit():
    todomvc.visit()
    todomvc.add('a', 'b', 'c')
    todomvc.should_have_items_left(3)

    todomvc.edit('b', 'b edited')

    todomvc.should_have('a', 'b edited', 'c')
    todomvc.should_have_items_left(3)
예제 #13
0
def test_clear_completed():
    todomvc.visit()
    todomvc.add('a', 'b', 'c')
    todomvc.toggle('a', 'c')

    todomvc.clear_completed()

    todomvc.should_have('b')
    todomvc.should_have_items_left(1)
예제 #14
0
def test_cancel_edit():
    todomvc.visit()
    todomvc.add('a')
    todomvc.should_have_items_left(1)

    todomvc.cancel_edit('a', 'a edited')

    todomvc.should_have('a')
    todomvc.should_have_items_left(1)
예제 #15
0
def test_complete_all():
    todomvc.visit()
    todomvc.add('a', 'b', 'c')

    todomvc.toggle_all()

    todomvc.should_have_active()
    todomvc.should_have_completed('a', 'b', 'c')
    todomvc.should_have_items_left(0)
예제 #16
0
def test_keep_storage_after_page_refresh():
    todomvc.visit()
    todomvc.add('a', 'b', 'c')
    todomvc.should_have_items_left(3)

    todomvc.refresh()
    todomvc.visit()

    todomvc.should_have('a', 'b', 'c')
    todomvc.should_have_items_left(3)
예제 #17
0
def test_activate_all():
    todomvc.visit()
    todomvc.add('a', 'b', 'c')
    todomvc.toggle_all()

    todomvc.toggle_all()

    todomvc.should_have_active('a', 'b', 'c')
    todomvc.should_have_completed()
    todomvc.should_have_items_left(3)
    todomvc.should_have_clear_completed_hidden()
예제 #18
0
def test_complete_all_with_few_competed():
    todomvc.visit()
    todomvc.add('a', 'b', 'c', 'e')
    todomvc.toggle('b', 'e')

    todomvc.toggle_all()

    todomvc.should_have_completed('a', 'b', 'c', 'e')
    todomvc.should_have_active()
    todomvc.should_have_items_left(0)
    todomvc.should_have_clear_completed_visible()
예제 #19
0
def test_activate():
    todomvc.visit()
    todomvc.add('a', 'b', 'c', 'd', 'e')
    todomvc.toggle('a', 'c', 'e')

    todomvc.toggle('a', 'c', 'e')

    todomvc.should_have_active('a', 'b', 'c', 'd', 'e')
    todomvc.should_have_completed_count(0)
    todomvc.should_have_completed()
    todomvc.should_have_items_left(5)
    todomvc.should_have_clear_completed_hidden()
예제 #20
0
def test_add_first_one():
    todomvc.visit()

    # WHEN EMPTY
    todomvc.add()

    todomvc.should_be_empty()

    # WHEN
    todomvc.add('a')

    todomvc.should_have('a')
    todomvc.should_have_items_left(1)
예제 #21
0
def test_common_todos():
    todomvc.visit()

    todomvc.add('a', 'b', 'c')
    todomvc.should_have('a', 'b', 'c')

    todomvc.edit('b', 'b edited')

    todomvc.toggle('b edited')
    todomvc.clear_completed()
    todomvc.should_have('a', 'c')

    todomvc.cancel_editing('c', ' to be canceled')

    todomvc.delete('c')
    todomvc.should_have('a')
def test_todos_life_cycle():
    todomvc.visit()

    todomvc.add('a', 'b', 'c')\
        .should_have('a', 'b', 'c')

    todomvc.edit('b', 'b edited')

    todomvc.toggle('b edited')

    todomvc.clear_completed()\
        .should_have('a', 'c')

    todomvc.cancel_edit('c', 'c to be canceled')

    todomvc.delete('c')\
        .should_have('a')
예제 #23
0
def test_delete():
    todomvc.visit()
    todomvc.add('a', 'b', 'c', 'e')

    todomvc.delete('a', 'c')