[Windmill-dev] mouseover and mouseout
Matthew Eernisse
mde at osafoundation.org
Sat Dec 15 01:07:56 PST 2007
Really great to see this. Nice work, Robert, and thanks! :)
Matthew
Mikeal Rogers wrote:
> This is awesome!
>
> None of the unit tests are *really* failing. They should be failing on
> the javascript side which is what you're seeing in the IDE, but then on
> the python end we're checking that the failure propagates correctly.
> That's why writing tests in test_unit.py is such a pain with the assert
> blah['result'] stuff, we turn off a bunch of niceties so that we can
> verify failures fire right by hand. Looks like you figured it all out
> tho, the unit tests look solid and adam is applying this patch and
> getting it contributed.
>
> -Mikeal
>
>
> On Dec 14, 2007, at December 14, 20074:15 PM, Robert Leftwich wrote:
>
>> I had a need for these commands, so I've added them. Following is the
>> svn diff - hopefully I made all the required changes, including adding
>> some unit tests.
>>
>> I note that some of the unit tests in test_unit.py are failing - but
>> that was before I changed anything :-)
>>
>> Robert
>>
>>
>> Index: test/test_live/test_unit.py
>> ===================================================================
>> --- test/test_live/test_unit.py (revision 614)
>> +++ test/test_live/test_unit.py (working copy)
>> @@ -70,6 +70,10 @@
>> assert client.asserts.assertText(validator=u'mouse downed',
>> id=u'mousedownme')['result']
>> assert client.mouseup(id=u'mouseupme')['result']
>> assert client.asserts.assertText(validator=u'mouse upped',
>> id=u'mouseupme')['result']
>> + assert client.mouseover(id=u'mouseoverme')['result']
>> + assert client.asserts.assertText(validator=u'mouse overred',
>> id=u'mouseoverme')['result']
>> + assert client.mouseout(id=u'mouseoverme')['result']
>> + assert client.asserts.assertText(validator=u'mouse outed',
>> id=u'mouseoverme')['result']
>> assert client.asserts.assertNode(id=u'amIhere')['result']
>> assert
>> client.asserts.assertProperty(validator=u'style.height|50px',
>> id=u'amIhere')['result']
>> assert not client.asserts.assertNode(id=u'doesntExist')['result']
>> Index: test/test_live/unit_tester.html
>> ===================================================================
>> --- test/test_live/unit_tester.html (revision 614)
>> +++ test/test_live/unit_tester.html (working copy)
>> @@ -70,8 +70,10 @@
>>
>> <div id="mousedownme"
>> style="position:relative;width:200px;height:50px;border:1px solid red;"
>> onmousedown="document.getElementById('mousedownme').innerHTML = 'mouse
>> downed';"></div><br>
>>
>> -<div id="mouseupme"
>> style="position:relative;width:200px;height:50px;border:1px solid
>> purple;" onmouseup="document.getElementById('mouseupme').innerHTML =
>> 'mouse upped';"></div><br>
>> +<div id="mouseupme"
>> style="position:relative;width:200px;height:50px;border:1px solid
>> purple;" onmouseup="document.getElementById('mouseupme').innerHTML =
>> 'mouse upped';"></div><br><br>
>>
>> +<div id="mouseoverme"
>> style="position:relative;width:200px;height:50px;border:1px solid
>> purple;" onmouseover="document.getElementById('mouseoverme').innerHTML =
>> 'mouse overred';"
>> onmouseout="document.getElementById('mouseoverme').innerHTML = 'mouse
>> outed';"></div><br>
>> +
>> <div id="amIhere" style="width:200px;height:50px;border:1px solid
>> black;"></div><br>
>>
>> <div id="jsidTeset" style="width:200px;height:50px;border:1px solid
>> orange;"></div>
>> Index: windmill/html/js/controller/controller.js
>> ===================================================================
>> --- windmill/html/js/controller/controller.js (revision 614)
>> +++ windmill/html/js/controller/controller.js (working copy)
>> @@ -327,7 +327,21 @@
>> return true;
>> };
>>
>> + this.mouseover = function (param_object){
>> + var mdnElement = this._lookupDispatch(param_object);
>> + windmill.events.triggerMouseEvent(mdnElement, 'mouseover', true);
>> +
>> + return true;
>> + };
>>
>> + this.mouseout = function (param_object){
>> + var mdnElement = this._lookupDispatch(param_object);
>> + windmill.events.triggerMouseEvent(mdnElement, 'mouseout', true);
>> +
>> + return true;
>> + };
>> +
>> +
>> //Browser navigation functions
>> this.goBack = function(param_object){
>> windmill.testWindow.history.back();
>> Index: windmill/html/js/wm/registry.js
>> ===================================================================
>> --- windmill/html/js/wm/registry.js (revision 614)
>> +++ windmill/html/js/wm/registry.js (working copy)
>> @@ -32,6 +32,8 @@
>> windmill.registry.methods['doubleClick'] = {'locator': true,
>> 'option': false};
>> windmill.registry.methods['mousedown'] = {'locator': true,
>> 'option': false};
>> windmill.registry.methods['mouseup'] = {'locator': true,
>> 'option': false};
>> +windmill.registry.methods['mouseout'] = {'locator': true,
>> 'option': false};
>> +windmill.registry.methods['mouseover'] = {'locator': true,
>> 'option': false};
>> windmill.registry.methods['type'] = {'locator': true,
>> 'option': 'text'};
>> windmill.registry.methods['radio'] = {'locator': true,
>> 'option': false };
>> windmill.registry.methods['check'] = {'locator': true,
>> 'option': false };
>>
>>
>> _______________________________________________
>> Windmill-dev mailing list
>> Windmill-dev at osafoundation.org <mailto:Windmill-dev at osafoundation.org>
>> http://lists.osafoundation.org/mailman/listinfo/windmill-dev
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Windmill-dev mailing list
> Windmill-dev at osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/windmill-dev
More information about the Windmill-dev
mailing list