Code alignment in Units
Hi,
I have installed TD in 2 machines, One machine[#1] TC having tab count as 6 in another machine[#2] on having count as 4 like below
I have edited some scripts created in #1 from #2 machine.
And committed code into Git hub.
But the looks like below. I don't see any difference in TC alignment in both mahicne's TC
Is there any way to make it better in formating or aligning the code in code Editor?
I'm using TC 12.30
Hi,
> How can I fix this?
No way. (As per my understanding.)
The case is that all CI\CD servers/pipelines use a concept of single, atomic independent (unit-) test. This means that when you command in a pipeline to execute, say, three tests, the runner does not execute them within one single 'session'. Instead, TestExecute is invoked and commanded to execute one test (not necessarily the first one, you should not rely or expect some defined order of execution). When the test ends and TestExecute closes, the runner invokes TestExecute for the second time and commands it to execute another test. And so on and so forth until the list of requested tests is over.
(The same explanation was provided in some other thread here by Support but I don't have it at hand at the moment.)
As a kind of workaround, you may consider to use aqTestCase object provided by TestComplete assuming the wrapping code like this (untested pseudocode):
// @"My Test"
function aTestFactory {
var arTestsList = ['test1()', 'test2()', ...];
for (var aTest in arTestsList) {
var strCurrTest = arTestsList[aTest];
aqTestCase.Begin(strCurrTest);
eval(strCurrTest);
aqTestCase.End();
}
// export log here or use /ExportSummary flag
}
This should provide one test log (because only one "My Test" test has been executed from the runner's point of view) but with the summary for all test cases executed from aTestFactory() function.
Note, however, that aqTestCase is not fully equivalent to test case created in the Execution Plan and there are more or less subtle differences between them.