Ejemplo n.º 1
0
def evaluate_the_javascript(step, negate, script, value):
    try:
        assert_equals_with_negate("%s" % world.browser.evaluate_script(script),
                                  value, negate)
    except NotImplementedError:
        logger.info(
            "Attempted to run javascript in a javascript-disabled browser. Moving along."
        )
Ejemplo n.º 2
0
    def assert_javascript_returns_value(negate, script, value):
        try:
            assert_equals_with_negate(
                "%s" % world.browser.evaluate_script(script), value, negate)
        except NotImplementedError:
            logger.info("Attempted to run javascript in a javascript-disabled"
                        "browser. Moving along.")

        return True
Ejemplo n.º 3
0
def attribute_value_test(element, negate, *args):
    attribute = args[0]
    value = args[1]
    assert_equals_with_negate(element.get_attribute(attribute), value, negate)
Ejemplo n.º 4
0
 def _this_step(step, negate, first, last, find_pattern, attr_name,
                attr_value):
     ele = _get_element(finder_function, first, last, find_pattern)
     assert_equals_with_negate("%s" % ele[attr_name], attr_value,
                               negate)
Ejemplo n.º 5
0
 def _this_step(step, negate, attribute, pick, find_pattern, value):
     ele = _get_visible_element(finder_function, pick, find_pattern)
     assert_equals_with_negate(getattr(ele, attribute), value, negate)
Ejemplo n.º 6
0
Archivo: page.py Proyecto: kiwnix/salad
 def assert_url_equals(negate, partial, url):
     if partial == 'is':
         assert_equals_with_negate(world.browser.url, url, negate)
     else:
         assert_with_negate(url in world.browser.url, negate)
     return True
Ejemplo n.º 7
0
Archivo: forms.py Proyecto: salad/salad
 def _this_step(step, negate, attribute, pick, find_pattern, name):
     ele = _get_visible_element(finder_function, pick, find_pattern)
     assert_equals_with_negate(getattr(ele, attribute),
                               world.stored_values[name], negate)
Ejemplo n.º 8
0
 def assert_url_equals(negate, partial, url):
     if partial == 'is':
         assert_equals_with_negate(world.browser.url, url, negate)
     else:
         assert_with_negate(url in world.browser.url, negate)
     return True
Ejemplo n.º 9
0
def attribute_value_test(element, negate, *args):
    attribute = args[0]
    value = args[1]
    assert_equals_with_negate(element[attribute], value, negate)
Ejemplo n.º 10
0
def contains_exactly_test(element, negate, *args):
    content = args[0]
    text = getattr(element, 'text', None)
    assert_equals_with_negate(content, text, negate)
Ejemplo n.º 11
0
Archivo: page.py Proyecto: salad/salad
def should_be_titled(step, negate, title):
    assert_equals_with_negate(world.browser.title, title, negate)
Ejemplo n.º 12
0
Archivo: page.py Proyecto: salad/salad
def should_have_html(step, negate, html):
    assert_equals_with_negate(world.browser.html, html, negate)
Ejemplo n.º 13
0
Archivo: page.py Proyecto: salad/salad
def should_have_the_url(step, negate, url):
    assert_equals_with_negate(world.browser.url, url, negate)
Ejemplo n.º 14
0
 def _this_step(step, first, last, find_pattern, negate, value):
     ele = _get_element(finder_function, first, last, find_pattern)
     assert_equals_with_negate(ele.value, value, negate)
Ejemplo n.º 15
0
 def _this_step(step, first, last, find_pattern, negate, value):
     ele = _get_element(finder_function, first, last, find_pattern)
     assert_equals_with_negate(ele.value, value, negate)
Ejemplo n.º 16
0
 def _this_step(step, negate, first, last, find_pattern, content):
     ele = _get_element(finder_function, first, last, find_pattern)
     assert_equals_with_negate(ele.text, content, negate)
Ejemplo n.º 17
0
 def assert_title_equals(negate, partial, title):
     if 'contains' in partial:
         assert_with_negate(title in world.browser.title, negate)
     else:
         assert_equals_with_negate(world.browser.title, title, negate)
     return True
Ejemplo n.º 18
0
 def _this_step(step, negate, first, last, find_pattern, attr_name, attr_value):
     ele = _get_element(finder_function, first, last, find_pattern)
     assert_equals_with_negate("%s" % ele[attr_name], attr_value, negate)
Ejemplo n.º 19
0
 def assert_page_html_is(negate, partial, html):
     if partial == 'is':
         assert_equals_with_negate(world.browser.html, html, negate)
     else:
         assert_with_negate(html in world.browser.html, negate)
     return True
Ejemplo n.º 20
0
def should_be_titled(step, negate, title):
    assert_equals_with_negate(world.browser.title, title, negate)
Ejemplo n.º 21
0
Archivo: forms.py Proyecto: salad/salad
 def _this_step(step, negate, attribute, pick, find_pattern, value):
     ele = _get_visible_element(finder_function, pick, find_pattern)
     assert_equals_with_negate(getattr(ele, attribute), value, negate)
Ejemplo n.º 22
0
def should_have_the_url(step, negate, url):
    assert_equals_with_negate(world.browser.url, url, negate)
Ejemplo n.º 23
0
Archivo: page.py Proyecto: kiwnix/salad
 def assert_title_equals(negate, partial, title):
     if 'contains' in partial:
         assert_with_negate(title in world.browser.title, negate)
     else:
         assert_equals_with_negate(world.browser.title, title, negate)
     return True
Ejemplo n.º 24
0
def should_have_html(step, negate, html):
    assert_equals_with_negate(world.browser.html, html, negate)
Ejemplo n.º 25
0
Archivo: page.py Proyecto: kiwnix/salad
 def assert_page_html_is(negate, partial, html):
     if partial == 'is':
         assert_equals_with_negate(world.browser.html, html, negate)
     else:
         assert_with_negate(html in world.browser.html, negate)
     return True
Ejemplo n.º 26
0
def contains_exactly_test(element, negate, *args):
    content = args[0]
    text = getattr(element, 'text', None)
    assert_equals_with_negate(content, text, negate)
Ejemplo n.º 27
0
 def _this_step(step, negate, attribute, pick, find_pattern, name):
     ele = _get_visible_element(finder_function, pick, find_pattern)
     assert_equals_with_negate(getattr(ele, attribute),
                               world.stored_values[name],
                               negate)
Ejemplo n.º 28
0
 def _this_step(step, negate, first, last, find_pattern, content):
     ele = _get_element(finder_function, first, last, find_pattern)
     assert_equals_with_negate(ele.text, content, negate)