Skip to content

Commit 38a59b9

Browse files
committed
Updated ecf's to the latest version.
Clean code and updated agents to the new style.
1 parent a5346bd commit 38a59b9

22 files changed

+76
-96
lines changed

examples/examples.ecf

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
<exclude>/CVS$</exclude>
88
<exclude>/.svn$</exclude>
99
</file_rule>
10-
<option warning="true" is_attached_by_default="true" void_safety="all" syntax="transitional">
10+
<option warning="true">
1111
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
1212
</option>
13+
1314
<setting name="console_application" value="true"/>
1415
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
1516
<library name="selenium" location="..\selenium-safe.ecf"/>

selenium-safe.ecf

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="ISO-8859-1"?>
2-
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-10-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-10-0 http://www.eiffel.com/developers/xml/configuration-1-10-0.xsd" name="selenium" uuid="F76D19F7-509C-47B1-B2EA-46FCB05F9893" library_target="selenium">
2+
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-18-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-18-0 http://www.eiffel.com/developers/xml/configuration-1-18-0.xsd" name="selenium" uuid="F76D19F7-509C-47B1-B2EA-46FCB05F9893" library_target="selenium">
33
<target name="selenium">
44
<root all_classes="true"/>
5-
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="standard">
6-
<assertions precondition="true" postcondition="true" check="true" invariant="true" supplier_precondition="true"/>
5+
<option warning="true">
6+
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
77
</option>
88
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
99
<library name="encoding" location="$ISE_LIBRARY\library\encoding\encoding-safe.ecf"/>

src/converter/se_build_value_json_converter.e

-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ feature -- Access
2525
feature -- Conversion
2626

2727
from_json (a_json: detachable JSON_VALUE; ctx: JSON_DESERIALIZER_CONTEXT; a_type: detachable TYPE [detachable ANY]): detachable like object
28-
--from_json (j: like to_json): detachable like object
2928
do
3029
if attached {JSON_OBJECT} a_json as j then
3130
create Result.make_empty
@@ -42,7 +41,6 @@ feature -- Conversion
4241
end
4342

4443
to_json (obj: detachable ANY; ctx: JSON_SERIALIZER_CONTEXT): JSON_VALUE
45-
--to_json (o: like object): JSON_OBJECT
4644
local
4745
jo: JSON_OBJECT
4846
do
@@ -65,8 +63,6 @@ feature -- Conversion
6563

6664
feature {NONE} -- Implementation
6765

68-
69-
7066
version_key: JSON_STRING
7167
once
7268
create Result.make_from_string ("version")

src/converter/se_capabilities_json_converter.e

-6
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ feature -- Access
2727
feature -- Conversion
2828

2929
from_json (a_json: detachable JSON_VALUE; ctx: JSON_DESERIALIZER_CONTEXT; a_type: detachable TYPE [detachable ANY]): detachable like object
30-
--from_json (j: like to_json): detachable like object
3130
do
3231
create Result.make
3332
if attached {JSON_OBJECT} a_json as j then
@@ -78,12 +77,9 @@ feature -- Conversion
7877
-- end
7978

8079
end
81-
82-
8380
end
8481

8582
to_json (obj: detachable ANY; ctx: JSON_SERIALIZER_CONTEXT): JSON_VALUE
86-
--to_json (o: like object): JSON_OBJECT
8783
local
8884
jo: JSON_OBJECT
8985
do
@@ -115,8 +111,6 @@ feature -- Conversion
115111
else
116112
create {JSON_NULL} Result
117113
end
118-
119-
120114
end
121115

122116
feature {NONE} -- Implementation

src/converter/se_cookie_json_converter.e

-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ feature -- Access
2525
feature -- Conversion
2626

2727
from_json (a_json: detachable JSON_VALUE; ctx: JSON_DESERIALIZER_CONTEXT; a_type: detachable TYPE [detachable ANY]): detachable like object
28-
-- from_json (j: like to_json): detachable like object
2928
do
3029
create Result
3130
if attached {JSON_OBJECT} a_json as j then
@@ -53,7 +52,6 @@ feature -- Conversion
5352
end
5453

5554
to_json (obj: detachable ANY; ctx: JSON_SERIALIZER_CONTEXT): JSON_VALUE
56-
--to_json (o: like object): JSON_OBJECT
5755
local
5856
jo: JSON_OBJECT
5957
do
@@ -81,8 +79,6 @@ feature -- Conversion
8179

8280
feature {NONE} -- Implementation
8381

84-
85-
8682
name_key: JSON_STRING
8783
once
8884
create Result.make_from_string ("name")

src/converter/se_java_value_json_converter.e

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ note
55

66
class
77
SE_JAVA_VALUE_JSON_CONVERTER
8+
89
inherit
10+
911
SE_JSON_CONVERTER
1012

1113
create
@@ -25,7 +27,6 @@ feature -- Access
2527
feature -- Conversion
2628

