File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
packages/selenium-ide/src Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ export const Commands = Object.freeze({
7575 assertElementNotPresent : "assert element not present" ,
7676 assertPrompt : "assert prompt" ,
7777 assertText : "assert text" ,
78+ assertValue : "assert value" ,
7879 assertTitle : "assert title" ,
7980 chooseCancelOnNextConfirmation : "choose cancel on next confirmation" ,
8081 chooseCancelOnNextPrompt : "choose cancel on next prompt" ,
@@ -104,6 +105,7 @@ export const Commands = Object.freeze({
104105 verifyElementPresent : "verify element present" ,
105106 verifyElementNotPresent : "verify element not present" ,
106107 verifyText : "verify text" ,
108+ verifyValue : "verify value" ,
107109 verifyTitle : "verify title"
108110} ) ;
109111
Original file line number Diff line number Diff line change @@ -354,6 +354,13 @@ Selenium.prototype.doVerifyText = function(locator, value) {
354354 }
355355} ;
356356
357+ Selenium . prototype . doVerifyValue = function ( locator , value ) {
358+ let element = this . browserbot . findElement ( locator ) ;
359+ if ( element . value !== value ) {
360+ throw new Error ( "Actual value '" + element . value + "' did not match '" + value + "'" ) ;
361+ }
362+ } ;
363+
357364Selenium . prototype . doVerifyTitle = function ( value ) {
358365 if ( normalizeSpaces ( this . getTitle ( ) ) !== value ) {
359366 throw new Error ( "Actual value '" + normalizeSpaces ( this . getTitle ( ) ) + "' did not match '" + value + "'" ) ;
@@ -390,6 +397,13 @@ Selenium.prototype.doAssertText = function(locator, value) {
390397 }
391398} ;
392399
400+ Selenium . prototype . doAssertValue = function ( locator , value ) {
401+ let element = this . browserbot . findElement ( locator ) ;
402+ if ( element . value !== value ) {
403+ throw new Error ( "Actual value '" + element . value + "' did not match '" + value + "'" ) ;
404+ }
405+ } ;
406+
393407Selenium . prototype . doAssertTitle = function ( value ) {
394408 if ( normalizeSpaces ( this . getTitle ( ) ) !== value ) {
395409 throw new Error ( "Actual value '" + normalizeSpaces ( this . getTitle ( ) ) + "' did not match '" + value + "'" ) ;
You can’t perform that action at this time.
0 commit comments