Пример #1
0
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 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()
Пример #4
0
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'))
Пример #5
0
 def open(self):
     visit('order.html')
Пример #6
0
def visit():
    tools.visit('file://' + os.path.abspath(os.path.dirname(__file__)) +
                '/../../resources/todomvcapp/home.html')
Пример #7
0
def visit():
    tools.visit('https://todomvc4tasj.herokuapp.com')
    wait_to(
        have.js_returned_true(
            "return $._data($('#clear-completed').get(0), 'events').hasOwnProperty('click')"
        ))
Пример #8
0
# -*- 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
Пример #10
0
def visit():
    tools.visit('file://' + os.path.abspath(os.path.dirname(__file__)) + '/../../resources/todomvcapp/home.html')
Пример #11
0
 def open(self):
     visit('order.html')