@@ -347,6 +347,24 @@ Selenium.prototype.reset = function() {
347347 this . browserbot . resetPopups ( ) ;
348348} ;
349349
350+ Selenium . prototype . doVerifyChecked = function ( locator ) {
351+ let element = this . browserbot . findElement ( locator ) ;
352+ if ( element . type !== "checkbox" && element . type !== "radio" ) {
353+ throw new Error ( `Element with locator ${ locator } is not a checkbox nor a radio button` ) ;
354+ } else if ( ! element . checked ) {
355+ throw new Error ( `Element with locator ${ locator } is not checked` ) ;
356+ }
357+ } ;
358+
359+ Selenium . prototype . doVerifyNotChecked = function ( locator ) {
360+ let element = this . browserbot . findElement ( locator ) ;
361+ if ( element . type !== "checkbox" && element . type !== "radio" ) {
362+ throw new Error ( `Element with locator ${ locator } is not a checkbox nor a radio button` ) ;
363+ } else if ( element . checked ) {
364+ throw new Error ( `Element with locator ${ locator } is checked` ) ;
365+ }
366+ } ;
367+
350368Selenium . prototype . doVerifyEditable = function ( locator ) {
351369 if ( ! this . isEditable ( locator ) ) {
352370 throw new Error ( `Element with locator ${ locator } is not editable` ) ;
@@ -402,6 +420,24 @@ Selenium.prototype.doVerifyElementNotPresent = function(locator) {
402420 }
403421} ;
404422
423+ Selenium . prototype . doAssertChecked = function ( locator ) {
424+ let element = this . browserbot . findElement ( locator ) ;
425+ if ( element . type !== "checkbox" && element . type !== "radio" ) {
426+ throw new Error ( `Element with locator ${ locator } is not a checkbox nor a radio button` ) ;
427+ } else if ( ! element . checked ) {
428+ throw new Error ( `Element with locator ${ locator } is not checked` ) ;
429+ }
430+ } ;
431+
432+ Selenium . prototype . doAssertNotChecked = function ( locator ) {
433+ let element = this . browserbot . findElement ( locator ) ;
434+ if ( element . type !== "checkbox" && element . type !== "radio" ) {
435+ throw new Error ( `Element with locator ${ locator } is not a checkbox nor a radio button` ) ;
436+ } else if ( element . checked ) {
437+ throw new Error ( `Element with locator ${ locator } is checked` ) ;
438+ }
439+ } ;
440+
405441Selenium . prototype . doAssertEditable = function ( locator ) {
406442 if ( ! this . isEditable ( locator ) ) {
407443 throw new Error ( `Element with locator ${ locator } is not editable` ) ;
0 commit comments