SpecFlowOSS / SpecFlow.Actions

BSD 3-Clause "New" or "Revised" License
57 stars 53 forks source link

Win app driver improvements #111

Closed lietho closed 1 year ago

lietho commented 1 year ago

This Pull request contains some improvements for SpecFlow.Actions.WindowsAppDriver that were necessary to make it work for our purposes. It contains the following changes:

  1. WindowsAppDriverOptions.Current isn't lazy (and therefore "cached") anymore. The reason is, that we have to modify the capabilities after each scenario. We are doing this by modifying the WindowsAppDriverConfiguration. These changes do not take effect, when WindowsAppDriverOptions.Current is lazy.
  2. Introduced new option WindowsAppDriverPort. On some computers in our company the WinAppDriver default port is already in use by some Windows process. Without the ability to configure the port to be used for the WinAppDriver, it is impossible to launch the tests on these computers.
  3. Introduced new option CloseAppAutomatically. Currently, the AUT will be automatically closed in AppDriver.Dispose. Unfortunately, this doesn't always work for the application we are testing, because sometimes there are additional steps necessary to really close the app. Therefore, we are handling the termination of the application ourselves after each scenario. But then Current.CloseApp() will throw an exception in AppDriver.Dispose. To maintain backwards compatibility, the setting is optional and default to true.
SabotageAndi commented 1 year ago

Thanks for the PR. New NuGet packages should be available tomorrow (if I don't forget to push the publish button)