Specflow+Runner Specrun doesn't support TFS 2015 Secret Variables:
In a TFS 2015 build definition it's possible to set Variables. These variables are also set as environment variabeles on the agent, and so usable in Specflow / Specrun tests.
TFS 2015 also supports Secret Variables, these can be passed into the test run with Override Test Run Parameters. Very usefull for example for passwords used in tests. They are not set as enviroment variables .
If I set a secret variable in TFS it can override my TestRunParameters set in .runsettings, for example:
#defined in runsettings file: <TestRunParameters> <Parameter name="password" value="nothing yet" /> </TestRunParameters>
In the Visual Studio Test task in TFS 2015 : Override TestRun Parameters : password=$(Secret_Password_Variable)
When using MsTest as test runner I can access this variable trough : Microsoft.VisualStudio.TestTools.UnitTesting.TestContext.Properties['password']
However, Specrun doesn't support the TestRunParameters, and therefore also not the overrided parameters from TFS. The TestContext is only available when the Specflow tests run with the MsTest unitTestProvider, and not with SpecRun.
Please sign in to leave a comment.