Skip to content

Commit dac07a3

Browse files
Add columns
1 parent 79870db commit dac07a3

File tree

3 files changed

+97
-91
lines changed

3 files changed

+97
-91
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Features:
66
- Remove Customers Feature -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/25)
77
- Add 'Steps' label into Test page -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/31)
88
- Add ID column to Suites List -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/18)
9+
- Add Executor and Pass Rate column to Test Run List table -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/41)
910

1011
Bugfixes:
1112
- It should not be possible to delete Customer that assigned to the projects -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/9)

src/app/pages/project/project-view/project-veiw.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ export class ProjectViewComponent implements OnInit {
6464
{ name: 'Execution Environment', property: 'execution_environment', type: 'text' },
6565
{ name: 'Start Time', property: 'start_time', type: 'date', class: 'fit' },
6666
{ name: 'Finish Time', property: 'finish_time', type: 'date', class: 'fit' },
67-
{ name: 'Failed Tests, %', property: 'failed', type: 'text', class: 'fit' },
67+
{ name: 'Pass Rate, %', property: 'failed', type: 'text', class: 'fit' },
6868
];
6969
});
7070
}
7171

7272
getNumberOfFails(id: number) {
7373
const stats: TestRunStat = this.testRunStats.filter(x => x.id === id)[0];
74-
return stats ? (stats.failed / stats.total * 100).toFixed(2) : 0;
74+
return stats ? ((stats.passed / stats.total) * 100).toFixed(2) : 0;
7575
}
7676

