0
我正在運行此測試,看起來當測試進入到我的describe塊的函數部分時,它跳過了整個事物並給出了傳遞的誤報。Webdriverio Node.js Mocha Chai測試跳過描述塊
// required libraries
var webdriverio = require('webdriverio');
var describe = require('describe');
var after = require('after');
console.log("Lets begin");
describe('Title Test for google site', function() {
console.log("MARTY!!");
// set timeout to 10 seconds
this.timeout(10000);
var driver = {};
console.log("before we start");
// hook to run before tests
before(function (done) {
// load the driver for browser
console.log("before browser");
driver = webdriverio.remote({ desiredCapabilities: {browserName: 'firefox'} });
driver.init(done);
});
it('should load correct page and title', function() {
// load page, then call function()
return driver
.console.log("before site")
.url('http://www.ggogle.com')
// get title, then pass title to function()
.getTitle().then(function (title) {
// verify title
(title).should.be.equal("google");
// uncomment for console debug
// console.log('Current Page Title: ' + title);
});
});
});
// a "hook" to run after all tests in this block
after(function(done) {
driver.end(done);
});
console.log ("Fin");
這是輸出我得到
讓我們開始
翅
[在0.4秒完成]
正如你可以看到它跳過一切。
是的,我曾經這樣做過,它是輸出描述和未定義之後。 – Lupin
你如何運行你的測試?你的命令行是什麼? – Louis
iTerminal中的node testname.js或者我只是在Sublime中運行代碼 – Lupin