Get help with testing, discuss unit testing strategies etc.


Post by marogalli »

I want to test when Accordion is collapsed. So I am trying to get a reference to the component and use t.click(Component).
 	t.waitForSelector('#openedAccordion',function() {
			var ele = Ext.ComponentQuery.query('.openedNavigator');
			console.log(ele);
	});


The code above works and I see in console the returned component. Then I did :
t.waitForSelector('#openedAccordion',function() {
			var ele = Ext.ComponentQuery.query('.openedNavigator');
 			t.click(ele, function() {
				console.log('accordion clicked');
			});
	});
I this case I got : "Uncaught Incorrect arguments passed to getPathBetweenPoints".

What am I doing wrong?

Tks

Post by marogalli »

If I use moveMouseTo :
t.waitForSelector('#openedAccordion',function() {	
      var ele = Ext.ComponentQuery.query('.openedNavigator');
       t.moveMouseTo(ele);
  });
I got :
Uncaught Incorrect arguments passed to getPathBetweenPoints
Uncaught TypeError: Cannot read property 'clearTimeout' of null

but the mouse moved to the component. This is a better solution, because if I move the component and keep its ID the mouse go to it.

The bellow is working, but it is hard to mantain :
t.moveMouseBy([ 50, 110 ],function() {
 					t.click();
});

Post by mats »

Queries return arrays, so use ele[0] and it should be ok.

Post by marogalli »

That was the problem!
thks

Post Reply