@@ -142,18 +142,19 @@ internal val WebElement.wrappedDriver get() = (this as RemoteWebElement).wrapped
142
142
143
143
fun WebElement.fireEvent (eventName : Event , eventProperties : Map <String , Map <String , Any ?>> = emptyMap()): Any? {
144
144
wrappedDriver.ensureScript(" testing-library.js" , " fireEvent.change" )
145
- return wrappedDriver.executeScript(" fireEvent.$eventName (arguments[0], arguments[1])" , this , eventProperties)
145
+ val event = eventName.name.replaceFirstChar(Char ::lowercase)
146
+ return wrappedDriver.executeScript(" fireEvent.$event (arguments[0], arguments[1])" , this , eventProperties)
146
147
}
147
148
148
149
@Suppress(" unused" )
149
150
enum class Event {
150
- copy, cut, paste, compositionEnd, compositionStart, compositionUpdate, keyDown, keyPress, keyUp, focus, blur ,
151
- focusIn, focusOut, change, input, invalid, submit, reset, click, contextMenu, dblClick, drag, dragEnd, dragEnter ,
152
- dragExit, dragLeave, dragOver, dragStart, drop, mouseDown, mouseEnter, mouseLeave, mouseMove, mouseOut, mouseOver ,
153
- mouseUp, select, touchCancel, touchEnd, touchMove, touchStart, resize, scroll, wheel, abort, canPlay ,
154
- canPlayThrough, durationChange, emptied, encrypted, ended, loadedData, loadedMetadata, loadStart, pause, play ,
155
- playing, progress, rateChange, seeked, seeking, stalled, suspend , timeUpdate, volumeChange, waiting, load, error ,
156
- animationStart, animationEnd, animationIteration, transitionCancel, transitionEnd, transitionRun, transitionStart ,
157
- pointerOver, pointerEnter, pointerDown, pointerMove, pointerUp, pointerCancel, pointerOut, pointerLeave ,
158
- gotPointerCapture, lostPointerCapture, popState, offline, online, doubleClick
151
+ Copy , Cut , Paste , CompositionEnd , CompositionStart , CompositionUpdate , KeyDown , KeyPress , KeyUp , Focus , Blur ,
152
+ FocusIn , FocusOut , Change , Input , Invalid , Submit , Reset , Click , ContextMenu , DblClick , Drag , DragEnd , DragEnter ,
153
+ DragExit , DragLeave , DragOver , DragStart , Drop , MouseDown , MouseEnter , MouseLeave , MouseMove , MouseOut , MouseOver ,
154
+ MouseUp , Select , TouchCancel , TouchEnd , TouchMove , TouchStart , Resize , Scroll , Wheel , Abort , CanPlay ,
155
+ CanPlayThrough , DurationChange , Emptied , Encrypted , Ended , LoadedData , LoadedMetadata , LoadStart , Pause , Play ,
156
+ Playing , Progress , RateChange , Seeked , Seeking , Stalled , Suspend , TimeUpdate , VolumeChange , Waiting , Load , Error ,
157
+ AnimationStart , AnimationEnd , AnimationIteration , TransitionCancel , TransitionEnd , TransitionRun , TransitionStart ,
158
+ PointerOver , PointerEnter , PointerDown , PointerMove , PointerUp , PointerCancel , PointerOut , PointerLeave ,
159
+ GotPointerCapture , LostPointerCapture , PopState , Offline , Online , DoubleClick
159
160
}
0 commit comments