@@ -102,6 +102,18 @@ def test_201_Build_Android_WithPrepare(self):
102
102
assert ("Project successfully built" in output )
103
103
assert FileExists ("TNS_App/platforms/android/build/outputs/apk/TNSApp-debug.apk" )
104
104
105
+ def test_210_Build_Android_PlatformNotAdded (self ):
106
+ CreateProject (projName = "TNS_App" )
107
+ output = runAUT (tnsPath + " build android --path TNS_App" )
108
+
109
+ assert ("Project successfully prepared" in output )
110
+ assert ("BUILD SUCCESSFUL" in output )
111
+ assert ("Project successfully built" in output )
112
+
113
+ assert not ("ERROR" in output )
114
+ assert not ("FAILURE" in output )
115
+ assert FileExists ("TNS_App/platforms/android/build/outputs/apk/TNSApp-debug.apk" )
116
+
105
117
def test_300_Build_Android_WithAdditionalStylesXML (self ):
106
118
107
119
# This is test for issue 644
@@ -142,40 +154,34 @@ def test_301_Build_Android_WithDashInPath(self):
142
154
# Verify AndroidManifest.xml
143
155
output = runAUT ("cat tns-app/platforms/android/src/main/AndroidManifest.xml" )
144
156
assert ("org.nativescript.tnsapp" in output )
145
-
146
- @unittest .skip ("TODO: Fix this test. Now build command opens a browser" )
157
+
147
158
def test_400_Build_MissingPlatform (self ):
148
159
output = runAUT (tnsPath + " build" )
149
- assert CheckOutput (output , 'build_help_output.txt' )
150
-
160
+ assert ("The input is not valid sub-command for 'build' command" in output )
161
+ assert ("# build" in output )
162
+ assert ("$ tns build <Platform>" in output )
163
+
151
164
def test_401_Build_InvalidPlatform (self ):
152
165
output = runAUT (tnsPath + " build invalidCommand" )
153
166
assert ("The input is not valid sub-command for 'build' command" in output )
154
-
167
+
155
168
def test_402_Build_Android_WithOutPath (self ):
156
169
output = runAUT (tnsPath + " build android" )
157
170
assert ("No project found at or above" in output )
158
171
assert ("and neither was a --path specified." in output )
159
-
160
- def test_403_Build_Android_WithOutPath (self ):
172
+
173
+ def test_403_Build_Android_WithInvalidPath (self ):
161
174
output = runAUT (tnsPath + " build android --path invalidPath" )
162
175
assert ("No project found at or above" in output )
163
176
assert ("and neither was a --path specified." in output )
164
177
165
- @unittest .skip ("Skipped because of https://github.com/NativeScript/nativescript-cli/issues/277" )
166
- def test_404_Build_Android_WhenPlatformIsNotAdded (self ):
167
- CreateProject (projName = "TNS_App" )
168
- output = runAUT (tnsPath + " build android --path TNS_App" )
169
- # TODO: Verify after issue is fixed
170
- assert not ("error" in output )
171
-
172
- def test_405_Build_Android_WithWrongParam (self ):
178
+ def test_404_Build_Android_WithWrongParam (self ):
173
179
CreateProjectAndAddPlatform (projName = "TNS_App" , platform = "android" , frameworkPath = androidRuntimePath )
174
180
output = runAUT (tnsPath + " build android --invalidOption --path TNS_App" )
175
181
assert ("The option 'invalidOption' is not supported" in output )
176
-
177
- def test_406_Build_IOSonNotOSXMachine (self ):
178
- CreateProject (projName = "TNS_App" );
182
+
183
+ def test_405_Build_IOSonNotOSXMachine (self ):
184
+ CreateProject (projName = "TNS_App" );
179
185
output = runAUT (tnsPath + " build ios --path TNS_App" )
180
186
if 'Darwin' in platform .platform ():
181
187
pass
0 commit comments