|
From: James X. L. <jam...@us...> - 2007-02-14 00:46:24
|
Hi Brenna,
IeUnit has a method called assertSelectHasOption() that probably
does what you want (e.g. _.assertSelectHasOption(0, "OptionC")) .
Please see the test case IeUnit\samples\ApiTest\SelectTest.jst for
more sample code.
To negate an assertion statement you can use the assertMustFail.
Something like:
_.assertMustFail( function() { _.assertSelectHasOption(0, "OptionC"); } );
The syntax is not very nice. If you need to use this freqently, you probably
should
create your own assertion method.
James
Hey all,
I've been using IEUnit for awhile, and find it to be extremely useful.
However, recently I have run across a problem with constructing the
correct test assertion.
If I want to assert that a particular option (let's say, Bunnies) is
present for a dropdown, I can do something like:
_.setSelectionOption(0, "Bunnies");
No problems here, although I must admit that this isn't the best way to
do this (since I'm basically asserting the value is there because I'm
selecting it, not by scanning it to see if the value is there).
The trouble begins when I want to assert that a dropdown does not have
an option present. Presently, if I do:
_.assertNull(_.setSelectOption(0, "Bunnies"));
I will get the following result:
Failed: 'value' is undefined
Is this a bug in IeDHTML.js? Is there a better way to go about writing
this assertion?
Thanks in advance for the advice!
Brenna Flood
Software Test Engineer III
Serials Solutions
--------------------------------------------------------------------------------
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier.
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
--------------------------------------------------------------------------------
> _______________________________________________
> Ieunit-general mailing list
> Ieu...@li...
> https://lists.sourceforge.net/lists/listinfo/ieunit-general
>
|