Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions spec_files/reports/templates/newman/html_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -320,15 +320,15 @@
}

::-webkit-scrollbar-track {
background: #f1f1f1;
background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
background: #888;
background: #888;
}

::-webkit-scrollbar-thumb:hover {
background: #555;
background: #555;
}

/* The switch - the box around the slider */
Expand Down Expand Up @@ -533,15 +533,15 @@ <h5 class="card-title text-uppercase text-white text-center bg-info">Runtime Inf
<div class="tab-pane fade" id="pills-requests" role="tabcard" aria-labelledby="pills-requests-tab">

<button id="topOfRequestsScreen" class="btn btn-outline-success btn-sm backToTop" onclick="topFunction()">Go To Top</button>

<div class="btn-group float-right" role="group" aria-label="Button Group">
<button id="openAll" class="btn btn-outline-success btn-sm float-right">Expand Folders</button>
<button id="openAllRequests" class="btn btn-outline-success btn-sm float-right">Expand Requests</button>
<button id="closeAll" class="btn btn-outline-success btn-sm float-right">Collapse Folders</button>
<button id="closeAllRequests" class="btn btn-outline-success btn-sm float-right">Collapse Requests</button>
</div>

<div class="text-uppercase" id="execution-menu">
<div class="text-uppercase" id="execution-menu">
<nav class="table-responsive">
<ul class="nav single-line-tabs d-none" id="iterationList">
</ul>
Expand Down Expand Up @@ -595,14 +595,15 @@ <h5><strong>SKIPPED</strong></h5>
{{/if}}
<span><i class="fas fa-info-circle"></i></span><strong> Request Method:</strong> <span class="badge-outline-success badge badge-success"> {{request.method}}</span><br>
<span><i class="fas fa-info-circle"></i></span><strong> Request URL:</strong> {{request.path}} <br>
<span><i class="fas fa-info-circle"></i></span><strong> trace-id:</strong> <a href="{{traceUrl}}"><span id="copyText-trace-id-{{../id}}-{{request.id}}">{{traceId}}</span></a>
<button class="btn btn-outline-secondary btn-sm copyButton" type="button" data-clipboard-action="copy" data-clipboard-target="#copyText-trace-id-{{../id}}-{{request.id}}">Copy to Clipboard</button>
<br>
</div>
</div>
<div class="card border-info" style="width: 50rem;">
<div class="card-body">
<h5 class="card-title text-uppercase text-white text-center bg-info">Response Information</h5>
<span><i class="fas fa-info-circle"></i></span><strong> Response Code:</strong> <span class="float-right badge-outline badge badge-success"> {{response.status}} - {{response.statusText}} </span><br>
<span><i class="fas fa-stopwatch"></i></span><strong> Mean time per request:</strong> <span class="float-right badge-outline badge badge-success"> NA</span><br>
<span><i class="fas fa-database"></i></span><strong> Mean size per request:</strong> <span class="float-right badge-outline badge badge-success"> NA</span><br>
<hr>
<h5 class="card-title text-uppercase text-white text-center bg-info">Test Pass Percentage</h5>
<div>
Expand Down Expand Up @@ -839,7 +840,7 @@ <h5 class="card-title text-uppercase text-white text-center bg-info">Test Inform
</td>
{{else}}
<td class="text-center bg-danger">
FAILED
FAILED
</td>
</tr><tr><td colspan="2" class="text-center bg-danger">({{resultStatus.message}})</td>
{{/if}}
Expand Down Expand Up @@ -1005,7 +1006,7 @@ <h5 class="card-title text-uppercase text-white text-center bg-danger">Test Fail
data = JSON.stringify(obj, null, 2);
}
else if(isXML(data)) {
data = formatXML(data);
data = formatXML(data);
}
$(this).text(data);
});
Expand Down Expand Up @@ -1095,7 +1096,7 @@ <h5 class="card-title text-uppercase text-white text-center bg-danger">Test Fail
"use strict";

window.onload = function () {

let totalIterations = 1;

let menu = document.querySelector('#execution-menu .nav');
Expand All @@ -1118,7 +1119,7 @@ <h5 class="card-title text-uppercase text-white text-center bg-danger">Test Fail
allMenus.forEach(function(elem){
elem.style.borderBottom = 'none';
})

this.style.borderBottom = 'solid 3px #032a33';

let items = document.querySelectorAll("." + this.id);
Expand Down
13 changes: 6 additions & 7 deletions spec_files/reports/templates/newman/pdf_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -320,15 +320,15 @@
}

::-webkit-scrollbar-track {
background: #f1f1f1;
background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
background: #888;
background: #888;
}

::-webkit-scrollbar-thumb:hover {
background: #555;
background: #555;
}

/* The switch - the box around the slider */
Expand Down Expand Up @@ -515,7 +515,7 @@ <h5 class="card-title text-uppercase text-white text-center bg-info">Runtime Inf
<div>


