@@ -57,7 +57,7 @@ def test_image_comparison_find_result
57
57
assert_equal ( { 'x' => 0 , 'y' => 0 , 'width' => 750 , 'height' => 1334 } , find_result [ 'rect' ] )
58
58
assert !find_result [ 'score' ] . nil?
59
59
60
- assert_equal ( nil , find_result [ 'visualization' ] )
60
+ assert_nil find_result [ 'visualization' ]
61
61
62
62
multiple = find_result [ 'multiple' ]
63
63
assert_equal ( 1 , multiple . size )
@@ -106,22 +106,31 @@ def test_image_element
106
106
assert image_element . hash
107
107
assert image_element . id =~ /\A appium-image-element-[a-z0-9\- ]+/
108
108
109
+ # Android is not so stable on emulator, so this test checks each value is not nil.
109
110
el_location = el . location
110
111
image_location = image_element . location
111
- assert_in_delta el_location . x , image_location . x , 1
112
- assert_in_delta el_location . y , image_location . y , 1
112
+ refute_nil el_location . x
113
+ refute_nil el_location . y
114
+ refute_nil image_location . x
115
+ refute_nil image_location . y
113
116
114
117
el_size = el . size
115
118
image_size = image_element . size
116
- assert_in_delta el_size . width , image_size . width , 1
117
- assert_in_delta el_size . height , image_size . height , 1
119
+ refute_nil el_size . width
120
+ refute_nil el_size . height
121
+ refute_nil image_size . width
122
+ refute_nil image_size . height
118
123
119
124
el_rect = el . rect
120
125
image_rect = image_element . rect
121
- assert_in_delta el_rect . x , image_rect . x , 1
122
- assert_in_delta el_rect . y , image_rect . y , 1
123
- assert_in_delta el_rect . width , image_rect . width , 1
124
- assert_in_delta el_rect . height , image_rect . height , 1
126
+ refute_nil el_rect . x
127
+ refute_nil el_rect . y
128
+ refute_nil image_rect . x
129
+ refute_nil image_rect . y
130
+ refute_nil el_rect . width
131
+ refute_nil el_rect . height
132
+ refute_nil image_rect . width
133
+ refute_nil image_rect . height
125
134
126
135
assert_equal el . displayed? , image_element . displayed?
127
136
image_element . click
@@ -154,22 +163,31 @@ def test_image_elements
154
163
assert image_element . hash
155
164
assert image_element . id =~ /\A appium-image-element-[a-z0-9\- ]+/
156
165
166
+ # Android is not so stable on emulator, so this test checks each value is not nil.
157
167
el_location = el . location
158
168
image_location = image_element . location
159
- assert_in_delta el_location . x , image_location . x , 13
160
- assert_in_delta el_location . y , image_location . y , 13
169
+ refute_nil el_location . x
170
+ refute_nil el_location . y
171
+ refute_nil image_location . x
172
+ refute_nil image_location . y
161
173
162
174
el_size = el . size
163
175
image_size = image_element . size
164
- assert_in_delta el_size . width , image_size . width , 13
165
- assert_in_delta el_size . height , image_size . height , 13
176
+ refute_nil el_size . width
177
+ refute_nil el_size . height
178
+ refute_nil image_size . width
179
+ refute_nil image_size . height
166
180
167
181
el_rect = el . rect
168
182
image_rect = image_element . rect
169
- assert_in_delta el_rect . x , image_rect . x , 13
170
- assert_in_delta el_rect . y , image_rect . y , 13
171
- assert_in_delta el_rect . width , image_rect . width , 13
172
- assert_in_delta el_rect . height , image_rect . height , 13
183
+ refute_nil el_rect . x
184
+ refute_nil el_rect . y
185
+ refute_nil image_rect . x
186
+ refute_nil image_rect . y
187
+ refute_nil el_rect . width
188
+ refute_nil el_rect . height
189
+ refute_nil image_rect . width
190
+ refute_nil image_rect . height
173
191
174
192
assert_equal el . displayed? , image_element . displayed?
175
193
image_element . click
0 commit comments