【问题标题】:javascript UI testing framework with event simulation带有事件模拟的 javascript UI 测试框架
【发布时间】:2012-07-13 18:34:46
【问题描述】:

我正在寻找一个框架来通过 jquery 模拟鼠标拖放各种 html 标签,然后捕获屏幕并将其与保存的图像进行比较。我这样做是为了测试网页 UI。

我看过一篇很棒的帖子:Javascript testing to simulate drag for JQuery UI sortable lists,它给出了这个链接:https://github.com/jquery/jquery-ui/blob/master/tests/jquery.simulate.js

目前我不确定如何使用 jquery.simulate.js(但我正在玩它来学习),所以我很感兴趣是否有任何其他框架可以使用(也许有些看起来更多 类似于 JUnit/NUnit)。

我希望能够像这样编写代码:

simulateDivDrag(Image expectedResult){
  simulate mouse drag  of event
  take screenshot
  cmp(expectedResult, screenshot)
}

我记得读过 Firefox 已经为这种自动化 UI 测试构建了一个内部工具,所以这绝对是可能的。

谢谢:)

【问题讨论】:

    标签: javascript jquery user-interface automated-tests frontend


    【解决方案1】:

    如果您使用的是 jUnit,您可能希望使用 Selenium,它可以在多个浏览器中自动执行用户操作。

    【讨论】:

    • 适用于 .NET 网站;我提到这些单元测试是因为我对它们非常熟悉,因为我从事后端工作。 Selenium 可以与任何网站集成吗?
    • 还有 nUnit,如果您阅读 Selenium 的网站,您会看到它在 bunch of languages 中可用。
    猜你喜欢
    • 2017-04-19
    • 1970-01-01
    • 2018-05-01
    • 2010-10-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多