forked from gusarin/jest-allure-reporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testcase.ts
28 lines (26 loc) · 880 Bytes
/
testcase.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
* jest-allure-reporter
* @author: Pascal Esemann
* @file: testcase.ts
* @description: Class for representing a testcase.
*/
//Getting testcase-related data from the json-results of the testcase.
export class Testcase {
public startTime: string;
public stopTime: string;
public status: string;
public fullName: string;
public title: string;
public failureMessages: string;
constructor(testcase: any, jsonResults: any) {
this.startTime = jsonResults.startTime;
this.stopTime = (parseInt(jsonResults.startTime) + parseInt(testcase.duration)).toString();
this.status = testcase.status;
this.fullName = testcase.fullName;
this.title = testcase.title;
this.failureMessages = "";
testcase.failureMessages.forEach((fMsg: any) => {
this.failureMessages += fMsg;
});
}
}