QuickTip testing
6 posts
• Page 1 of 1
QuickTip testing
Is it possible to test quick tips using Siesta?
Below is a simple test that I can't get to work. The callback is never executed.
If you hover over the button while the test is running and waiting, it will pass.
Below is a simple test that I can't get to work. The callback is never executed.
- Code: Select all
StartTest(function (t) {
var Ext = t.getExt();
var cmp = Ext.create('Ext.button.Button',{
renderTo: Ext.getBody(),
text: 'Some Button',
tooltip: 'A tooltip describes the purpose'
});
var M = Ext.tip.QuickTipManager;
M.init();
t.mouseOver(cmp);
t.waitFor(
function(){ return M.getQuickTip().isVisible(); },
function(){
t.diag('Tooltip was displayed');
t.done();
},
this
);
});
If you hover over the button while the test is running and waiting, it will pass.
- zombeerose
- Posts: 111
- Joined: Fri Nov 18, 2011 9:37 pm
Re: QuickTip testing
Are you sure that code actually uses a QuickTip under the hood, and not a Tooltip?
We're hiring! We have an open position for an experienced Sencha developer (Ext JS and/or Sencha Touch). Contact us at jobs@bryntum.com
Follow us on Twitter: @bryntum or Facebook
Need professional services or training? Read more here.
API documentation
Follow us on Twitter: @bryntum or Facebook
Need professional services or training? Read more here.
API documentation
-

mats - Core Developer

- Posts: 7074
- Joined: Sat Dec 19, 2009 11:41 pm
- Location: Sweden
Re: QuickTip testing
Hmmm....interesting question. I would believe so because if you inspect the element, the property in the html is 'data-qtip,' which directly correlates to the values of the tagConfig property that is defined in Ext.tip.QuickTip. Secondly, if you hover the mouse over the button while the test is running so that the tip pops up, then the test will continue and pass.
- Code: Select all
<button id="button-1014-btnEl" type="button" class="x-btn-center" hidefocus="true" role="button" autocomplete="off" data-qtip="A tooltip describes the purpose of this button" style="width: 194px; height: 44px; "><span id="button-1014-btnInnerEl" class="x-btn-inner" style="width: 194px; height: 44px; line-height: 44px; ">Some Button</span><span id="button-1014-btnIconEl" class="x-btn-icon "></span></button>
- zombeerose
- Posts: 111
- Joined: Fri Nov 18, 2011 9:37 pm
Re: QuickTip testing
Try to also move a "virtual" cursor a little may be?:
- Code: Select all
t.mouseOver(cmp);
t.moveMouseBy([ 5, 0 ]);
t.waitFor(...
-

nickolay - Core Developer

- Posts: 1074
- Joined: Mon May 16, 2011 10:48 am
Re: QuickTip testing
This works fine for me:
- Code: Select all
StartTest(function (t) {
var Ext = t.getExt();
var cmp = Ext.create('Ext.button.Button', {
renderTo: Ext.getBody(),
text: 'Some Button',
tooltip: 'A tooltip describes the purpose'
});
var M = Ext.tip.QuickTipManager;
M.init();
t.moveMouseTo(cmp.el);
t.waitForComponentVisible(M.getQuickTip(), function () {
t.pass('Tooltip was displayed');
});
});
We're hiring! We have an open position for an experienced Sencha developer (Ext JS and/or Sencha Touch). Contact us at jobs@bryntum.com
Follow us on Twitter: @bryntum or Facebook
Need professional services or training? Read more here.
API documentation
Follow us on Twitter: @bryntum or Facebook
Need professional services or training? Read more here.
API documentation
-

mats - Core Developer

- Posts: 7074
- Joined: Sat Dec 19, 2009 11:41 pm
- Location: Sweden
6 posts
• Page 1 of 1
Return to Help & General discussion
Who is online
Users browsing this forum: No registered users and 1 guest