chr
2026-04-08 53e656200368a983e563550e2cc1acbc6d86b729
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
using System.Net.Http;
namespace OpenTap.Engine.UnitTests
{
    [Display("HTTP Artifact Step", Group: "Test")]
    public class HttpArtifactStep : TestStep
    {
        public string Url { get; set; }
        public string FileName { get; set; } = "test.html";
 
        public override void Run()
        {
            var response = new HttpClient().GetAsync(Url, HttpCompletionOption.ResponseHeadersRead).Result;
            response.EnsureSuccessStatusCode();
 
            StepRun.PublishArtifact(response.Content.ReadAsStreamAsync().Result, FileName);
            response.Dispose();
        }
    }
}