TestIT.Adapter.XUnit 1.6.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package TestIT.Adapter.XUnit --version 1.6.3                
NuGet\Install-Package TestIT.Adapter.XUnit -Version 1.6.3                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TestIT.Adapter.XUnit" Version="1.6.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TestIT.Adapter.XUnit --version 1.6.3                
#r "nuget: TestIT.Adapter.XUnit, 1.6.3"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install TestIT.Adapter.XUnit as a Cake Addin
#addin nuget:?package=TestIT.Adapter.XUnit&version=1.6.3

// Install TestIT.Adapter.XUnit as a Cake Tool
#tool nuget:?package=TestIT.Adapter.XUnit&version=1.6.3                

Test IT TMS Adapter for XUnit

Getting Started

Installation

NuGet CLI
Install-Package TestIT.Adapter.XUnit
Install-Package TestIT.Adapter.Core
.NET CLI
dotnet package add TestIT.Adapter.XUnit
dotnet package add TestIT.Adapter.Core

Usage

Configuration

Description File property Environment variable
Location of the TMS instance url TMS_URL
API secret key How to getting API secret key? privateToken TMS_PRIVATE_TOKEN
ID of project in TMS instance How to getting project ID? projectId TMS_PROJECT_ID
ID of configuration in TMS instance How to getting configuration ID? configurationId TMS_CONFIGURATION_ID
ID of the created test run in TMS instance. If you don't provide a test run ID, the adapter will automatically create one. testRunId TMS_TEST_RUN_ID
It enables/disables certificate validation (It's optional). Default value - true certValidation TMS_CERT_VALIDATION
Mode of automatic creation test cases (It's optional). Default value - false. The adapter supports following modes:<br/>true - in this mode, the adapter will create a test case linked to the created autotest (not to the updated autotest)<br/>false - in this mode, the adapter will not create a test case automaticCreationTestCases TMS_AUTOMATIC_CREATION_TEST_CASES
Mode of automatic updation links to test cases (It's optional). Default value - false. The adapter supports following modes:<br/>true - in this mode, the adapter will update links to test cases<br/>false - in this mode, the adapter will not update link to test cases automaticUpdationLinksToTestCases TMS_AUTOMATIC_UPDATION_LINKS_TO_TEST_CASES
Enable debug logs (It's optional). Default value - false isDebug -
File

Create Tms.config.json file in the project directory:

{
  "url": "URL",
  "privateToken": "USER_PRIVATE_TOKEN",
  "projectId": "PROJECT_ID",
  "configurationId": "CONFIGURATION_ID",
  "testRunId": "TEST_RUN_ID",
  "automaticCreationTestCases": false,
  "automaticUpdationLinksToTestCases": false,
  "certValidation": true,
  "isDebug": true
}

How to run

If you specified TestRunId, then just run the command:

dotnet test

To create and complete TestRun you can use the Test IT CLI:

$ export TMS_TOKEN=<YOUR_TOKEN>
$ testit \
  --mode create
  --url https://tms.testit.software \
  --project-id 5236eb3f-7c05-46f9-a609-dc0278896464 \
  --testrun-name "New test run" \
  --output tmp/output.txt

$ export TMS_TEST_RUN_ID=$(cat output.txt)  

$ dotnet test

$ testit \
  --mode finish
  --url https://tms.testit.software \
  --testrun-id $(cat tmp/output.txt) 

Attributes

Use attributes to specify information about autotest.

Description of attributes:

  • WorkItemIds - a method that links autotests with manual tests. Receives the array of manual tests' IDs
  • DisplayName - internal autotest name (used in Test IT)
  • ExternalId - unique internal autotest ID (used in Test IT)
  • Title - autotest name specified in the autotest card. If not specified, the name from the displayName method is used
  • Description - autotest description specified in the autotest card
  • Labels - tags listed in the autotest card
  • Links - links listed in the autotest card
  • Step - the designation of the step

Description of methods:

  • Adapter.AddLinks - add links to the autotest result.
  • Adapter.AddAttachments - add attachments to the autotest result.
  • Adapter.AddMessage - add message to the autotest result.

Examples

Simple test
using Tms.Adapter.Core.Attributes;
using Tms.Adapter.XUnit.Attributes;
using Tms.Adapter.Core.Models;

public class SampleTests : IDisposable {

    [Before]
    public StepsTests()
    {
    }
    
    [Step]
    public void CreateProject()
    {
        Assert.IsTrue(true);
    }

    [Step]
    [Title("Enter project title")]
    [Description("Enter project description")]
    public void EnterProject()
    {
        Assert.IsTrue(true);
    }

    [Step]
    public void CreateSection() 
    {
        Assert.IsTrue(true);
        Adapter.AddAttachment("/Users/user/screen.json");
    }

    [TmsFact]
    [WorkItemIds("1523344", "54321")]
    [ExternalId("all_annotations_test")]
    [Title("All Annotations Test Title")]
    [DisplayName("All Annotations Test Display Name")]
    [Labels("tag01", "tag02")]
    [Description("All Annotations Test Description")]
    [Links("https://test01.example", "Example01", "Example01 description", LinkType.Issue)]
    [Links("https://test02.example")]
    public void AllAnnotationsTest()
    {
        Adapter.AddLinks("https://test01.example", "Example01", "Example01 description", LinkType.Issue);
        Adapter.AddLinks("https://test02.example");
        CreateProject();
        EnterProject();
        CreateSection();
    }
    
    [After]
    public void Dispose()
    {
    }
}
Parameterized test
using Tms.Adapter.Core.Attributes;
using Tms.Adapter.XUnit.Attributes;
using Tms.Adapter.Core.Models;

public class ParameterizedTests {

    [InlineData(1, "string1")]
    [InlineData(2, "string2")]
    [InlineData(3, "string3")]
    [ExternalId("ParametrizedTest_Success_{number}_{str}")]
    [Title("ParametrizedTest_Success Title {number} {str}")]
    [DisplayName("ParametrizedTest_Success DisplayName {number} {str}")]
    [TmsTheory]
    public void ParametrizedTest_Success(int number, string str)
    {
        Assert.True(true);
    }
}

Contributing

You can help to develop the project. Any contributions are greatly appreciated.

  • If you have suggestions for adding or removing projects, feel free to open an issue to discuss it, or create a direct pull request after you edit the README.md file with necessary changes.
  • Make sure to check your spelling and grammar.
  • Create individual PR for each suggestion.
  • Read the Code Of Conduct before posting your first idea as well.

License

Distributed under the Apache-2.0 License. See LICENSE for more information.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.7.0 28 11/27/2024
1.6.5 89 10/8/2024
1.6.4 143 9/12/2024
1.6.3 122 7/5/2024
1.6.1 109 6/30/2024
1.6.0 93 5/20/2024
1.5.1 123 4/9/2024
1.5.0 120 3/29/2024
1.4.1 144 3/11/2024
1.4.0 129 3/11/2024
1.3.1 135 2/15/2024
1.3.0 154 12/20/2023
1.2.0 152 12/18/2023
1.1.1 138 12/8/2023
1.1.0 143 11/27/2023
1.0.8 175 7/31/2023
1.0.7 158 7/27/2023
1.0.6 138 7/27/2023
1.0.5 128 7/3/2023
1.0.4 132 7/3/2023
1.0.3 134 6/2/2023
1.0.2 149 6/1/2023