@@ -38,36 +38,28 @@ def setUp(self):
38
38
Folder .cleanup ('./TNS_App/platforms/android/build/outputs' )
39
39
40
40
def tearDown (self ):
41
- pass
41
+ Emulator . stop_emulators ()
42
42
43
43
@classmethod
44
44
def tearDownClass (cls ):
45
45
Emulator .stop_emulators ()
46
46
Folder .cleanup ('./TNS_App' )
47
47
48
- @unittest .skip ("Skipped because of https://github.com/NativeScript/nativescript-cli/issues/352" )
49
48
def test_001_emulate_android_in_running_emulator (self ):
50
49
51
50
Emulator .ensure_available ()
52
-
53
- Tns .create_app_platform_add (app_name = "TNS_App" ,
54
- platform = "android" , framework_path = ANDROID_RUNTIME_PATH )
55
51
output = run (TNS_PATH + " emulate android --path TNS_App --timeout 600 --justlaunch" , timeout = 660 )
56
52
assert "Project successfully prepared" in output
57
53
assert "Project successfully built" in output
58
-
59
- # Emulator can not be started without active UI
60
- if ('ACTIVE_UI' in os .environ ) and ("YES" in os .environ ['ACTIVE_UI' ]):
61
- assert "installing" in output
62
- assert "running" in output
63
- assert not "Starting Android emulator with image" in output
54
+ assert "Successfully deployed on device with identifier 'emulator-5554'" in output
55
+ assert not "Starting Android emulator with image" in output
64
56
65
57
# TODO: Get device id and verify files are deployed and process is
66
58
# running on this device
67
59
68
60
def test_002_emulate_android_release (self ):
69
61
70
- output = run (TNS_PATH + " emulate android --avd Api19 " +
62
+ output = run (TNS_PATH + " emulate android --device Api19 " +
71
63
"--keyStorePath " + ANDROID_KEYSTORE_PATH +
72
64
" --keyStorePassword " + ANDROID_KEYSTORE_PASS +
73
65
" --keyStoreAlias " + ANDROID_KEYSTORE_ALIAS +
@@ -91,7 +83,7 @@ def test_200_emulate_android_inside_project_and_specify_emulator_name(self):
91
83
current_dir = os .getcwd ()
92
84
os .chdir (os .path .join (current_dir , "TNS_App" ))
93
85
output = run (os .path .join (".." , TNS_PATH ) +
94
- " emulate android --avd Api19 --timeout 600 --justlaunch" , timeout = 660 )
86
+ " emulate android --device Api19 --timeout 600 --justlaunch" , timeout = 660 )
95
87
os .chdir (current_dir )
96
88
assert "Project successfully prepared" in output
97
89
assert "Project successfully built" in output
@@ -105,7 +97,7 @@ def test_200_emulate_android_inside_project_and_specify_emulator_name(self):
105
97
def test_300_emulate_android_platform_not_added (self ):
106
98
Tns .create_app (app_name = "TNSAppNoPlatform" )
107
99
output = run (TNS_PATH +
108
- " emulate android --avd Api19 --timeout 600 --justlaunch --path TNSAppNoPlatform" ,
100
+ " emulate android --device Api19 --timeout 600 --justlaunch --path TNSAppNoPlatform" ,
109
101
timeout = 660 )
110
102
assert "Copying template files..." in output
111
103
assert "Project successfully created." in output
@@ -125,12 +117,19 @@ def test_400_emulate_invalid_platform(self):
125
117
assert "The input is not valid sub-command for 'emulate' command" in output
126
118
assert "Usage" in output
127
119
128
- @unittest .skip (
129
- "Skipped because of https://github.com/NativeScript/nativescript-cli/issues/289" )
130
120
def test_401_emulate_invalid_avd (self ):
131
121
output = run (TNS_PATH + \
132
- " emulate android --avd invaliddevice_id --path TNS_App --timeout 600 --justlaunch" ,
122
+ " emulate android --device invaliddevice_id --path TNS_App --timeout 600 --justlaunch" ,
133
123
timeout = 660 )
134
- # TODO: Modify assert when issue is fixed
135
- assert "'invalidPlatform' is not valid sub-command for 'emulate' command" in output
124
+ assert not "Option --avd is no longer supported. Please use --device isntead!" in output
125
+ assert "Cannot find device with name: invaliddevice_id" in output
126
+ assert "Usage" in output
127
+
128
+
129
+ def test_402_emulate_invalid_avd (self ):
130
+ output = run (TNS_PATH +
131
+ " emulate android --avd invaliddevice_id --path TNS_App --timeout 600 --justlaunch" ,
132
+ timeout = 660 )
133
+ assert "Option --avd is no longer supported. Please use --device isntead!"
134
+ assert "Cannot find device with name: invaliddevice_id" in output
136
135
assert "Usage" in output
0 commit comments