• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python util.assert_with_negate函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: should_see_prompt_with_text

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


示例17: attribute_test

def attribute_test(element, negate, *args):
    attribute = args[0]
    assert_with_negate(element[attribute] != None, negate)
开发者ID:Work4Labs,项目名称:salad,代码行数:3,代码来源:elements.py


示例18: should_see_a_link_called

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


示例19: assert_text_present_with_negates

 def assert_text_present_with_negates(negate, text):
     assert_with_negate(world.browser.is_text_present(text), negate)
     return True
开发者ID:Work4Labs,项目名称:salad,代码行数:3,代码来源:elements.py


示例20: assert_link_exists_negates

 def assert_link_exists_negates(negate, text):
     assert_with_negate(len(world.browser.find_link_by_href(text)) > 0, negate)
     return True
开发者ID:Work4Labs,项目名称:salad,代码行数:3,代码来源:elements.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python core.Checkout类代码示例发布时间:2022-05-27
下一篇:
Python finders._get_element函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap