@gurglosa/playwright-zephyr-jira-reporter
Version:
A custom Playwright reporter that syncs test results to Zephyr Scale and creates Jira bugs on failures.
129 lines (128 loc) • 2.89 kB
TypeScript
export interface GetJiraIssueResponse {
expand: string;
id: string;
self: string;
key: string;
fields: Fields;
}
export interface Fields {
statuscategorychangedate: string;
issuetype: IssueType;
description: Description;
attachment: any[];
summary: string;
creator: User;
created: string;
reporter: User;
environment: null | string;
progress: Progress;
issuelinks: any[];
assignee: User;
status: Status;
}
export interface IssueType {
self: string;
id: string;
description: string;
iconUrl: string;
name: string;
subtask: boolean;
avatarId: number;
entityId: string;
hierarchyLevel: number;
}
export interface Description {
type: string;
version: number;
content: Array<{
type: string;
content: Array<{
type: string;
text: string;
}>;
}>;
}
export interface User {
self: string;
accountId: string;
emailAddress: string;
displayName: string;
active: boolean;
timeZone: string;
accountType: string;
}
export interface Progress {
progress: number;
total: number;
}
export interface Status {
self: string;
description: string;
iconUrl: string;
name: string;
id: string;
}
export interface JiraConfig {
Jira_Base_URL: string;
Jira_Access_Token: string;
Jira_Email: string;
Jira_project_Key: string;
Jira_Enabled: string;
}
export interface JiraIssuePayload {
fields: {
summary: string;
issuetype: {
id: string;
};
project: {
key: string;
};
description?: any;
assignee?: {
id: string;
};
reporter?: {
id: string;
};
customfield_10069?: string;
};
update?: Record<string, any>;
}
export declare enum IssueStatusTransition {
to_do = "11",
in_progress = "21",
done = "31",
ready_for_testing = "3",
testing = "2"
}
export interface JiraIssueResponse {
id: string;
key: string;
self: string;
}
export interface JiraIssueSearchResponse {
sections: {
id: string;
issues: {
id: number;
img: string;
key: string;
keyHtml: string;
summary: string;
summaryText: string;
}[];
label: string;
msg: string;
sub: string;
}[];
}
export declare class JiraServices {
private client;
constructor(config: JiraConfig);
createIssue(payload: JiraIssuePayload): Promise<JiraIssueResponse>;
getJiraIssue(issueId: string): Promise<GetJiraIssueResponse>;
searchIssueWithTitleUsingJQL(TestCaseID: string): Promise<JiraIssueSearchResponse>;
transitionIssue(issueId: string, transitionId: string): Promise<void>;
}
export default JiraServices;