예제 #1
0
def test_assure_and_alias_methods():
    given_active("a")
    s("#clear-completed").assure(hidden)
    s("#clear-completed").insist(hidden)
    s("#clear-completed").should(hidden)
    s("#clear-completed").should_be(hidden)
    s("#clear-completed").should_have(hidden)
예제 #2
0
def test_assure_and_alias_methods():
    given_active("a")
    s("#clear-completed").assure(hidden)
    s("#clear-completed").insist(hidden)  # alias
    s("#clear-completed").should(hidden)  # alias
    s("#clear-completed").should_be(hidden)  # alias
    s("#clear-completed").should_have(hidden)  # alias
def test_selements_collections_of_custom_selements():
    given_active("a", "b", "c")
    ss("#todo-list>li").of(Task)[1].delete()
    ss("#todo-list>li").of(Task).assure(texts("a", "c"))

    ss("#todo-list>li").of(Task).find(text("c")).delete()
    ss("#todo-list>li").of(Task).assure(texts("a"))
def test_nested_custom_selements():
    given_active("a", "b")

    page = TodoMVC("#todoapp") # it's more widget than page... todo: rename to todomvc, etc...

    page.tasks.find(text("b")).toggle()
    page.clear_completed()
    page.tasks.assure(texts("a"))
def test_nested_custom_selements():
    given_active("a", "b")

    page = TodoMVC("#todoapp") # it's more widget than page... todo: rename to todomvc, etc...

    page.tasks.find(text("b")).toggle()
    page.clear_completed()
    page.tasks.assure(texts("a"))
    page.footer.assure_items_left(1)
예제 #6
0
def test_by_text_with_single_and_double_quotes():
    given_active("""Fred's last name is "Li".""")
    assert find_element(by_text("""Fred's last name is "Li".""")).is_displayed()
def test_selements_collections_of_custom_selements_iterator():
    given_active("a", "b", "c")
    for task in ss("#todo-list>li", of=Task):
        task.delete()
    ss("#todo-list>li").of(Task).assure(empty)
def test_custom_selement():
    given_active("a", "b")
    Task("#todo-list>li:nth-child(1)").delete()
    ss("#todo-list>li").assure(texts("b"))
예제 #9
0
def test_assure_fails():
    given_active("a", "b")
    with pytest.raises(TimeoutException):
        ss("#todo-list>li").assure(exact_texts("a.", "b."), timeout=0.1)
예제 #10
0
def test_assure_passes():
    given_active("a", "b")
    ss("#todo-list>li").assure(exact_texts("a", "b"))
def test_custom_selement():
    given_active("a", "b")
    Task("#todo-list>li:nth-child(1)").delete()
    ss("#todo-list>li").assure(texts("b"))
예제 #12
0
def test_search_inner_selements_collection():
    given_active("a", "b")
    s("#todo-list").ss("li").assure(exact_texts("a", "b"))
예제 #13
0
def test_search_inner_selement():
    given_active("a", "b")
    s("#todo-list").s("li").assure(exact_text("a"))
예제 #14
0
def test_by_text_with_single_and_double_quotes():
    given_active("""Fred's last name is "Li".""")
    assert find_element(
        by_text("""Fred's last name is "Li".""")).is_displayed()
예제 #15
0
def test_assure_hidden():
    given_active("a")
    s("#clear-completed").assure(hidden)
def test_selements_collections_of_custom_selements_iterator():
    given_active("a", "b", "c")
    for task in ss("#todo-list>li", of=Task):
        task.delete()
    ss("#todo-list>li").of(Task).assure(empty)