Skip to content

Commit 881227d

Browse files
committed
update changes in hello world ng template
1 parent ab1f187 commit 881227d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

data/changes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class NGHelloWorld(object):
6666
old_value='Ter Stegen', new_value='Unknown',
6767
old_text='Ter Stegen', new_text='Unknown')
6868
CSS = ChangeSet(file_path=os.path.join('src', 'app.css'),
69-
old_value='}', new_value='}\nListView { background-color: pink;}\n',
69+
old_value='}', new_value='}\nLabel{background-color:pink;}\n',
7070
old_color=Colors.WHITE, new_color=Colors.PINK)
7171
HTML = ChangeSet(file_path=os.path.join('src', 'app', 'item', 'items.component.html'), old_value='"item.name"',
7272
new_value='"item.id"', old_text=None, new_text=None)

data/sync/hello_world_ng.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
from core.enums.device_type import DeviceType
99
from core.enums.platform_type import Platform
1010
from core.enums.os_type import OSType
11+
from core.log.log import Log
1112
from core.settings import Settings
13+
from core.utils.wait import Wait
1214
from data.changes import Changes, Sync
1315
from data.const import Colors
1416
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
9092
device=device)
9193
TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings, timeout=180,
9294
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!')
9498

9599
# Revert changes
96100
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
116120
device=device)
117121
TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings, timeout=180,
118122
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!')
120126

121127
# Assert final and initial states are same
122128
initial_state = os.path.join(Settings.TEST_OUT_IMAGES, device.name, 'initial_state.png')

0 commit comments

Comments
 (0)