问题
I would like my Protractor- CucumberJS framework to start browser at the start of every feature file - load the URL - execute scenarios - close the browser once all scenarios are done executing - launch fresh browser instance for next feature file...and so on.
I am using Beforefeature
hook to launch URL and Afterfeature
hook to do browser.quit()
Tried setting shardTestFiles
to true in multiCapabilities
. It does launch a separate browser for every feature file but throws error - NoSuchSessionError: This driver instance does not have a valid session ID (did you call WebDriver.quit()?) and may no longer be used.
Setting restartBrowserBetweenTests
to true
in config file closes and opens browser instance for every scenario - not what I want.
How can this be accomplished?
来源:https://stackoverflow.com/questions/39904082/restart-browser-after-every-feature-file