janono.ado.testcase.associate.cli
janono.ado.testcase.associate is an extension for automatic association of test methods from code to Test Cases in Azure DevOps Test Plans.
Extension was created as current approach for association is manual activity.For each test case with can be very time consuming, susceptible to mistakes (as each manual activity), time costly in maintenance. Current approach also requires Visual Studio with is not needed in case of using extension.
Extension consists of 2 components
Create Test Project or open existing, supported any with MSTest, NUnit, xUnit written in .NET Core or .NET Framework version.
Add latest nuget package "janono.ado.testcase.associate" from https://www.nuget.org/packages/janono.ado.testcase.associate/ .
[janono.ado.testcase.associate.Organization("janono-pub")]
where replace value "janono-pub" your azure devops organization name.using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace ExampleTestProject
{
[TestClass]
[janono.ado.testcase.associate.Organization("janono-pub")] //<---
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
//yours test method content
//...
//
}
}
}
[janono.ado.testcase.associate.TestCase(5)]
where replace '5' with yours 'test case id' for with you want to associate automation.using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace ExampleTestProject
{
[TestClass]
[janono.ado.testcase.associate.Organization("janono-pub")]
public class UnitTest1
{
[TestMethod]
[janono.ado.testcase.associate.TestCase(5)] //<---
public void TestMethod1()
{
//yours test method content
//...
//
}
}
}
[janono.ado.testcase.associate.Organization("janono-pub")] -> [Organization("janono-pub")]
[janono.ado.testcase.associate.Organization("janono-pub")] -> [TestCase(5)]
using Microsoft.VisualStudio.TestTools.UnitTesting;
using janono.ado.testcase.associate; //<---
namespace ExampleTestProject { [TestClass] [Organization("janono-pub")] //<--- public class UnitTest1 { [TestMethod] [TestCase(5)] //<--- public void TestMethod1() { //yours test method content //... // } } }
* Build projects or solution for generating ddl assembly for tests
* Download latest CLI release [janono.ado.testcase.associate.cli](https://github.com/JanuszNowak/janono.ado.testcase.associate.cli/releases) for your platform Windwos, MacOs, [Linux](https://en.wikipedia.org/wiki/Linux) as cli is writen in cross platform [.NET Core](https://github.com/dotnet/core). Extract to folder where you would like to keep it.
* Open console with you are using, go to folder where you extract cli. Type "janono.ado.testcase.associate.cli.exe" press enter, now you will see the possible options.
![janono.ado.testcase.associate](/img/cli.png)
Options:
-am, --authMethod <Basic|oAuth|PAT> (REQUIRED) Authentication method Oauth Token, PAT,Basic
--authValue <authValue> (REQUIRED) The password, Personal Access Token or OAuth Token to authenticate
--action <Associate|List> (REQUIRED) Action
--path <path> (REQUIRED) Path to dlls with tests, supporting '*' wildcards.
--version Show version information
-?, -h, --help Show help and usage information
* Pass parameters for CLI
* --authMethod PAT or oAuth(in coming future)
* --authMethod "PAT" [PAT (personal access token)](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate)
* --path to dll file with test for association
* --action "List" for scan dll test assembly and check if need to update association, or "Associate" for association test methods to test cases also cover update case
* Example --action "List" ```janono.ado.testcase.associate.cli.exe --authMethod PAT --authValue [yours PAT] --path D:\ExampleTestProject\bin\Release\net6.0\ExampleTestProject.dll --action List```
![janono.ado.testcase.associate](/img/cli_List.png)
* Example --action "Associate" ```janono.ado.testcase.associate.cli.exe --authMethod PAT --authValue [yours PAT] --path D:\ExampleTestProject\bin\Release\net6.0\ExampleTestProject.dll --action Associate```
![janono.ado.testcase.associate](/img/cli_Associate.png)
* Result, now on test case workitem on "Associated Automation" tab you will see automatically associated automation with will be executed [run automated tests from test plans](https://docs.microsoft.com/en-us/azure/devops/test/run-automated-tests-from-test-hub?view=azure-devops).
![janono.ado.testcase.associate](/img/end_result.png)
<!-- normalny you
would open test exproler from visual studio and then find corepoding test,
then you would connect from Team Explorer to yours Azure DevOps organization,
Then you will query for specitc test case Id for ith oyu would like to assocate or run query to find it.
All that you will repat or update for each test case for with you have automation. -->
## Features planned
* Add support for [Azure devops server](https://azure.microsoft.com/pl-pl/services/devops/server/).
* Add [Azure DevOps Marketplace](https://marketplace.visualstudio.com/) extension with dedicated build task for making automatic association.
* Generate CLI for multiple platforms.
## Communication
[Gitter](https://gitter.im/JanuszNowak/janono.ado.testcase.associate)