예제 #1
0
파일: javascript.py 프로젝트: salad/salad
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."
        )
예제 #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
예제 #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)
예제 #4
0
파일: elements.py 프로젝트: skoczen/salad
 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)
예제 #5
0
파일: forms.py 프로젝트: Work4Labs/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)
예제 #6
0
파일: page.py 프로젝트: 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
예제 #7
0
파일: forms.py 프로젝트: 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)
예제 #8
0
파일: page.py 프로젝트: afsoun1981/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
예제 #9
0
파일: elements.py 프로젝트: Work4Labs/salad
def attribute_value_test(element, negate, *args):
    attribute = args[0]
    value = args[1]
    assert_equals_with_negate(element[attribute], value, negate)
예제 #10
0
파일: elements.py 프로젝트: Work4Labs/salad
def contains_exactly_test(element, negate, *args):
    content = args[0]
    text = getattr(element, 'text', None)
    assert_equals_with_negate(content, text, negate)
예제 #11
0
파일: page.py 프로젝트: salad/salad
def should_be_titled(step, negate, title):
    assert_equals_with_negate(world.browser.title, title, negate)
예제 #12
0
파일: page.py 프로젝트: salad/salad
def should_have_html(step, negate, html):
    assert_equals_with_negate(world.browser.html, html, negate)
예제 #13
0
파일: page.py 프로젝트: salad/salad
def should_have_the_url(step, negate, url):
    assert_equals_with_negate(world.browser.url, url, negate)
예제 #14
0
파일: forms.py 프로젝트: skoczen/salad
 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)
예제 #15
0
파일: forms.py 프로젝트: adw0rd/salad
 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)
예제 #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)
예제 #17
0
파일: page.py 프로젝트: afsoun1981/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
예제 #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)
예제 #19
0
파일: page.py 프로젝트: afsoun1981/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
예제 #20
0
def should_be_titled(step, negate, title):
    assert_equals_with_negate(world.browser.title, title, negate)
예제 #21
0
파일: forms.py 프로젝트: 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)
예제 #22
0
def should_have_the_url(step, negate, url):
    assert_equals_with_negate(world.browser.url, url, negate)
예제 #23
0
파일: page.py 프로젝트: 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
예제 #24
0
def should_have_html(step, negate, html):
    assert_equals_with_negate(world.browser.html, html, negate)
예제 #25
0
파일: page.py 프로젝트: 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
예제 #26
0
def contains_exactly_test(element, negate, *args):
    content = args[0]
    text = getattr(element, 'text', None)
    assert_equals_with_negate(content, text, negate)
예제 #27
0
파일: forms.py 프로젝트: Work4Labs/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)
예제 #28
0
파일: elements.py 프로젝트: skoczen/salad
 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)