8
8
from core .enums .device_type import DeviceType
9
9
from core .enums .platform_type import Platform
10
10
from core .enums .os_type import OSType
11
+ from core .log .log import Log
11
12
from core .settings import Settings
13
+ from core .utils .wait import Wait
12
14
from data .changes import Changes , Sync
13
15
from data .const import Colors
14
16
from products .nativescript .preview_helpers import Preview
@@ -90,7 +92,9 @@ def sync_hello_world_ng(app_name, platform, device, bundle=True, uglify=False, a
90
92
device = device )
91
93
TnsLogs .wait_for_log (log_file = result .log_file , string_list = strings , timeout = 180 ,
92
94
not_existing_string_list = not_existing_string_list )
93
- device .wait_for_main_color (color = Changes .NGHelloWorld .CSS .new_color )
95
+ assert Wait .until (lambda : device .get_pixels_by_color (color = Changes .NGHelloWorld .CSS .new_color ) > 100 ), \
96
+ 'CSS on root level not applied!'
97
+ Log .info ('CSS on root level applied successfully!' )
94
98
95
99
# Revert changes
96
100
Sync .revert (app_name = app_name , change_set = Changes .NGHelloWorld .HTML )
@@ -116,7 +120,9 @@ def sync_hello_world_ng(app_name, platform, device, bundle=True, uglify=False, a
116
120
device = device )
117
121
TnsLogs .wait_for_log (log_file = result .log_file , string_list = strings , timeout = 180 ,
118
122
not_existing_string_list = not_existing_string_list )
119
- device .wait_for_main_color (color = Colors .WHITE )
123
+ assert Wait .until (lambda : device .get_pixels_by_color (color = Changes .NGHelloWorld .CSS .new_color ) < 100 ), \
124
+ 'CSS on root level not applied!'
125
+ Log .info ('CSS on root level applied successfully!' )
120
126
121
127
# Assert final and initial states are same
122
128
initial_state = os .path .join (Settings .TEST_OUT_IMAGES , device .name , 'initial_state.png' )
0 commit comments