I am trying to run my end to end tests against the real environment using VS2019 in the IDE. The tests are located in separate test project within the main solution.
So I was trying to load environment variables using below two methods:
Method 1
Update launchSettings.json in the test project
{
"profiles": {
"My.Endpoint.Tests": {
"commandName": "Project",
"environmentVariables": {
"ServerName": "Apim"
}
}
}
}
Method 2
Create below cmd file and add it to the project and then call same in Build Events - Pre-build event command-line: in the test project properties.
set ServerName=Apim
Unfortunately none of the above methods can read the given environment variable when execute the tests via VS2019 IDE