Beispiel #1
0
def test_add_many():
    todomvc.visit()

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

    todomvc.should_have('a', 'b')
    todomvc.should_have_items_left(2)
Beispiel #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)
Beispiel #3
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)
Beispiel #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)
Beispiel #5
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)
Beispiel #6
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)
Beispiel #7
0
def test_delete_last_one():
    todomvc.visit()
    todomvc.add('a')

    todomvc.delete('a')

    todomvc.should_have()
    todomvc.should_have_footer_hidden()
Beispiel #8
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)
Beispiel #9
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)
Beispiel #10
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)
Beispiel #11
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)
Beispiel #12
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)
Beispiel #13
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)
Beispiel #14
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)
Beispiel #15
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')