2729
from_json (a_json: detachable JSON_VALUE; ctx: JSON_DESERIALIZER_CONTEXT; a_type: detachable TYPE [detachable ANY]): detachable like object
28-
--from_json (j: like to_json): detachable like object
2930
do
3031
create Result.make_empty
3132
if attached {JSON_OBJECT} a_json as j then
@@ -36,7 +37,6 @@ feature -- Conversion
3637
end
3738

3839
to_json (obj: detachable ANY; ctx: JSON_SERIALIZER_CONTEXT): JSON_VALUE
39-
--to_json (o: like object): JSON_OBJECT
4040
local
4141
jo: JSON_OBJECT
4242
do
@@ -53,8 +53,6 @@ feature -- Conversion
5353

5454
feature {NONE} -- Implementation
5555

56-
57-
5856
version_key: JSON_STRING
5957
once
6058
create Result.make_from_string ("version")

src/converter/se_json_converter.e

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ deferred class
77
SE_JSON_CONVERTER
88

99
inherit
10-
-- JSON_CONVERTER
1110
JSON_SERIALIZER
1211
JSON_DESERIALIZER
1312

src/converter/se_os_value_json_converter.e

-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ feature -- Access
2727
feature -- Conversion
2828

2929
from_json (a_json: detachable JSON_VALUE; ctx: JSON_DESERIALIZER_CONTEXT; a_type: detachable TYPE [detachable ANY]): detachable like object
30-
--from_json (j: like to_json): detachable like object
3130
do
3231
create Result.make_empty
3332
if attached {JSON_OBJECT} a_json as j then
@@ -44,7 +43,6 @@ feature -- Conversion
4443
end
4544

4645
to_json (obj: detachable ANY; ctx: JSON_SERIALIZER_CONTEXT): JSON_VALUE
47-
-- to_json (o: like object): JSON_OBJECT
4846
local
4947
jo: JSON_OBJECT
5048
do

src/converter/se_response_json_converter.e

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ note
55

66
class
77
SE_RESPONSE_JSON_CONVERTER
8+
89
inherit
10+
911
SE_JSON_CONVERTER
1012

1113
create
@@ -25,7 +27,6 @@ feature -- Access
2527
feature -- Conversion
2628

2729
from_json (a_json: detachable JSON_VALUE; ctx: JSON_DESERIALIZER_CONTEXT; a_type: detachable TYPE [detachable ANY]): detachable like object
28-
--from_json (j: like to_json): detachable like object
2930
do
3031
create Result.make_empty
3132
if attached {JSON_OBJECT} a_json as j then
@@ -42,7 +43,6 @@ feature -- Conversion
4243
end
4344

4445
to_json (obj: detachable ANY; ctx: JSON_SERIALIZER_CONTEXT): JSON_VALUE
45-
--to_json (o: like object): JSON_OBJECT
4646
local
4747
jo: JSON_OBJECT
4848
do

src/converter/se_status_json_converter.e

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class
77
SE_STATUS_JSON_CONVERTER
88

99
inherit
10+
1011
SE_JSON_CONVERTER
1112

1213
create
@@ -26,7 +27,6 @@ feature -- Access
2627
feature -- Conversion
2728

2829
from_json (a_json: detachable JSON_VALUE; ctx: JSON_DESERIALIZER_CONTEXT; a_type: detachable TYPE [detachable ANY]): detachable like object
29-
-- from_json (j: like to_json): detachable like object
3030
do
3131
if attached {JSON_OBJECT} a_json as j then
3232
create Result
@@ -52,7 +52,6 @@ feature -- Conversion
5252
end
5353

5454
to_json (obj: detachable ANY; ctx: JSON_SERIALIZER_CONTEXT): JSON_VALUE
55-
--to_json (o: like object): JSON_OBJECT
5655
local
5756
jo: JSON_OBJECT
5857
do

src/converter/se_status_value_json_converter.e

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ note
55

66
class
77
SE_STATUS_VALUE_JSON_CONVERTER
8+
89
inherit
10+
911
SE_JSON_CONVERTER
1012

1113
create
@@ -25,7 +27,6 @@ feature -- Access
2527
feature -- Conversion
2628

2729
from_json (a_json: detachable JSON_VALUE; ctx: JSON_DESERIALIZER_CONTEXT; a_type: detachable TYPE [detachable ANY]): detachable like object
28-
--from_json (j: like to_json): detachable like object
2930
do
3031
if attached {JSON_OBJECT} a_json as j then
3132
create Result.make_empty
@@ -42,7 +43,6 @@ feature -- Conversion
4243
end
4344

4445
to_json (obj: detachable ANY; ctx: JSON_SERIALIZER_CONTEXT): JSON_VALUE
45-
--to_json (o: like object): JSON_OBJECT
4646
local
4747
jo: JSON_OBJECT
4848
do
@@ -65,8 +65,6 @@ feature -- Conversion
6565

6666
feature {NONE} -- Implementation
6767

68-
69-
7068
os_key: JSON_STRING
7169
once
7270
create Result.make_from_string ("os")

src/converter/se_timeout_type_json_converter.e

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ note
55

66
class
77
SE_TIMEOUT_TYPE_JSON_CONVERTER
8+
89
inherit
10+
911
SE_JSON_CONVERTER
1012

