Qase TMS .Net Api Client
Qase.io uses API tokens to authenticate requests. You can view an manage your API keys in API tokens pages.
You must replace api token with your personal API key.
QaseAPI qaseAPI = new QaseAPI("https://api.qase.io/v1", "your api token");
This method allows to retrieve all projects available for your account. You can you limit and offset params to paginate.
BaseFilter filter = new BaseFilter();
filter.limit = 100;
filter.offset = 0;
var projects = await qaseAPI.GetAllProjectsAsync(filter);
This method allows to retrieve a specific project.
var project = await qaseAPI.GetSpecificProjectAsync("TEST");
This method is used to create a new project through API.
using Qase.API.Qase.Model.Projects
var project = await qaseAPI.CreateNewProjectAsync(new CreateProjectRequest
{
Title = "TestNet",
Code = "TESTNET",
Description = "Test project .Net",
Access = AccessLevel.All.ToString(),
Group = null
});
This method allows to retrieve all test cases stored in selected project. You can you limit and offset params to paginate.
BaseFilter filter = new BaseFilter();
filter.DictionaryFilters.Add($"filters[{TypeFilter.type}]", new List<string>() { TypeCase.other.ToString(), TypeCase.performance.ToString() });
var testCases = await qaseAPI.GetAllTestCasesAsync("TEST", filter);
This method allows to retrieve a specific test case.
var testCase = await qaseAPI.GetSpecificTestCaseAsync("TEST", 1);
This method completely deletes a test case from repository.
var testCase = await qaseAPI.DeleteTestCaseAsync("TEST", 1);
This method allows to retrieve all test runs stored in selected project. You can you limit and offset params to paginate.
BaseFilter filter = new BaseFilter();
filter.DictionaryFilters.Add($"filters[{TypeFilter.status}]", StatusTestRun.active.ToString());
var testRuns = await qaseAPI.GetAllTestRunsAsync("TEST", filter);
This method allows to retrieve a specific test run.
var testRun = await qaseAPI.GetSpecificTestRunAsync("TEST", 1);
This method is used to create a new test run through API.
using Qase.API.Qase.Model.TestRuns;
var cases = new List<int>();
cases.Add(1);
var resp = await qaseAPI.CreateNewTestRunAsync("TEST", new CreateTestRunRequest
{
Title = "TestNet2",
Description = "Test project .Net",
Cases = cases
});
var id = resp.Result.Id;
This method completely deletes a test run from repository.
var resp = await qaseAPI.DeleteTestRunAsync("TEST", 1);
This method allows to retrieve all test run results stored in selected project. You can you limit and offset params to paginate.
BaseFilter filter = new BaseFilter();
filter.DictionaryFilters.Add($"filters[{TypeFilter.status}]", StatusTestRunResult.passed.ToString());
var testRunResults = await qaseAPI.GetAllTestRunResultsAsync("TEST", filter);
This method allows to retrieve a specific test run result.
var testRunResult = await qaseAPI.GetSpecificTestRunResultAsync("TEST", "5796a7fb165a0eff2a7de3436485154beff88afc");
This method is used to create a new test run result through API.
using Qase.API.Qase.Model.TestRunResults;
var steps = new List<StepTestRunResult>();
steps.Add(new StepTestRunResult
{
Position = 1,
Status = "failed",
Comment = "Something went wrong",
Attachments = new List<string>() { "2898ba7f3b4d857cec8bee4a852cdc85f8b33132" }
});
var resp = await 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" }
});
var hash = resp.Result.Hash;
This method is used to update existing test run result through API.
using Qase.API.Qase.Model.TestRunResults;
var steps = new List<StepTestRunResult>();
steps.Add(new StepTestRunResult
{
Position = 1,
Status = "passed"
});
var resp = await qaseAPI.UpdateTestRunResultAsync("TEST", 2, "c0def82a1d5e2df80d991a917c21df0944b49b7b", new UpdateTestRunResultRequest
{
Time = 100,
Status = "passed",
Comment = "Failed via API v2 .Net",
Defect = true,
Steps = steps,
Attachments = new List<string>() { "2898ba7f3b4d857cec8bee4a852cdc85f8b33132" }
});
var hash = resp.Result.Hash;
This method completely deletes a test run result from repository.
var resp = await qaseAPI.DeleteTestRunResultAsync("TEST", 4, "2898ba7f3b4d857cec8bee4a852cdc85f8b33132");
This method allows to retrieve all test suites stored in selected project. You can you limit and offset params to paginate.
BaseFilter filter = new BaseFilter();
filter.DictionaryFilters.Add($"filters[{TypeFilter.search}]", "text search");
var suites = await qaseAPI.GetAllTestSuitesAsync("TEST", filter);
This method allows to retrieve a specific test suite.
var suite = await qaseAPI.GetSpecificTestSuiteAsync("TEST", 1);
This method is used to create a new test suite through API.
using Qase.API.Qase.Model.Suites;
var resp = await qaseAPI.CreateTestSuiteAsync("TEST", new SuiteRequest
{
Title = "Test suite",
Description = "Suite description",
Preconditions = "Suite preconditions"
});
var id = resp.Result.Id;
This method is used to update a test suite through API. You should provide an object with a list of fields you want to update in a payload. At least one field is required. Fields in payload will overwrite existing values.
using Qase.API.Qase.Model.Suites;
var resp = await qaseAPI.CreateTestSuiteAsync("TEST", 1, new SuiteRequest
{
Title = "Test suite title",
Description = "Suite description",
Preconditions = "Suite preconditions"
});
var id = resp.Result.Id;
This method completely deletes a test suite from repository.
var resp = await qaseAPI.DeleteTestSuiteAsync("TEST", 1);
This method allows to retrieve all milestones stored in selected project. You can you limit and offset params to paginate.
BaseFilter filter = new BaseFilter();
filter.DictionaryFilters.Add($"filters[{TypeFilter.search}]", "text search");
var milestones = await qaseAPI.GetAllMilestonesAsync("TEST", filter);
This method allows to retrieve a specific milestone.
var milestone = await qaseAPI.GetSpecificMilestoneAsync("TEST", 1);
This method is used to create a new milestone through API.
using Qase.API.Qase.Model.Milestones;
var resp = await qaseAPI.CreateMilestoneAsync("TEST", new MilestoneRequest
{
Title = "New milestone"
});
var id = resp.Result.Id;
This method is used to update a milestone through API. You should provide an object with a list of fields you want to update in a payload. At least one field is required. Fields in payload will overwrite existing values.
using Qase.API.Qase.Model.Milestones;
var resp = await qaseAPI.UpdateMilestoneAsync("TEST", 1, new MilestoneRequest
{
Title = "Test milestone",
Description = "Milestone description",
});
var id = resp.Result.Id;
This method completely deletes a milestone from repository.
var resp = await qaseAPI.DeleteMilestoneAsync("TEST", 1);
This method allows to retrieve all shared steps stored in selected project. You can you limit and offset params to paginate.
BaseFilter filter = new BaseFilter();
var sharedSteps = await qaseAPI.GetAllSharedStepsAsync("TEST", filter);
This method allows to retrieve a specific shared step.
var sharedStep = await qaseAPI.GetSpecificSharedStepAsync("TEST", "7d03f27a6a841fa50019a16d47a86d855da50da7");
This method is used to create a new shared step through API.
using Qase.API.Qase.Model.SharedSteps;
var resp = await qaseAPI.CreateSharedStepAsync("TEST", new SharedStepRequest
{
Title = "Test SharedStep"
});
var hash = resp.Result.Hash;
This method is used to update a shared step through API. You should provide an object with a list of fields you want to update in a payload. At least one field is required. Fields in payload will overwrite existing values.
using Qase.API.Qase.Model.SharedSteps;
var resp = await qaseAPI.UpdateSharedStepAsync("TEST", "7d03f27a6a841fa50019a16d47a86d855da50da7", new SharedStepRequest
{
Title = "Test SharedStep update"
});
var hash = resp.Result.Hash;
This method completely deletes a shared step from repository. Also it will be removed from all test cases.
var resp = await qaseAPI.DeleteSharedStepAsync("TEST", "7d03f27a6a841fa50019a16d47a86d855da50da7");
var hash = resp.Result.Hash;
This method allows to retrieve all test plans stored in selected project. You can you limit and offset params to paginate.
BaseFilter filter = new BaseFilter();
var testPlans = await qaseAPI.GetAllTestPlansAsync("TEST", filter);
This method allows to retrieve a specific test plan with detailed information about test cases in that plan and assignee.
var testPlan = await qaseAPI.GetSpecificTestPlanAsync("TEST", 1);
This method is used to create a new test plan through API. In response you will receive an ID of newly created plan.
using Qase.API.Qase.Model.TestPlans;
var resp = await qaseAPI.CreateTestPlanAsync("TEST", new TestPlanRequest
{
Title = "New Test Plan",
Cases = new List<int>() { 1 }
});
var id = resp.Result.Id;
This method is used to update a test plan through API. You should provide an object with a list of fields you want to update in a payload. At least one field is required. Fields in payload will overwrite existing values.
using Qase.API.Qase.Model.TestPlans;
var resp = await qaseAPI.UpdateTestPlanAsync("TEST", 1, new TestPlanRequest
{
Title = "Test testPlan",
Description = "TestPlan description",
});
var id = resp.Result.Id;
This method completely deletes a test plan from repository.
var resp = qaseAPI.DeleteTestPlanAsync("TEST", 1);
var id = resp.Result.Id;
This method allows to retrieve all defects stored in selected project. You can you limit and offset params to paginate.
BaseFilter filter = new BaseFilter();
filter.DictionaryFilters.Add($"filters[{TypeFilter.status}]", StatusDefect.open.ToString());
var defects = await qaseAPI.GetAllDefectsAsync("TEST", filter);
This method allows to retrieve a specific defect.
var defects = await qaseAPI.GetSpecificDefectAsync("TEST", 1);
This method is used to resolve defect through API. If defect is already resolved, you will get a message that defect is not found.
var resp = await qaseAPI.ResolveDefectAsync("TEST", 1)
var id = resp.Result.Id;
This method completely deletes a defect from repository.
var resp = await qaseAPI.DeleteDefectAsync("TEST", 1);
var id = resp.Result.Id;
This method allows to retrieve all custom fields for a specific project. You can you limit and offset params to paginate.
BaseFilter filter = new BaseFilter();
var customFields = await qaseAPI.GetAllCustomFieldsAsync("TEST", filter);
This method allows to retrieve one custom fields for specific project by id.
var customField = await qaseAPI.GetSpecificCustomFieldAsync("TEST", 1);
This method allows to retrieve all users in your team. You can you limit and offset params to paginate.
BaseFilter filter = new BaseFilter();
var teams = await qaseAPI.GetAllTeamsAsync("TEST", filter);
This method allows to retrieve a specific team member by id.
var team = await qaseAPI.GetSpecificTeamAsync("TEST", 1);
This method allows to retrieve all attachments uploaded into your projects. You can you limit and offset params to paginate.
BaseFilter filter = new BaseFilter();
var attachments = await qaseAPI.GetAllAttachmentsAsync("TEST", filter);
This method allows to retrieve a specific attachment by hash.
var attachment = await qaseAPI.GetSpecificAttachmentAsync("5b9d96e5a4dc75e71fe2378d65f9e9ea176ce479");
This method allows to upload attachment to Qase. Files to attach are sent as request body using 'multipart/form-data' content type. Max upload size: * Up to 32 Mb per file * Up to 128 Mb per single request * Up to 20 files per single request
If there is no free space left in your team account, you will receive an error with code 507 - Insufficient Storage.
var path = @"TestFiles\Test.pdf";
using var stream = new FileStream(path, FileMode.Open);
var attachment = await qaseAPI.UploadAttachmentAsync("TEST", new StreamPart(stream, "test-streampart.pdf", "application/pdf"));
This method completely deletes an attachment.
var resp = await qaseAPI.DeleteAttachmentAsync("5b9d96e5a4dc75e71fe2378d65f9e9ea176ce479");