I try to add another test to my existing .opa.qunit.js file which requires a complete restart of my app. What I tried was to call "iTeardownMyAppFrame" in my test and then again "iStartMyAppInAFrame" to ensure a clean setup.
At first the iFrame is shown but closed immediatly and after some time the test just times out. Both methods below just call "iTeardownMyAppFrame" and "iStartMyAppInAFrame" nothing else.
opaTest("FirstTest", function(Given, When, Then) {
Given.iStartTheSampleApp();
//Testlogic
});
opaTest("TestWithCleanState", function(Given, When, Then) {
Given.iShutdownTheApp();
//Until here everything above works fine
Given.iStartTheSampleApp();
//Testlogic
});
//EOF
There is no error on the console, just some two messages repeating every second:
sap-ui-core.js:15219 2015-03-11 10:05:37 Opa check was undefined -
sap-ui-core.js:15219 2015-03-11 10:05:37 Opa is executing the check: function () {
if (!bFrameLoaded) {
return;
}
return checkForUI5ScriptLoaded();
} -
What's the intended functionality of "iTeardownMyAppFrame"? Should it only be used to teardown the whole test at the end of all tests? Or can it also be used to reset the app to ensure a clean state at the beginning of the test? If this is the case how should it work?
Thanks
teardonw removes the iframe and in the next test you have to bring it up again. This way you can write separated tests that can be run standalone.
An example is here:
Opa sample with 2 isolated tests
If you press the rerun button on test2 it will execute standalone with no dependency on test1
BR, Tobias