Skip to content

Commit 50eaeba

Browse files
Vasil ChimevVasil Chimev
Vasil Chimev
authored and
Vasil Chimev
committed
Fix LiveSync iOS device tests.
1 parent a44db5f commit 50eaeba

File tree

1 file changed

+28
-40
lines changed

1 file changed

+28
-40
lines changed

tests/livesync_ios.py

Lines changed: 28 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@
44
from helpers._os_lib import CleanupFolder, replace, catAppFile, uninstall_app
55
from helpers._tns_lib import iosRuntimePath, \
66
CreateProjectAndAddPlatform, LiveSync, Run
7-
from helpers.device import GivenRealDeviceRunning
7+
from helpers.device import GivenRealDeviceRunning, \
8+
StopEmulators, StopSimulators
89

910
class LiveSync_iOS(unittest.TestCase):
1011

11-
# LiveSync Tests on Android Emulator
12+
# LiveSync Tests on iOS Device
13+
14+
@classmethod
15+
def setUpClass(cls):
16+
StopEmulators()
17+
StopSimulators()
1218

1319
def setUp(self):
1420

@@ -25,22 +31,31 @@ def setUp(self):
2531
def tearDown(self):
2632
pass
2733

28-
def test_001_LiveSync_iOS_XmlFile(self):
34+
@classmethod
35+
def tearDownClass(cls):
36+
pass
37+
38+
def test_001_LiveSync_iOS_XmlJsCss_Files(self):
2939
CreateProjectAndAddPlatform(projName="TNS_App", platform="ios", frameworkPath=iosRuntimePath)
3040
Run(platform="ios", path="TNS_App")
3141

3242
replace("TNS_App/app/main-page.xml", "TAP", "TEST")
43+
replace("TNS_App/app/main-view-model.js", "taps", "clicks")
44+
replace("TNS_App/app/app.css", "30", "20")
3345
LiveSync(platform="ios", path="TNS_App")
3446

3547
output = catAppFile("ios", "TNSApp", "app/main-page.xml")
3648
assert ("<Button text=\"TEST\" tap=\"{{ tapAction }}\" />" in output)
49+
output = catAppFile("ios", "TNSApp", "app/main-view-model.js")
50+
assert ("this.set(\"message\", this.counter + \" clicks left\");" in output)
51+
output = catAppFile("ios", "TNSApp", "app/app.css")
52+
assert ("font-size: 20;" in output)
3753

3854
def test_002_LiveSync_iOS_Device_XmlFile(self):
3955
CreateProjectAndAddPlatform(projName="TNS_App", platform="ios", frameworkPath=iosRuntimePath)
4056
Run(platform="ios", path="TNS_App")
4157

4258
replace("TNS_App/app/main-view-model.js", "taps", "clicks")
43-
# a0036be7bace11a09a86fd5a31fca9c8c105011f
4459
LiveSync(platform="ios", device="54dec253cfb494a373ca281e12b2b0fc4912aec1", path="TNS_App")
4560

4661
output = catAppFile("ios", "TNSApp", "app/main-view-model.js")
@@ -49,47 +64,20 @@ def test_002_LiveSync_iOS_Device_XmlFile(self):
4964
@unittest.skip("TODO: Fix this test.")
5065
def test_004_LiveSync_iOS_Watch(self):
5166
pass
52-
53-
def test_011_LiveSync_iOS_JsFile(self):
54-
CreateProjectAndAddPlatform(projName="TNS_App", platform="ios", frameworkPath=iosRuntimePath)
55-
Run(platform="ios", path="TNS_App")
56-
57-
replace("TNS_App/app/main-view-model.js", "taps", "clicks")
58-
LiveSync(platform="ios", path="TNS_App")
59-
60-
output = catAppFile("ios", "TNSApp", "app/main-view-model.js")
61-
assert ("this.set(\"message\", this.counter + \" clicks left\");" in output)
62-
63-
def test_012_LiveSync_iOS_CssFile(self):
64-
CreateProjectAndAddPlatform(projName="TNS_App", platform="ios", frameworkPath=iosRuntimePath)
65-
Run(platform="ios", path="TNS_App")
66-
67-
replace("TNS_App/app/app.css", "30", "20")
68-
LiveSync(platform="ios", path="TNS_App")
69-
70-
output = catAppFile("ios", "TNSApp", "app/app.css")
71-
assert ("font-size: 20;" in output)
72-
73-
def test_013_LiveSync_iOS_TnsModules_File(self):
74-
CreateProjectAndAddPlatform(projName="TNS_App", platform="ios", frameworkPath=iosRuntimePath)
75-
Run(platform="ios", path="TNS_App")
76-
77-
replace("TNS_App/app/tns_modules/application/application-common.js", "(\"globals\");", "(\"globals\"); // test")
78-
LiveSync(platform="ios", path="TNS_App")
79-
80-
output = catAppFile("ios", "TNSApp", "app/tns_modules/application/application-common.js")
81-
assert ("require(\"globals\"); // test" in output)
82-
83-
def test_014_LiveSync_iOS_TnsModules_LICENSE(self):
67+
68+
def test_011_LiveSync_iOS_TnsModules_Files(self):
8469
CreateProjectAndAddPlatform(projName="TNS_App", platform="ios", frameworkPath=iosRuntimePath)
8570
Run(platform="ios", path="TNS_App")
86-
87-
replace("TNS_App/app/tns_modules/LICENSE", "2015", "9999")
71+
72+
replace("TNS_App/node_modules/tns-core-modules/LICENSE", "2015", "9999")
73+
replace("TNS_App/node_modules/tns-core-modules/application/application-common.js", "(\"globals\");", "(\"globals\"); // test")
8874
LiveSync(platform="ios", path="TNS_App")
89-
75+
9076
output = catAppFile("ios", "TNSApp", "app/tns_modules/LICENSE")
9177
assert ("Copyright (c) 9999 Telerik AD" in output)
92-
78+
output = catAppFile("ios", "TNSApp", "app/tns_modules/application/application-common.js")
79+
assert ("require(\"globals\"); // test" in output)
80+
9381
def test_021_LiveSync_iOS_AddNewFiles(self):
9482
CreateProjectAndAddPlatform(projName="TNS_App", platform="ios", frameworkPath=iosRuntimePath)
9583
Run(platform="ios", path="TNS_App")

0 commit comments

Comments
 (0)