def test_complete_task(): given_active("a", "b") page = TodoMVC() page.tasks.task("b").toggle() page.clear_completed() page.tasks.should_be("a") page.footer.should_have_items_left(1)
def test_search_inner_selene_collection(): given_active("a", "b") s("#todo-list").all("li").should(have.exact_texts("a", "b"))
def test_search_inner_selement(): given_active("a", "b") s("#todo-list").s("li").should(have.exact_text("a"))
def test_assure_and_alias_methods(): given_active("a") s("#clear-completed").assure(hidden) s("#clear-completed").should(hidden) # alias s("#clear-completed").should_be(hidden) # alias s("#clear-completed").should_have(hidden) # alias
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_should_fails(): given_active("a", "b") with pytest.raises(TimeoutException): ss("#todo-list>li").should(have.exact_texts("a.", "b."), timeout=0.1)
def test_should_passes(): given_active("a", "b") ss("#todo-list>li").should(have.exact_texts("a", "b"))