Есть ли способ использовать параметры плана тестирования Azure DevOps для каждого тестового примера в рамках автоматичес ⇐ C#
Есть ли способ использовать параметры плана тестирования Azure DevOps для каждого тестового примера в рамках автоматичес
One of my automated testing projects is looking to use parameters under Azure DevOps Test Plan as an input for each test case. After I did my research I cannot find anything that relates to it. All I found is how to use test cases with parameters manually but I need to use it for automation testing.
I checked ADO API documents from version 5.0, 5.1, and 6.0. There is no information talking about how to use parameters automatically. The closest one that I can find from ADO Documents is Result with Parameters. But that is after manual testing not before.
My unit testing code currently reading those test inputs from a .xml file. But I need to read those inputs from ADO->TestPlan->Parameters. I hope anyone can point me in a direction if it is possible to achieve this goal.
public static async void GetTestCase(string pat, int TestPlanID, int TestSuiteID, int TestCaseID) { using (HttpClient client = new HttpClient()) { client.DefaultRequestHeaders.Accept.Add( new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String( System.Text.ASCIIEncoding.ASCII.GetBytes( string.Format("{0}:{1}", "", pat)))); using (HttpResponseMessage response = client.GetAsync("https://dev.azure.com/natescott/E2E-ATF ... t/Plans/"+ TestPlanID +"/suites/"+ TestSuiteID + "/testcases/"+ TestCaseID + "?api-version=6.0-preview.3").Result) { Console.WriteLine("StatusCode: " + response.StatusCode); response.EnsureSuccessStatusCode(); string responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine("JSON: " + responseBody); } } } I hope I can replace that .xml with Azure DevOps->TestPlan->Parameters.
Источник: https://stackoverflow.com/questions/584 ... case-as-pa
One of my automated testing projects is looking to use parameters under Azure DevOps Test Plan as an input for each test case. After I did my research I cannot find anything that relates to it. All I found is how to use test cases with parameters manually but I need to use it for automation testing.
I checked ADO API documents from version 5.0, 5.1, and 6.0. There is no information talking about how to use parameters automatically. The closest one that I can find from ADO Documents is Result with Parameters. But that is after manual testing not before.
My unit testing code currently reading those test inputs from a .xml file. But I need to read those inputs from ADO->TestPlan->Parameters. I hope anyone can point me in a direction if it is possible to achieve this goal.
public static async void GetTestCase(string pat, int TestPlanID, int TestSuiteID, int TestCaseID) { using (HttpClient client = new HttpClient()) { client.DefaultRequestHeaders.Accept.Add( new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String( System.Text.ASCIIEncoding.ASCII.GetBytes( string.Format("{0}:{1}", "", pat)))); using (HttpResponseMessage response = client.GetAsync("https://dev.azure.com/natescott/E2E-ATF ... t/Plans/"+ TestPlanID +"/suites/"+ TestSuiteID + "/testcases/"+ TestCaseID + "?api-version=6.0-preview.3").Result) { Console.WriteLine("StatusCode: " + response.StatusCode); response.EnsureSuccessStatusCode(); string responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine("JSON: " + responseBody); } } } I hope I can replace that .xml with Azure DevOps->TestPlan->Parameters.
Источник: https://stackoverflow.com/questions/584 ... case-as-pa
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Как установить различную макетную реализацию для каждого тестового примера?
Anonymous » » в форуме Javascript - 0 Ответы
- 5 Просмотры
-
Последнее сообщение Anonymous
-