Skip to content

Commit cd32fde

Browse files
committed
1 parent b62e612 commit cd32fde

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

core/device/emulator.py

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import os
55
import time
66

7+
from core.device.device import Device
78
from core.device.helpers.adb import Adb
89
from core.osutils.command import run
910
from core.osutils.command_log_level import CommandLogLevel
@@ -81,9 +82,17 @@ def wait(device_id, timeout=300):
8182
booted = Emulator.is_running(device_id=device_id)
8283
if (booted is True) or (time.time() > end_time):
8384
break
85+
8486
# If booted, make sure screen will not lock
8587
if booted:
8688
Adb.run(command='shell settings put system screen_off_timeout -1', device_id=device_id)
89+
90+
# If booted, make sure screen will not lock
91+
if booted:
92+
text = Adb.get_page_source(device_id=device_id)
93+
if "android.process.acore" in text:
94+
print "Error dialog detected! Try to kill it..."
95+
Device.click(device_id=device_id, text="OK", timeout=10)
8796
return booted
8897

8998
@staticmethod

tests/build/ios/prepare_ios_tests.py

+15-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from core.osutils.command import run
1010
from core.osutils.file import File
1111
from core.osutils.folder import Folder
12-
from core.settings.settings import IOS_RUNTIME_PATH, CURRENT_OS, OSType, TEST_RUN_HOME
12+
from core.settings.settings import IOS_RUNTIME_PATH, CURRENT_OS, OSType, TEST_RUN_HOME, ANDROID_RUNTIME_PATH
1313
from core.tns.replace_helper import ReplaceHelper
1414
from core.tns.tns import Tns
1515
from core.tns.tns_platform_type import Platform
@@ -32,6 +32,7 @@ def setUp(self):
3232
def test_100_prepare_ios(self):
3333
Tns.create_app(self.app_name)
3434
Tns.platform_add_ios(attributes={"--path": self.app_name, "--frameworkPath": IOS_RUNTIME_PATH})
35+
Tns.platform_add_android(attributes={"--path": self.app_name, "--frameworkPath": ANDROID_RUNTIME_PATH})
3536

3637
# Initial prepare should be full.
3738
output = Tns.prepare_ios(attributes={"--path": self.app_name})
@@ -54,6 +55,18 @@ def test_100_prepare_ios(self):
5455
result = re.search("Schemes:\n\s*TestApp", output)
5556
assert result is not None
5657

58+
# Initial prepare for other platform (Android) should be full.
59+
output = Tns.prepare_android(attributes={"--path": self.app_name})
60+
TnsAsserts.prepared(self.app_name, platform=Platform.ANDROID, output=output, prepare=Prepare.FULL)
61+
62+
# Prepare original platform (iOS) should be skipped.
63+
output = Tns.prepare_ios(attributes={"--path": self.app_name}, assert_success=False)
64+
TnsAsserts.prepared(self.app_name, platform=Platform.IOS, output=output, prepare=Prepare.SKIP)
65+
66+
# Initial prepare for other platform (Android) should be skipped.
67+
output = Tns.prepare_android(attributes={"--path": self.app_name}, assert_success=False)
68+
TnsAsserts.prepared(self.app_name, platform=Platform.ANDROID, output=output, prepare=Prepare.SKIP)
69+
5770
def test_200_prepare_additional_appresources(self):
5871
Tns.create_app(self.app_name)
5972
Tns.platform_add_ios(attributes={"--path": self.app_name, "--frameworkPath": IOS_RUNTIME_PATH})
@@ -98,7 +111,7 @@ def test_220_build_ios_with_custom_plist(self):
98111
# Prepare in release
99112
Tns.prepare_ios(attributes={"--path": self.app_name, '--release': ''})
100113
assert "<string>fbXXXXXXXXX</string>" in File.read(final_plist)
101-
assert not "<string>orgnativescriptTestApp</string>" in File.read(final_plist)
114+
assert "<string>orgnativescriptTestApp</string>" not in File.read(final_plist)
102115

103116
def test_300_prepare_ios_preserve_case(self):
104117
Tns.create_app(self.app_name)

0 commit comments

Comments
 (0)