1113
create
@@ -25,7 +27,6 @@ feature -- Access
2527
feature -- Conversion
2628

2729
from_json (a_json: detachable JSON_VALUE; ctx: JSON_DESERIALIZER_CONTEXT; a_type: detachable TYPE [detachable ANY]): detachable like object
28-
--from_json (j: like to_json): detachable like object
2930
do
3031
if attached {JSON_OBJECT} a_json as j then
3132
create Result.make_empty
@@ -39,7 +40,6 @@ feature -- Conversion
3940
end
4041

4142
to_json (obj: detachable ANY; ctx: JSON_SERIALIZER_CONTEXT): JSON_VALUE
42-
--to_json (o: like object): JSON_OBJECT
4343
local
4444
jo: JSON_OBJECT
4545
do
@@ -57,7 +57,6 @@ feature -- Conversion
5757

5858
feature {NONE} -- Implementation
5959

60-
6160
type_key: JSON_STRING
6261
once
6362
create Result.make_from_string ("type")

src/helpers/json_helper.e

-15
Original file line numberDiff line numberDiff line change
@@ -126,21 +126,6 @@ feature -- Access
126126
Result.register (create {SE_TIMEOUT_TYPE_JSON_CONVERTER}.make, {SE_TIMEOUT_TYPE})
127127
end
128128

129-
130-
-- initialize_converters (j: like json)
131-
-- -- Initialize json converters
132-
-- do
133-
-- j.add_converter (create {SE_STATUS_JSON_CONVERTER}.make)
134-
-- j.add_converter (create {SE_BUILD_VALUE_JSON_CONVERTER}.make)
135-
-- j.add_converter (create {SE_JAVA_VALUE_JSON_CONVERTER}.make)
136-
-- j.add_converter (create {SE_OS_VALUE_JSON_CONVERTER}.make)
137-
-- j.add_converter (create {SE_STATUS_VALUE_JSON_CONVERTER}.make)
138-
-- j.add_converter (create {SE_CAPABILITIES_JSON_CONVERTER}.make)
139-
-- j.add_converter (create {SE_RESPONSE_JSON_CONVERTER}.make)
140-
-- j.add_converter (create {SE_TIMEOUT_TYPE_JSON_CONVERTER}.make)
141-
-- j.add_converter (create {SE_COOKIE_JSON_CONVERTER}.make)
142-
-- end
143-
144129
to_json_value (a_obj: detachable ANY): JSON_VALUE
145130
-- Convert an object `a_obj' to JSON_VALUE representation.
146131
local

src/interaction/se_send_keys_action.e

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ feature {NONE} -- Implementation
2929
keys_set: keys = a_keys
3030
end
3131

32-
3332
make_with_location (a_keyboard: SE_KEYBOARD; a_mouse: SE_MOUSE; a_coordinate: SE_COORDINATES; a_keys: ARRAY[STRING_32])
3433
do
3534
set_keyboard (a_keyboard)

src/protocol/se_json_wire_protocol.e

+4-8
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,8 @@ feature -- Commands
6060
if commnad_executor.is_available then
6161
response := commnad_executor.status
6262
check_response (response)
63-
if not has_error then
64-
if attached response.json_response as l_response then
65-
Result := json_to_se_status (l_response)
66-
end
63+
if not has_error and then attached response.json_response as l_response then
64+
Result := json_to_se_status (l_response)
6765
end
6866
end
6967
end
@@ -91,10 +89,8 @@ feature -- Commands
9189
if attached to_json (capabilities) as l_json then
9290
response := commnad_executor.new_session (desired_capabilities (l_json.representation))
9391
check_response (response)
94-
if not has_error then
95-
if attached response.json_response as r_value then
96-
Result := new_session (r_value, "session")
97-
end
92+
if not has_error and then attached response.json_response as r_value then
93+
Result := new_session (r_value, "session")
9894
end
9995
end
10096
end

src/se_button.e

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,20 @@ feature -- Query
7474
is_left : BOOLEAN
7575
-- is the current value left?
7676
do
77-
Result := (value = left_value)
77+
Result := value = left_value
7878
end
7979

8080
is_middle : BOOLEAN
8181
-- is the current value middle?
8282
do
83-
Result := (value = middle_value)
83+
Result := value = middle_value
8484
end
8585

8686

8787
is_right : BOOLEAN
8888
-- is the current value right?
8989
do
90-
Result := (value = right_value)
90+
Result := value = right_value
9191
end
9292

9393

src/se_session.e

+6
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,17 @@ class
88

99
create
1010
make
11+
1112
feature -- Initializaton
13+
1214
make (a_session_id : STRING_32; a_capabilities: SE_CAPABILITIES)
15+
-- Create a session with session `a_session_id' and capabilities `a_capabilities'.
1316
do
1417
session_id := a_session_id
1518
capabilities := a_capabilities
19+
ensure
20+
session_set: session_id = a_session_id
21+
capatiblites_set: capabilities = a_capabilities
1622
end
1723

1824
feature -- Access

0 commit comments

Comments
 (0)