alielie
2026-09-10 f3889f2d36c50cf99468594854def9b7ed069fb5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
using System.IO;
namespace OpenTap
{
    /// <summary> Defines the interface for IArtifactListeners. 
    /// Artifacts are generated by the test plan and may be any kind of file. 
    /// The artifacts are published sequentially with the results.  
    /// </summary>
    public interface IArtifactListener
    {
        /// <summary> Invoked when an artifact is published. 
        /// Note the artifactStream MUST be disposed after use.
        /// The artifact may be a FileStream, in which case it can be used as such.
        /// </summary>
        /// <param name="run">May be a TestPlanRun or TestStepRun depending on how the artifact is published. If it is published with a TestStepRun it means it belongs to that specific step. If its a TestStepRun, TestStepRunCompleted has not been called for that step run. </param>
        /// <param name="artifactStream">The stream containing the artifact data. </param>
        /// <param name="artifactName">The name of the artifact. e.g results.csv</param>
        void OnArtifactPublished(TestRun run, Stream artifactStream, string artifactName);
    }
}