Example #1
0
        public void FixtureTearDown()
        {
            if (!IgnoreAddResults)
            {
                if (_resultsForCases.Count > 0)
                {
                    var cases = new List <int>();
                    cases.Add(_caseId);


                    var runId = _qaseAPI.CreateNewTestRunAsync(_code, new CreateTestRunRequest
                    {
                        Title = _title,
                        Cases = cases
                    }).Result
                                .Result.Id;

                    if (runId > 0)
                    {
                        foreach (var result in _resultsForCases)
                        {
                            var hash = _qaseAPI.AddTestRunResultAsync(_code, runId, result).Result.Result.Hash;
                        }
                    }
                }
            }
        }
Example #2
0
        public void AddTestRunResult()
        {
            QaseAPI qaseAPI = new QaseAPI("https://api.qase.io/v1", "your api token");

            var steps = new List <StepTestRunResult>();

            steps.Add(new StepTestRunResult
            {
                Position    = 1,
                Status      = "failed",
                Comment     = "Something went wrong",
                Attachments = new List <string>()
                {
                    "2898ba7f3b4d857cec8bee4a852cdc85f8b33132"
                }
            });

            try
            {
                var hash = (qaseAPI.AddTestRunResultAsync("TEST", 2, new AddTestRunResultRequest
                {
                    CaseId = 1,
                    Time = 100,
                    Status = "failed",
                    MemberId = 1,
                    Comment = "Failed via API .Net",
                    Defect = true,
                    Steps = steps,
                    Attachments = new List <string>()
                    {
                        "2898ba7f3b4d857cec8bee4a852cdc85f8b33132"
                    }
                }).Result)
                           .Result.Hash;
            }
            catch (Exception ex)
            {
            }
        }