@@ -22,22 +22,30 @@ Move In Circle
2222 Mouse Move 0 0
2323
2424Draggable Test
25- ${x } = Get Boundingbox \#draggable x
26- ${y } = Get Boundingbox \#draggable y
25+ [Setup] New Page ${DRAGGAME_URL }
26+ ${x } = Get Boundingbox id=blue-box x
27+ ${y } = Get Boundingbox id=blue-box y
2728 # evaluate end coordinates
28- ${xnew } = Evaluate ${x } + 400
29- ${ynew } = Evaluate ${y } + 400
29+ ${xnew } = Evaluate ${x } - 200
30+ ${ynew } = Evaluate ${y } - 200
3031 Mouse Button down ${x } ${y }
3132 Mouse Button up ${xnew } ${ynew }
3233 # just do a random move to make sure the element is not stuck to mouse any more
3334 Mouse Move 0 0
34- Get Text \#dragX == 400
35- Get Text \#dragY == 400
35+ Get Text id=blue-box-x-value == 360
36+ Get Text id=blue-box-y-value == 80
3637
3738Drag And Drop
38- Drag And Drop id=draggable id=clickWithOptions
39- ${obj_center } = Get Boundingbox id=draggable ALL evaluate ${Center_Func }
40- ${dest_center } = Get Boundingbox id=clickWithOptions ALL evaluate ${Center_Func }
39+ [Setup] New Page ${DRAGGAME_URL }
40+ Drag And Drop id=blue-box id=invisible-element
41+ Take Screenshot
42+ ${dest_center } = Get Boundingbox
43+ ... id=invisible-element
44+ ... ALL
45+ ... evaluate
46+ ... ${Center_Func }
47+ ... allow_hidden=True
48+ Take Screenshot
4149 Assert Position ${dest_center } [x] ${dest_center } [y] ${tol }
4250
4351Drag And Drop With Strict
@@ -47,34 +55,37 @@ Drag And Drop With Strict
4755 ... Drag And Drop //input id=clickWithOptions
4856 Run Keyword And Expect Error
4957 ... *strict mode violation*//input*resolved to ${INPUT_ELEMENT_COUNT_IN_LOGIN } elements*
50- ... Drag And Drop id=draggable //input
58+ ... Drag And Drop id=clickWithOptions //input
5159 Set Strict Mode False
52- Drag And Drop id=draggable //input
60+ Drag And Drop id=clickWithOptions //input
5361 Drag And Drop //input id=clickWithOptions
5462 [Teardown] Set Strict Mode True
5563
5664Drag And Drop With Coordinates
5765 [Tags] slow
5866 [Timeout] 60s
59- ${obj_center } = Get Boundingbox id=draggable ALL evaluate ${Center_Func }
60- ${obj_dim } = Get Boundingbox id=draggable ALL evaluate ${Dim_Func }
61- ${dest_center } = Get Boundingbox id=clickWithOptions ALL evaluate ${Center_Func }
67+ [Setup] New Page ${DRAGGAME_URL }
68+ ${obj_center } = Get Boundingbox id=blue-box ALL evaluate ${Center_Func }
69+ ${obj_dim } = Get Boundingbox id=blue-box ALL evaluate ${Dim_Func }
70+ ${dest_center } = Get Boundingbox id=goal-post ALL evaluate ${Center_Func }
6271 # Tests with implicit argument drop=True
6372 Drag And Drop By Coordinates
6473 ... from_x=${obj_center } [x] from_y=${obj_center } [y]
6574 ... to_x=${dest_center } [x] to_y=${dest_center } [y] steps=200
6675 Assert Position ${dest_center } [x] ${dest_center } [y] ${tol }
76+ Take Screenshot
6777 Drag And Drop By Coordinates
6878 ... from_x=${dest_center } [x] from_y=${dest_center } [y]
6979 ... to_x=${obj_center } [x] to_y=${obj_center } [y] steps=200
80+ Take Screenshot
7081 Assert Position ${obj_center } [x] ${obj_center } [y] ${tol }
7182 # Tests with explicit values True or False for argument drop
72- # "Start coordinates" of draggable object:
83+ # "Start coordinates" of blue-box object:
7384 ${x1 } = Set Variable ${obj_center } [x]
7485 ${y1 } = Set Variable ${obj_center } [y]
7586 ${width } = Set Variable ${obj_dim } [width]
7687 ${height } = Set Variable ${obj_dim } [height]
77- Log Draggable object: ${obj_center }
88+ Log blue-box object: ${obj_center }
7889 # coordinates where to drag in relative values:
7990 ${x2 } = Evaluate ${x1 } + 0.1 * ${width }
8091 ${y2 } = Evaluate ${y1 } - 1.0 * ${height }
@@ -88,12 +99,19 @@ Drag And Drop With Coordinates
8899 ${time } = Set Variable 1
89100
90101Hover And Drop To Hover
91- Hover id=draggable 10 10
102+ [Setup] New Page ${DRAGGAME_URL }
103+ ${x } = Get Text id=blue-box-x-value
104+ ${y } = Get Text id=blue-box-y-value
105+ Hover id=blue-box 10 10
92106 Mouse Button down
93- Hover id=draggable 30 40
107+ Hover id=blue-box 30 40
94108 Mouse Button up
95- Get Text \#dragX == 20
96- Get Text \#dragY == 30
109+ ${x } = Evaluate ${x } +30
110+ ${y } = Evaluate ${y } +40
111+ ${x } = Convert To String ${x }
112+ ${y } = Convert To String ${y }
113+ Get Text id=blue-box-x-value == ${x }
114+ Get Text id=blue-box-y-value == ${y }
97115
98116Hover With Strict
99117 Set Strict Mode True
@@ -105,16 +123,18 @@ Hover With Strict
105123 [Teardown] Set Strict Mode True
106124
107125Drag And Drop With Move Relative
108- Relative DnD 32 64 32 64
109- Relative DnD 0 -64 32 0
110- Relative DnD -20 0 12 0
111- Relative DnD -22 -20 -10 -20
126+ [Setup] New Page ${DRAGGAME_URL }
127+ Relative DnD 32 64 672 424
128+ Relative DnD 0 -64 752 440
129+ Relative DnD -20 0 812 520
130+ Relative DnD -22 -20 870 580
112131
113132Drag And Drop Relative To
114- DnD Relative To 32 64 32 64
115- DnD Relative To 0 -64 32 0
116- DnD Relative To -20 0 12 0
117- DnD Relative To -22 -20 -10 -20
133+ [Setup] New Page ${DRAGGAME_URL }
134+ DnD Relative To 32 64 672 424
135+ DnD Relative To 0 -64 752 440
136+ DnD Relative To -20 0 812 520
137+ DnD Relative To -22 -20 870 580
118138
119139Click Count
120140 ${x } = Get Boundingbox \#clickWithOptions x
@@ -172,15 +192,15 @@ Scroll By Mouse Wheel
172192*** Keywords ***
173193Relative DnD
174194 [Arguments] ${x } ${y } ${txt_x } ${txt_y }
175- Hover id=draggable
195+ Hover id=blue-box
176196 Mouse Button down
177- Mouse Move Relative To id=draggable ${x } ${y } steps=2
197+ Mouse Move Relative To id=blue-box ${x } ${y } steps=2
178198 Mouse Button up
179- Get Text \#dragX == ${txt_x }
180- Get Text \#dragY == ${txt_y }
199+ Get Text id=blue-box-x-value == ${txt_x }
200+ Get Text id=blue-box-y-value == ${txt_y }
181201
182202DnD Relative To
183203 [Arguments] ${x } ${y } ${txt_x } ${txt_y }
184- Drag And Drop Relative To id=draggable ${x } ${y } steps=2
185- Get Text id=dragX == ${txt_x }
186- Get Text id=dragY == ${txt_y }
204+ Drag And Drop Relative To id=blue-box ${x } ${y } steps=2
205+ Get Text id=blue-box-x-value == ${txt_x }
206+ Get Text id=blue-box-y-value == ${txt_y }
0 commit comments