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

Python selenium_driver.SeleniumDriver类代码示例

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

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



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

示例1: test_selenium_resolve_element_key_uses_SeleniumElementSelector_for_non_null_contexts

def test_selenium_resolve_element_key_uses_SeleniumElementSelector_for_non_null_contexts(
):
    context = Context(Settings())
    driver = SeleniumDriver(context)
    key = driver.resolve_element_key(context, "Button", "SomethingElse")
    expected = "//*[(@name='SomethingElse' or @id='SomethingElse')]"
    assert key == expected, "Expected %s, Actual: %s" % (expected, key)
开发者ID:andrewsmedina,项目名称:pyccuracy,代码行数:7,代码来源:test_selenium_browser_driver.py


示例2: test_wait_for_disappear

def test_wait_for_disappear():
    context = Context(Settings())
    selenium_mock = Mock()
    selenium_mock.expects(once()).is_element_present(eq('some element')).will(return_value(True))
    selenium_mock.expects(once()).is_visible(eq('some element')).will(return_value(False))

    driver = SeleniumDriver(context, selenium=selenium_mock)
    driver.wait_for_element_to_disappear("some element", 1)
    selenium_mock.verify()
开发者ID:andrewsmedina,项目名称:pyccuracy,代码行数:9,代码来源:test_selenium_browser_driver.py


示例3: test_selenium_driver_calls_get_eval

def test_selenium_driver_calls_get_eval():
    javascript = "some javascript"
    context = Context(Settings())
    selenium_mock = Mock()
    selenium_mock.expects(once()).get_eval(eq(javascript)).will(return_value("ok"))
    
    driver = SeleniumDriver(context, selenium=selenium_mock)
    
    assert driver.exec_js(javascript) == "ok"
开发者ID:andrewsmedina,项目名称:pyccuracy,代码行数:9,代码来源:test_selenium_browser_driver.py


示例4: test_wait_for_disappear_works_even_when_is_visible_raises

def test_wait_for_disappear_works_even_when_is_visible_raises():
    context = Context(Settings())
    selenium_mock = Mock()
    selenium_mock.expects(at_least_once()).is_element_present(eq('some element')).will(return_value(True))
    selenium_mock.expects(once()).is_visible(eq('some element')).will(raise_exception(Exception("ERROR: Element some element not found")))

    driver = SeleniumDriver(context, selenium=selenium_mock)
    driver.wait_for_element_to_disappear("some element", 1)
    selenium_mock.verify()
开发者ID:andrewsmedina,项目名称:pyccuracy,代码行数:9,代码来源:test_selenium_browser_driver.py


示例5: test_selenium_driver_overrides_page_open_properly

def test_selenium_driver_overrides_page_open_properly():
    context = Context(Settings())
    selenium_mock = Mock()
    selenium_mock.expects(once()).open(eq("http://localhost"))

    driver = SeleniumDriver(context, selenium=selenium_mock)

    driver.page_open("http://localhost")
    selenium_mock.verify()
开发者ID:andrewsmedina,项目名称:pyccuracy,代码行数:9,代码来源:test_selenium_browser_driver.py


示例6: test_selenium_driver_calls_proper_selenese_on_click_element

def test_selenium_driver_calls_proper_selenese_on_click_element():
    context = Context(Settings())
    selenium_mock = Mock()
    selenium_mock.expects(once()).click(eq("some"))

    driver = SeleniumDriver(context, selenium=selenium_mock)

    driver.click_element("some")
    selenium_mock.verify()
开发者ID:andrewsmedina,项目名称:pyccuracy,代码行数:9,代码来源:test_selenium_browser_driver.py


示例7: test_selenium_driver_calls_proper_selenese_on_wait_for_page

def test_selenium_driver_calls_proper_selenese_on_wait_for_page():
    context = Context(Settings())
    selenium_mock = Mock()
    selenium_mock.expects(once()).wait_for_page_to_load(eq(10000))

    driver = SeleniumDriver(context, selenium=selenium_mock)

    driver.wait_for_page()
    selenium_mock.verify()
开发者ID:andrewsmedina,项目名称:pyccuracy,代码行数:9,代码来源:test_selenium_browser_driver.py


示例8: test_selenium_driver_overrides_start_test_properly

def test_selenium_driver_overrides_start_test_properly():
    context = Context(Settings())
    selenium_mock = Mock()
    selenium_mock.expects(once()).start()

    driver = SeleniumDriver(context, selenium=selenium_mock)

    driver.start_test("http://localhost")
    selenium_mock.verify()
开发者ID:andrewsmedina,项目名称:pyccuracy,代码行数:9,代码来源:test_selenium_browser_driver.py


示例9: test_selenium_driver_calls_proper_selenese_on_stop_test

def test_selenium_driver_calls_proper_selenese_on_stop_test():
    context = Context(Settings())
    selenium_mock = Mock()
    selenium_mock.expects(once()).stop()

    driver = SeleniumDriver(context, selenium=selenium_mock)

    driver.stop_test()
    selenium_mock.verify()
开发者ID:andrewsmedina,项目名称:pyccuracy,代码行数:9,代码来源:test_selenium_browser_driver.py


示例10: test_selenium_driver_overrides_start_test_properly_when_extra_args_specified

def test_selenium_driver_overrides_start_test_properly_when_extra_args_specified():
    context = Context(Settings())
    context.settings.extra_args = {"selenium.server": "localhost", "selenium.port": 4444}
    selenium_mock = Mock()
    selenium_mock.expects(once()).start()

    driver = SeleniumDriver(context, selenium=selenium_mock)

    driver.start_test("http://localhost")
    selenium_mock.verify()
