[英]Inspect a Method Chain with a Degugger in Node.js
我正在尝试调试这种事情:
browser
.chain
.session()
.open('/')
.type('q', 'Hello World')
.click('btnG')
.waitForTextPresent('Hello World')
.getTitle(function(title){
assert.ok(~title.indexOf('hello world'), 'Title did not include the query: ' + title);
})
.click('link=Advanced search')
.waitForPageToLoad(2000)
.assertText('css=#gen-query', 'Hello World')
.assertAttribute('as_q@value', 'Hello World')
.end(function(err){
browser.testComplete(function(){
console.log('done');
if (err) throw err;
});
});
我已经设法使用直接node debug app.js
或使用node-inspector
和chrome
来连接调试器。 但是,当我尝试在.click('btnG')
创建一个断点时,它不起作用,它只在链的末尾创建一个断点。 node.js
似乎将整个链视为单个语句。
你如何逐步调试这种链接? 你怎么能在这里注入一个REPL? 谢谢!
尝试使用underscore.js中的tap方法
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.