@@ -31,9 +31,7 @@ def setUpClass(cls):
31
31
Emulator .ensure_available ()
32
32
Folder .cleanup ('./' + cls .app_name )
33
33
Tns .create_app (cls .app_name , update_modules = True )
34
- Tns .platform_add_android (attributes = {"--path" : cls .app_name ,
35
- "--frameworkPath" : ANDROID_RUNTIME_PATH
36
- })
34
+ Tns .platform_add_android (attributes = {"--path" : cls .app_name , "--frameworkPath" : ANDROID_RUNTIME_PATH })
37
35
38
36
def setUp (self ):
39
37
BaseClass .setUp (self )
@@ -50,29 +48,27 @@ def tearDownClass(cls):
50
48
51
49
def test_001_emulate_android_in_running_emulator (self ):
52
50
output = Tns .run_tns_command ("emulate android" , attributes = {"--path" : self .app_name ,
53
- "--timeout" : "600 " ,
51
+ "--timeout" : "240 " ,
54
52
"--justlaunch" : ""
55
- }, timeout = 660 )
53
+ }, timeout = 300 )
56
54
assert successfully_prepared in output
57
55
assert successfully_built in output
58
56
assert installed_on_device .format (EMULATOR_ID ) in output
59
57
assert "Starting Android emulator with image" not in output
60
58
Device .is_running (app_id = app_identifier , device_id = EMULATOR_ID ), \
61
- "Application is not running on {0}" .format (EMULATOR_ID )
59
+ "Application is not running on {0}" .format (EMULATOR_ID )
62
60
63
61
def test_002_emulate_android_release (self ):
64
- output = Tns .run_tns_command ("emulate android" , attributes = { # "--device": EMULATOR_NAME,
65
- "--keyStorePath" : ANDROID_KEYSTORE_PATH ,
66
- "--keyStorePassword" : ANDROID_KEYSTORE_PASS ,
67
- "--keyStoreAlias" : ANDROID_KEYSTORE_ALIAS ,
68
- "--keyStoreAliasPassword" :
69
- ANDROID_KEYSTORE_ALIAS_PASS ,
70
- "--release" : "" ,
71
- "--path" : self .app_name ,
72
- "--timeout" : "600" ,
73
- "--justlaunch" : ""
74
- },
75
- timeout = 660 )
62
+ output = Tns .run_tns_command ("emulate android" , attributes = {"--keyStorePath" : ANDROID_KEYSTORE_PATH ,
63
+ "--keyStorePassword" : ANDROID_KEYSTORE_PASS ,
64
+ "--keyStoreAlias" : ANDROID_KEYSTORE_ALIAS ,
65
+ "--keyStoreAliasPassword" :
66
+ ANDROID_KEYSTORE_ALIAS_PASS ,
67
+ "--release" : "" ,
68
+ "--path" : self .app_name ,
69
+ "--timeout" : "240" ,
70
+ "--justlaunch" : ""
71
+ }, timeout = 300 )
76
72
assert successfully_prepared in output
77
73
assert successfully_built in output
78
74
assert "Starting Android emulator with image" not in output
@@ -82,11 +78,8 @@ def test_002_emulate_android_release(self):
82
78
def test_200_emulate_android_inside_project (self ):
83
79
current_dir = os .getcwd ()
84
80
os .chdir (os .path .join (current_dir , self .app_name ))
85
- output = Tns .run_tns_command ("emulate android" , attributes = { # "--device": EMULATOR_NAME,
86
- "--timeout" : "600" ,
87
- "--justlaunch" : ""
88
- },
89
- tns_path = os .path .join (".." , TNS_PATH ), timeout = 660 )
81
+ output = Tns .run_tns_command ("emulate android" , attributes = {"--timeout" : "240" , "--justlaunch" : "" },
82
+ tns_path = os .path .join (".." , TNS_PATH ), timeout = 300 )
90
83
os .chdir (current_dir )
91
84
assert successfully_prepared in output
92
85
assert successfully_built in output
@@ -96,8 +89,8 @@ def test_200_emulate_android_inside_project(self):
96
89
97
90
def test_300_emulate_android_platform_not_added (self ):
98
91
Tns .create_app (self .app_name_noplatform )
99
- output = Tns .run_tns_command ("emulate android" , attributes = {"--timeout" : "720 " , "--justlaunch" : "" ,
100
- "--path" : self .app_name_noplatform }, timeout = 750 )
92
+ output = Tns .run_tns_command ("emulate android" , attributes = {"--timeout" : "240 " , "--justlaunch" : "" ,
93
+ "--path" : self .app_name_noplatform }, timeout = 300 )
101
94
assert copy_template_files in output
102
95
assert successfully_created in output
103
96
assert successfully_prepared in output
@@ -107,19 +100,15 @@ def test_300_emulate_android_platform_not_added(self):
107
100
assert started_on_device in output
108
101
109
102
def test_400_emulate_invalid_platform (self ):
110
- output = Tns .run_tns_command ("emulate invalidPlatform" , attributes = {"--path" : self .app_name ,
111
- "--timeout" : "30" ,
112
- "--justlaunch" : ""
113
- })
103
+ output = Tns .run_tns_command ("emulate invalidPlatform" , attributes = {"--path" : self .app_name , "--timeout" : "30" ,
104
+ "--justlaunch" : "" })
114
105
assert invalid_input .format ("emulate" ) in output
115
106
assert "Usage" in output
116
107
117
108
def test_401_emulate_invalid_avd (self ):
118
- output = Tns .run_tns_command ("emulate android" , attributes = {"--path" : self .app_name ,
119
- "--device" : invalid ,
120
- "--timeout" : "30" ,
121
- "--justlaunch" : ""
122
- })
109
+ output = Tns .run_tns_command ("emulate android" ,
110
+ attributes = {"--path" : self .app_name , "--device" : invalid , "--timeout" : "30" ,
111
+ "--justlaunch" : "" })
123
112
assert 'Cannot resolve the specified connected device by the provided index or identifier' or \
124
113
'Cannot find device with name' in output
125
114
assert "Usage" in output
0 commit comments