{{ testResult.testName }} |
{{ testResult.className }} |
{{ testResult.errorMessage }} |
- {{ testResult.failureStack }} |
+ {{ testResult.stackTrace }} |
{{ testResult.failureType }} |
{{ testResult.createdDate | formatMediumDatetime }} |
{{ testResult.lastModifiedDate | formatMediumDatetime }} |
diff --git a/simulator-ui/src/main/webapp/app/entities/test-result/test-result.model.spec.ts b/simulator-ui/src/main/webapp/app/entities/test-result/test-result.model.spec.ts
new file mode 100644
index 000000000..63c9d382c
--- /dev/null
+++ b/simulator-ui/src/main/webapp/app/entities/test-result/test-result.model.spec.ts
@@ -0,0 +1,36 @@
+import {
+ testResultStatusFromId,
+ testResultStatusFromName,
+ STATUS_UNKNOWN,
+ STATUS_SUCCESS,
+ STATUS_FAILURE,
+ STATUS_SKIP
+} from './test-result.model';
+
+describe('TestResult Status', () => {
+ describe('testResultStatusFromName', () => {
+ it('should return the correct status for a valid name', () => {
+ expect(testResultStatusFromName('UNKNOWN')).toEqual(STATUS_UNKNOWN);
+ expect(testResultStatusFromName('SUCCESS')).toEqual(STATUS_SUCCESS);
+ expect(testResultStatusFromName('FAILURE')).toEqual(STATUS_FAILURE);
+ expect(testResultStatusFromName('SKIP')).toEqual(STATUS_SKIP);
+ });
+
+ it('should return STATUS_UNKNOWN for an invalid name', () => {
+ expect(testResultStatusFromName('invalid')).toEqual(STATUS_UNKNOWN);
+ });
+ });
+
+ describe('testResultStatusFromId', () => {
+ it('should return the correct status for a valid id', () => {
+ expect(testResultStatusFromId(0)).toEqual(STATUS_UNKNOWN);
+ expect(testResultStatusFromId(1)).toEqual(STATUS_SUCCESS);
+ expect(testResultStatusFromId(2)).toEqual(STATUS_FAILURE);
+ expect(testResultStatusFromId(3)).toEqual(STATUS_SKIP);
+ });
+
+ it('should return STATUS_UNKNOWN for an invalid id', () => {
+ expect(testResultStatusFromId(99)).toEqual(STATUS_UNKNOWN);
+ });
+ });
+});
diff --git a/simulator-ui/src/main/webapp/app/entities/test-result/test-result.model.ts b/simulator-ui/src/main/webapp/app/entities/test-result/test-result.model.ts
index 1dfed6054..55bbe3b98 100644
--- a/simulator-ui/src/main/webapp/app/entities/test-result/test-result.model.ts
+++ b/simulator-ui/src/main/webapp/app/entities/test-result/test-result.model.ts
@@ -6,7 +6,7 @@ export interface ITestResult {
testName?: string | null;
className?: string | null;
errorMessage?: string | null;
- failureStack?: string | null;
+ stackTrace?: string | null;
failureType?: string | null;
createdDate?: dayjs.Dayjs | null;
lastModifiedDate?: dayjs.Dayjs | null;
@@ -21,5 +21,25 @@ export interface ITestResultStatus {
export const STATUS_UNKNOWN: ITestResultStatus = { id: 0, name: 'UNKNOWN' };
export const STATUS_SUCCESS: ITestResultStatus = { id: 1, name: 'SUCCESS' };
-export const STATUS_FAILED: ITestResultStatus = { id: 2, name: 'FAILURE' };
+export const STATUS_FAILURE: ITestResultStatus = { id: 2, name: 'FAILURE' };
export const STATUS_SKIP: ITestResultStatus = { id: 3, name: 'SKIP' };
+
+export const testResultStatusFromName = (name: string): ITestResultStatus => {
+ for (const status of [STATUS_UNKNOWN, STATUS_SUCCESS, STATUS_FAILURE, STATUS_SKIP]) {
+ if (status.name === name) {
+ return status;
+ }
+ }
+
+ return STATUS_UNKNOWN;
+};
+
+export const testResultStatusFromId = (id: number): ITestResultStatus => {
+ for (const status of [STATUS_UNKNOWN, STATUS_SUCCESS, STATUS_FAILURE, STATUS_SKIP]) {
+ if (status.id === id) {
+ return status;
+ }
+ }
+
+ return STATUS_UNKNOWN;
+};
diff --git a/simulator-ui/src/main/webapp/app/entities/test-result/test-result.test-samples.ts b/simulator-ui/src/main/webapp/app/entities/test-result/test-result.test-samples.ts
index 6ea1d32e5..12955b402 100644
--- a/simulator-ui/src/main/webapp/app/entities/test-result/test-result.test-samples.ts
+++ b/simulator-ui/src/main/webapp/app/entities/test-result/test-result.test-samples.ts
@@ -17,7 +17,7 @@ export const sampleWithPartialData: ITestResult = {
testName: 'zowie',
className: 'regarding openly',
errorMessage: 'toward',
- failureStack: 'whose',
+ stackTrace: 'whose',
createdDate: dayjs('2023-09-26T13:39'),
lastModifiedDate: dayjs('2023-09-26T15:03'),
};
@@ -28,7 +28,7 @@ export const sampleWithFullData: ITestResult = {
testName: 'peruse probable display',
className: 'dining',
errorMessage: 'reproachfully better what',
- failureStack: 'flugelhorn over',
+ stackTrace: 'flugelhorn over',
failureType: 'aha',
createdDate: dayjs('2023-09-26T07:09'),
lastModifiedDate: dayjs('2023-09-26T09:18'),
diff --git a/simulator-ui/src/main/webapp/app/home/test-result-summary.component.ts b/simulator-ui/src/main/webapp/app/home/test-result-summary.component.ts
index 1555abc9c..09e856414 100644
--- a/simulator-ui/src/main/webapp/app/home/test-result-summary.component.ts
+++ b/simulator-ui/src/main/webapp/app/home/test-result-summary.component.ts
@@ -5,12 +5,14 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { filter, map } from 'rxjs/operators';
-import { STATUS_FAILED, STATUS_SUCCESS } from 'app/entities/scenario-execution/scenario-execution.model';
+import { ITEM_DELETED_EVENT } from 'app/config/navigation.constants';
+
+import { STATUS_FAILURE, STATUS_SUCCESS } from 'app/entities/test-result/test-result.model';
import { TestResultsByStatus, TestResultService } from 'app/entities/test-result/service/test-result.service';
+
import SharedModule from 'app/shared/shared.module';
+
import TestResultDeleteDialogComponent from './delete/test-result-delete-dialog.component';
-import { switchMap } from 'rxjs';
-import { ITEM_DELETED_EVENT } from '../config/navigation.constants';
@Component({
standalone: true,
@@ -27,7 +29,7 @@ export default class TestResultSummaryComponent implements OnInit {
failedPercentage = '0';
statusSuccess = STATUS_SUCCESS;
- statusFailed = STATUS_FAILED;
+ statusFailed = STATUS_FAILURE;
constructor(
private modalService: NgbModal,
diff --git a/simulator-ui/src/main/webapp/app/scenario-result/filter/scenario-execution-filter.component.html b/simulator-ui/src/main/webapp/app/scenario-result/filter/scenario-execution-filter.component.html
index a16ee4b06..90336ee9a 100644
--- a/simulator-ui/src/main/webapp/app/scenario-result/filter/scenario-execution-filter.component.html
+++ b/simulator-ui/src/main/webapp/app/scenario-result/filter/scenario-execution-filter.component.html
@@ -20,16 +20,16 @@
diff --git a/simulator-ui/src/main/webapp/app/scenario-result/filter/scenario-execution-filter.component.spec.ts b/simulator-ui/src/main/webapp/app/scenario-result/filter/scenario-execution-filter.component.spec.ts
index 56fa71d8e..5a3a26db2 100644
--- a/simulator-ui/src/main/webapp/app/scenario-result/filter/scenario-execution-filter.component.spec.ts
+++ b/simulator-ui/src/main/webapp/app/scenario-result/filter/scenario-execution-filter.component.spec.ts
@@ -10,7 +10,7 @@ import { TranslateModule } from '@ngx-translate/core';
import { DEBOUNCE_TIME_MILLIS } from 'app/config/input.constants';
-import { STATUS_SUCCESS } from 'app/entities/scenario-execution/scenario-execution.model';
+import {STATUS_SUCCESS} from "app/entities/test-result/test-result.model";
import SharedModule from 'app/shared/shared.module';
diff --git a/simulator-ui/src/main/webapp/app/scenario-result/filter/scenario-execution-filter.component.ts b/simulator-ui/src/main/webapp/app/scenario-result/filter/scenario-execution-filter.component.ts
index ec81032d6..8f674e724 100644
--- a/simulator-ui/src/main/webapp/app/scenario-result/filter/scenario-execution-filter.component.ts
+++ b/simulator-ui/src/main/webapp/app/scenario-result/filter/scenario-execution-filter.component.ts
@@ -16,11 +16,7 @@ import SharedModule from 'app/shared/shared.module';
import { formatDateTimeFilterOptions } from 'app/shared/date/format-date-time-filter-options';
import { FilterOptions, IFilterOptions } from 'app/shared/filter';
-import {
- IScenarioExecutionStatus,
- scenarioExecutionStatusFromId,
- scenarioExecutionStatusFromName,
-} from 'app/entities/scenario-execution/scenario-execution.model';
+import { ITestResultStatus, testResultStatusFromId, testResultStatusFromName } from 'app/entities/test-result/test-result.model';
import HeaderFilterDialogComponent, { ComparatorType, HeaderFilter, ValueType } from './header-filter-dialog.component';
import HeaderFilterHelpDialogComponent from './header-filter-help-dialog.component';
@@ -29,7 +25,7 @@ type ScenarioExecutionFilter = {
nameContains: string | undefined;
fromDate: dayjs.Dayjs | undefined;
toDate: dayjs.Dayjs | undefined;
- statusIn: IScenarioExecutionStatus | undefined;
+ statusIn: ITestResultStatus | undefined;
headerFilter: string | undefined;
};
@@ -165,7 +161,7 @@ export default class ScenarioExecutionFilterComponent implements OnInit, OnDestr
nameContains: formValue.nameContains,
fromDate: formValue.fromDate ? dayjs(formValue.fromDate) : undefined,
toDate: formValue.toDate ? dayjs(formValue.toDate) : undefined,
- statusIn: formValue.statusIn ? scenarioExecutionStatusFromName(formValue.statusIn) : undefined,
+ statusIn: formValue.statusIn ? testResultStatusFromName(formValue.statusIn) : undefined,
headerFilter: formValue.headerFilter,
}),
),
@@ -195,7 +191,7 @@ export default class ScenarioExecutionFilterComponent implements OnInit, OnDestr
this.filterForm.controls.toDate.markAsDirty();
break;
case 'status':
- this.filterForm.controls.statusIn.setValue(scenarioExecutionStatusFromId(Number(filterOption.values[0])).name);
+ this.filterForm.controls.statusIn.setValue(testResultStatusFromId(Number(filterOption.values[0])).name);
this.filterForm.controls.statusIn.markAsDirty();
break;
case 'headers':
diff --git a/simulator-ui/src/main/webapp/i18n/en/scenarioExecution.json b/simulator-ui/src/main/webapp/i18n/en/scenarioExecution.json
index 254274f71..a42461770 100644
--- a/simulator-ui/src/main/webapp/i18n/en/scenarioExecution.json
+++ b/simulator-ui/src/main/webapp/i18n/en/scenarioExecution.json
@@ -43,13 +43,9 @@
"id": "ID",
"startDate": "Start Date",
"endDate": "End Date",
- "status": "Status",
- "statusAll": "All",
- "statusRunning": "Running",
- "statusSuccess": "Success",
- "statusFailed": "Failed",
"scenarioName": "Scenario Name",
"errorMessage": "Error Message",
+ "testResult": "Test Result",
"scenarioActions": "Scenario Actions",
"scenarioMessages": "Scenario Messages",
"scenarioParameters": "Scenario Parameters"
diff --git a/simulator-ui/src/main/webapp/i18n/en/testResult.json b/simulator-ui/src/main/webapp/i18n/en/testResult.json
index 1abeca263..06b66f7b9 100644
--- a/simulator-ui/src/main/webapp/i18n/en/testResult.json
+++ b/simulator-ui/src/main/webapp/i18n/en/testResult.json
@@ -11,10 +11,14 @@
},
"id": "ID",
"status": "Status",
+ "statusAll": "All",
+ "statusSuccess": "Success",
+ "statusFailure": "Failure",
+ "statusSkip": "Skipped",
"testName": "Test Name",
"className": "Class Name",
"errorMessage": "Error Message",
- "failureStack": "Failure Stack",
+ "stackTrace": "Stack Trace",
"failureType": "Failure Type",
"testParameter": "Test Parameters",
"createdDate": "Created Date",