<div class="text-uppercase" id="execution-menu">
<div class="text-uppercase" id="execution-menu">
<nav class="table-responsive">
<ul class="nav single-line-tabs d-none" id="iterationList">
</ul>
Expand Down Expand Up @@ -558,14 +558,13 @@ <h6 class="text-uppercase text-muted" id="iterationSelected" style="padding-top:
<h5 class="card-title text-uppercase text-white text-center bg-info">Request Information</h5>
<span><i class="fas fa-info-circle"></i></span><strong> Request Method:</strong> <span class="badge-outline-success badge badge-success"> {{request.method}}</span><br>
<span><i class="fas fa-info-circle"></i></span><strong> Request URL:</strong> {{request.path}} <br>
<span><i class="fas fa-info-circle"></i></span><strong> trace-id:</strong> <a href="{{traceUrl}}">{{traceId}}</a><br>
</div>
</div>
<div class="card border-info" style="width: 50rem;">
<div class="card-body">
<h5 class="card-title text-uppercase text-white text-center bg-info">Response Information</h5>
<span><i class="fas fa-info-circle"></i></span><strong> Response Code:</strong> <span class="float-right badge-outline badge badge-success"> {{response.status}} - {{response.statusText}} </span><br>
<span><i class="fas fa-stopwatch"></i></span><strong> Mean time per request:</strong> <span class="float-right badge-outline badge badge-success"> NA</span><br>
<span><i class="fas fa-database"></i></span><strong> Mean size per request:</strong> <span class="float-right badge-outline badge badge-success"> NA</span><br>
<hr>
<h5 class="card-title text-uppercase text-white text-center bg-info">Test Pass Percentage</h5>
<div>
Expand Down Expand Up @@ -722,7 +721,7 @@ <h5 class="card-title text-uppercase text-white text-center bg-info">Test Inform
</td>
{{else}}
<td class="text-center bg-danger">
FAILED
FAILED
</td>
</tr><tr><td colspan="2" class="text-center bg-danger">({{resultStatus.message}})</td>
{{/if}}
Expand Down
20 changes: 16 additions & 4 deletions src/lib/test-outbound/outbound-initiator.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ const _ = require('lodash')
const axios = require('axios').default
const https = require('https')
const uuid = require('uuid')
const util = require('node:util')
const crypto = require('node:crypto')
require('request-to-curl')
require('atob') // eslint-disable-line

Expand Down Expand Up @@ -255,6 +257,7 @@ const processTestCase = async (
const templateIDArr = []
for (const i in testCase.requests) {
requestsObj[testCase.requests[i].id] = testCase.requests[i]
if (testCase.requests[i].requestId) requestsObj[testCase.requests[i].requestId] = testCase.requests[i]
templateIDArr.push(testCase.requests[i].id)
}
// Sort the request ids array
Expand Down Expand Up @@ -297,11 +300,12 @@ const processTestCase = async (

// Form the path from params and operationPath
convertedRequest.path = replacePathVariables(request.operationPath, convertedRequest.params)
const requestTraceId = templateOptions.traceUrl ? crypto.randomBytes(8).toString('hex') : traceID

// Insert traceparent header if sessionID passed
if (tracing.sessionID) {
convertedRequest.headers = convertedRequest.headers || {}
convertedRequest.headers.traceparent = '00-' + traceID + '-' + String(testCase.id).padStart(8, '0') + String(templateIDArr[i]).padStart(8, '0') + '-01'
convertedRequest.headers.traceparent = '00-' + requestTraceId + '-' + String(testCase.id).padStart(8, '0') + String(templateIDArr[i]).padStart(8, '0') + '-01'
// todo: think about proper traceparent header
}

Expand Down Expand Up @@ -377,7 +381,9 @@ const processTestCase = async (
contextObj,
globalConfig,
metrics,
templateName
templateName,
requestTraceId,
util.format(templateOptions.traceUrl || '//trace/%s', requestTraceId)
)
}
} catch (err) {
Expand All @@ -401,7 +407,9 @@ const processTestCase = async (
contextObj,
globalConfig,
metrics,
templateName
templateName,
requestTraceId,
util.format(templateOptions.traceUrl || '//trace/%s', requestTraceId)
)
} finally {
if (request.appended?.testResult?.isFailed) {
Expand Down Expand Up @@ -440,7 +448,9 @@ const setResponse = async (
contextObj,
globalConfig,
metrics,
templateName
templateName,
traceId,
traceUrl
) => {
// Get the requestsHistory and callbacksHistory from the arrayStore
const requestsHistoryObj = arrayStore.get('requestsHistory')
Expand All @@ -461,6 +471,8 @@ const setResponse = async (
request.appended = {
status,
testResult,
traceId,
traceUrl,
response: resp.syncResponse,
callback: resp.callback,
request: convertedRequest,
Expand Down