File tree Expand file tree Collapse file tree 6 files changed +16
-20
lines changed Expand file tree Collapse file tree 6 files changed +16
-20
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ def StopApplication(appId, deviceId):
18
18
19
19
def IsRunning (appId , deviceId ):
20
20
21
- output = runAUT ("adb -s " + deviceId + " shell ps | " + appId )
21
+ output = runAUT ("adb -s " + deviceId + " shell ps | grep " + appId )
22
22
if ("org.nativescript.TNSApp" in output ):
23
23
return True
24
24
else :
Original file line number Diff line number Diff line change @@ -77,7 +77,8 @@ def GetPhysicalDeviceId(platform):
77
77
for line in lines :
78
78
lline = line .lower ()
79
79
if (platform in lline ) and (not ("emulator" in lline )):
80
- deviceId = lline .split ((platform ),1 )[1 ].replace (" " , "" )
80
+ deviceId = lline .split ((platform ),1 )[1 ].replace (" " , "" ) # deviceId = @030b206908e6c3c5@
81
+ deviceId = deviceId [3 :- 3 ] # devideId = 030b206908e6c3c5
81
82
print deviceId
82
83
return deviceId
83
84
Original file line number Diff line number Diff line change @@ -25,18 +25,19 @@ def setUp(self):
25
25
26
26
def tearDown (self ):
27
27
pass
28
-
29
- def test_001_Device_ListApplications_And_Run_Android (self ):
28
+
29
+ def test_001_Device_ListApplications_And_Run_Android (self ):
30
30
deviceId = GetPhysicalDeviceId (platform = "android" );
31
- if (deviceId is not None ):
31
+ if (deviceId is not None ):
32
32
33
33
# Deploy TNS_App on device
34
34
CreateProjectAndAddPlatform (projName = "TNS_App" , platform = "android" , frameworkPath = androidRuntimePath )
35
35
output = runAUT (tnsPath + " deploy android --path TNS_App" )
36
36
assert ("Project successfully prepared" in output )
37
37
assert ("Project successfully built" in output )
38
38
assert ("Successfully deployed on device with identifier" in output )
39
- assert (deviceId in output )
39
+ runAUT ("echo " + deviceId )
40
+ assert (deviceId in output )
40
41
sleep (10 )
41
42
42
43
# Verify list-applications command list org.nativescript.TNSApp
@@ -60,7 +61,7 @@ def test_001_Device_ListApplications_And_Run_Android(self):
60
61
else :
61
62
print "Prerequisites not met. This test requires at least one real android device."
62
63
assert (False )
63
-
64
+
64
65
def test_002_Device_Log_Android (self ):
65
66
if (GetDeviceCount (platform = "android" ) > 1 ):
66
67
output = runAUT (tnsPath + " device log" )
Original file line number Diff line number Diff line change @@ -112,16 +112,11 @@ def test_200_Platform_List_InsideEmptyProject(self):
112
112
def test_201_Platform_Add_Android_InsideProject (self ):
113
113
CreateProject (projName = "TNS_App" )
114
114
currentDir = os .getcwd ()
115
- os .chdir (os .path .join (currentDir , "TNS_App" ))
115
+ os .chdir (os .path .join (currentDir , "TNS_App" ))
116
116
output = runAUT (os .path .join (".." , tnsPath ) + " platform add android" )
117
117
os .chdir (currentDir );
118
118
119
119
assert ("Copying template files..." in output )
120
-
121
- # Not valid for 1.3.0+
122
- # assert("Updated project.properties" in output)
123
- # assert("Updated local.properties" in output)
124
-
125
120
assert ("Project successfully created" in output )
126
121
127
122
if ('TESTRUN' in os .environ ) and (not "SMOKE" in os .environ ['TESTRUN' ]) and ("2" in os .environ ['ANDROID_HOME' ]):
Original file line number Diff line number Diff line change @@ -119,9 +119,9 @@ def test_401_PluginAdd_InvalidPlugin(self):
119
119
output = runAUT (tnsPath + " plugin add wd --path TNS_App" )
120
120
assert ("wd is not a valid NativeScript plugin" in output )
121
121
assert ("Verify that the plugin package.json file contains a nativescript key and try again" in output )
122
-
122
+
123
123
def test_403_PluginAdd_PluginNotSupportedOnSpecificPlatform (self ):
124
- CreateProjectAndAddPlatform (projName = "TNS_App" , platform = "android" , frameworkPath = androidRuntimePath )
124
+ CreateProjectAndAddPlatform (projName = "TNS_App" , platform = "android" , frameworkPath = androidRuntimePath )
125
125
output = runAUT (
tnsPath + " plugin add [email protected] --path TNS_App" );
126
126
assert ("tns-plugin is not supported for android" in output )
127
127
assert ("Successfully installed plugin tns-plugin" in output )
Original file line number Diff line number Diff line change @@ -168,12 +168,11 @@ def test_401_PluginAdd_InvalidPlugin(self):
168
168
output = runAUT (tnsPath + " plugin add wd --path TNS_App" )
169
169
assert ("wd is not a valid NativeScript plugin" in output )
170
170
assert ("Verify that the plugin package.json file contains a nativescript key and try again" in output )
171
-
171
+
172
172
def test_403_PluginAdd_PluginNotSupportedOnSpecificPlatform (self ):
173
- CreateProjectAndAddPlatform (projName = "TNS_App" , platform = "ios" , frameworkPath = iosRuntimePath )
173
+ CreateProjectAndAddPlatform (projName = "TNS_App" , platform = "ios" , frameworkPath = iosRuntimePath )
174
174
PlatformAdd (platform = "android" , frameworkPath = androidRuntimePath , path = "TNS_App" )
175
-
175
+
176
176
output = runAUT (
tnsPath + " plugin add [email protected] --path TNS_App" )
177
- assert ("Successfully prepared plugin tns-plugin for ios" in output )
178
177
assert ("tns-plugin is not supported for android" in output )
179
- assert ("Successfully installed plugin tns-plugin" in output )
178
+ assert ("Successfully installed plugin tns-plugin" in output )
You can’t perform that action at this time.
0 commit comments