@@ -22,22 +22,26 @@ 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
37+
3638
3739Drag 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 }
40+ [Setup] New Page ${DRAGGAME_URL }
41+ Drag And Drop id=blue-box id=invisible-element
42+ Take Screenshot
43+ ${dest_center } = Get Boundingbox id=invisible-element ALL evaluate ${Center_Func } allow_hidden=True
44+ Take Screenshot
4145 Assert Position ${dest_center } [x] ${dest_center } [y] ${tol }
4246
4347Drag And Drop With Strict
@@ -47,34 +51,37 @@ Drag And Drop With Strict
4751 ... Drag And Drop //input id=clickWithOptions
4852 Run Keyword And Expect Error
4953 ... *strict mode violation*//input*resolved to ${INPUT_ELEMENT_COUNT_IN_LOGIN } elements*
50- ... Drag And Drop id=draggable //input
54+ ... Drag And Drop id=clickWithOptions //input
5155 Set Strict Mode False
52- Drag And Drop id=draggable //input
56+ Drag And Drop id=clickWithOptions //input
5357 Drag And Drop //input id=clickWithOptions
5458 [Teardown] Set Strict Mode True
5559
5660Drag And Drop With Coordinates
5761 [Tags] slow
5862 [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 }
63+ [Setup] New Page ${DRAGGAME_URL }
64+ ${obj_center } = Get Boundingbox id=blue-box ALL evaluate ${Center_Func }
65+ ${obj_dim } = Get Boundingbox id=blue-box ALL evaluate ${Dim_Func }
66+ ${dest_center } = Get Boundingbox id=goal-post ALL evaluate ${Center_Func }
6267 # Tests with implicit argument drop=True
6368 Drag And Drop By Coordinates
6469 ... from_x=${obj_center } [x] from_y=${obj_center } [y]
6570 ... to_x=${dest_center } [x] to_y=${dest_center } [y] steps=200
6671 Assert Position ${dest_center } [x] ${dest_center } [y] ${tol }
72+ Take Screenshot
6773 Drag And Drop By Coordinates
6874 ... from_x=${dest_center } [x] from_y=${dest_center } [y]
6975 ... to_x=${obj_center } [x] to_y=${obj_center } [y] steps=200
76+ Take Screenshot
7077 Assert Position ${obj_center } [x] ${obj_center } [y] ${tol }
7178 # Tests with explicit values True or False for argument drop
72- # "Start coordinates" of draggable object:
79+ # "Start coordinates" of blue-box object:
7380 ${x1 } = Set Variable ${obj_center } [x]
7481 ${y1 } = Set Variable ${obj_center } [y]
7582 ${width } = Set Variable ${obj_dim } [width]
7683 ${height } = Set Variable ${obj_dim } [height]
77- Log Draggable object: ${obj_center }
84+ Log blue-box object: ${obj_center }
7885 # coordinates where to drag in relative values:
7986 ${x2 } = Evaluate ${x1 } + 0.1 * ${width }
8087 ${y2 } = Evaluate ${y1 } - 1.0 * ${height }
@@ -88,12 +95,19 @@ Drag And Drop With Coordinates
8895 ${time } = Set Variable 1
8996
9097Hover And Drop To Hover
91- Hover id=draggable 10 10
98+ [Setup] New Page ${DRAGGAME_URL }
99+ ${x } Get Text id=blue-box-x-value
100+ ${y } Get Text id=blue-box-y-value
101+ Hover id=blue-box 10 10
92102 Mouse Button down
93- Hover id=draggable 30 40
103+ Hover id=blue-box 30 40
94104 Mouse Button up
95- Get Text \#dragX == 20
96- Get Text \#dragY == 30
105+ ${x } Evaluate ${x } +30
106+ ${y } Evaluate ${y } +40
107+ ${x } Convert To String ${x }
108+ ${y } Convert To String ${y }
109+ Get Text id=blue-box-x-value == ${x }
110+ Get Text id=blue-box-y-value == ${y }
97111
98112Hover With Strict
99113 Set Strict Mode True
@@ -105,16 +119,18 @@ Hover With Strict
105119 [Teardown] Set Strict Mode True
106120
107121Drag 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
122+ [Setup] New Page ${DRAGGAME_URL }
123+ Relative DnD 32 64 672 424
124+ Relative DnD 0 -64 752 440
125+ Relative DnD -20 0 812 520
126+ Relative DnD -22 -20 870 580
112127
113128Drag 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
129+ [Setup] New Page ${DRAGGAME_URL }
130+ DnD Relative To 32 64 672 424
131+ DnD Relative To 0 -64 752 440
132+ DnD Relative To -20 0 812 520
133+ DnD Relative To -22 -20 870 580
118134
119135Click Count
120136 ${x } = Get Boundingbox \#clickWithOptions x
@@ -172,15 +188,15 @@ Scroll By Mouse Wheel
172188*** Keywords ***
173189Relative DnD
174190 [Arguments] ${x } ${y } ${txt_x } ${txt_y }
175- Hover id=draggable
191+ Hover id=blue-box
176192 Mouse Button down
177- Mouse Move Relative To id=draggable ${x } ${y } steps=2
193+ Mouse Move Relative To id=blue-box ${x } ${y } steps=2
178194 Mouse Button up
179- Get Text \#dragX == ${txt_x }
180- Get Text \#dragY == ${txt_y }
195+ Get Text id=blue-box-x-value == ${txt_x }
196+ Get Text id=blue-box-y-value == ${txt_y }
181197
182198DnD Relative To
183199 [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 }
200+ Drag And Drop Relative To id=blue-box ${x } ${y } steps=2
201+ Get Text id=blue-box-x-value == ${txt_x }
202+ Get Text id=blue-box-y-value == ${txt_y }
0 commit comments