Skip to content

Commit 8a29895

Browse files
author
vhristov5555
committed
Merge remote-tracking branch 'origin/master'
2 parents ef2ad4b + 8c4c1ae commit 8a29895

9 files changed

+28
-34
lines changed

tests/build/android/plugin_android_tests.py

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import os
66
import time
7+
import unittest
78

89
from core.base_class.BaseClass import BaseClass
910
from core.device.helpers.adb import Adb
@@ -129,6 +130,7 @@ def test_300_build_app_with_plugin_added_outside_project(self):
129130
output = Tns.run_tns_command("plugin", attributes={"--path": self.app_name})
130131
assert tns_plugin in output
131132

133+
@unittest.skip("Temporary issues with jcenter.")
132134
def test_390_plugin_with_promise_in_hooks(self):
133135
Tns.plugin_add("[email protected]", attributes={"--path": self.app_name})
134136
output = Tns.prepare_android(attributes={"--path": self.app_name}, assert_success=False)

tests/build/android/prepare_android_tests.py

+2
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ def test_310_prepare_should_flatten_scoped_dependencies(self):
138138
ng_path = os.path.join(self.app_name, TnsAsserts.PLATFORM_ANDROID_NPM_MODULES_PATH, '@angular', 'core')
139139
assert File.exists(ng_path), "Scoped dependencies are flattened, please see #1783!"
140140

141+
# TODO: Remove Java related skipping after nativescript-facebook/demo uses android >= 4.1.0
142+
@unittest.skipIf(Java.version() != "1.8", "Run only if Java version is 8.")
141143
@unittest.skipIf(CURRENT_OS == OSType.WINDOWS, "Skip on Windows")
142144
def test_320_prepare_scoped_plugins(self):
143145
"""

tests/device/run_ios_device_tests.py

+3-11
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"""
1717

1818
import os
19+
import unittest
1920
from datetime import datetime
2021
from time import sleep
2122

@@ -201,9 +202,11 @@ def test_310_tns_run_ios_emulator_should_run_only_on_emulator(self):
201202
for device_id in self.DEVICES:
202203
assert app_id + " on device " + device_id not in output, 'App is deployed on {0} device.'.format(device_id)
203204

