Example #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."
        )
Example #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
Example #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)
Example #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)
Example #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)
Example #6
0
File: page.py Project: 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
Example #7
0
File: forms.py Project: 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)
Example #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
Example #9
0
def attribute_value_test(element, negate, *args):
    attribute = args[0]
    value = args[1]
    assert_equals_with_negate(element[attribute], value, negate)
Example #10
0
def contains_exactly_test(element, negate, *args):
    content = args[0]
    text = getattr(element, 'text', None)
    assert_equals_with_negate(content, text, negate)
Example #11
0
File: page.py Project: salad/salad
def should_be_titled(step, negate, title):
    assert_equals_with_negate(world.browser.title, title, negate)
Example #12
0
File: page.py Project: salad/salad
def should_have_html(step, negate, html):
    assert_equals_with_negate(world.browser.html, html, negate)
Example #13
0
File: page.py Project: salad/salad
def should_have_the_url(step, negate, url):
    assert_equals_with_negate(world.browser.url, url, negate)
Example #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)
Example #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)
Example #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)
Example #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
Example #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)
Example #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
Example #20
0
def should_be_titled(step, negate, title):
    assert_equals_with_negate(world.browser.title, title, negate)
Example #21
0
File: forms.py Project: 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)
Example #22
0
def should_have_the_url(step, negate, url):
    assert_equals_with_negate(world.browser.url, url, negate)
Example #23
0
File: page.py Project: 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
Example #24
0
def should_have_html(step, negate, html):
    assert_equals_with_negate(world.browser.html, html, negate)
Example #25
0
File: page.py Project: 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
Example #26
0
def contains_exactly_test(element, negate, *args):
    content = args[0]
    text = getattr(element, 'text', None)
    assert_equals_with_negate(content, text, negate)
Example #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)
Example #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)