Forum Discussion
Gotcha. Yep, seeing that.
Now, HKosova probably can give a more official response but, as I understand it, the routine drop down at the top of a script edit window is intended within the context of developing test cases as script. Each "routine" is, potentially, a test case and the idea is to give easy access to select such a test case and then click the "Run Current Routine" button.
While in a full JavaScript IDE, those methods are "routines", they are not test cases or methods that can be run in such a manner... you need to instantiate the object and then run the routine. So, in the context of what TestComplete provides, this doesn't feel to me like it makes sense. That said, not sure why it works in JScript but not in JavaScript but, basically, that's how I experience it. I look forward to seeing the feature request as there might be some cool aspects about it concerning turning TC into something more of a full IDE.
Now, to your question about intellisense, etc... Creating classes and such and then having them available in what TC calls "code completion" would be cool. But keep in mind that, effectively, each script unit is being treated in the same way that a page is treated when using JavaScript for web development. You cannot call a routine or method or property of an object instantiated in a different web page unless you first import it into the web page or otherwise pass it through. So, in that line, TC is following that model. If you want an object to be available in Code completion, that object needs to be built in, somehow, to the environment either as a plugin or a Script Extension.
Thank you for the valuable inputs.
I understood the routine list purpose. Then it would be good if we have something like tree structure of a Unit with its contents (like each functions) under Project Explorer as it would display in Eclipse IDE. Any solutions would be so helpful for us.
And yes, with JavaScript Class, I am able to export/import to another unit and can access its methods. Its working as expected.
Also these are core units files of the Project and we do not want to use as ScriptExtensions, since these are expected to change very often.
As you said Code completion is good with ScriptExtensions.
So as HKosova, I will put this in Features section. Hope Smartbear admins can come up with smart solution.
Many Thanks,
Saravana
- tristaanogre8 years agoEsteemed Contributor
If they are core units to a project, I wouldn't expect them to change that frequently... test cases that consume those units, yes... but the actual core units of a test framework should be relatively static. But then, that's just my way of designing things.. YMMV.
I keep my extension code in my TFS repository along with everything else so I can track it, develop it, version it, etc. The only difference between that code and my regular script code is that I need to "package" it as a tcx... but that takes all of 2 minutes... and if I am only changing my core code a few times a quarter, then adding 2 minutes to my work isn't that big of a deal. :)
Related Content
- 2 years agotorus