Closed KeithClarke closed 4 years ago
Tests written using tools like Protractor/webdriverio etc. run on a dev/build machines and are meant for end-to-end tests by launching a browser and letting you interact with the browser. When you are authoring component tests in LTS, aura the framework is essentially already loaded and ready by the time your test starts running (by virtue of the fact that you kick off a run by going to an aura application).
May be your question is more around testing async code and use of promises. Wondering if you can create some test utils of your own to simplify your test code. For example $T itself is just a static resource file here
Yes my question is about LTS offering more help in handling the asynchronous situations than $T.waitFor
. The waitForAngular
isn't waiting for Angular to load but for:
wait until Angular has finished rendering and has no outstanding $http or $timeout calls before continuing
So I am wondering about the possibility of a $T.waitForAura()
mechanism that holds up the test until Aura has finished all its work, but I assume that would need to hook into the Aura framework somehow. Hence perhaps something that could be bolted on in a utility library. Also the more help LTS provides out of the box the more people will use it...
Still new to LTS, but finding
$T.waitFor
pretty annoying in that the condition that you want toexpect
on ends up in there or ends up being duplicated. Can you comment on the possibility of adding an API to the core Aura libraries of this nature (that is then exposed in LTS):so that cleaner tests can be written?