From 54e547e0d5b700298d4c9088cc2e0ab9e4e26698 Mon Sep 17 00:00:00 2001 From: Manuel Kiessling Date: Wed, 15 Mar 2017 14:33:34 +0100 Subject: [PATCH] Added row coloring and waterfall/log links to testresults table. --- .../Resources/views/testcases/index.html.twig | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/php/src/AppBundle/Resources/views/testcases/index.html.twig b/php/src/AppBundle/Resources/views/testcases/index.html.twig index 591eca2..57d810c 100644 --- a/php/src/AppBundle/Resources/views/testcases/index.html.twig +++ b/php/src/AppBundle/Resources/views/testcases/index.html.twig @@ -68,6 +68,10 @@ return testresults[index].id; }; + var waterfallUriTemplate = 'http://www.softwareishard.com/har/viewer/?inputUrl={{ app.request.getSchemeAndHttpHost() }}{{ path('testresult-show-har', {'testresultId': 'placeholder'}) }}'; + + var testresultdetailsUriTemplate = '{{ path('testresults.show', {'testresultId': 'placeholder'}) }}'; + // Chart with request information nv.addGraph(function() { requestChart = nv.models.multiBarChart() @@ -93,9 +97,8 @@ .call(requestChart); requestChart.multibar.dispatch.on('elementClick', function(element) { - var uriTemplate = 'http://www.softwareishard.com/har/viewer/?inputUrl={{ app.request.getSchemeAndHttpHost() }}{{ path('testresult-show-har', {'testresultId': 'placeholder'}) }}'; window.open( - uriTemplate.replace('placeholder', getId(element.index)), + waterfallUriTemplate.replace('placeholder', getId(element.index)), '_blank' ); }); @@ -166,9 +169,8 @@ }); timingChart.multibar.dispatch.on('elementClick', function(element) { - var uriTemplate = '{{ path('testresults.show', {'testresultId': 'placeholder'}) }}'; window.open( - uriTemplate.replace('placeholder', getId(element.index)), + testresultdetailsUriTemplate.replace('placeholder', getId(element.index)), '_blank' ); }); @@ -201,6 +203,19 @@ }; var updateTestresultsTable = function() { + + var getTableRowClassForExitCode = function(exitCode) { + if (exitCode == 0) { + return 'success'; + } else if (exitCode == 2) { + return 'warning'; + } else if (exitCode == 3) { + return 'danger'; + } else { + return 'danger'; + } + }; + var getBeautifiedRuntimeValue = function(runtimeMilliseconds) { if (runtimeMilliseconds === null) { return 'unknown'; @@ -221,7 +236,7 @@ var body = ''; for (var i = testresults.length - 1; i > -1; i--) { - body += ''; + body += ''; body += ''; body += getDateAndTimeOfRun(i); body += ''; @@ -237,6 +252,12 @@ body += ''; body += getBeautifiedNumberOfRequestsValue(testresults[i]['numberOf500']); body += ''; + body += ''; + body += 'Waterfall'; + body += ''; + body += ''; + body += 'Journey Log'; + body += ''; body += ''; } @@ -250,6 +271,8 @@ + 'Status 200' + 'Status 400' + 'Status 500' + + '' + + '' + '' + '' + ''