1
1
import unittest
2
2
3
3
from helpers ._os_lib import CleanupFolder , runAUT , FileExists
4
- from helpers ._tns_lib import Build , iosRuntimePath , \
4
+ from helpers ._tns_lib import Build , iosRuntimeSymlinkPath , \
5
5
tnsPath , CreateProject , PlatformAdd , Prepare
6
6
7
7
class Plugins_OSX_Pods (unittest .TestCase ):
@@ -14,10 +14,10 @@ def setUp(self):
14
14
print "#####"
15
15
print ""
16
16
17
- CleanupFolder ('./TNS_App' );
17
+ CleanupFolder ('./TNS_App' )
18
18
19
19
def tearDown (self ):
20
- CleanupFolder ( './TNS_App' );
20
+ pass
21
21
22
22
def test_001_PluginAdd_Pod_GoogleMaps_Before_PlatformAdd_iOS (self ):
23
23
CreateProject (projName = "TNS_App" );
@@ -33,7 +33,7 @@ def test_001_PluginAdd_Pod_GoogleMaps_Before_PlatformAdd_iOS(self):
33
33
assert ("dependencies" in output )
34
34
assert ("googlesdk" in output )
35
35
36
- PlatformAdd (platform = "ios" , frameworkPath = iosRuntimePath , path = "TNS_App" )
36
+ PlatformAdd (platform = "ios" , frameworkPath = iosRuntimeSymlinkPath , path = "TNS_App" )
37
37
output = Prepare (platform = "ios" , path = "TNS_App" )
38
38
assert ("Installing pods..." in output )
39
39
assert ("Successfully prepared plugin googlesdk for ios." in output )
@@ -52,7 +52,7 @@ def test_001_PluginAdd_Pod_GoogleMaps_Before_PlatformAdd_iOS(self):
52
52
53
53
def test_002_PluginAdd_Pod_GoogleMaps_After_PlatformAdd_iOS (self ):
54
54
CreateProject (projName = "TNS_App" );
55
- PlatformAdd (platform = "ios" , frameworkPath = iosRuntimePath , path = "TNS_App" )
55
+ PlatformAdd (platform = "ios" , frameworkPath = iosRuntimeSymlinkPath , path = "TNS_App" )
56
56
57
57
output = runAUT (tnsPath + " plugin add QA-TestApps/CocoaPods/googlesdk --path TNS_App" )
58
58
assert ("TNS_App/node_modules/googlesdk" in output )
@@ -77,9 +77,105 @@ def test_002_PluginAdd_Pod_GoogleMaps_After_PlatformAdd_iOS(self):
77
77
output = runAUT ("cat TNS_App/platforms/ios/TNSApp.xcworkspace/contents.xcworkspacedata" )
78
78
assert ("location = \" group:TNSApp.xcodeproj\" >" in output )
79
79
assert ("location = \" group:Pods/Pods.xcodeproj\" >" in output )
80
+ assert FileExists ("TNS_App/platforms/ios/Pods/Pods.xcodeproj" )
81
+
82
+ def test_003_PluginAdd_MultiplePods (self ):
83
+ CreateProject (projName = "TNS_App" );
84
+ PlatformAdd (platform = "ios" , frameworkPath = iosRuntimeSymlinkPath , path = "TNS_App" )
85
+
86
+ output = runAUT (tnsPath + " plugin add QA-TestApps/CocoaPods/carousel --path TNS_App" )
87
+ assert ("TNS_App/node_modules/carousel" in output )
88
+ assert ("Successfully installed plugin carousel." in output )
89
+ assert FileExists ("TNS_App/node_modules/carousel/package.json" )
90
+ assert FileExists ("TNS_App/node_modules/carousel/platforms/ios/Podfile" )
91
+
92
+ output = runAUT ("cat TNS_App/package.json" )
93
+ assert ("carousel" in output )
94
+
95
+ output = runAUT (tnsPath + " plugin add QA-TestApps/CocoaPods/keychain --path TNS_App" )
96
+ assert ("TNS_App/node_modules/keychain" in output )
97
+ assert ("Successfully installed plugin keychain." in output )
98
+ assert FileExists ("TNS_App/node_modules/keychain/package.json" )
99
+ assert FileExists ("TNS_App/node_modules/keychain/platforms/ios/Podfile" )
100
+
101
+ output = runAUT ("cat TNS_App/package.json" )
102
+ assert ("keychain" in output )
103
+
104
+ output = Build (platform = "ios" , path = "TNS_App" )
105
+ assert ("Installing pods..." in output )
106
+ assert ("Successfully prepared plugin carousel for ios." in output )
107
+ assert ("Successfully prepared plugin keychain for ios." in output )
80
108
109
+ output = runAUT ("cat TNS_App/platforms/ios/Podfile" )
110
+ assert ("pod 'iCarousel'" in output )
111
+ assert ("pod 'AFNetworking'" in output )
112
+ assert ("pod 'UICKeyChainStore'" in output )
113
+
114
+ output = runAUT ("cat TNS_App/platforms/ios/TNSApp.xcworkspace/contents.xcworkspacedata" )
115
+ assert ("location = \" group:TNSApp.xcodeproj\" >" in output )
116
+ assert ("location = \" group:Pods/Pods.xcodeproj\" >" in output )
81
117
assert FileExists ("TNS_App/platforms/ios/Pods/Pods.xcodeproj" )
82
118
119
+ def test_004_Prepare_Install_Pods (self ):
120
+ CreateProject (projName = "TNS_App" );
121
+ PlatformAdd (platform = "ios" , frameworkPath = iosRuntimeSymlinkPath , path = "TNS_App" )
122
+
123
+ runAUT ("cp QA-TestApps/CocoaPods/carousel/platforms/ios/Podfile TNS_App/platforms/ios" )
124
+ output = Build (platform = "ios" , path = "TNS_App" )
125
+ assert ("Creating project scheme..." in output )
126
+ assert ("Installing pods..." in output )
127
+
128
+ output = runAUT ("cat TNS_App/platforms/ios/Podfile" )
129
+ assert ("pod 'iCarousel'" in output )
130
+ assert ("pod 'AFNetworking'" in output )
131
+
132
+ output = runAUT ("cat TNS_App/platforms/ios/TNSApp.xcworkspace/contents.xcworkspacedata" )
133
+ assert ("location = \" group:TNSApp.xcodeproj\" >" in output )
134
+ assert ("location = \" group:Pods/Pods.xcodeproj\" >" in output )
135
+ assert FileExists ("TNS_App/platforms/ios/Pods/Pods.xcodeproj" )
136
+
137
+ def test_401_PluginAdd_InvalidPod (self ):
138
+ CreateProject (projName = "TNS_App" );
139
+ PlatformAdd (platform = "ios" , frameworkPath = iosRuntimeSymlinkPath , path = "TNS_App" )
140
+
141
+ output = runAUT (tnsPath + " plugin add QA-TestApps/CocoaPods/invalidpod --path TNS_App" )
142
+ assert ("TNS_App/node_modules/invalidpod" in output )
143
+ assert ("Successfully installed plugin invalidpod." in output )
144
+ assert FileExists ("TNS_App/node_modules/invalidpod/package.json" )
145
+ assert FileExists ("TNS_App/node_modules/invalidpod/platforms/ios/Podfile" )
146
+
147
+ output = runAUT ("cat TNS_App/package.json" )
148
+ assert ("invalidpod" in output )
149
+
150
+ output = Prepare (platform = "ios" , path = "TNS_App" , assertSuccess = False )
151
+ assert ("Installing pods..." in output )
152
+ assert ("Processing node_modules failed. Error:Error: Command failed: /bin/sh -c pod install" in output )
153
+
154
+ output = runAUT ("cat TNS_App/platforms/ios/Podfile" )
155
+ assert ("pod 'InvalidPod'" in output )
156
+
157
+ assert not FileExists ("TNS_App/platforms/ios/TNSApp.xcworkspace" )
158
+ assert not FileExists ("TNS_App/platforms/ios/Pods/Pods.xcodeproj" )
159
+
160
+ def test_402_PluginAdd_InvalidPodFile (self ):
161
+ CreateProject (projName = "TNS_App" );
162
+ PlatformAdd (platform = "ios" , frameworkPath = iosRuntimeSymlinkPath , path = "TNS_App" )
163
+
164
+ output = runAUT (tnsPath + " plugin add QA-TestApps/CocoaPods/invalidpodfile --path TNS_App" )
165
+ assert ("TNS_App/node_modules/invalidpodfile" in output )
166
+ assert ("Successfully installed plugin invalidpodfile." in output )
167
+ assert FileExists ("TNS_App/node_modules/invalidpodfile/package.json" )
168
+ assert FileExists ("TNS_App/node_modules/invalidpodfile/platforms/ios/Podfile" )
169
+
170
+ output = runAUT ("cat TNS_App/package.json" )
171
+ assert ("invalidpodfile" in output )
172
+
173
+ output = Prepare (platform = "ios" , path = "TNS_App" , assertSuccess = False )
174
+ assert ("Installing pods..." in output )
175
+ assert ("Processing node_modules failed. Error:Error: Command failed: /bin/sh -c pod install" in output )
176
+
177
+ output = runAUT ("cat TNS_App/platforms/ios/Podfile" )
178
+ assert ("pod UICKeyChainStore" in output )
83
179
84
- # def test_401_PluginAdd_InvalidPod(self):
85
- # pass
180
+ assert not FileExists ( "TNS_App/platforms/ios/TNSApp.xcworkspace" )
181
+ assert not FileExists ( "TNS_App/platforms/ios/Pods/Pods.xcodeproj" )
0 commit comments