@@ -377,6 +377,25 @@ Selenium.prototype.doVerifyNotEditable = function(locator) {
377377 }
378378} ;
379379
380+
381+ Selenium . prototype . doVerifySelectedValue = function ( locator , value ) {
382+ let element = this . browserbot . findElement ( locator ) ;
383+ if ( element . type !== "select-one" ) {
384+ throw new Error ( `Element with locator ${ locator } is not a select` ) ;
385+ } else if ( element . value !== value ) {
386+ throw new Error ( "Actual value '" + element . value + "' did not match '" + value + "'" ) ;
387+ }
388+ } ;
389+
390+ Selenium . prototype . doVerifyNotSelectedValue = function ( locator , value ) {
391+ let element = this . browserbot . findElement ( locator ) ;
392+ if ( element . type !== "select-one" ) {
393+ throw new Error ( `Element with locator ${ locator } is not a select` ) ;
394+ } else if ( element . value === value ) {
395+ throw new Error ( "Actual value '" + element . value + "' did match" ) ;
396+ }
397+ } ;
398+
380399Selenium . prototype . doVerifyText = function ( locator , value ) {
381400 let element = this . browserbot . findElement ( locator ) ;
382401 if ( getText ( element ) !== value ) {
@@ -450,6 +469,24 @@ Selenium.prototype.doAssertNotEditable = function(locator) {
450469 }
451470} ;
452471
472+ Selenium . prototype . doAssertSelectedValue = function ( locator , value ) {
473+ let element = this . browserbot . findElement ( locator ) ;
474+ if ( element . type !== "select-one" ) {
475+ throw new Error ( `Element with locator ${ locator } is not a select` ) ;
476+ } else if ( element . value !== value ) {
477+ throw new Error ( "Actual value '" + element . value + "' did not match '" + value + "'" ) ;
478+ }
479+ } ;
480+
481+ Selenium . prototype . doAssertNotSelectedValue = function ( locator , value ) {
482+ let element = this . browserbot . findElement ( locator ) ;
483+ if ( element . type !== "select-one" ) {
484+ throw new Error ( `Element with locator ${ locator } is not a select` ) ;
485+ } else if ( element . value === value ) {
486+ throw new Error ( "Actual value '" + element . value + "' did match" ) ;
487+ }
488+ } ;
489+
453490Selenium . prototype . doAssertText = function ( locator , value ) {
454491 let element = this . browserbot . findElement ( locator ) ;
455492 if ( getText ( element ) !== value ) {
0 commit comments