Skip to content

Commit a2c61ac

Browse files
Vasil ChimevVasil Chimev
Vasil Chimev
authored and
Vasil Chimev
committed
Update livesync_simulator.py
1 parent 392e093 commit a2c61ac

File tree

1 file changed

+79
-38
lines changed

1 file changed

+79
-38
lines changed

tests/livesync_simulator.py

Lines changed: 79 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -192,27 +192,28 @@ def test_113_livesync_ios_simulator_watch_change_css_file(self):
192192
output = cat_app_file_on_simulator("TNSApp", "app/test/test.css")
193193
assert "color: lightgreen;" in output
194194

195-
def test_121_livesync_ios_simulator_watch_delete_xml_file(self):
196-
remove("TNS_App/app/test/test.xml")
197-
self.wait_for_text_in_output("app/test/test.xml")
198-
199-
output = cat_app_file_on_simulator("TNSApp", "app/test/test.xml")
200-
assert "No such file or directory" in output
201-
202-
def test_122_livesync_ios_simulator_watch_delete_js_file(self):
203-
remove("TNS_App/app/test/test.js")
204-
self.wait_for_text_in_output("app/test/test.js")
205-
time.sleep(2)
206-
207-
output = cat_app_file_on_simulator("TNSApp", "app/test/test.js")
208-
assert "No such file or directory" in output
209-
210-
def test_123_livesync_ios_simulator_watch_delete_css_file(self):
211-
remove("TNS_App/app/test/test.css")
212-
self.wait_for_text_in_output("app/test/test.css")
213-
214-
output = cat_app_file_on_simulator("TNSApp", "app/test/test.css")
215-
assert "No such file or directory" in output
195+
# https://github.com/NativeScript/nativescript-cli/issues/1210
196+
# def test_121_livesync_ios_simulator_watch_delete_xml_file(self):
197+
# remove("TNS_App/app/test/test.xml")
198+
# self.wait_for_text_in_output("app/test/test.xml")
199+
#
200+
# output = cat_app_file_on_simulator("TNSApp", "app/test/test.xml")
201+
# assert "No such file or directory" in output
202+
#
203+
# def test_122_livesync_ios_simulator_watch_delete_js_file(self):
204+
# remove("TNS_App/app/test/test.js")
205+
# self.wait_for_text_in_output("app/test/test.js")
206+
# time.sleep(2)
207+
#
208+
# output = cat_app_file_on_simulator("TNSApp", "app/test/test.js")
209+
# assert "No such file or directory" in output
210+
#
211+
# def test_123_livesync_ios_simulator_watch_delete_css_file(self):
212+
# remove("TNS_App/app/test/test.css")
213+
# self.wait_for_text_in_output("app/test/test.css")
214+
#
215+
# output = cat_app_file_on_simulator("TNSApp", "app/test/test.css")
216+
# assert "No such file or directory" in output
216217

217218
def test_301_livesync_ios_simulator_before_run(self):
218219
print "~~~ Killing subprocess ..."
@@ -223,35 +224,75 @@ def test_301_livesync_ios_simulator_before_run(self):
223224
print "~~~ Forced killing subprocess ..."
224225
self.process.kill()
225226

226-
cleanup_folder('appTest')
227-
create_project(proj_name="appTest")
227+
cleanup_folder('TNS_App')
228+
create_project(proj_name="TNS_App")
228229
platform_add(platform="ios", framework_path=IOS_RUNTIME_SYMLINK_PATH, \
229-
path="appTest", symlink=True)
230-
build(platform="ios", path="appTest")
230+
path="TNS_App", symlink=True)
231231

232232
# replace
233-
replace("appTest/app/main-page.xml", "TAP", "TEST")
234-
replace("appTest/app/main-view-model.js", "taps", "clicks")
235-
replace("appTest/app/app.css", "30", "20")
233+
replace("TNS_App/app/main-page.xml", "TAP", "TEST")
234+
replace("TNS_App/app/main-view-model.js", "taps", "clicks")
235+
replace("TNS_App/app/app.css", "30", "20")
236236

