Skip to content

Commit b0bb035

Browse files
committed
Added double click example
1 parent 9d0689a commit b0bb035

File tree

2 files changed

+77
-1
lines changed

2 files changed

+77
-1
lines changed

examples/example_double_click.e

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
note
2+
description: "Summary description for {EXAMPLE_DOUBLE_CLICK}."
3+
author: ""
4+
date: "$Date$"
5+
revision: "$Revision$"
6+
7+
class
8+
EXAMPLE_DOUBLE_CLICK
9+
10+
inherit
11+
12+
ANY
13+
redefine
14+
default_create
15+
end
16+
17+
create
18+
default_create
19+
20+
feature {NONE} -- Initialization
21+
22+
default_create
23+
do
24+
test_double_click
25+
end
26+
27+
feature -- Test
28+
29+
30+
test_double_click
31+
local
32+
web_driver: WEB_DRIVER
33+
wait: WEB_DRIVER_WAIT
34+
actions: SE_ACTIONS
35+
do
36+
--Create a new instance of a Web driver
37+
create web_driver.make
38+
39+
-- Start session with chrome
40+
web_driver.start_session_chrome
41+
42+
-- Go to Page under test
43+
web_driver.to_url ("http://dl.dropbox.com/u/55228056/DoubleClickDemo.html")
44+
create wait.make (web_driver,100)
45+
46+
-- Create a new instance of actions
47+
create actions.make (web_driver)
48+
49+
-- Find links
50+
if attached {WEB_ELEMENT} web_driver.find_element ((create {SE_BY}).id("message")) as l_element then
51+
52+
if attached l_element.get_css_value ("color") as l_value then
53+
-- check
54+
-- Expected_blue: l_value.same_string ("rgb(0, 0, 255)")
55+
-- end
56+
end
57+
actions.double_click (l_element).execute
58+
59+
if attached l_element.get_css_value ("background") as l_value then
60+
-- check
61+
-- Expected_yellow: l_value.same_string ("rgb(255, 255, 0)")
62+
-- end
63+
end
64+
end
65+
print("%NEnd Process ...")
66+
io.read_line
67+
-- close the window
68+
web_driver.window_close
69+
end
70+
71+
end

examples/examples.ecf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,13 @@
7777
<root class="EXAMPLE_SLIDER" feature="default_create"/>
7878
<cluster name="src" location=".\" recursive="true"/>
7979
</target>
80-
8180

81+
<target name="exampleDoubleClick" extends="selenium_example">
82+
<root class="EXAMPLE_DOUBLE_CLICK" feature="default_create"/>
83+
<cluster name="src" location=".\" recursive="true"/>
84+
</target>
85+
86+
8287

8388

8489

0 commit comments

Comments
 (0)