1919 HoverAt ,
2020 TypeTextAt ,
2121 ScrollDocument ,
22+ ScrollAt ,
23+ DragAndDrop ,
2224 GoBack ,
2325 GoForward ,
2426 Search ,
@@ -38,21 +40,27 @@ def test_navigate(self):
3840 self .assertEqual (command .model_dump (), function_call )
3941
4042 def test_click_at (self ):
41- function_call = {"name" : "click_at" , "args" : {"y " : 1 , "x " : 2 }}
43+ function_call = {"name" : "click_at" , "args" : {"x " : 2 , "y " : 1 }}
4244 command = CommandModel .model_validate (function_call )
4345 self .assertIsInstance (command .root , ClickAt )
4446 self .assertEqual (command .model_dump (), function_call )
4547
4648 def test_hover_at (self ):
47- function_call = {"name" : "hover_at" , "args" : {"y " : 1 , "x " : 2 }}
49+ function_call = {"name" : "hover_at" , "args" : {"x " : 2 , "y " : 1 }}
4850 command = CommandModel .model_validate (function_call )
4951 self .assertIsInstance (command .root , HoverAt )
5052 self .assertEqual (command .model_dump (), function_call )
5153
5254 def test_type_text_at (self ):
5355 function_call = {
5456 "name" : "type_text_at" ,
55- "args" : {"y" : 1 , "x" : 2 , "text" : "one" },
57+ "args" : {
58+ "x" : 2 ,
59+ "y" : 1 ,
60+ "text" : "one" ,
61+ "press_enter" : True ,
62+ "clear_before_typing" : False ,
63+ },
5664 }
5765 command = CommandModel .model_validate (
5866 function_call ,
@@ -62,7 +70,13 @@ def test_type_text_at(self):
6270 command .model_dump (),
6371 {
6472 "name" : "type_text_at" ,
65- "args" : {"y" : 1 , "x" : 2 , "text" : "one" },
73+ "args" : {
74+ "x" : 2 ,
75+ "y" : 1 ,
76+ "text" : "one" ,
77+ "press_enter" : True ,
78+ "clear_before_typing" : False ,
79+ },
6680 },
6781 )
6882
@@ -77,6 +91,58 @@ def test_scroll_document(self):
7791 self .assertIsInstance (command .root , ScrollDocument )
7892 self .assertEqual (command .model_dump (), function_call )
7993
94+ function_call = {
95+ "name" : "scroll_document" ,
96+ "args" : {"direction" : "down" },
97+ }
98+ command = CommandModel .model_validate (
99+ function_call ,
100+ )
101+ self .assertIsInstance (command .root , ScrollDocument )
102+ self .assertEqual (command .model_dump (), function_call )
103+
104+ function_call = {
105+ "name" : "scroll_document" ,
106+ "args" : {"direction" : "left" },
107+ }
108+ command = CommandModel .model_validate (
109+ function_call ,
110+ )
111+ self .assertIsInstance (command .root , ScrollDocument )
112+ self .assertEqual (command .model_dump (), function_call )
113+
114+ function_call = {
115+ "name" : "scroll_document" ,
116+ "args" : {"direction" : "right" },
117+ }
118+ command = CommandModel .model_validate (
119+ function_call ,
120+ )
121+ self .assertIsInstance (command .root , ScrollDocument )
122+ self .assertEqual (command .model_dump (), function_call )
123+
124+ def test_scroll_at (self ):
125+ function_call = {
126+ "name" : "scroll_at" ,
127+ "args" : {"x" : 1 , "y" : 2 , "direction" : "up" , "magnitude" : 10 },
128+ }
129+ command = CommandModel .model_validate (
130+ function_call ,
131+ )
132+ self .assertIsInstance (command .root , ScrollAt )
133+ self .assertEqual (command .model_dump (), function_call )
134+
135+ def test_drag_and_drop (self ):
136+ function_call = {
137+ "name" : "drag_and_drop" ,
138+ "args" : {"x" : 1 , "y" : 2 , "destination_x" : 3 , "destination_y" : 4 },
139+ }
140+ command = CommandModel .model_validate (
141+ function_call ,
142+ )
143+ self .assertIsInstance (command .root , DragAndDrop )
144+ self .assertEqual (command .model_dump (), function_call )
145+
80146 def test_go_back (self ):
81147 function_call = {"name" : "go_back" , "args" : {}}
82148 command = CommandModel .model_validate (function_call )
0 commit comments