Ejemplo n.º 1
0
def x_test_filter_tasks():
    config.browser_name = BrowserName.MARIONETTE

    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)

    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.exact_texts('a', 'b', 'c'))

    ss('#todo-list li').element_by(
        have.exact_text('b')).element('.toggle').click()
    s(by.link_text('Active')).click()
    ss('#todo-list li').filtered_by(be.visible).should(
        have.exact_texts('a', 'c'))

    s(by.link_text('Completed')).click()
    ss('#todo-list li').filtered_by(be.visible).should(have.exact_texts('b'))

    s(by.link_text('All')).click()
    ss('#todo-list li').filtered_by(be.visible).should(
        have.exact_texts('a', 'b', 'c'))
Ejemplo n.º 2
0
    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'))
Ejemplo n.º 3
0
    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'))
Ejemplo n.º 4
0
def visit():
    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))