File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed 
main/kotlin/com/luissoares 
test/kotlin/com/luissoares Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ data class ByRole(
1515    private  val  selected :  Boolean?  = null ,
1616    private  val  checked :  Boolean?  = null ,
1717    private  val  pressed :  Boolean?  = null ,
18+     private  val  current :  Boolean?  = null ,
1819    //  TODO
19-     //  current?: boolean | string,
2020    //  expanded?: boolean,
2121    //  queryFallbacks?: boolean,
2222    private  val  level :  Int?  = null ,
@@ -33,6 +33,7 @@ data class ByRole(
3333                " selected" 
3434                " checked" 
3535                " pressed" 
36+                 " current" 
3637                " level" 
3738            ).filterValues { it !=  null  },
3839        )
Original file line number Diff line number Diff line change @@ -224,4 +224,26 @@ class ByRoleTest(private val driver: RemoteWebDriver) {
224224
225225        assertEquals(" 👍" 
226226    }
227+ 
228+     @Disabled
229+     @ParameterizedTest
230+     @MethodSource(" test cases current" 
231+     fun  current (current :  Boolean? , expectedFound :  List <String >) {
232+         driver.getFromHtml(
233+             """ <nav>
234+                         <a href="current/page" aria-current="true">👍</a> 
235+                         <a href="another/page">👎</a> 
236+                       </nav>"""  
237+         )
238+ 
239+         val  result =  driver.findElements(ByRole (" link" =  true ))
240+ 
241+         assertEquals(expectedFound, result.map { it.text })
242+     }
243+ 
244+     private  fun  `test cases current` =  setOf (
245+         of(true , listOf (" 👍" 
246+         of(false , listOf (" 👍" " 👎" 
247+         of(null , listOf (" 👎" 
248+     )
227249}
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments