File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1003,13 +1003,14 @@ class Playwright extends Helper {
10031003   */ 
10041004
10051005  async  grabCheckedElementStatus ( locator ,  options  =  { } )  { 
1006+     const  supportedTypes  =  [ 'checkbox' ,  'radio' ] ; 
10061007    const  el  =  await  this . _locateElement ( locator ) ; 
10071008    const  type  =  await  el . getAttribute ( 'type' ) ; 
10081009
1009-     if  ( [ 'checkbox' ,   'radio' ] . includes ( type ) )  { 
1010+     if  ( supportedTypes . includes ( type ) )  { 
10101011      return  el . isChecked ( options ) ; 
10111012    } 
1012-     throw  new  Error ( ' Element is not a checkbox  or radio  input' ) ; 
1013+     throw  new  Error ( ` Element is not a ${ supportedTypes . join ( '  or ' ) } ` ) ; 
10131014  } 
10141015  /** 
10151016   * Return the disabled status of given element. 
Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ describe('Playwright', function () {
129129      result  =  await  I . grabCheckedElementStatus ( {  id : 'ts'  } ) ; 
130130      assert . equal ( result ,  false ) ; 
131131      try  { 
132-         result   =   await  I . grabCheckedElementStatus ( {  id : 'basic'  } ) ; 
132+         await  I . grabCheckedElementStatus ( {  id : 'basic'  } ) ; 
133133      }  catch  ( e )  { 
134134        assert . equal ( e . message ,  'Element is not a checkbox or radio input' ) ; 
135135      } 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments