SO quick (hopefully) question.
I have three files
InterfaceTests - Written to test for a particular interface to which multiple files need to submit data
genericOfficeTests - One of the groups of files which need to submit to the interface
docTypeTests - Used to test the functionality for a specific file.
Each extends from the one above it and InterfaceTests extends from testbox.system.BaseSpec When all tests pass, no problem. When a test fails, I’m getting the error listed below.
question 1: Is this the correct / best way to set this up?
question 2: If not, what am I doing wrong and can I do something to fix that error?
Thanks
Interface Tests looks like this:
component extends="testbox.system.BaseSpec"{
// Place your content here
function interfaceTests(filename,thisFileResult){
it("should be a struct",
function()
{
expect(thisFileResult).tobetypeof("struct");
});
}
}
genericOfficeTests (middle level) looks like this:
component extends="tests.pdfCreation.pdfReneredFileInterface"{
// Place your content here
function officeTests(filename,testPDF,thisFileResult,result){
it(title = "should return an array",
data = {filename = filename, testPDF = testPDF, result = result, thisresult = thisFileResult},
body =
function(data)
{
expect(data.result).tobetypeof("array");
});
}
}
and finally, docTypeTests looks like this:
component extends="tests.pdfCreation.genericOfficeTests"{
/*********************************** LIFE CYCLE Methods ***********************************/
// executes before all suites+specs in the run() method
function beforeAll(){
}
// executes after all suites+specs in the run() method
function afterAll(){
}
/*********************************** BDD SUITES ***********************************/
function run(){
thisFileResult={}
describe("Office Tests",function(){
officeTests("DummyData.txt",thisFileResult);
});
describe("Interface Tests",function(){
interfaceTests("DummyData.txt",thisFileResult);
});
}
}
When all the tests pass, no problem. If one fails I get this error:
The element at position 1 cannot be found. |
The error occurred in C:/Users/djcar/Dropbox/sites/FalveySites/Yachts_Intranet/testbox/system/reports/assets/simple.cfm: line 194
Called from C:/Users/djcar/Dropbox/sites/FalveySites/Yachts_Intranet/testbox/system/reports/assets/simple.cfm: line 224
Called from C:/Users/djcar/Dropbox/sites/FalveySites/Yachts_Intranet/testbox/system/reports/assets/simple.cfm: line 142
Called from C:/Users/djcar/Dropbox/sites/FalveySites/Yachts_Intranet/testbox/system/reports/SimpleReporter.cfc: line 52
Called from C:/Users/djcar/Dropbox/sites/FalveySites/Yachts_Intranet/testbox/system/TestBox.cfc: line 308
Called from C:/Users/djcar/Dropbox/sites/FalveySites/Yachts_Intranet/testbox/system/TestBox.cfc: line 101
Called from C:/Users/djcar/Dropbox/sites/FalveySites/Yachts_Intranet/testbox/system/BaseSpec.cfc: line 517
|
<br>192 : - <strong>#htmlEditFormat( local.thisSpec.failMessage )#</strong><br>193 : <button onclick="toggleDebug( '#local.thisSpec.id#' )" title="Show more information">+</button><br><br>**194 : <div class="">#local.thisSpec.failOrigin[ 1 ].raw_trace#</div>**<br>195 : <cfif structKeyExists( local.thisSpec.failOrigin[ 1 ], "codePrintHTML" )><br>196 : <div class="">#local.thisSpec.failOrigin[ 1 ].codePrintHTML#</div> <br>
|
That section of simple.cfm looks like:
<button onclick="toggleDebug( '#local.thisSpec.id#' )" title="Show more information">+</button><br>
<div class="">#local.thisSpec.failOrigin[ 1 ].raw_trace#</div>
<cfif structKeyExists( local.thisSpec.failOrigin[ 1 ], "codePrintHTML" )>
<div class="">#local.thisSpec.failOrigin[ 1 ].codePrintHTML#</div>
</cfif>
<div class="box debugdata" data-specid="#local.thisSpec.id#">
<cfdump var="#local.thisSpec.failorigin#" label="Failure Origin">
</div>
Is this the right place for that question?
Dan