I don't know how my code really helps. I am experiencing problems and difficult dealing with t.click(). That why for the moment I using t.moveMouseTo() and t.click(), but I intend to change it soon.
I would prefer to test my components isolated, I mean, instead of loading all application. When I load the view from the component I want to test I can't use the actions that is in the Controller. I did my best to test it isolated, but with no sucesss, thats why I am testing the hole application.
Summarizing, I have a Tree and when I click the node I load the DataView. This Dataview has some checkboxes that must be clicked in order to test.
I am loving Siesta! I intend to use it in CI soon.
I appreciate your help.
Do you have interest in my cooperation writing tutorials about using Siesta?
marogalli wrote:I don't know how my code really helps. I am experiencing problems and difficult dealing with t.click(). That why for the moment I using t.moveMouseTo() and t.click(), but I intend to change it soon.
I would prefer to test my components isolated, I mean, instead of loading all application. When I load the view from the component I want to test I can't use the actions that is in the Controller. I did my best to test it isolated, but with no sucesss, thats why I am testing the hole application.
Summarizing, I have a Tree and when I click the node I load the DataView. This Dataview has some checkboxes that must be clicked in order to test.
Hm.. Can you try to add one more wait step to your outer "t.chain"? Perhaps your test ends right after the click on the checkbox and the context is cleared.
function (next) {
t.diag("openedTree chosenState functionalities");
t.waitForSelector('#cb11_13',function() {
var cb1 = Ext.select("#cb11_13");
console.log(cb1.elements[0]);
t.click(cb1.elements[0], next);
});
},
function () {
setTimeout(function () {}, 5000)
}
marogalli wrote:
I am loving Siesta! I intend to use it in CI soon.
I appreciate your help.
Do you have interest in my cooperation writing tutorials about using Siesta?
Thanks! What is your CI tool? Sure, we would love to see any tutorial/guide about using Siesta with various CI tools.
Thank you. Instead of usind setTimeOut I used t.waitFor. The solution was :
t.waitForSelector('#cb11_13',function() {
var cb1 = Ext.select("#cb11_13");
t.click(cb1.elements[0],function() {
t.waitFor(
function() {
return $("#conteudo_escolhida").find(".row_data").size()!=0;
},
function() {
var partsChosen = $("#conteudo_escolhida").find(".row_data").size();
t.is(partsChosen,1,'1 part was checked and exists in #chosen_content');
}
);
});
This solution just work if the DOM (east panel size) is closed. If it is open, the selection is not done and the test returns fail. If I hit CRTL + "-" in the browser until the checkbox is in the screen it works even with the Toogle DOM active. If I can't see the checkbox in the east screen the t.click does not work, if I make the screen smaller, util I see the check box, t.click works. Do you understand what I mean?
I dont have CI yet. The plans is to have it in the next 60 days and Jenkins was the chosen. It would be a pleasure to help with documentations using it.
I having problems selecting a node from a Tree. I will open another post to treat it.
I think elements you click must be visible, in your test you can try calling scrollIntoView on your element prior to clicking it if you know it'll be outside the visible area.
marogalli wrote:I dont have CI yet. The plans is to have it in the next 60 days and Jenkins was the chosen. It would be a pleasure to help with documentations using it.