@@ -14,6 +14,9 @@ var actionMap = map[string]ActionFunc{
1414 "Click" : ClickAction ,
1515 "DoubleClick" : DoubleClickAction ,
1616 "Tap" : TapAction ,
17+ "Focus" : FocusAction ,
18+ "Blur" : BlurAction ,
19+ "Clear" : ClearAction ,
1720 "Fill" : FillAction ,
1821 "Check" : CheckAction ,
1922 "Uncheck" : UncheckAction ,
@@ -87,6 +90,30 @@ func TapAction(page playwrightgo.Page, element string, target ...any) error {
8790 return page .Locator (element ).First ().Tap ()
8891}
8992
93+ func FocusAction (page playwrightgo.Page , element string , target ... any ) error {
94+ if element == "" {
95+ return fmt .Errorf ("need element to focus on" )
96+ }
97+ // TODO: support passing Focus options
98+ return page .Locator (element ).First ().Focus ()
99+ }
100+
101+ func BlurAction (page playwrightgo.Page , element string , target ... any ) error {
102+ if element == "" {
103+ return fmt .Errorf ("need element to blur" )
104+ }
105+ // TODO: support passing Blur options
106+ return page .Locator (element ).First ().Blur ()
107+ }
108+
109+ func ClearAction (page playwrightgo.Page , element string , target ... any ) error {
110+ if element == "" {
111+ return fmt .Errorf ("need element to blur" )
112+ }
113+ // TODO: support passing Clear options
114+ return page .Locator (element ).First ().Clear ()
115+ }
116+
90117func CheckAction (page playwrightgo.Page , element string , target ... any ) error {
91118 if element == "" {
92119 return fmt .Errorf ("need element to check on" )
0 commit comments