Search code examples
visual-studioazure-devopsautomated-tests

(Azure DevOps Testplans) Is it possible to associate an automated Test to a testcase without Visual Studio?


My Goal is to trigger my testcafe-test via the test case and not with the pipeline. on the microsoft docs they say i need visual studio, but is it possible to link my test to a test case without it?

enter image description here


Solution

  • (Azure DevOps Testplans) Is it possible to associate an automated Test to a testcase without Visual Studio?

    You could use REST API to do this Work Items - Update:

    PATCH https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?api-version=6.0
    

    Content-Type: application/json-patch+json

    Body:

    [
      {
        "op": "add",
        "path": "/fields/Microsoft.VSTS.TCM.AutomatedTestName",
        "value": "[namespace.classname.methodname (e.g. UnitTestProject1.UnitTest1.TestMethod2)]"
      },
      {
        "op": "add",
        "path": "/fields/Microsoft.VSTS.TCM.AutomatedTestStorage",
        "value": "[assembly name(e.g. unittestproject1.dll)"
      },
      {
        "op": "add",
        "path": "/fields/Microsoft.VSTS.TCM.AutomatedTestId",
        "value": "[guid id]"
      },
      {
        "op": "add",
        "path": "/fields/Microsoft.VSTS.TCM.AutomatedTestType",
        "value": "Unit Test"
      },
       {
        "op": "add",
        "path": "/fields/Microsoft.VSTS.TCM.AutomationStatus",
        "value": "Automated"
      }
    ]