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(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 filter_completed(): s(by_link_text("Completed")).click()
def filter_active(): s(by_link_text("Active")).click()
def link_text(text): return bys.by_link_text(text)
def test_by_link_text(): assert by_link_text("text") == ('link text', 'text')