From 10f3ac23c7032ceaacb3e48d9620eaaa034d79fb Mon Sep 17 00:00:00 2001
From: Richard Herbert <1644678+richardherbert@users.noreply.github.com>
Date: Tue, 31 Dec 2024 11:21:10 +0000
Subject: [PATCH] Update index.cfm
Updated to reflect `testbox/cfml/browser/index.cfm`
---
tests/index.cfm | 80 +++++++++++++++++++++++++++++++++----------------
1 file changed, 55 insertions(+), 25 deletions(-)
diff --git a/tests/index.cfm b/tests/index.cfm
index ef6ec95f2..1ad8dd44a 100644
--- a/tests/index.cfm
+++ b/tests/index.cfm
@@ -1,23 +1,29 @@
// No cf debugging
cfsetting( showdebugoutput="false" );
- // Path Navigation
- param name="url.path" default="";
- // Root Tests Directory
- rootMapping = "/tests/specs";
+ // GLOBAL VARIABLES
+ ASSETS_DIR = expandPath( "/testbox/system/reports/assets" );
+ TESTBOX_VERSION = new testBox.system.TestBox().getVersion();
+ // TEST LOCATIONS -> UPDATE AS YOU SEE FIT
+ rootMapping = "/tests";
+
+ // Local Variables
rootPath = expandPath( rootMapping );
targetPath = rootPath;
- // Append navigation path
+
+ // Incoming Navigation
+ param name="url.path" default="";
if( len( url.path ) ){
targetPath = getCanonicalPath( rootpath & "/" & url.path );
- // Avoid traversals
+ // Avoid traversals, reset to root
if( !findNoCase( rootpath, targetPath ) ){
targetPath = rootpath;
}
}
+
// Get the actual execution path
executePath = rootMapping & ( len( url.path ) ? "/#url.path#" : "/" );
- // Directory Runner
+ // Execute an incoming path
if( !isNull( url.action ) ){
if( directoryExists( targetPath ) ){
writeOutput( "#new testbox.system.TestBox( directory=executePath ).run()#" );
@@ -26,17 +32,16 @@
}
abort;
}
- // Get target path listing
+
+ // Get the tests to navigate
qResults = directoryList( targetPath, false, "query", "", "name" );
- // Get the back path
+
+ // Calculate the back navigation path
if( len( url.path ) ){
backPath = url.path.listToArray( "/\" );
backPath.pop();
backPath = backPath.toList( "/" );
}
- // TestBox Assets
- ASSETS_DIR = expandPath( "/testbox/system/reports/assets" );
- TESTBOX_VERSION = new testBox.system.TestBox().getVersion();
@@ -82,13 +87,27 @@
@@ -116,8 +135,14 @@
-
-
+
+
@@ -129,7 +154,7 @@
#x271A; #qResults.name#
-
+
-
+
+ data-bx="true"
+ class="btn btn-success btn-sm my-1"
+
+ data-bx="false"
+ class="btn btn-info btn-sm my-1"
+
href="#executePath & "/" & qResults.name#?method=runRemote"
target="_blank"
>
#qResults.name#
-
- #qResults.name#
-