Skip to content

fix: livesync failures #438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/utils/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def start():
run(cmd=cmd, wait=False)
Log.info('Starting docker!')
elif OSUtils.is_catalina():
if not Process.is_running_by_name('docker'):
if not Process.is_running_by_name('Docker'):
cmd = 'open --background -a Docker'
run(cmd=cmd, wait=False)
Log.info('Starting docker!')
Expand Down
16 changes: 8 additions & 8 deletions data/changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class NGHelloWorld(object):
old_value='Ter Stegen', new_value='Unknown',
old_text='Ter Stegen', new_text='Unknown')
CSS = ChangeSet(file_path=os.path.join('src', 'app.css'),
old_value='}', new_value='}\nListView { background-color: pink;}\n',
old_value='}', new_value='}\nLabel{background-color:pink;}\n',
old_color=Colors.WHITE, new_color=Colors.PINK)
HTML = ChangeSet(file_path=os.path.join('src', 'app', 'item', 'items.component.html'), old_value='"item.name"',
new_value='"item.id"', old_text=None, new_text=None)
Expand Down Expand Up @@ -105,20 +105,20 @@ class MasterDetailNG(object):

# This change should make background of items on home page purple
SCSS_NESTED_COMMON = ChangeSet(file_path=os.path.join('src', 'app', 'cars', '_car-list.component.scss'),
old_value='$background-color: background',
new_value='$background-color: purple',
old_color=Colors.WHITE, new_color=Colors.PURPLE_CUSTOM)
old_value='background-alt-10);',
new_value='background-alt-10);\nbackground-color: yellow;',
old_color=Colors.WHITE, new_color=Colors.YELLOW)

# This change should make icons on home page yellow
SCSS_NESTED_ANDROID = ChangeSet(file_path=os.path.join('src', 'app', 'cars', 'car-list.component.android.scss'),
old_value='Android here',
new_value='Android here\n.cars-list__item{ color: yellow; }\n',
old_color=None, new_color=Colors.YELLOW)
new_value='Android here\n.cars-list__item-name{background-color: orange;}\n',
old_color=None, new_color=Colors.ORANGE)

SCSS_NESTED_IOS = ChangeSet(file_path=os.path.join('src', 'app', 'cars', 'car-list.component.ios.scss'),
old_value='iOS here',
new_value='iOS here\n.cars-list__item{ color: yellow; }\n',
old_color=None, new_color=Colors.YELLOW)
new_value='iOS here\n.cars-list__item-name{background-color: orange;}\n',
old_color=None, new_color=Colors.ORANGE)

class JSTabNavigation(object):
JS = ChangeSet(file_path=os.path.join('app', 'home', 'home-items-view-model.js'),
Expand Down
1 change: 1 addition & 0 deletions data/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ class Colors(object):
PURPLE_CUSTOM = numpy.array([255, 48, 129]) # A bit custom purple (when apply purple on master-detail).
YELLOW = numpy.array([0, 255, 255]) # Yellow (standard CSS color).
YELLOW_ICON = numpy.array([0, 242, 255]) # Yellow of star.png
ORANGE = numpy.array([0, 165, 255]) # Orange (standard CSS color).
GREEN_ICON = numpy.array([0, 128, 0]) # Green of background colour of resources generate images
10 changes: 8 additions & 2 deletions data/sync/hello_world_ng.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
from core.enums.device_type import DeviceType
from core.enums.platform_type import Platform
from core.enums.os_type import OSType
from core.log.log import Log
from core.settings import Settings
from core.utils.wait import Wait
from data.changes import Changes, Sync
from data.const import Colors
from products.nativescript.preview_helpers import Preview
Expand Down Expand Up @@ -90,7 +92,9 @@ def sync_hello_world_ng(app_name, platform, device, bundle=True, uglify=False, a
device=device)
TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings, timeout=180,
not_existing_string_list=not_existing_string_list)
device.wait_for_main_color(color=Changes.NGHelloWorld.CSS.new_color)
assert Wait.until(lambda: device.get_pixels_by_color(color=Changes.NGHelloWorld.CSS.new_color) > 100), \
'CSS on root level not applied!'
Log.info('CSS on root level applied successfully!')

# Revert changes
Sync.revert(app_name=app_name, change_set=Changes.NGHelloWorld.HTML)
Expand All @@ -116,7 +120,9 @@ def sync_hello_world_ng(app_name, platform, device, bundle=True, uglify=False, a
device=device)
TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings, timeout=180,
not_existing_string_list=not_existing_string_list)
device.wait_for_main_color(color=Colors.WHITE)
assert Wait.until(lambda: device.get_pixels_by_color(color=Changes.NGHelloWorld.CSS.new_color) < 100), \
'CSS on root level not applied!'
Log.info('CSS on root level applied successfully!')

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