-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored testrail api to be more seperate and able to use on its own added get cases api call
- Loading branch information
Pierre Awaragi
committed
Jul 25, 2017
1 parent
04c12c4
commit 1c0c611
Showing
7 changed files
with
171 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
export interface TestRailOptions { | ||
domain: string, | ||
username: string, | ||
password: string, | ||
projectId: number, | ||
suiteId: number, | ||
assignedToId?: number, | ||
} | ||
|
||
export enum Status { | ||
Passed = 1, | ||
Blocked = 2, | ||
Untested = 3, | ||
Retest = 4, | ||
Failed = 5 | ||
} | ||
|
||
export interface TestRailResult { | ||
case_id: number, | ||
status_id: Status, | ||
comment?: String, | ||
} | ||
|
||
export interface TestRailCase { | ||
id: number, | ||
title: string, | ||
section_id: number, | ||
template_id: number, | ||
type_id: number, | ||
priority_id: number, | ||
milestone_id?: number, | ||
refs?: string, | ||
created_by: number, | ||
created_on: number, | ||
updated_by: number, | ||
updated_on: number, | ||
estimate?: string, | ||
estimate_forecast?: string, | ||
suite_id: number, | ||
custom_preconds?: string, | ||
custom_steps?: string, | ||
custom_expected?: string, | ||
custom_steps_separated?: string, | ||
custom_mission?: string, | ||
custom_goals?: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,39 @@ | ||
import {TestRail} from "../lib/testrail"; | ||
import {TestRailResult, TestRailCase, Status} from "../lib/testrail.interface"; | ||
|
||
describe.skip("TestRail API", () => { | ||
describe("TestRail API", () => { | ||
it("Publish test run", (done) => { | ||
new TestRail({ | ||
domain: "testingoutone", | ||
username: "[email protected]", | ||
password: "XyMp8uojG3wkzNNNXiTk-dP4MnBmOiQhVC2xGvmyY", | ||
projectId: 1, | ||
suiteId: 2, | ||
assignedToId: 1, | ||
}).publish(0, 0, 0, ["test 1: pass", "test 2: fail"], [ | ||
{ | ||
caseId: 74, | ||
pass: true | ||
}, { | ||
caseId: 75, | ||
pass: false, | ||
comment: "Failure...." | ||
} | ||
], done); | ||
}) | ||
let testRail = new TestRail({ | ||
domain: process.env.DOMAIN, | ||
username: process.env.USERNAME, | ||
password: process.env.PASSWORD, | ||
projectId: 10, | ||
suiteId: 104, | ||
// assignedToId: 2, | ||
}); | ||
|
||
testRail.fetchCases({type_id: [3], priority_id: [4]}, (cases: TestRailCase[]) => { | ||
console.log(cases); | ||
let results: TestRailResult | ||
cases.forEach((value => { | ||
console.log(value.id, value.title); | ||
})); | ||
}); | ||
|
||
testRail.publish("Unit Test of mocha-testrail-reporter", "Unit Test of mocha-testrail-reporter", [{ | ||
case_id: 3033, | ||
status_id: Status.Passed, | ||
comment: "Passing...." | ||
}, { | ||
case_id: 3034, | ||
status_id: Status.Passed | ||
}, { | ||
case_id: 3035, | ||
status_id: Status.Passed | ||
}, { | ||
case_id: 3036, | ||
status_id: Status.Failed, | ||
comment: "Failure...." | ||
}], done); | ||
}); | ||
}); |