Skip to content

Commit

Permalink
TESTBOX-289 #resolve
Browse files Browse the repository at this point in the history
showUDFs = false option with debug()
  • Loading branch information
lmajano committed Sep 9, 2024
1 parent d9a1d19 commit 86bc9c0
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 12 deletions.
7 changes: 5 additions & 2 deletions system/BaseSpec.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,8 @@ component {
any var,
string label = "",
boolean deepCopy = false,
numeric top = "999"
numeric top = "999",
boolean showUDFs = false
){
// null check
if ( isNull( arguments.var ) ) {
Expand All @@ -1500,14 +1501,16 @@ component {
// Check if executing spec is set, else most likely this is called from a request scoped debug method
arguments.label = !isNull( this.$currentExecutingSpec ) ? this.$currentExecutingSpec : "request";
}

// add to debug output
arrayAppend(
this.$debugBuffer,
{
"data" : newVar,
"label" : arguments.label,
"timestamp" : now(),
"top" : arguments.top
"top" : arguments.top,
"showUDFs" : arguments.showUDFs
}
);
return this;
Expand Down
15 changes: 11 additions & 4 deletions system/reports/assets/dot.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,15 @@
<div class="my-2 pl-4 debugdata" style="display:none;" data-specid="#thisBundle.id#">
<p>The following data was collected in order as your tests ran via the <em>debug()</em> method:</p>
<cfloop array="#thisBundle.debugBuffer#" index="thisDebug">
<h6>#thisDebug.label#</h6>
<cfdump var="#thisDebug.data#" label="#thisDebug.label# - #dateFormat( thisDebug.timestamp, " short" )# at #timeFormat( thisDebug.timestamp, "full" )#" top="#thisDebug.top#" />
<cfif !IsNull( thisDebug )>
<h6>#thisDebug.label#</h6>
<cfdump
var="#thisDebug.data#"
label="#thisDebug.label# - #dateFormat( thisDebug.timestamp, " short" )# at #timeFormat( thisDebug.timestamp, "full" )#"
top="#thisDebug.top#"
showUDfs="#thisDebug.showUDFs#"
/>
</cfif>
</cfloop>
</div>
</li>
Expand All @@ -158,7 +165,7 @@
$(".expand-collapse").click(function (event) {
let icon = $(this).children(".svg-inline--fa");
var icon_fa_icon = icon.attr('data-icon');
if (icon_fa_icon === "minus-square") {
icon.attr('data-icon', 'plus-square');
} else if (icon_fa_icon === "plus-square") {
Expand Down Expand Up @@ -239,4 +246,4 @@ function toggleDebug( specid ) {
</cfoutput>
</cfsavecontent>
<cfreturn local.report>
</cffunction>
</cffunction>
15 changes: 11 additions & 4 deletions system/reports/assets/min.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<body>
</cfif>
<div class="container-fluid my-3">
<!-- Header -->
<!-- Header -->
<div class="d-flex justify-content-between align-items-end">
<div>
<img src="data:image/png;base64, #toBase64( fileReadBinary( '#ASSETS_DIR#/images/TestBoxLogo125.png' ) )#" height="75">
Expand Down Expand Up @@ -126,8 +126,15 @@
<div class="my-2 pl-4 debugdata" style="display:none;" data-specid="#thisBundle.id#">
<p>The following data was collected in order as your tests ran via the <em>debug()</em> method:</p>
<cfloop array="#thisBundle.debugBuffer#" index="thisDebug">
<h6>#thisDebug.label#</h6>
<cfdump var="#thisDebug.data#" label="#thisDebug.label# - #dateFormat( thisDebug.timestamp, " short" )# at #timeFormat( thisDebug.timestamp, "full" )#" top="#thisDebug.top#" />
<cfif !IsNull( thisDebug )>
<h6>#thisDebug.label#</h6>
<cfdump
var="#thisDebug.data#"
label="#thisDebug.label# - #dateFormat( thisDebug.timestamp, " short" )# at #timeFormat( thisDebug.timestamp, "full" )#"
top="#thisDebug.top#"
showUDfs="#thisDebug.showUDFs#"
/>
</cfif>
</cfloop>
</div>
</li>
Expand Down Expand Up @@ -169,4 +176,4 @@ function toggleDebug( specid ) {
</body>
</html>
</cfif>
</cfoutput>
</cfoutput>
9 changes: 7 additions & 2 deletions system/reports/assets/simple.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,14 @@
<div id="debugdata_#thisBundle.id#" class="overflow-auto bg-light p-2 collapse" data-specid="#thisBundle.id#">
<p>The following data was collected in order as your tests ran via the <em>debug()</em> method:</p>
<cfloop array="#thisBundle.debugBuffer#" index="thisDebug">
<cfif !IsNull(thisDebug)>
<cfif !IsNull( thisDebug )>
<h6>#thisDebug.label#</h6>
<cfdump var="#thisDebug.data#" label="#thisDebug.label# - #dateFormat( thisDebug.timestamp, " short" )# at #timeFormat( thisDebug.timestamp, "full" )#" top="#thisDebug.top#" />
<cfdump
var="#thisDebug.data#"
label="#thisDebug.label# - #dateFormat( thisDebug.timestamp, " short" )# at #timeFormat( thisDebug.timestamp, "full" )#"
top="#thisDebug.top#"
showUDfs="#thisDebug.showUDFs#"
/>
</cfif>
</cfloop>
</div>
Expand Down

0 comments on commit 86bc9c0

Please sign in to comment.