最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - onCleanUp() vs onComplete() vs afterLaunch() - Stack Overflow

programmeradmin0浏览0评论

In Protractor, there is a "global set up" method called onPrepare(), but I'm not pletely sure what is meant to be a "global tear down" - there are three relevant methods: onCleanUp, onComplete and afterLaunch that are all called after a test execution.

Why does protractor have three methods called after a test run? What is the difference between onCleanUp, onComplete and afterLaunch?


I've also noticed that there is an "exit" event that we can attach a callback to (example here):

protractor.on('exit', function (status) {

});

In Protractor, there is a "global set up" method called onPrepare(), but I'm not pletely sure what is meant to be a "global tear down" - there are three relevant methods: onCleanUp, onComplete and afterLaunch that are all called after a test execution.

Why does protractor have three methods called after a test run? What is the difference between onCleanUp, onComplete and afterLaunch?


I've also noticed that there is an "exit" event that we can attach a callback to (example here):

protractor.on('exit', function (status) {

});
Share Improve this question edited Dec 20, 2015 at 4:06 alecxe asked Dec 20, 2015 at 2:24 alecxealecxe 474k127 gold badges1.1k silver badges1.2k bronze badges
Add a ment  | 

1 Answer 1

Reset to default 9 +50

onComplete will be executed once per capability after all tests have finished, but the webdriver instance has not yet been shut down.

onCleanup will be executed once per capability after all tests have finished and the webdriver instance has been shut down

afterLaunch will be executed only once before program exits; after all capabilities are finished (after all onCleanup)

Further information on protractor callback functions can be found in their GitHub documentation.

发布评论

评论列表(0)

  1. 暂无评论