Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

index.cfm 4.2 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
  1. <cfscript>
  2. // No cf debugging
  3. cfsetting( showdebugoutput="false" );
  4. // Path Navigation
  5. param name="url.path" default="";
  6. // Root Tests Directory
  7. rootMapping = "/tests/specs";
  8. rootPath = expandPath( rootMapping );
  9. targetPath = rootPath;
  10. // Append navigation path
  11. if( len( url.path ) ){
  12. targetPath = getCanonicalPath( rootpath & "/" & url.path );
  13. // Avoid traversals
  14. if( !findNoCase( rootpath, targetPath ) ){
  15. targetPath = rootpath;
  16. }
  17. }
  18. // Get the actual execution path
  19. executePath = rootMapping & ( len( url.path ) ? "/#url.path#" : "/" );
  20. // Directory Runner
  21. if( !isNull( url.action ) ){
  22. if( directoryExists( targetPath ) ){
  23. writeOutput( "#new testbox.system.TestBox( directory=executePath ).run()#" );
  24. } else {
  25. writeOutput( "<h2>Invalid Directory: #encodeForHTML( targetPath )#</h2>" );
  26. }
  27. abort;
  28. }
  29. // Get target path listing
  30. qResults = directoryList( targetPath, false, "query", "", "name" );
  31. // Get the back path
  32. if( len( url.path ) ){
  33. backPath = replacenocase( url.path, listLast( url.path, "/" ), "" );
  34. backPath = reReplace( backpath, "/$", "" );
  35. }
  36. // TestBox Assets
  37. ASSETS_DIR = expandPath( "/testbox/system/reports/assets" );
  38. TESTBOX_VERSION = new testBox.system.TestBox().getVersion();
  39. </cfscript>
  40. <!DOCTYPE html>
  41. <html>
  42. <head>
  43. <meta charset="utf-8">
  44. <meta name="generator" content="TestBox v#TESTBOX_VERSION#">
  45. <title>TestBox Browser</title>
  46. <cfoutput>
  47. <style>#fileRead( '#ASSETS_DIR#/css/main.css' )#</style>
  48. <script>#fileRead( '#ASSETS_DIR#/js/jquery-3.3.1.min.js' )#</script>
  49. <script>#fileRead( '#ASSETS_DIR#/js/popper.min.js' )#</script>
  50. <script>#fileRead( '#ASSETS_DIR#/js/bootstrap.min.js' )#</script>
  51. <script>#fileRead( '#ASSETS_DIR#/js/stupidtable.min.js' )#</script>
  52. </cfoutput>
  53. </head>
  54. <cfoutput>
  55. <body>
  56. <div id="tb-runner" class="container">
  57. <!--- Header --->
  58. <div class="row">
  59. <div class="col-md-4 text-center mx-auto">
  60. <img class="mt-3" src="http://www.ortussolutions.com/__media/testbox-185.png" alt="TestBox" id="tb-logo"/>
  61. <br>
  62. v#TESTBOX_VERSION#
  63. <br>
  64. <a
  65. href="index.cfm?action=runTestBox&path=#URLEncodedFormat( url.path )#"
  66. target="_blank"
  67. >
  68. <button
  69. class="btn btn-primary btn-sm my-1"
  70. type="button">
  71. Run All
  72. </button>
  73. </a>
  74. </div>
  75. </div>
  76. <!--- Listing --->
  77. <div class="row">
  78. <div class="col-md-12">
  79. <form name="runnerForm" id="runnerForm">
  80. <input type="hidden" name="opt_run" id="opt_run" value="true">
  81. <h2>TestBox Test Browser: </h2>
  82. <p>
  83. Below is a listing of the files and folders starting from your root <code>#rootMapping#</code>. You can click on individual tests in order to execute them
  84. or click on the <strong>Run All</strong> button on your left and it will execute a directory runner from the visible folder.
  85. </p>
  86. <fieldset>
  87. <legend>#targetPath.replace( rootPath, "" )#</legend>
  88. <!--- Show Back If we are traversing --->
  89. <cfif len( url.path )>
  90. <a href="index.cfm?path=#URLEncodedFormat( backPath )#">
  91. <button type="button" class="btn btn-secondary btn-sm my-1">&##xAB; Back</button>
  92. </a>
  93. <br>
  94. <hr>
  95. </cfif>
  96. <cfloop query="qResults">
  97. <!--- Skip . folder file names --->
  98. <cfif refind( "^\.", qResults.name )>
  99. <cfcontinue>
  100. </cfif>
  101. <cfif qResults.type eq "Dir">
  102. <a
  103. class="btn btn-secondary btn-sm my-1"
  104. href="index.cfm?path=#urlEncodedFormat( url.path & qResults.name )#"
  105. >
  106. &##x271A; #qResults.name#
  107. </a>
  108. <br />
  109. <cfelseif listLast( qresults.name, ".") eq "cfm">
  110. <a
  111. class="btn btn-primary btn-sm my-1"
  112. href="#executePath & "/" & qResults.name#"
  113. target="_blank"
  114. >
  115. #qResults.name#
  116. </a>
  117. <br />
  118. <cfelseif listLast( qresults.name, ".") eq "cfc" and qresults.name neq "Application.cfc">
  119. <a
  120. class="btn btn-primary btn-sm my-1"
  121. href="#executePath & "/" & qResults.name#?method=runRemote"
  122. target="_blank"
  123. >
  124. #qResults.name#
  125. </a>
  126. <br />
  127. <cfelse>
  128. #qResults.name#
  129. <br/>
  130. </cfif>
  131. </cfloop>
  132. </fieldset>
  133. </form>
  134. </div>
  135. </div>
  136. </div>
  137. </body>
  138. </html>
  139. </cfoutput>
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...