就像 onPrepare() 函数在我的任何测试之前运行一次一样,是否有一个函数在所有测试结束时运行一次?
这是我的情况。我在 onPrepare() 中有一个 global.db.connect()。各种测试使用这个全局变量来运行 mysql 查询。测试在多个浏览器上并行运行。一旦我的测试完成运行,我想执行 db.disconnect()。
最佳答案
过早发布问题。解决方案是使用这个
onComplete: function() {
// At this point, tests will be done but global objects will still be
// available.
}
文档 https://github.com/angular/protractor/blob/master/docs/referenceConf.js
关于mysql - Protractor : Function to run at the end of all tests,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37260099/