当前位置: 首页>>代码示例>>Python>>正文


Python util.assert_with_negate函数代码示例

本文整理汇总了Python中salad.tests.util.assert_with_negate函数的典型用法代码示例。如果您正苦于以下问题:Python assert_with_negate函数的具体用法?Python assert_with_negate怎么用?Python assert_with_negate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了assert_with_negate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: assert_element_exists_with_negate

def assert_element_exists_with_negate(negate, text, partial, function):
    infix = "partial_" if partial else ""
    found = True
    try:
        _get_visible_element(function % (infix, ), None, text)
    except (ElementDoesNotExist, ElementIsNotVisible,
            ElementAtIndexDoesNotExist):
        found = False
    assert_with_negate(found, negate)
    return True
开发者ID:afsoun1981,项目名称:salad,代码行数:10,代码来源:elements.py

示例2: assert_alert_with_text

 def assert_alert_with_text(negate, type_of_match, text):
     world.prompt = _get_alert_or_none()
     prompt_exists = world.prompt is not None
     text_exists = None
     if "contains" in type_of_match:
         text_exists = text in world.prompt.text
     else:
         text_exists = world.prompt.text == text
     assert_with_negate(prompt_exists and text_exists, negate)
     if world.prompt:
         world.prompt.accept()
     return True
开发者ID:kiwnix,项目名称:salad,代码行数:12,代码来源:alerts.py

示例3: assert_alert_with_stored_value

 def assert_alert_with_stored_value(negate, type_of_match, upper_lower, name):
     world.prompt = _get_alert_or_none()
     assert world.stored_values[name]
     stored = world.stored_values[name]
     current = world.prompt.text
     if upper_lower:
         stored, current = transform_for_upper_lower_comparison(stored, current, upper_lower)
     prompt_exists = world.prompt is not None
     text_exists = None
     if "contains" in type_of_match:
         text_exists = stored in current
     else:
         text_exists = stored == current
     assert_with_negate(prompt_exists and text_exists, negate)
     if world.prompt:
         world.prompt.accept()
     return True
开发者ID:kiwnix,项目名称:salad,代码行数:17,代码来源:alerts.py

示例4: _check_is_on_page

def _check_is_on_page(page, negate):
    if page not in leaf_world.available_pages:
        raise KeyError('"%s" page is undefined.' % page)

    if page not in leaf_world.pages:
        try:
            page_object = create_page_object(page)
        except KeyError:
            raise
    else:
        page_object = leaf_world.pages[page]

    is_on_page = page_object.is_current(world.browser.url, get_page_url(world.browser.url))

    assert_with_negate(is_on_page, negate)

    leaf_world.current_page = page_object
开发者ID:mroohian,项目名称:Leaf,代码行数:17,代码来源:navigation.py

示例5: should_see_alert_with_text

def should_see_alert_with_text(step, negate, text):
    alert = _get_alert_or_none()
    assert_with_negate(alert is not None and alert.text == text, negate)
    if alert:
        alert.accept()
开发者ID:Mondego,项目名称:pyreco,代码行数:5,代码来源:allPythonContent.py

示例6: should_see_alert

def should_see_alert(step, negate):
    alert = _get_alert_or_none()
    assert_with_negate(alert is not None, negate)
    if alert:
        alert.accept()
开发者ID:Mondego,项目名称:pyreco,代码行数:5,代码来源:allPythonContent.py

示例7: assert_text_present_with_negates

 def assert_text_present_with_negates(negate, text):
     body = world.browser.driver.find_element_by_tag_name('body')
     assert_with_negate(text in body.text, negate)
     return True
开发者ID:afsoun1981,项目名称:salad,代码行数:4,代码来源:elements.py

示例8: assert_url_equals

 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
开发者ID:afsoun1981,项目名称:salad,代码行数:6,代码来源:page.py

示例9: _this_step

 def _this_step(step, negate, first, last, find_pattern, attr_name):
     ele = _get_element(finder_function, first, last, find_pattern)
     assert_with_negate(ele[attr_name] != None, negate)
开发者ID:Mondego,项目名称:pyreco,代码行数:3,代码来源:allPythonContent.py

示例10: should_see_a_link_to

def should_see_a_link_to(step, negate, link):
    assert_with_negate(len(world.browser.find_link_by_href(link)) > 0, negate)
开发者ID:Mondego,项目名称:pyreco,代码行数:2,代码来源:allPythonContent.py

示例11: should_see_in_the_page

def should_see_in_the_page(step, negate, text):
    assert_with_negate(text in world.browser.html, negate)
开发者ID:Mondego,项目名称:pyreco,代码行数:2,代码来源:allPythonContent.py

示例12: should_see_in_the_page

def should_see_in_the_page(step, negate, text):
    assert_with_negate(world.browser.is_text_present(text), negate)
开发者ID:zwant,项目名称:salad,代码行数:2,代码来源:elements.py

示例13: assert_alert

 def assert_alert(negate):
     world.prompt = _get_alert_or_none()
     assert_with_negate(world.prompt is not None, negate)
     if world.prompt:
         world.prompt.accept()
     return True
开发者ID:kiwnix,项目名称:salad,代码行数:6,代码来源:alerts.py

示例14: should_see_prompt

def should_see_prompt(step, negate):
    world.prompt = _get_alert_or_none()
    assert_with_negate(world.prompt is not None, negate)
    if world.prompt:
        world.prompt.accept()
开发者ID:Mondego,项目名称:pyreco,代码行数:5,代码来源:allPythonContent.py

示例15: contains_test

def contains_test(element, negate, *args):
    content = args[0]
    text = getattr(element, 'text', None)
    assert_with_negate(content in text, negate)
开发者ID:Work4Labs,项目名称:salad,代码行数:4,代码来源:elements.py


注:本文中的salad.tests.util.assert_with_negate函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。