Skip to content

Commit 38a3ed5

Browse files
committed
Fix provisioning tests and add test for tns run without devices
1 parent 8e4e0fa commit 38a3ed5

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

tests/build/ios/build_ios_provision_tests.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ def test_200_build_ios_list_provisions(self):
4646
assert PROVISIONING in output
4747
assert DEVELOPMENT_TEAM in output
4848

49-
@unittest.skipIf(float(Xcode.get_version()) >= 9.0,
50-
"Skip on Xcode9 because of https://github.com/NativeScript/nativescript-cli/issues/3046")
49+
@unittest.skipIf("9." in Xcode.get_version(),
50+
"Skip on Xcode 9 because of https://github.com/NativeScript/nativescript-cli/issues/3046")
5151
def test_201_build_ios_with_provision(self):
5252
build_attributes = {"--path": self.app_name, "--forDevice": "", "--release": "", "--provision": PROVISIONING}
5353
Tns.build_ios(attributes=build_attributes)
5454

55-
@unittest.skipIf(float(Xcode.get_version()) >= 9.0,
56-
"Skip on Xcode9 because of https://github.com/NativeScript/nativescript-cli/issues/3046")
55+
@unittest.skipIf("9." in Xcode.get_version(),
56+
"Skip on Xcode 9 because of https://github.com/NativeScript/nativescript-cli/issues/3046")
5757
def test_202_build_ios_with_distribution_provision(self):
5858
build_attributes = {"--path": self.app_name, "--forDevice": "", "--release": "",
5959
"--provision": DISTRIBUTION_PROVISIONING}

tests/simulator/run_ios_tests.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import os
1515
import time
16+
import unittest
1617

1718
import nose
1819
from flaky import flaky
@@ -367,7 +368,7 @@ def test_390_tns_run_ios_should_warn_if_package_ids_do_not_match(self):
367368
str2 = "<string>${EXECUTABLE_NAME}</string>" \
368369
"<key>CFBundleIdentifier</key>" \
369370
"<string>org.nativescript.myapp</string>"
370-
info = os.path.join(self.app_name, 'app', 'App_Resources','iOS','Info.plist')
371+
info = os.path.join(self.app_name, 'app', 'App_Resources', 'iOS', 'Info.plist')
371372
File.replace(file_path=info, str1=str1, str2=str2)
372373
output = Tns.run_ios(attributes={'--path': self.app_name, '--justlaunch': ''})
373374
assert "[WARNING]: The CFBundleIdentifier key inside the 'Info.plist' will be overriden" in output
@@ -389,3 +390,11 @@ def test_404_run_on_invalid_device_id(self):
389390
assert_success=False)
390391
assert cannot_resolve_device in output
391392
assert list_devices in output
393+
394+
@unittest.skipIf(Device.get_count(platform=Platform.IOS) > 0, "Valid only if there are no devices.")
395+
def test_410_run_without_platform_and_without_devices(self):
396+
Simulator.stop()
397+
Tns.create_app(self.app_name, update_modules=True)
398+
output = Tns.run(attributes={'--path': self.app_name, '--justlaunch': ''}, assert_success=False)
399+
assert "Unable to find applicable devices to execute operation " \
400+
"and unable to start emulator when platform is not specified" in output

0 commit comments

Comments
 (0)