Skip to content

Commit 36b6957

Browse files
committed
Initial import for advanced interactions
1 parent 3bf772c commit 36b6957

File tree

9 files changed

+242
-103
lines changed

9 files changed

+242
-103
lines changed

src/interaction/se_action.e

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
note
2+
description: "Summary description for {SE_ACTION}."
3+
author: ""
4+
date: "$Date$"
5+
revision: "$Revision$"
6+
7+
deferred class
8+
SE_ACTION
9+
10+
feature -- Execute
11+
12+
execute
13+
deferred
14+
end
15+
end

src/interaction/se_actions.e

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
note
2+
description: "Summary description for {SE_ACTIONS}."
3+
author: ""
4+
date: "$Date$"
5+
revision: "$Revision$"
6+
7+
class
8+
SE_ACTIONS
9+
10+
11+
feature -- Access
12+
13+
-- keyboard: SE_KEYBOARD
14+
-- mouse: SE_MOUSE
15+
end

src/interaction/se_composite_action.e

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
note
2+
description: "Summary description for {SE_COMPOSITE_ACTION}."
3+
author: ""
4+
date: "$Date$"
5+
revision: "$Revision$"
6+
7+
class
8+
SE_COMPOSITE_ACTION
9+
10+
inherit
11+
12+
SE_ACTION
13+
14+
create
15+
make
16+
17+
feature {NONE} -- Initialization
18+
19+
make
20+
do
21+
create {ARRAYED_LIST[SE_ACTION]}actions.make (5)
22+
ensure
23+
actions_empty: actions.is_empty
24+
end
25+
26+
feature -- Execute
27+
28+
execute
29+
do
30+
across actions as c loop c.item.execute end
31+
end
32+
33+
feature -- Access
34+
35+
count: INTEGER
36+
do
37+
Result := actions.count
38+
end
39+
40+
feature -- Change Element
41+
42+
add_action (a_action: SE_ACTION)
43+
do
44+
actions.force (a_action)
45+
end
46+
47+
feature {NONE} -- Implementation
48+
49+
actions: LIST[SE_ACTION]
50+
51+
end

src/interaction/se_coordinates.e

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
note
2+
description: "Provides coordinates of an element for advanced interactions"
3+
author: ""
4+
date: "$Date$"
5+
revision: "$Revision$"
6+
7+
class
8+
SE_COORDINATES
9+
10+
inherit
11+
12+
REFACTORING_HELPER
13+
14+
create
15+
make
16+
17+
feature {NONE} -- Initialization
18+
19+
make ( a_web_driver : like driver)
20+
-- Create an object se_mouse with his driver
21+
do
22+
driver := a_web_driver
23+
ensure
24+
web_driver_set : driver = a_web_driver
25+
end
26+
27+
28+
feature -- Access
29+
30+
on_screen: detachable SE_POINT
31+
do
32+
to_implement ("Not supported yet.")
33+
end
34+
35+
in_view_port: detachable SE_POINT
36+
do
37+
if attached driver.active_element as l_element and then
38+
attached driver.session as l_session then
39+
Result := driver.api.location_in_view (l_session.session_id, l_element.element)
40+
end
41+
end
42+
43+
on_page: detachable SE_POINT
44+
do
45+
if attached driver.active_element as l_element and then
46+
attached driver.session as l_session then
47+
Result := driver.api.element_location (l_session.session_id, l_element.element)
48+
end
49+
end
50+
51+
auxiliary: detachable ANY
52+
do
53+
if attached driver.active_element as l_element then
54+
Result := l_element.element
55+
end
56+
end
57+
58+
59+
feature -- {NONE} -- Implementations
60+
driver : WEB_DRIVER
61+
-- web_driver
62+
63+
end

src/se_keyboard.e renamed to src/interaction/se_keyboard.e

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ class
99

1010
create
1111
make
12+
1213
feature {NONE} -- Initialization
14+
1315
make ( a_web_driver : like driver)
1416
-- Create an object se_keyboard with his driver
1517
do
@@ -19,6 +21,7 @@ feature {NONE} -- Initialization
1921
end
2022

2123
feature --Access
24+
2225
send_keys (keys : ARRAY[STRING_32])
2326
do
2427
if attached driver.active_element as l_active_element then
@@ -50,9 +53,8 @@ feature --Access
5053
end
5154
end
5255

53-
54-
5556
feature {NONE} -- Implementation
57+
5658
driver : WEB_DRIVER
5759
-- web_driver
5860

src/interaction/se_mouse.e

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
note
2+
description: "Summary description for {SE_MOUSE}."
3+
author: ""
4+
date: "$Date$"
5+
revision: "$Revision$"
6+
7+
class
8+
SE_MOUSE
9+
10+
create
11+
make
12+
13+
feature {NONE} -- Initialization
14+
15+
make ( a_web_driver : like driver)
16+
-- Create an object se_mouse with his driver
17+
do
18+
driver := a_web_driver
19+
ensure
20+
web_driver_set : driver = a_web_driver
21+
end
22+
23+
feature -- Mouse Actions
24+
25+
click (a_coordinates: SE_COORDINATES)
26+
do
27+
end
28+
29+
double_click (a_coordinates: SE_COORDINATES)
30+
do
31+
32+
end
33+
34+
mouse_down (a_coordinates: SE_COORDINATES)
35+
do
36+
37+
end
38+
39+
40+
mouse_up (a_coordinates: SE_COORDINATES)
41+
do
42+
43+
end
44+
45+
mouse_move (a_coordinates: SE_COORDINATES)
46+
do
47+
48+
end
49+
50+
mouse_move_by_params (a_coordinates: SE_COORDINATES; a_param1: INTEGER_64; a_param2: INTEGER_64)
51+
do
52+
53+
end
54+
55+
context_click (a_coordinates: SE_COORDINATES)
56+
do
57+
58+
end
59+
60+
61+
62+
feature {NONE} -- Implementation
63+
64+
65+
params_from_coordinates (a_where: SE_COORDINATES): HASH_TABLE[ANY,STRING]
66+
do
67+
create Result.make(1)
68+
if attached {STRING} a_where.auxiliary as l_id then
69+
Result.force (l_id,"element")
70+
end
71+
end
72+
73+
74+
75+
driver : WEB_DRIVER
76+
-- web_driver
77+
78+
json_template : String = "[
79+
{"value" :"$value",
80+
"isdown" : $boolean}
81+
]"
82+
end

src/se_mouse.e

Lines changed: 0 additions & 96 deletions
This file was deleted.

src/web_driver.e

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ feature {WEB_DRIVER, WEB_DRIVER_WAIT}
476476
end
477477
end
478478

479-
feature {SE_KEYBOARD} -- Implementation
479+
feature {SE_KEYBOARD, SE_COORDINATES} -- Implementation
480480

481481
session: detachable SE_SESSION
482482

0 commit comments

Comments
 (0)