Closed matthewmcgarvey closed 4 years ago
Rather than requiring users of the library to start their own driver processes (like chromedriver), provide the ability to start them in the library.
This is largely a simplified copy of the ruby selenium library's implementation: https://github.com/SeleniumHQ/selenium/blob/e675f9bf66537930de9ebf2be2de44635821db22/rb/lib/selenium/webdriver/common/service.rb#L27
The only part that I know that I wasn't able to implement is the exit hook piece https://github.com/SeleniumHQ/selenium/blob/e675f9bf66537930de9ebf2be2de44635821db22/rb/lib/selenium/webdriver/common/service_manager.rb#L52 This is because the way the at_exit hook works causes problems with Spec. Spec uses an at_exit hook to run the tests so if this library had one that means it would always run before any of the tests ran. It will need to be very clear that the user MUST call driver.stop in order to end the process.
at_exit
driver.stop
Rather than requiring users of the library to start their own driver processes (like chromedriver), provide the ability to start them in the library.
This is largely a simplified copy of the ruby selenium library's implementation: https://github.com/SeleniumHQ/selenium/blob/e675f9bf66537930de9ebf2be2de44635821db22/rb/lib/selenium/webdriver/common/service.rb#L27
The only part that I know that I wasn't able to implement is the exit hook piece https://github.com/SeleniumHQ/selenium/blob/e675f9bf66537930de9ebf2be2de44635821db22/rb/lib/selenium/webdriver/common/service_manager.rb#L52 This is because the way the
at_exit
hook works causes problems with Spec. Spec uses anat_exit
hook to run the tests so if this library had one that means it would always run before any of the tests ran. It will need to be very clear that the user MUST calldriver.stop
in order to end the process.