diff --git a/ui/src/app/core/model/scenario/scenario-execution-report.model.ts b/ui/src/app/core/model/scenario/scenario-execution-report.model.ts index 9e9a94be0..1edd0f928 100644 --- a/ui/src/app/core/model/scenario/scenario-execution-report.model.ts +++ b/ui/src/app/core/model/scenario/scenario-execution-report.model.ts @@ -1,12 +1,17 @@ import { StepExecutionReport } from '@core/model/scenario/step-execution-report.model'; +import { ExecutionStatus } from './execution-status'; export class ScenarioExecutionReport { constructor( public executionId: string, + public status: ExecutionStatus, + public duration: number, + public startDate: Date, public report: StepExecutionReport, public environment: string, public user: string, public scenarioName?: string, + public error?: string, public contextVariables?: Map ) { } } diff --git a/ui/src/app/modules/scenarios/components/execution/detail/execution.component.html b/ui/src/app/modules/scenarios/components/execution/detail/execution.component.html index 5bca054d6..3bc8eeafa 100644 --- a/ui/src/app/modules/scenarios/components/execution/detail/execution.component.html +++ b/ui/src/app/modules/scenarios/components/execution/detail/execution.component.html @@ -1,14 +1,14 @@
-
+
- - {{'global.time.in' | translate}} {{scenarioExecutionReport.report.duration | duration}} + {{'global.time.in' | translate}} {{scenarioExecutionReport.duration | duration}} - {{'global.time.at' | translate}} {{scenarioExecutionReport.report.startDate | date:'medium'}} + {{'global.time.at' | translate}} {{scenarioExecutionReport.startDate | date:'medium'}} {{'global.smallword.by' | translate}} : {{scenarioExecutionReport.user}} @@ -54,7 +54,7 @@
-
+
-
+
-
+
+ {{ scenarioExecutionReport?.error }} +
+
@@ -216,25 +219,25 @@
-
+
- -
+ +
-
+                    
                     
-
+                
                 
