我一直在nightwatch.js用于功能测试自动化.问题是测试套件完成后测试暂停.它并没有结束这个过程.代码如下所示:
var afterSuite = function(browser) {
dbFixture.deleteCollectionItemById(companyId, 'cilents');
dbFixture.deleteCollectionItemById(customerId, 'users');
dbFixture.deleteCollectionItemById(assetId, 'assets');
dbFixture.deleteFile(imageId);
browser.end();
};
var loginTest = function(browser) {
dbFixture.createCompany(function(company) {
dbFixture.createCustomer(company._id, function(customer, assetid, imageid) {
companyId = company._id;
customerId = customer._id;
assetId = assetid;
imageId = imageid;
goTo.goTo(url.localhost_home + url.login, browser);
login.loginAsAny(customer.email, browser);
newCustomerLoginAssert.assertNewCustomerLogin(browser);
});
});
};
module.exports = {
after: afterSuite,
'As a Customer, I should be able to login to the system once my registration has been approved': loginTest
};
Run Code Online (Sandbox Code Playgroud)
我也尝试添加done();的afterSuite …