6
6
from core .enums .platform_type import Platform
7
7
from core .settings import Settings
8
8
from core .utils .file_utils import Folder , File
9
+ from data .changes import Changes
9
10
from data .sync .hello_world_js import sync_hello_world_js
10
11
from data .templates import Template
11
12
from products .nativescript .tns import Tns
@@ -24,7 +25,7 @@ def setUpClass(cls):
24
25
Tns .create (app_name = cls .app_name , template = Template .HELLO_WORLD_JS .local_package , update = True )
25
26
src = os .path .join (Settings .TEST_RUN_HOME , 'assets' , 'logs' , 'hello-world-js' , 'app.js' )
26
27
target = os .path .join (Settings .TEST_RUN_HOME , cls .app_name , 'app' )
27
- File .copy (src = src , target = target )
28
+ File .copy (source = src , target = target )
28
29
Tns .platform_add_android (app_name = cls .app_name , framework_path = Settings .Android .FRAMEWORK_PATH )
29
30
if Settings .HOST_OS is OSType .OSX :
30
31
Tns .platform_add_ios (app_name = cls .app_name , framework_path = Settings .IOS .FRAMEWORK_PATH )
@@ -36,10 +37,11 @@ def setUp(self):
36
37
TnsRunTest .setUp (self )
37
38
# "src" folder of TestApp will be restored before each test.
38
39
# This will ensure failures in one test do not cause common failures.
39
- source_src = os .path .join (self .target_project_dir , 'app' )
40
- target_src = os .path .join (self .source_project_dir , 'app' )
41
- Folder .clean (target_src )
42
- Folder .copy (source = source_src , target = target_src )
40
+ for change in [Changes .JSHelloWord .CSS , Changes .JSHelloWord .XML , Changes .JSHelloWord .JS ]:
41
+ source_src = os .path .join (self .target_project_dir , 'app' , os .path .basename (change .file_path ))
42
+ target_src = os .path .join (self .source_project_dir , change .file_path )
43
+ File .clean (path = target_src )
44
+ File .copy (source = source_src , target = target_src )
43
45
44
46
def test_100_run_android (self ):
45
47
sync_hello_world_js (self .app_name , Platform .ANDROID , self .emu )
0 commit comments