def test_filter_tasks(): config.browser_name = 'chrome' visit('https://todomvc4tasj.herokuapp.com') wait_to( have.js_returned_true( "return $._data($('#clear-completed').get(0), 'events').hasOwnProperty('click')" )) 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'))
def setup_function(f): global browser global shaded_browser set_driver(webdriver.Firefox()) visit(TODOMVC_URL) s("#new-todo").should_be(visible) browser = webdriver.Firefox() browser.get(TODOMVC_URL) WebDriverWait(browser, 4).until(expected_conditions.visibility_of_element_located((By.CSS_SELECTOR, "#new-todo"))) shaded_browser = webdriver.Firefox()
def test_filter_tasks(): visit('https://todomvc4tasj.herokuapp.com') 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'))
def open(self): visit('order.html')
def visit(): tools.visit('file://' + os.path.abspath(os.path.dirname(__file__)) + '/../../resources/todomvcapp/home.html')
def visit(): tools.visit('https://todomvc4tasj.herokuapp.com') wait_to( have.js_returned_true( "return $._data($('#clear-completed').get(0), 'events').hasOwnProperty('click')" ))
# -*- coding: utf-8 -*- from selenium import webdriver from selene.conditions import text from selene.tools import set_driver, visit, s import bemo wd = webdriver.Firefox() set_driver(wd) visit('https://accounts.google.com/SignUp') with bemo.Session(wd=wd) as session: handler = session.handle('InputValidator', body={ 'input01': { 'Valid': 'false', 'ErrorMessage': 'Error!', 'Errors': { 'GmailAddress': 'It work.', }, 'ErrorData': [], }, 'Locale': 'ru', }) session.inject() s('#GmailAddress').set('John Snow') s('#submitbutton').click()
def open(self): visit("http://google.com/ncr") return self