有没有用过doh做web单元测试的?

wangju309 2009-03-02 04:01:55
加精
在用doh的robot做自动化测试时,看到http://dojotoolkit.org/2008/10/31/doh-robot-part-2-automating-acceptance-tests-and-user-stories这个文章里写了waitForPageToLoad方法,有知道是怎么用的么?最好给个例子
另外上面写到它是在dijit里,而实际上我看代码怎么在dojo里呢?
...全文
235 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
reedseutozte 2010-03-26
  • 打赏
  • 举报
回复
关于Doh robot本人最近正在研究,打算近期写一篇博文,呵呵,应为这方面几乎没有中文资料,你说的函数参照如下例子
关于doh建议直接阅读作者 的英文blog
doh.robot: Automating Web UI Unit Tests with Real User Events
doh.robot, part 2: Automating Web UI Unit Tests with Real User Events

doh.register('user_story1',{
name: 'login_pagechange',
timeout: 60000,
runTest: function(){
return doh.robot.waitForPageToLoad(function(){
// click login
doh.robot.mouseMoveAt(function(){ return dojo.doc.getElementsByTagName('input')[2]; }, 1623, 801);//移动鼠标到指定节点
doh.robot.mouseClick({left:true, middle:false, right:false}, 992);//点击鼠标链接,加载页面
});
}
});


wangju309 2009-03-13
  • 打赏
  • 举报
回复
把这段给我解析一下也可以
waitForPageToLoad: function(/*Function*/ submitActions){
// summary:
// Notifies DOH that the doh.robot is about to make a page change in the application it is driving,
// returning a doh.Deferred object the user should return in their runTest function as part of a DOH test.
//
// description:
// Notifies DOH that the doh.robot is about to make a page change in the application it is driving,
// returning a doh.Deferred object the user should return in their runTest function as part of a DOH test.
// Example:
// runTest:function(){
// return waitForPageToLoad(function(){ doh.robot.keyPress(dojo.keys.ENTER, 500); });
// }
//
// submitActions:
// The doh.robot will execute the actions the test passes into the submitActions argument (like clicking the submit button),
// expecting these actions to create a page change (like a form submit).
// After these actions execute and the resulting page loads, the next test will start.
//
}
waitForPageToLoad takes a function called submitActions. The robot expects submit
wangju309 2009-03-12
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 ilysony 的回复:]
DOH是什么
[/Quote]
DOH是dojo用的测试工具
youyouzui 2009-03-12
  • 打赏
  • 举报
回复
好像是这样呢
fanyuanwaifdl 2009-03-12
  • 打赏
  • 举报
回复
up
renjingzhangji 2009-03-11
  • 打赏
  • 举报
回复
厉害厉害
fanyangnib0 2009-03-11
  • 打赏
  • 举报
回复
学习,学习
q527388993 2009-03-11
  • 打赏
  • 举报
回复
顶起
ywjgift 2009-03-11
  • 打赏
  • 举报
回复
提倡用TestNG及JMock
Sou2012 2009-03-11
  • 打赏
  • 举报
回复
DOH是什么
zgycsmb 2009-03-04
  • 打赏
  • 举报
回复
mark.
wangju309 2009-03-03
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 kingya2008 的回复:]
王菊??打官司的?
什么是打官司的?
wangju309 2009-03-03
  • 打赏
  • 举报
回复
快来人啊
kingya2008 2009-03-02
  • 打赏
  • 举报
回复
王菊??打官司的?
wangju309 2009-03-02
  • 打赏
  • 举报
回复
咋就没人理小女子的帖子呢?
  • 打赏
  • 举报
回复
大部分高手不喜欢冒泡
wangju309 2009-03-02
  • 打赏
  • 举报
回复
话说CSDN高手如云
泡面之夏 2009-03-02
  • 打赏
  • 举报
回复
帮顶~

81,091

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