11
11
If emulator is not started and device is not connected `tns run android` should start emulator.
12
12
"""
13
13
14
+ import datetime
14
15
import os
16
+ import re
15
17
import time
16
18
import unittest
17
19
18
20
import nose
21
+ import pytz
19
22
20
23
from core .base_class .BaseClass import BaseClass
21
24
from core .device .device import Device
33
36
from core .tns .tns_platform_type import Platform
34
37
from core .tns .tns_prepare_type import Prepare
35
38
from core .tns .tns_verifications import TnsAsserts
36
- import re
37
- import datetime
38
- import pytz
39
39
40
40
41
41
class RunAndroidEmulatorTests (BaseClass ):
@@ -45,12 +45,12 @@ class RunAndroidEmulatorTests(BaseClass):
45
45
"1234567890123456789012345678901234567890"
46
46
very_long_string = ''
47
47
for x in range (0 , 30 ):
48
- very_long_string = very_long_string + one_hundred_symbols_string
48
+ very_long_string += one_hundred_symbols_string
49
49
50
50
max_long_string = ''
51
51
for x in range (0 , 10 ):
52
- max_long_string = max_long_string + one_hundred_symbols_string
53
- max_long_string = max_long_string + "123456789012345678901234"
52
+ max_long_string += one_hundred_symbols_string
53
+ max_long_string += "123456789012345678901234"
54
54
55
55
@classmethod
56
56
def setUpClass (cls ):
@@ -59,17 +59,25 @@ def setUpClass(cls):
59
59
Emulator .stop ()
60
60
Emulator .ensure_available ()
61
61
Device .uninstall_app (app_prefix = "org.nativescript." , platform = Platform .ANDROID )
62
- Tns .create_app (cls .app_name ,
63
- attributes = {'--template' : os .path .join ('data' , 'apps' , 'livesync-hello-world.tgz' )},
64
- update_modules = True )
65
- Tns .platform_add_android (attributes = {'--path' : cls .app_name , '--frameworkPath' : ANDROID_PACKAGE })
66
- Folder .cleanup (cls .temp_app )
67
- Folder .copy (cls .source_app , cls .temp_app )
62
+ if CURRENT_OS != OSType .WINDOWS :
63
+ Tns .create_app (cls .app_name ,
64
+ attributes = {'--template' : os .path .join ('data' , 'apps' , 'livesync-hello-world.tgz' )},
65
+ update_modules = True )
66
+ Tns .platform_add_android (attributes = {'--path' : cls .app_name , '--frameworkPath' : ANDROID_PACKAGE })
67
+ Folder .cleanup (cls .temp_app )
68
+ Folder .copy (cls .source_app , cls .temp_app )
68
69
69
70
def setUp (self ):
70
71
BaseClass .setUp (self )
71
72
Folder .cleanup (self .source_app )
72
- Folder .copy (self .temp_app , self .source_app )
73
+ if CURRENT_OS != OSType .WINDOWS :
74
+ Folder .copy (self .temp_app , self .source_app )
75
+ else :
76
+ Tns .create_app (self .app_name ,
77
+ attributes = {'--template' : os .path .join ('data' , 'apps' , 'livesync-hello-world.tgz' )},
78
+ update_modules = True )
79
+ Tns .platform_add_android (attributes = {'--path' : self .app_name , '--frameworkPath' : ANDROID_PACKAGE })
80
+ Emulator .ensure_available ()
73
81
74
82
def tearDown (self ):
75
83
Tns .kill ()
@@ -590,16 +598,16 @@ def test_310_tns_run_android_clean_builds(self):
590
598
Device .wait_for_text (device_id = EMULATOR_ID , text = '42 taps left' )
591
599
592
600
def test_315_tns_run_android_change_appResources_check_per_platform (self ):
593
- #https://github.com/NativeScript/nativescript-cli/pull/3619
601
+ # https://github.com/NativeScript/nativescript-cli/pull/3619
594
602
output = Tns .run_android (attributes = {'--path' : self .app_name }, wait = False , assert_success = False )
595
603
strings = ['Successfully installed on device with identifier' ,
596
- 'Successfully synced application' , EMULATOR_ID ,]
604
+ 'Successfully synced application' , EMULATOR_ID , ]
597
605
Tns .wait_for_log (log_file = output , string_list = strings , timeout = 120 , check_interval = 10 )
598
606
599
607
source = os .path .join ('data' , 'issues' , 'nativescript-cli-3619' , 'hello.png' )
600
608
target = os .path .join (self .app_name , 'app' , 'App_Resources' , 'Android' , 'drawable-hdpi' )
601
609
File .copy (source , target )
602
- strings = ['Gradle build' ]
610
+ strings = ['Gradle build' ]
603
611
Tns .wait_for_log (log_file = output , string_list = strings , clean_log = False )
604
612
assert "Xcode build" not in output
605
613
0 commit comments