onCleanUp() vs onComplete() vs afterLaunch() onCleanUp() vs onComplete() vs afterLaunch() selenium selenium

onCleanUp() vs onComplete() vs afterLaunch()


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.