浏览器自动化测试解決方案 Geb

    xiaoxiao2023-09-12  168

    Geb 详细介绍

    Geb 是浏览器自动化(browser automation)测试解決方案。

    它以强大的 WebDriver 为基础,搭配优雅的 jQuery 选择器,健壮的 Page Object 模型,以及富于表现力的 Groovy 语言。

    可以简单的做为程序脚本运行,也可以无缝整合 Spock、 JUnit或 TestNG 等测试框架进行功能测试、web测试和验收测试。

    代码示例:

    import geb.Browser Browser.drive { go "http://myapp.com/login" assert $("h1").text() == "Please Login" $("form.login").with { username = "admin" password = "password" login().click() } assert $("h1").text() == "Admin Section" }

    文章转载自 开源中国社区[https://www.oschina.net]

    相关资源:兼容性测试方案-浏览器编
    最新回复(0)