We would like to test our application with qooxdoo simulator tests. Our application uses an iframe qx.ui.embed.Iframe located in a window qx.ui.window.Window for the login procedure to allow browsers to store username and password locally. The content of the iframe is a simple form with username and password field.
...
<form id="loginform" name="loginform" method="post" action="">
<label><span>E-Mail / Benutzername</span>
<input type="text" value="" name="username"></label>
<label><span>Passwort</span><input type="password" value="" name="password"></label>
<input type="submit" value="Anmelden" id="submitbutton" name="submit"></form>
...
With the simulator its possible to locate the iframe inside the window with qxhv locator.
this.getSimulation().waitForWidget("qxhv=[@classname=app.window.system.Login]");
The problem now is that i have to "qxTypeKeys" into the username and password field to authenticate the test user. But the content of the iframe is outside the simulator scope.
Is there any suggestion how i can access the fields? Or is there an alternative way, like sending an post request before proceeding?
qx.Class.define("app.simulation.LoginTest", {
extend: simulator.unit.TestCase,
construct : function () {
this.base(arguments);
},
members: {
testLogin: function () {
this.getSimulation().waitForWidget("qxhv=[@classname=app.window.system.Login]");
this.getQxSelenium().qxType(???, "[email protected]");
}
}
});
Based on the answer from Daniel Wagner, I have created the following abstract base class for our simulator tests. The method access the iframe, fill out the form, and submits the from to the server and wait for the success response.