205+
@unittest.skip("Skip because of https://github.com/NativeScript/nativescript-cli/issues/3644")
204206
def test_320_tns_run_ios_specific_device(self):
205207
"""
206208
`tns run ios --device` should run only on specified device
209+
This will also verify justlaunch release console after it completes.
207210
"""
208211
self.SIMULATOR_ID = Simulator.ensure_available(simulator_name=SIMULATOR_NAME)
209212
output = Tns.run_ios(attributes={'--path': self.app_name, '--device': self.DEVICE_ID, '--justlaunch': ''},
@@ -292,14 +295,3 @@ def test_400_tns_run_ios_should_not_crash_when_uninstall_app(self):
292295
strings = ['Successfully installed', 'Successfully synced application']
293296
Tns.wait_for_log(log_file=log, string_list=strings, timeout=180, check_interval=10)
294297
assert Device.wait_for_text(device_id=self.DEVICE_ID, text="TEST"), "XML changes not synced on device!"
295-
296-
def test_404_tns_run_ios_on_not_existing_device_should_not_start_simualtor(self):
297-
"""
298-
`tns run ios --device fakeID` should show error and emulator should not be started (test for issue #2728)
299-
"""
300-
Simulator.stop()
301-
output = Tns.run_ios(attributes={'--path': self.app_name, '--device': 'fakeID', '--justlaunch': ''},
302-
assert_success=False)
303-
TnsAsserts.invalid_device(output=output)
304-
sleep(10)
305-
assert not Simulator.is_running()[0], 'iOS Simulator started by `tns run ios --device fakeID`!'

tests/regression/regression_tests_js.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,17 @@ def test_100_run_android(self):
7373
Helpers.android_screen_match(image=self.image_original, timeout=80)
7474

7575
# Change JS, XML and CSS
76-
ReplaceHelper.replace(self.app_name, self.js_change)
77-
ReplaceHelper.replace(self.app_name, self.xml_change)
78-
ReplaceHelper.replace(self.app_name, self.css_change)
76+
ReplaceHelper.replace(self.app_name, self.js_change, sleep=10)
77+
ReplaceHelper.replace(self.app_name, self.xml_change, sleep=10)
78+
ReplaceHelper.replace(self.app_name, self.css_change, sleep=10)
7979

8080
# Verify application looks correct
8181
Helpers.android_screen_match(image=self.image_change, timeout=80)
8282

8383
# Revert changes
84-
ReplaceHelper.rollback(self.app_name, self.js_change)
85-
ReplaceHelper.rollback(self.app_name, self.xml_change)
86-
ReplaceHelper.rollback(self.app_name, self.css_change)
84+
ReplaceHelper.rollback(self.app_name, self.js_change, sleep=10)
85+
ReplaceHelper.rollback(self.app_name, self.xml_change, sleep=10)
86+
ReplaceHelper.rollback(self.app_name, self.css_change, sleep=10)
8787

8888
# Verify application looks correct
8989
Helpers.android_screen_match(image=self.image_original, timeout=80)

tests/regression/regression_tests_ng.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,17 @@ def test_100_run_android(self):
7171
Helpers.android_screen_match(image=self.image_original, timeout=80)
7272

7373
# Change JS, XML and CSS
74-
ReplaceHelper.replace(self.app_name, self.ts_change)
75-
ReplaceHelper.replace(self.app_name, self.html_change)
76-
ReplaceHelper.replace(self.app_name, self.css_change)
74+
ReplaceHelper.replace(self.app_name, self.ts_change, sleep=10)
75+
ReplaceHelper.replace(self.app_name, self.html_change, sleep=10)
76+
ReplaceHelper.replace(self.app_name, self.css_change, sleep=10)
7777

7878
# Verify application looks correct
7979
Helpers.android_screen_match(image=self.image_change, timeout=80)
8080

8181
# Revert changes
82-
ReplaceHelper.rollback(self.app_name, self.html_change)
83-
ReplaceHelper.rollback(self.app_name, self.ts_change)
84-
ReplaceHelper.rollback(self.app_name, self.css_change)
82+
ReplaceHelper.rollback(self.app_name, self.html_change, sleep=10)
83+
ReplaceHelper.rollback(self.app_name, self.ts_change, sleep=10)
84+
ReplaceHelper.rollback(self.app_name, self.css_change, sleep=10)
8585

8686
# Verify application looks correct
8787
Helpers.android_screen_match(image=self.image_original, timeout=80)

tests/simulator/run_ios_tests.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,8 @@ def test_390_tns_run_ios_should_warn_if_package_ids_do_not_match(self):
500500
"<string>org.nativescript.myapp</string>"
501501
info = os.path.join(self.app_name, 'app', 'App_Resources', 'iOS', 'Info.plist')
502502
File.replace(file_path=info, str1=str1, str2=str2)
503-
output = Tns.run_ios(attributes={'--path': self.app_name, '--justlaunch': ''})
503+
# `--emulator` added to workaround https://github.com/NativeScript/nativescript-cli/issues/3644
504+
output = Tns.run_ios(attributes={'--path': self.app_name, '--emulator': '', '--justlaunch': ''})
504505
assert "[WARNING]: The CFBundleIdentifier key inside the 'Info.plist' will be overriden" in output
505506
assert "Successfully synced application org.nativescript.TestApp" in output
506507

@@ -511,12 +512,13 @@ def test_400_tns_run_on_folder_with_spaces(self):
511512
destination_path = os.path.join(TEST_RUN_HOME, "folder with spaces", "Test App")
512513
Folder.cleanup(folder=destination_path)
513514
Folder.copy(src=self.app_name, dst=destination_path)
514-
output = Tns.run_ios(attributes={'--path': "\"" + destination_path + "\"", '--justlaunch': ''})
515+
output = Tns.run_ios(
516+
attributes={'--path': "\"" + destination_path + "\"", '--emulator': '', '--justlaunch': ''})
515517
assert "Multiple errors were thrown" not in output
516518
assert "fail" not in output
517519

518520
@unittest.skip("Ignore because of https://github.com/NativeScript/nativescript-cli/issues/3625")
519-
def test_404_run_on_invalid_device_id(self):
521+
def test_404_tns_run_ios_on_not_existing_device_should_not_start_simulator(self):
520522
Simulator.stop()
521523
output = Tns.run_ios(attributes={'--path': self.app_name, '--device': 'fakeId', '--justlaunch': ''},
522524
assert_success=False)

tests/webpack/hello_world_js_tests.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ def apply_changes(app_name, log, platform):
6868

6969
ReplaceHelper.replace(app_name, WebPackHelloWorldJS.css_change, sleep=10)
7070
if platform == Platform.ANDROID:
71-
strings = ['Successfully transferred app.css', 'Successfully synced application']
72-
Tns.wait_for_log(log_file=log, string_list=strings, clean_log=False)
71+
Tns.wait_for_log(log_file=log, string_list=['app.css'], clean_log=False)
7372

7473
Tns.wait_for_log(log_file=log, string_list=Helpers.wp_sync, not_existing_string_list=Helpers.wp_errors,
7574
timeout=120)

tests/webpack/hello_world_ng_tests.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,11 @@ def apply_changes(app_name, log, platform):
6565

6666
ReplaceHelper.replace(app_name, WebPackHelloWorldNG.html_change, sleep=10)
6767
if platform == Platform.ANDROID:
68-
strings = ['Successfully transferred items.component.html', 'Successfully synced application']
69-
Tns.wait_for_log(log_file=log, string_list=strings, clean_log=False)
68+
Tns.wait_for_log(log_file=log, string_list=['items.component.html'], clean_log=False)
7069

7170
ReplaceHelper.replace(app_name, WebPackHelloWorldNG.css_change, sleep=10)
7271
if platform == Platform.ANDROID:
73-
strings = ['Successfully transferred app.css', 'Successfully synced application']
74-
Tns.wait_for_log(log_file=log, string_list=strings, clean_log=False)
72+
Tns.wait_for_log(log_file=log, string_list=['app.css'], clean_log=False)
7573

7674
Tns.wait_for_log(log_file=log, string_list=Helpers.wp_sync, not_existing_string_list=Helpers.wp_errors,
7775
timeout=120)

tests/webpack/hello_world_ts_tests.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ def apply_changes(app_name, log, platform):
7070

7171
ReplaceHelper.replace(app_name, WebPackHelloWorldTS.css_change, sleep=10)
7272
if platform == Platform.ANDROID:
73-
strings = ['Successfully transferred app.css', 'Successfully synced application']
74-
Tns.wait_for_log(log_file=log, string_list=strings, clean_log=False)
73+
Tns.wait_for_log(log_file=log, string_list=['app.css'], clean_log=False)
7574

7675
Tns.wait_for_log(log_file=log, string_list=Helpers.wp_sync, not_existing_string_list=Helpers.wp_errors,
7776
timeout=120)

0 commit comments

Comments
 (0)