Skip to content

Commit ff4d31c

Browse files
Vasil ChimevVasil Chimev
Vasil Chimev
authored and
Vasil Chimev
committed
1 parent c73bbb5 commit ff4d31c

File tree

2 files changed

+33
-25
lines changed

2 files changed

+33
-25
lines changed

tests/build_linux.py

+24-18
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,18 @@ def test_201_Build_Android_WithPrepare(self):
102102
assert ("Project successfully built" in output)
103103
assert FileExists("TNS_App/platforms/android/build/outputs/apk/TNSApp-debug.apk")
104104

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+
105117
def test_300_Build_Android_WithAdditionalStylesXML(self):
106118

107119
# This is test for issue 644
@@ -142,40 +154,34 @@ def test_301_Build_Android_WithDashInPath(self):
142154
# Verify AndroidManifest.xml
143155
output = runAUT("cat tns-app/platforms/android/src/main/AndroidManifest.xml")
144156
assert ("org.nativescript.tnsapp" in output)
145-
146-
@unittest.skip("TODO: Fix this test. Now build command opens a browser")
157+
147158
def test_400_Build_MissingPlatform(self):
148159
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+
151164
def test_401_Build_InvalidPlatform(self):
152165
output = runAUT(tnsPath + " build invalidCommand")
153166
assert ("The input is not valid sub-command for 'build' command" in output)
154-
167+
155168
def test_402_Build_Android_WithOutPath(self):
156169
output = runAUT(tnsPath + " build android")
157170
assert ("No project found at or above" in output)
158171
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):
161174
output = runAUT(tnsPath + " build android --path invalidPath")
162175
assert ("No project found at or above" in output)
163176
assert ("and neither was a --path specified." in output)
164177

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):
173179
CreateProjectAndAddPlatform(projName="TNS_App", platform="android", frameworkPath=androidRuntimePath)
174180
output = runAUT(tnsPath + " build android --invalidOption --path TNS_App")
175181
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");
179185
output = runAUT(tnsPath + " build ios --path TNS_App")
180186
if 'Darwin' in platform.platform():
181187
pass

tests/build_osx.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,15 @@ def test_202_Build_iOS_WithPrepare(self):
117117
output = runAUT(command)
118118
assert not ("__PROJECT_NAME__.xcodeproj" in output)
119119

120+
def test_210_Build_iOS_PlatformNotAdded(self):
121+
CreateProject(projName="TNS_App")
122+
output = runAUT(tnsPath + " build ios --path TNS_App")
123+
assert ("Project successfully prepared" in output)
124+
assert ("build/emulator/TNSApp.app" in output)
125+
assert ("** BUILD SUCCEEDED **" in output)
126+
assert ("Project successfully built" in output)
127+
assert FileExists("TNS_App/platforms/ios/build/emulator/TNSApp.app")
128+
120129
def test_300_Build_iOS_WithDashInPath(self):
121130
CreateProjectAndAddPlatform(projName="tns-app", platform="ios", frameworkPath=iosRuntimeSymlinkPath, symlink=True)
122131

@@ -155,13 +164,6 @@ def test_302_Build_iOS_WithiOSinPath(self):
155164
assert FileExists("my-ios-app/platforms/ios/build/emulator/myiosapp.app")
156165
assert FileExists("my-ios-app/platforms/ios/myiosapp/myiosapp-Prefix.pch")
157166

158-
@unittest.skip("Skipped because of https://github.com/NativeScript/nativescript-cli/issues/277")
159-
def test_400_Build_iOS_WhenPlatformIsNotAdded(self):
160-
CreateProject(projName="TNS_App")
161-
output = runAUT(tnsPath + " build ios --path TNS_App")
162-
# TODO: Verify after issue is fixed
163-
assert not ("error" in output)
164-
165167
def test_401_Build_iOS_WithWrongParam(self):
166168
CreateProject(projName="TNS_App")
167169
output = runAUT(tnsPath + " build iOS --debug --path TNS_App")

0 commit comments

Comments
 (0)