237-
replace("appTest/node_modules/tns-core-modules/LICENSE", "2015", "9999")
237+
replace("TNS_App/node_modules/tns-core-modules/LICENSE", "2015", "9999")
238238
replace(
239-
"appTest/node_modules/tns-core-modules/application/application-common.js",
239+
"TNS_App/node_modules/tns-core-modules/application/application-common.js",
240240
"(\"globals\");", "(\"globals\"); // test")
241241

242-
livesync(platform="ios", emulator=True, path="appTest")
243-
self.wait_for_text_in_output("prepared")
244-
time.sleep(2)
242+
livesync(platform="ios", emulator=True, path="TNS_App")
245243

246-
output = cat_app_file_on_simulator("appTest", "app/main-page.xml")
244+
output = cat_app_file_on_simulator("TNSApp", "app/main-page.xml")
247245
assert "<Button text=\"TEST\" tap=\"{{ tapAction }}\" />" in output
248-
output = cat_app_file_on_simulator("appTest", "app/main-view-model.js")
246+
output = cat_app_file_on_simulator("TNSApp", "app/main-view-model.js")
249247
assert "this.set(\"message\", this.counter + \" clicks left\");" in output
250-
output = cat_app_file_on_simulator("appTest", "app/app.css")
248+
output = cat_app_file_on_simulator("TNSApp", "app/app.css")
251249
assert "font-size: 20;" in output
252250

253-
output = cat_app_file_on_simulator("appTest", "app/tns_modules/LICENSE")
251+
output = cat_app_file_on_simulator("TNSApp", "app/tns_modules/LICENSE")
254252
assert "Copyright (c) 9999 Telerik AD" in output
255-
output = cat_app_file_on_simulator("appTest", \
253+
output = cat_app_file_on_simulator("TNSApp", \
256254
"app/tns_modules/application/application-common.js")
257255
assert "require(\"globals\"); // test" in output
256+
257+
# https://github.com/NativeScript/nativescript-cli/issues/1225
258+
# def test_301_livesync_ios_simulator_before_run(self):
259+
# print "~~~ Killing subprocess ..."
260+
# self.process.terminate()
261+
#
262+
# time.sleep(2)
263+
# if psutil.pid_exists(self.process.pid):
264+
# print "~~~ Forced killing subprocess ..."
265+
# self.process.kill()
266+
#
267+
# cleanup_folder('appTest')
268+
# create_project(proj_name="appTest")
269+
# platform_add(platform="ios", framework_path=IOS_RUNTIME_SYMLINK_PATH, \
270+
# path="appTest", symlink=True)
271+
# build(platform="ios", path="appTest")
272+
#
273+
# # replace
274+
# replace("appTest/app/main-page.xml", "TAP", "TEST")
275+
# replace("appTest/app/main-view-model.js", "taps", "clicks")
276+
# replace("appTest/app/app.css", "30", "20")
277+
#
278+
# replace("appTest/node_modules/tns-core-modules/LICENSE", "2015", "9999")
279+
# replace(
280+
# "appTest/node_modules/tns-core-modules/application/application-common.js",
281+
# "(\"globals\");", "(\"globals\"); // test")
282+
#
283+
# livesync(platform="ios", emulator=True, path="appTest")
284+
# self.wait_for_text_in_output("prepared")
285+
# time.sleep(2)
286+
#
287+
# output = cat_app_file_on_simulator("appTest", "app/main-page.xml")
288+
# assert "<Button text=\"TEST\" tap=\"{{ tapAction }}\" />" in output
289+
# output = cat_app_file_on_simulator("appTest", "app/main-view-model.js")
290+
# assert "this.set(\"message\", this.counter + \" clicks left\");" in output
291+
# output = cat_app_file_on_simulator("appTest", "app/app.css")
292+
# assert "font-size: 20;" in output
293+
#
294+
# output = cat_app_file_on_simulator("appTest", "app/tns_modules/LICENSE")
295+
# assert "Copyright (c) 9999 Telerik AD" in output
296+
# output = cat_app_file_on_simulator("appTest", \
297+
# "app/tns_modules/application/application-common.js")
298+
# assert "require(\"globals\"); // test" in output

0 commit comments

Comments
 (0)