As I’m having a session with TestBox on this new p...
# box-products
r
As I’m having a session with TestBox on this new project, this time using the TestBox Test Browser, when I click on a single file I get a new tab with no content. If I click run all I see my test results. What have I get wrongly configured?
And yes, I my test does extend
testbox.system.BaseSpec
j
Do you have an abort somewhere in your code when it’s trying to load Coldbox or the model?
r
Thank you @jclausen, not that I’m aware of but I will check. The thing that confuses me is that the “Run All” button works as advertised, just running the individual test cfc files returns a blank screen. • So I spun. up a new site •
testbox generate harness
• Copied
/testbox/test-browser/index.cfm
to
/tests/index.cfm
• In
/tests/index.cfm
line 5 changed
"/testbox/tests/specs/"
to
"/tests/specs/"
http://localhost/tests/specs/BDDTest.cfc?method=runRemote - returns nothing http://localhost/tests/index.cfm?action=runTestBox&path=%2F - works This is not a ColdBox site, if that helps?
j
It might be because there’s not a Coldbox context. Which version of Testbox are you using?
Is there also any chance that you have an
Application.cfc
nested in your
tests/specs
directory which has an
abort
tag? This is a common method for preventing execution of views and components but, in this case, we wouldn’t want that there.
r
Important TestBox is a standalone testing package and is meant to be used with any ColdFusion (CFML) application, framework or library. IT IS NOT ONLY FOR COLDBOX APPLICATIONS.
I have used TestBox before on non-ColdBox project. It does extend
testbox.system.BaseSpec
rather than
coldbox…
I’m using the latest TestBox -
4.5.0+5
I currently have one, the first, test cfc in my specs folder. Could it be a web server issue? For local dev I’m using macOS/Apache. I’m trying to get on a Windows/IIS box to test there.
j
It could be an issue if you are using Apache and
.cfc
extensions are blocked.
Have you tried starting a server with CommandBox?
You might want to look at your
mod_rewrite
rules to see if there is something explicit on
.cfc
files in there.
In development, there’s really no need to put IIS or Apache in front of the app if you use CommandBox.
You can just run any version of Adobe or Lucee.
CommandBox can even use your existing
.htaccess
file for its rewrite rules.
r
I’d assume that any invocation of component in the regular code would have broken the site a long time again although TB is referencing the cfc directly. I am using CommandBox locally but fronted by Apache. I could look at taking Apache out of the picture. No rewrite rules in place apart from the enable switch in my
server.json
I’m actually using modCFML to host multiple contexts under one instance of Lucee
5.3.10+97
with CommandBox Services Manager. A lot of moving parts 😉 but I’ll look at moving Apache out of the way unless you have any further thoughts on my responses to your points?
j
Unless you use components in your application with a designation of “remote”, it is quite possible your app doesn’t doesn’t directly serve .cfc files. A blank white page usually means an abort has occurred before any output. I would do a search to see if anything you are testing might be aborting if something is missing from a scope.
There is also an
Application.cfc
method called
onCFCRequest
which executes when a request to a component has been called. You might want to check if that method is present and doing anything to modify the request.
r
Thanks, you’ve given me plenty to consider. I’ll work my way through those suggestions and I will come back to you.
👍 1