开发者ID:andrewsmedina,项目名称:pyccuracy,代码行数:10,代码来源:test_selenium_browser_driver.py


示例11: test_selenium_driver_calls_proper_selenese_on_get_title

def test_selenium_driver_calls_proper_selenese_on_get_title():
    context = Context(Settings())
    selenium_mock = Mock()
    selenium_mock.expects(once()).get_title().will(return_value("Some title"))

    driver = SeleniumDriver(context, selenium=selenium_mock)

    title = driver.get_title()
    assert title == "Some title"
    selenium_mock.verify()
开发者ID:andrewsmedina,项目名称:pyccuracy,代码行数:10,代码来源:test_selenium_browser_driver.py


示例12: test_selenium_driver_calls_type_keys

def test_selenium_driver_calls_type_keys():
    input_selector = "//some_xpath"
    text = "text to type"
    context = Context(Settings())
    selenium_mock = Mock()
    selenium_mock.expects(once()).type_keys(eq(input_selector), eq(text))

    driver = SeleniumDriver(context, selenium=selenium_mock)
    driver.type_keys(input_selector, text)
    selenium_mock.verify()
开发者ID:andrewsmedina,项目名称:pyccuracy,代码行数:10,代码来源:test_selenium_browser_driver.py


示例13: test_selenium_driver_overrides_page_open_properly

def test_selenium_driver_overrides_page_open_properly():
    
    mocker = Mocker()
    
    context = Context(Settings())
    selenium_mock = mocker.mock()
    selenium_mock.open("http://localhost")

    with mocker:
        driver = SeleniumDriver(context, selenium=selenium_mock)
    
        driver.page_open("http://localhost")
开发者ID:Desperado,项目名称:pyccuracy,代码行数:12,代码来源:test_selenium_browser_driver.py


示例14: test_selenium_driver_calls_proper_selenese_on_stop_test

def test_selenium_driver_calls_proper_selenese_on_stop_test():
    
    mocker = Mocker()
    
    context = Context(Settings())
    selenium_mock = mocker.mock()
    selenium_mock.stop()

    with mocker:
        driver = SeleniumDriver(context, selenium=selenium_mock)
    
        driver.stop_test()
开发者ID:Desperado,项目名称:pyccuracy,代码行数:12,代码来源:test_selenium_browser_driver.py


示例15: test_selenium_driver_overrides_start_test_properly

def test_selenium_driver_overrides_start_test_properly():
    
    mocker = Mocker()
    
    context = Context(Settings())
    selenium_mock = mocker.mock()
    selenium_mock.start()

    with mocker:
        driver = SeleniumDriver(context, selenium=selenium_mock)
    
        driver.start_test("http://localhost")
开发者ID:Desperado,项目名称:pyccuracy,代码行数:12,代码来源:test_selenium_browser_driver.py


示例16: test_selenium_driver_calls_proper_selenese_on_click_element

def test_selenium_driver_calls_proper_selenese_on_click_element():
    
    mocker = Mocker()
    
    context = Context(Settings())
    selenium_mock = mocker.mock()
    selenium_mock.click("some")

    with mocker:
        driver = SeleniumDriver(context, selenium=selenium_mock)
    
        driver.click_element("some")
开发者ID:Desperado,项目名称:pyccuracy,代码行数:12,代码来源:test_selenium_browser_driver.py


示例17: test_selenium_driver_calls_proper_selenese_on_wait_for_page

def test_selenium_driver_calls_proper_selenese_on_wait_for_page():
    
    mocker = Mocker()
    
    context = Context(Settings())
    selenium_mock = mocker.mock()
    selenium_mock.wait_for_page_to_load(30000)

    with mocker:
        driver = SeleniumDriver(context, selenium=selenium_mock)
    
        driver.wait_for_page()
开发者ID:Desperado,项目名称:pyccuracy,代码行数:12,代码来源:test_selenium_browser_driver.py


示例18: test_selenium_driver_calls_type_keys

def test_selenium_driver_calls_type_keys():
    
    mocker = Mocker()
    
    input_selector = "//some_xpath"
    text = "text to type"
    context = Context(Settings())
    selenium_mock = mocker.mock()
    selenium_mock.type_keys(input_selector, text)
    
    with mocker:
        driver = SeleniumDriver(context, selenium=selenium_mock)
        driver.type_keys(input_selector, text)
开发者ID:Desperado,项目名称:pyccuracy,代码行数:13,代码来源:test_selenium_browser_driver.py


示例19: test_refresh

def test_refresh():

    mocker = Mocker()

    context = Context(Settings())
    selenium_mock = mocker.mock()

    selenium_mock.refresh()
    selenium_mock.wait_for_page_to_load(30000)

    with mocker:
        driver = SeleniumDriver(context, selenium=selenium_mock)
        driver.refresh()
开发者ID:jusbrasil,项目名称:pyccuracy,代码行数:13,代码来源:test_selenium_browser_driver.py


示例20: test_selenium_driver_calls_proper_selenese_on_get_title

def test_selenium_driver_calls_proper_selenese_on_get_title():
    
    mocker = Mocker()
    
    context = Context(Settings())
    selenium_mock = mocker.mock()
    selenium_mock.get_title()
    mocker.result("Some title")

    with mocker:
        driver = SeleniumDriver(context, selenium=selenium_mock)
    
        title = driver.get_title()
        assert title == "Some title"
开发者ID:Desperado,项目名称:pyccuracy,代码行数:14,代码来源:test_selenium_browser_driver.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python fixture.Fixture类代码示例发布时间:2022-05-25
下一篇:
Python pycbf.cbf_handle_struct函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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