@@ -252,7 +255,7 @@
-
+
diff --git a/ui/src/app/modules/scenarios/components/execution/detail/execution.component.scss b/ui/src/app/modules/scenarios/components/execution/detail/execution.component.scss index 04a845d53..19ccdfcb9 100644 --- a/ui/src/app/modules/scenarios/components/execution/detail/execution.component.scss +++ b/ui/src/app/modules/scenarios/components/execution/detail/execution.component.scss @@ -11,6 +11,10 @@ } } +.error { + color: var(--bs-red); +} + .report-raw { .collapse { diff --git a/ui/src/app/modules/scenarios/components/execution/detail/execution.component.ts b/ui/src/app/modules/scenarios/components/execution/detail/execution.component.ts index 1cbf8c0da..8c6205de6 100644 --- a/ui/src/app/modules/scenarios/components/execution/detail/execution.component.ts +++ b/ui/src/app/modules/scenarios/components/execution/detail/execution.component.ts @@ -87,15 +87,17 @@ export class ScenarioExecutionComponent implements OnInit, OnDestroy, AfterViewI } ngAfterViewInit(): void { - this.resizeLeftPanelSubscription = merge( - fromEvent(window, 'resize'), - fromEvent(findScrollContainer(this.leftPanel.nativeElement),'scroll') - ).pipe( - throttleTime(150), - debounceTime(150) - ).subscribe(() => { - this.setLeftPanelStyle(); - }); + if(this.leftPanel) { + this.resizeLeftPanelSubscription = merge( + fromEvent(window, 'resize'), + fromEvent(findScrollContainer(this.leftPanel.nativeElement),'scroll') + ).pipe( + throttleTime(150), + debounceTime(150) + ).subscribe(() => { + this.setLeftPanelStyle(); + }); + } this.setReportHeaderTop(); @@ -142,7 +144,9 @@ export class ScenarioExecutionComponent implements OnInit, OnDestroy, AfterViewI this.observeScenarioExecution(executionId); } else { this.scenarioExecutionReport = scenarioExecutionReport; - this.afterReportUpdate(); + if(scenarioExecutionReport?.report) { + this.afterReportUpdate(); + } } }, error: error => { @@ -325,8 +329,10 @@ export class ScenarioExecutionComponent implements OnInit, OnDestroy, AfterViewI ////////////////////////////////////////////////////// REPORT new view private setLeftPanelStyle() { - this.setLefPanelHeight(); - this.setLefPanelTop(); + if(this.leftPanel) { + this.setLefPanelHeight(); + this.setLefPanelTop(); + } } private leftPanelHeight = 0; @@ -383,62 +389,37 @@ export class ScenarioExecutionComponent implements OnInit, OnDestroy, AfterViewI } togglePayloads() { - this.toggleCtxVars(); - this.toggleInputs(false); - this.toggleOutputs(false); + this.prettyPrintToggle = !this.prettyPrintToggle; timer(250).subscribe(() => this.setLefPanelHeight()); } private inOutCtxToggle_onClass = 'm-0 text-wrap text-break'; private inOutCtxToggle_offClass = 'm-0 d-block overflow-auto'; + prettyPrintToggle = true; inOutCtxToggleClass(toggleValue: boolean): string { return toggleValue ? this.inOutCtxToggle_onClass : this.inOutCtxToggle_offClass; } - ctxVarsToggle = true; - private toggleCtxVars() { - this.ctxVarsToggle = !this.ctxVarsToggle; - this.querySelector('.ctx-var-raw pre').forEach(e => { - e.className = this.inOutCtxToggleClass(this.ctxVarsToggle); - }); - } - toggleInputsOutputs() { - this.toggleInputs(true); - this.toggleOutputs(true); + this.toggleInputs(); + this.toggleOutputs(); } - inputsToggle = true; inputsDNoneToggle = true; - private toggleInputs(dNone: boolean) { - if (dNone) { - this.inputsDNoneToggle = !this.inputsDNoneToggle; - this.querySelector('.report-raw .inputs').forEach(e => { - this.toggleDisplayNone(e, this.inputsDNoneToggle); - }); - } else { - this.inputsToggle = !this.inputsToggle; - this.querySelector('.report-raw .inputs pre').forEach(e => { - e.className = this.inOutCtxToggleClass(this.inputsToggle); - }); - } + private toggleInputs() { + this.inputsDNoneToggle = !this.inputsDNoneToggle; + this.querySelector('.report-raw .inputs').forEach(e => { + this.toggleDisplayNone(e, this.inputsDNoneToggle); + }); } - outputsToggle = true; outputsDNoneToggle = true; - private toggleOutputs(dNone: boolean) { - if (dNone) { - this.outputsDNoneToggle = !this.outputsDNoneToggle; - this.querySelector('.report-raw .outputs').forEach(e => { - this.toggleDisplayNone(e, this.outputsDNoneToggle); - }); - } else { - this.outputsToggle = !this.outputsToggle; - this.querySelector('.report-raw .outputs pre').forEach(e => { - e.className = this.inOutCtxToggleClass(this.outputsToggle); - }); - } + private toggleOutputs() { + this.outputsDNoneToggle = !this.outputsDNoneToggle; + this.querySelector('.report-raw .outputs').forEach(e => { + this.toggleDisplayNone(e, this.outputsDNoneToggle); + }); } toggleInfosErrors() { @@ -512,9 +493,7 @@ export class ScenarioExecutionComponent implements OnInit, OnDestroy, AfterViewI if (scrollIntoView && step) { document.getElementById(step['rowId']).scrollIntoView({behavior: 'smooth', block: 'start'}); } - timer(1000).subscribe(() => - this.elementRef.nativeElement.scrollIntoView({behavior: 'smooth', block: 'start'}) - ); + this.elementRef.nativeElement.scrollIntoView({behavior: 'instant', block: 'start'}) } private computeAllStepRowId() { diff --git a/ui/src/app/modules/scenarios/services/scenario-execution.service.ts b/ui/src/app/modules/scenarios/services/scenario-execution.service.ts index 52457bc85..2a6a09b1c 100644 --- a/ui/src/app/modules/scenarios/services/scenario-execution.service.ts +++ b/ui/src/app/modules/scenarios/services/scenario-execution.service.ts @@ -91,19 +91,32 @@ export class ScenarioExecutionService { } private buildExecutionReport(jsonResponse: any): ScenarioExecutionReport { + let report; + let contextVariables; + if(jsonResponse.report) { + report = JSON.parse(jsonResponse.report).report + contextVariables = JSON.parse(jsonResponse.report).contextVariables + } return new ScenarioExecutionReport( jsonResponse.executionId, - JSON.parse(jsonResponse.report).report, + jsonResponse.status, + jsonResponse.duration, + new Date(jsonResponse.time), + report, jsonResponse.environment, jsonResponse.user, jsonResponse.testCaseTitle, - JSON.parse(jsonResponse.report).contextVariables + jsonResponse.error, + contextVariables ); } private buildExecutionReportFromEvent(jsonResponse: any): ScenarioExecutionReport { return new ScenarioExecutionReport( jsonResponse.executionId, + jsonResponse.status, + jsonResponse.duration, + new Date(jsonResponse.time), jsonResponse.report, jsonResponse.environment, jsonResponse.user, diff --git a/ui/src/assets/i18n/en.json b/ui/src/assets/i18n/en.json index ead53cc67..6817ff15c 100644 --- a/ui/src/assets/i18n/en.json +++ b/ui/src/assets/i18n/en.json @@ -80,6 +80,7 @@ "step": { "inputs": "Inputs", "outputs": "Outputs", + "inferr": "Logs", "actions": { "copy": "Copy value", "edit": "Edit value", diff --git a/ui/src/assets/i18n/fr.json b/ui/src/assets/i18n/fr.json index 38f2ad776..57afa13fa 100644 --- a/ui/src/assets/i18n/fr.json +++ b/ui/src/assets/i18n/fr.json @@ -80,6 +80,7 @@ "step": { "inputs": "Entrées", "outputs": "Sorties", + "inferr": "Logs", "actions": { "copy": "Copier la valeur", "edit": "Editer la valeur",