@@ -46,112 +46,6 @@ def tearDownClass(cls):
4646 BaseClass .tearDownClass ()
4747 Emulator .stop ()
4848
49- @flaky (max_runs = 3 )
50- def test_001_tns_run_android_ts_css_html (self ):
51- """Make valid changes in JS,CSS and XML"""
52-
53- # Copy the app folder (app is modified in order to get some console logs on loaded)
54- source = os .path .join ('data' , 'apps' , 'livesync-hello-world-ng' , 'src' )
55- target = os .path .join (self .app_name , 'src' )
56- Folder .cleanup (target )
57- Folder .copy (src = source , dst = target )
58-
59- # `tns run android` and wait until app is deployed
60- log = Tns .run_android (attributes = {'--path' : self .app_name , '--device' : EMULATOR_ID }, wait = False ,
61- assert_success = False )
62- strings = ['Project successfully built' ,
63- 'Successfully installed on device with identifier' , EMULATOR_ID ,
64- 'Successfully synced application' ,
65- 'Application loaded!' ,
66- 'Home page loaded!' ]
67- Tns .wait_for_log (log_file = log , string_list = strings , timeout = 240 , check_interval = 10 )
68-
69- # Verify initial state of the app
70- assert Device .wait_for_text (device_id = EMULATOR_ID , text = "Ter Stegen" ,
71- timeout = 20 ), 'Hello-world NG App failed to start or it does not look correct!'
72-
73- # Change TS and wait until app is synced
74- ReplaceHelper .replace (self .app_name , ReplaceHelper .NG_CHANGE_TS , sleep = 10 )
75- strings = ['Successfully transferred' , 'item.service.js' , 'Successfully synced application' ,
76- 'Application loaded!' , # This is to verify app is restarted.
77- 'Home page loaded!' ]
78- Tns .wait_for_log (log_file = log , string_list = strings , clean_log = False )
79- text_changed = Device .wait_for_text (device_id = EMULATOR_ID , text = "Stegen Ter" , timeout = 20 )
80- assert text_changed , 'Changes in TS file not applied (UI is not refreshed).'
81- log_content = File .read (log )
82- assert 'item.service.ts' not in log_content , "CLI should NOT transfer TS files!"
83-
84- # Clean log (this will not work on windows since file is locked)
85- if CURRENT_OS != OSType .WINDOWS :
86- File .write (file_path = log , text = "" )
87-
88- # Change HTML and wait until app is synced
89- ReplaceHelper .replace (self .app_name , ReplaceHelper .NG_CHANGE_HTML , sleep = 10 )
90-
91- # Verify app is synced and it is not restarted
92- strings = ['items.component.html' , 'Successfully synced application' , 'Home page loaded!' ]
93- if CURRENT_OS == OSType .WINDOWS :
94- not_existing_strings = None # We can not verify this on windows, because log is not clean
95- else :
96- not_existing_strings = ['Application loaded!' ] # This is to verify app is NOT restarted.
97- Tns .wait_for_log (log_file = log , string_list = strings , not_existing_string_list = not_existing_strings )
98- text_changed = Device .wait_for_text (device_id = EMULATOR_ID , text = '9' , timeout = 30 )
99- assert text_changed , 'Changes in HTML file not applied (UI is not refreshed).'
100-
101- # Clean log (this will not work on windows since file is locked)
102- if CURRENT_OS != OSType .WINDOWS :
103- File .write (file_path = log , text = "" )
104-
105- # Change CSS and wait until app is synced
106- ReplaceHelper .replace (self .app_name , ReplaceHelper .NG_CHANGE_CSS , sleep = 10 )
107-
108- # Verify app is synced and it is not restarted
109- strings = ['Successfully transferred' , 'app.css' , 'Successfully synced application' , 'Home page loaded!' ]
110- if CURRENT_OS == OSType .WINDOWS :
111- not_existing_strings = None # We can not verify this on windows, because log is not clean
112- else :
113- not_existing_strings = ['Application loaded!' ] # This is to verify app is NOT restarted.
114-
115- Tns .wait_for_log (log_file = log , string_list = strings , not_existing_string_list = not_existing_strings )
116- Device .screen_match (device_name = EMULATOR_NAME , device_id = EMULATOR_ID , expected_image = 'ng-hello-world-home-dark' ,
117- tolerance = 5.0 )
118-
119- # Revert HTML and wait until app is synced
120- ReplaceHelper .rollback (self .app_name , ReplaceHelper .NG_CHANGE_HTML , sleep = 10 )
121-
122- # Verify app is synced and it is not restarted
123- strings = ['items.component.html' , 'Successfully synced application' , 'Home page loaded!' ]
124- if CURRENT_OS == OSType .WINDOWS :
125- not_existing_strings = None # We can not verify this on windows, because log is not clean
126- else :
127- not_existing_strings = ['Application loaded!' ] # This is to verify app is NOT restarted.
128- Tns .wait_for_log (log_file = log , string_list = strings , not_existing_string_list = not_existing_strings )
129- text_changed = Device .wait_for_text (device_id = EMULATOR_ID , text = "Stegen Ter" , timeout = 30 )
130- assert text_changed , 'Changes in HTML file not applied (UI is not refreshed).'
131-
132- # Revert TS and wait until app is synced
133- ReplaceHelper .rollback (self .app_name , ReplaceHelper .NG_CHANGE_TS , sleep = 10 )
134- strings = ['Successfully transferred' , 'item.service.js' , 'Successfully synced application' ,
135- 'Application loaded!' , # This is to verify app is restarted.
136- 'Home page loaded!' ]
137- Tns .wait_for_log (log_file = log , string_list = strings )
138- text_changed = Device .wait_for_text (device_id = EMULATOR_ID , text = "Ter Stegen" , timeout = 30 )
139- assert text_changed , 'Changes in TS file not applied (UI is not refreshed).'
140-
141- # Revert CSS and wait until app is synced
142- ReplaceHelper .rollback (self .app_name , ReplaceHelper .NG_CHANGE_CSS , sleep = 10 )
143-
144- # Verify app is synced and it is not restarted
145- strings = ['Successfully transferred' , 'app.css' , 'Successfully synced application' , 'Home page loaded!' ]
146- if CURRENT_OS == OSType .WINDOWS :
147- not_existing_strings = None # We can not verify this on windows, because log is not clean
148- else :
149- not_existing_strings = ['Application loaded!' ] # This is to verify app is NOT restarted.
150-
151- Tns .wait_for_log (log_file = log , string_list = strings , not_existing_string_list = not_existing_strings )
152- Device .screen_match (device_name = EMULATOR_NAME , device_id = EMULATOR_ID ,
153- expected_image = 'ng-hello-world-home-white' , tolerance = 5.0 )
154-
15549 def test_200_tns_run_android_extending_class_inside_file_containing_dots (self ):
15650 """Test for https://github.com/NativeScript/android-runtime/issues/761"""
15751
@@ -211,27 +105,3 @@ def test_280_tns_run_android_console_time(self):
211105 # Verify console.time() works
212106 console_time = ['JS: startup:' ]
213107 Tns .wait_for_log (log_file = log , string_list = console_time )
214-
215- def test_290_tns_run_android_delete_node_modules (self ):
216- #https://github.com/NativeScript/nativescript-cli/issues/3944
217- log = Tns .run_android (attributes = {'--path' : self .app_name , '--device' : EMULATOR_ID }, wait = False ,
218- assert_success = False )
219-
220- # Verify the app is running
221- strings = ['Successfully synced application' ]
222- Tns .wait_for_log (log_file = log , string_list = strings , timeout = 240 , check_interval = 10 )
223-
224- Tns .kill ()
225- node_modules = os .path .join (self .app_name + '/' + 'node_modules' )
226- Folder .cleanup (node_modules )
227-
228- log = Tns .run_android (attributes = {'--path' : self .app_name , '--device' : EMULATOR_ID }, wait = False ,
229- assert_success = False )
230-
231- # Verify the app is running
232- strings = ['Project successfully built' ,
233- 'Successfully installed on device with identifier' , EMULATOR_ID ,
234- 'Successfully synced application' ]
235- Tns .wait_for_log (log_file = log , string_list = strings , timeout = 240 , check_interval = 10 )
236- assert "Cannot find module 'nativescript-angular/hooks/before-livesync'" not in log
237-
0 commit comments