【发布时间】:2012-08-16 01:32:49
【问题描述】:
我正在尝试调试这种东西:
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?谢谢你!
【问题讨论】:
-
我不认为你可以用这样流畅的代码,你可以吗?
-
我也不知道,如果我们不能,那就糟透了:(
-
我很确定你不能在这里做你想做的事。我不能证明这一点,但我很确定你不能
标签: javascript debugging node.js chaining soda