Custom settings with LeanFT

Question ID: 106310
0
0

Can I use custom settings for all of my LeanFT projects if I want and how would I do that if I can?

Marked as spam
Posted by (Questions: 175, Answers: 22)
Asked on August 7, 2015 2:05 pm
17 views
Answers (1)
1
Private answer

You could create a single settings file that you use in your projects if you want.

For Eclipse:

1.Create a LeanFT testing project, and tne edit the leanft.properties file as you want.

2.Save the properties file in a location that you can access with LeanFT.

3.When you run a LeanFT test project, pass the properties as an external variable using the lftConfigFile option. When you supply an external .properties file, the file doesn't have to be named leanft.properties.

Example:

java ''C:MyProjectsTest1.jar'' -DlftConfigFile=''c:testsCustomConfig.properties''

For Visual Studio:

1.Create a LeanFT project, and edit the app.config file as you want.

2.Compile the project and store the assembly in a location that can be accessed by LeanFT.

3.For each LeanFT test project, override the ConfigurationAssembly in UnitTestClassBase and provide the assembly containing the central app.config file:

protected override Assembly GetConfigurationAssembly()
{
return Assembly.LoadFrom(''MyCentralSettingsProject.dll'');
}

You can also just override only the Report elements or only the SDK elements of the configuration, using the GetSdkConfiguration or GetReportConfiguration methods.

Example:

protected override SdkConfiguration GetSdkConfiguration()
{
return new SdkConfiguration(Assembly.LoadFrom(''MyCentralSettingsProject.dll''));
}

4.Ensure that you deploy the referenced override assembly together with your test project .dll.

Marked as spam
Posted by (Questions: 2, Answers: 425)
Answered on August 7, 2015 2:07 pm