7777
openTestRun(testRunId: number) {

src/app/pages/project/testrun/testrun-list/testruns.component.ts

Lines changed: 94 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -56,96 +56,97 @@ export class TestRunsComponent implements OnInit {
5656
this.testRun = {
5757
project_id: this.route.snapshot.params['projectId']
5858
};
59-
await this.milestoneService.getMilestone({ project_id: this.route.snapshot.params['projectId'] }).then(res => {
60-
this.milestones = res;
61-
});
62-
await this.testrunService.getTestsRunLabels(0).subscribe(res => {
63-
this.labels = res;
64-
});
65-
await this.testSuiteService.getTestSuite({ project_id: this.route.snapshot.params['projectId'] }).then(res => {
66-
this.suites = res;
67-
});
68-
await this.testrunService.getTestsRunStats({ project_id: this.route.snapshot.params['projectId'] }).then(res => {
69-
this.testRunStats = res;
70-
this.testrunService.getTestRun({ project_id: this.route.snapshot.params['projectId'] }).then(result => {
71-
this.testRuns = result;
72-
this.testRuns.forEach(run => {
73-
if (run.finish_time && run.start_time) {
74-
run['duration'] = new Date(run.finish_time).getTime() - new Date(run.start_time).getTime();
75-
run['totalTests'] = (this.testRunStats.find(stat => stat.id === run.id) || { 'total': 0 }).total;
76-
run['not_assigned'] = (this.testRunStats.find(stat => stat.id === run.id) || { 'not_assigned': 0 }).not_assigned;
77-
}
78-
});
79-
this.tbCols = [
80-
{
81-
name: 'Label',
82-
property: 'label.name',
83-
filter: true,
84-
sorting: true,
85-
type: 'lookup-colored',
86-
entity: 'label',
87-
values: this.labels,
88-
editable: true,
89-
class: 'fit'
90-
},
91-
{ name: 'Start Time', property: 'start_time', filter: true, sorting: true, type: 'date', class: 'fit' },
92-
{ name: 'Build', property: 'build_name', filter: true, sorting: true, type: 'text', editable: false, class: 'ft-width-350' },
93-
{
94-
name: 'Test Suite',
95-
property: 'test_suite.name',
96-
filter: true,
97-
sorting: true,
98-
type: 'lookup-autocomplete',
99-
values: this.suites,
100-
propToShow: ['name'],
101-
entity: 'test_suite',
102-
allowEmpty: false,
103-
editable: false,
104-
class: 'fit'
105-
},
106-
{
107-
name: 'Milestone',
108-
property: 'milestone.name',
109-
filter: true,
110-
sorting: true,
111-
type: 'lookup-autocomplete',
112-
values: this.milestones,
113-
propToShow: ['name'],
114-
entity: 'milestone',
115-
allowEmpty: true,
116-
editable: false,
117-
class: 'fit'
118-
},
119-
{
120-
name: 'Execution Environment',
121-
property: 'execution_environment',
122-
filter: true,
123-
sorting: true,
124-
type: 'text',
125-
editable: false,
126-
class: 'fit'
127-
},
128-
{ name: 'Total Tests Executed', property: 'totalTests', filter: false, sorting: true, type: 'text', class: 'fit' },
129-
{
130-
name: 'No Resolution',
131-
property: 'not_assigned',
132-
filter: true,
133-
sorting: true,
134-
type: 'percent',
135-
editable: false,
136-
link: {
137-
template: `/project/${this.route.snapshot.params['projectId']}/testrun/{id}`,
138-
properties: ['id'], params: { f_test_resolution_opt: 1 }
139-
}
140-
},
141-
{ name: 'Duration', property: 'duration', filter: true, sorting: true, type: 'time', class: 'ft-width-120' }
142-
];
143-
this.hiddenCols = [
144-
{ name: 'Finish Time', property: 'finish_time', filter: true, sorting: true, type: 'date' },
145-
{ name: 'Debug', property: 'debug', filter: false, sorting: true, type: 'checkbox', editable: false }
146-
];
147-
});
59+
this.milestones = await this.milestoneService.getMilestone({ project_id: this.route.snapshot.params['projectId'] });
60+
this.labels = await this.testrunService.getTestsRunLabels(0).toPromise();
61+
this.suites = await this.testSuiteService.getTestSuite({ project_id: this.route.snapshot.params['projectId'] });
62+
this.testRunStats = await this.testrunService.getTestsRunStats({ project_id: this.route.snapshot.params['projectId'] });
63+
this.testRuns = await this.testrunService.getTestRun({ project_id: this.route.snapshot.params['projectId'] });
64+
this.testRuns.forEach(run => {
65+
if (run.finish_time && run.start_time) {
66+
run['duration'] = new Date(run.finish_time).getTime() - new Date(run.start_time).getTime();
67+
run['totalTests'] = (this.testRunStats.find(stat => stat.id === run.id) || { 'total': 0 }).total;
68+
run['not_assigned'] = (this.testRunStats.find(stat => stat.id === run.id) || { 'not_assigned': 0 }).not_assigned;
69+
run['passrate'] = this.getPassRate(this.testRunStats.find(stat => stat.id === run.id) || new TestRunStat());
70+
}
14871
});
72+
this.tbCols = [
73+
{
74+
name: 'Label',
75+
property: 'label.name',
76+
filter: true,
77+
sorting: true,
78+
type: 'lookup-colored',
79+
entity: 'label',
80+
values: this.labels,
81+
editable: true,
82+
class: 'fit'
83+
},
84+
{ name: 'Start Time', property: 'start_time', filter: true, sorting: true, type: 'date', class: 'fit' },
85+
{ name: 'Build', property: 'build_name', filter: true, sorting: true, type: 'text', editable: false, class: 'ft-width-350' },
86+
{
87+
name: 'Test Suite',
88+
property: 'test_suite.name',
89+
filter: true,
90+
sorting: true,
91+
type: 'lookup-autocomplete',
92+
values: this.suites,
93+
propToShow: ['name'],
94+
entity: 'test_suite',
95+
allowEmpty: false,
96+
editable: false,
97+
class: 'fit'
98+
},
99+
{
100+
name: 'Milestone',
101+
property: 'milestone.name',
102+
filter: true,
103+
sorting: true,
104+
type: 'lookup-autocomplete',
105+
values: this.milestones,
106+
propToShow: ['name'],
107+
entity: 'milestone',
108+
allowEmpty: true,
109+
editable: false,
110+
class: 'fit'
111+
},
112+
{
113+
name: 'Execution Environment',
114+
property: 'execution_environment',
115+
filter: true,
116+
sorting: true,
117+
type: 'text',
118+
editable: false,
119+
class: 'fit'
120+
}, {
121+
name: 'Executor',
122+
property: 'author',
123+
filter: true,
124+
sorting: true,
125+
type: 'text',
126+
editable: false,
127+
class: 'fit'
128+
},
129+
{ name: 'Total', property: 'totalTests', filter: false, sorting: true, type: 'text', class: 'fit' },
130+
{
131+
name: 'No Resolution',
132+
property: 'not_assigned',
133+
filter: true,
134+
sorting: true,
135+
type: 'percent',
136+
editable: false,
137+
link: {
138+
template: `/project/${this.route.snapshot.params['projectId']}/testrun/{id}`,
139+
properties: ['id'], params: { f_test_resolution_opt: 1 }
140+
},
141+
class: 'ft-width-250'
142+
},
143+
{ name: 'Pass Rate, %', property: 'passrate', filter: false, sorting: true, type: 'text', class: 'fit' },
144+
{ name: 'Duration', property: 'duration', filter: true, sorting: true, type: 'time', class: 'fit' }
145+
];
146+
this.hiddenCols = [
147+
{ name: 'Finish Time', property: 'finish_time', filter: true, sorting: true, type: 'date' },
148+
{ name: 'Debug', property: 'debug', filter: false, sorting: true, type: 'checkbox', editable: false }
149+
];
149150
}
150151

151152
handleAction($event) {
@@ -186,6 +187,10 @@ export class TestRunsComponent implements OnInit {
186187
this.hideModal = $event;
187188
}
188189

190+
getPassRate(stat: TestRunStat) {
191+
return stat ? ((stat.passed / stat.total) * 100).toFixed(2) : 0;
192+
}
193+
189194
uploadResults() {
190195
const columns = [
191196
{ name: 'Test Run ID', property: 'test_run_id' },

0 commit comments

Comments
 (0)