def test_filter_tasks(self): browser.visit(APP_URL) s('#new-todo').should(be.enabled).set_value('a').press_enter() s('#new-todo').should(be.enabled).set_value('b').press_enter() s('#new-todo').should(be.enabled).set_value('c').press_enter() ss("#todo-list>li").should(have.texts('a', 'b', 'c')) ss("#todo-list>li").element_by(exact_text('b')).find(".toggle").click() s(by_link_text("Active")).click() ss("#todo-list>li").filtered_by(be.visible).should(have.texts('a', 'c')) s(by_link_text("Completed")).click() ss("#todo-list>li").filtered_by(be.visible).should(have.texts('b'))
def test_filter_tasks(): browser.visit('file://' + os.path.abspath(os.path.dirname(__file__)) + '/../../resources/todomvcapp/home.html') s('#new-todo').should(be.enabled).set_value('a').press_enter() s('#new-todo').should(be.enabled).set_value('b').press_enter() s('#new-todo').should(be.enabled).set_value('c').press_enter() ss("#todo-list>li").should(have.texts('a', 'b', 'c'))
def test_add_tasks(): browser.open_url(todomvc_url) browser.should(have.js_returned_true(is_TodoMVC_loaded)) s('#new-todo').set_value('a').press_enter() s('#new-todo').set_value('b').press_enter() s('#new-todo').set_value('c').press_enter() ss("#todo-list>li").should(have.texts('a', 'b', 'c'))
def test_filter_tasks(self): browser.open_url(APP_URL) clear_completed_js_loaded = "return $._data($('#clear-completed').get(0), 'events').hasOwnProperty('click')" browser.wait_to(have.js_returned_true(clear_completed_js_loaded)) s('#new-todo').should(be.enabled).set_value('a').press_enter() s('#new-todo').should(be.enabled).set_value('b').press_enter() s('#new-todo').should(be.enabled).set_value('c').press_enter() ss("#todo-list>li").should(have.texts('a', 'b', 'c')) ss("#todo-list>li").element_by(exact_text('b')).find(".toggle").click() s(by_link_text("Active")).click() ss("#todo-list>li").filtered_by(be.visible).should(have.texts('a', 'c')) s(by_link_text("Completed")).click() ss("#todo-list>li").filtered_by(be.visible).should(have.texts('b'))
def test_filter_tasks(self): browser.open_url('https://todomvc4tasj.herokuapp.com/') clear_completed_js_loaded = "return $._data($('#clear-completed').get(0), 'events').hasOwnProperty('click')" browser.wait_to(have.js_returned_true(clear_completed_js_loaded), timeout=config.timeout*3) browser.wait_to(have.title(u'TroopJS • TodoMVC')) s('#new-todo').should(be.enabled).set_value('a').press_enter() s('#new-todo').should(be.enabled).set_value('b').press_enter() s('#new-todo').should(be.enabled).set_value('c').press_enter() ss("#todo-list>li").should(have.texts('a', 'b', 'c')) ss("#todo-list>li").element_by(exact_text('b')).find(".toggle").click() s(by_link_text("Active")).click() ss("#todo-list>li").filtered_by(be.visible).should(have.texts('a', 'c')) s(by_link_text("Completed")).click() ss("#todo-list>li").filtered_by(be.visible).should(have.texts('b'))
def test_todomvc_starts_with_cleaned_storage_at_new_browser(): # When browser.open(todomvc.url) # Then (browser.all("#todo-list>li").should(have.size(0)).should( have.no.texts('todo from A test'))) # When browser.element('#new-todo').set_value('todo from B test').press_enter() # Then browser.all("#todo-list>li").should(have.texts('todo from B test'))
def test_todomvc_can_add_todos(): browser.open(todomvc.url) browser.element('#new-todo').set_value('todo from A test').press_enter() browser.all("#todo-list>li").should(have.texts('todo from A test'))
def assert_visible_tasks(*task_texts): tasks.filtered_by(visible).should(have.texts(*task_texts))
def test_condition_have_texts(): assert have.texts("a", "b", "c").expected == ("a", "b", "c")
def test_todomvc_shares_todos_in_same_browser_session(): # When browser.open(todomvc.url) # Then (browser.all("#todo-list>li").should(have.texts('todo from B test')))
def test_can_add_new_user(setup): user = User("dodo", "123456", "*****@*****.**") (LoginPage().open().login_as( "admin", "admin").than_at_main_page().go_to_users_page().add_new_user( user).table.user_names().should(have.texts("admin", "dodo")))
def result_page_contains(text): ss(by('.result__title .result__a > b')).filtered_by(be.visible).should( have.texts(text))
def should_have_completed(self, *names): self._todos.filtered_by(have.css_class('completed'))\ .should(have.texts(*names)) return self
def should_have_active(self, *names): self._todos.filtered_by(have.css_class('active'))\ .should(have.texts(*names)) return self