Verisoft Wiki

If you are not familiar with the dependency injection design pattern and concept, take some time and read about it. Take a quick look at the Wikipedia value. I assume you understand the concept.

Tests should be agnostic to their driver type. For web UI tests it can be Chrome, Safari, Edge, etc. The test shouldn’t care less about the type of driver it is executing. This is exactly the point of using the WebDriver interface, and not instantiating any specific driver. A VerisoftDriver is a generic concrete class which is injected into the test.

In order to use the VerisoftDriver with the injection mechanism we use the following:

  1. Use a JUnit 5 extension named DriverInjectionExtension
  2. Make use of at least one of the three annotations: @DriverURL, @DriverCapabilities, @DriverCommandExecutor. This mechanism was written by the inspiration of Boni Garcia’s code.
  3. Each test takes a VerisoftDriver as a parameter