Skip to content

Commit 93fd283

Browse files
Vasil ChimevVasil Chimev
Vasil Chimev
authored and
Vasil Chimev
committed
Add tests for live sync new folder.
NativeScript/nativescript-cli#1285
1 parent 78bf227 commit 93fd283

File tree

1 file changed

+33
-5
lines changed

1 file changed

+33
-5
lines changed

tests/livesync_simulator.py

+33-5
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,6 @@ def test_001_full_livesync_ios_simulator_xml_js_css_tns_files(self):
9797
assert "require(\"globals\"); // test" in output
9898

9999

100-
# # Add a new folder
101-
# def test_100_livesync_ios_simulator_watch_add_new_folder(self):
102-
# create_folder("folder")
103-
104-
105100
# Add new files
106101
def test_101_livesync_ios_simulator_watch_add_xml_file(self):
107102
shutil.copyfile("TNS_App/app/main-page.xml", "TNS_App/app/test/test.xml")
@@ -174,6 +169,39 @@ def test_123_livesync_ios_simulator_watch_delete_css_file(self):
174169
assert "No such file or directory" in output
175170

176171

172+
# Add files to a new folder
173+
def test_131_livesync_ios_simulator_watch_add_xml_file_to_new_folder(self):
174+
create_folder("TNS_App/app/folder")
175+
self.wait_for_text_in_output("app/folder/ to")
176+
177+
shutil.copyfile("TNS_App/app/main-page.xml", "TNS_App/app/folder/test.xml")
178+
self.wait_for_text_in_output("app/folder/test.xml to")
179+
180+
output = cat_app_file_on_simulator("TNSApp", "app/folder/test.xml")
181+
assert "<Button text=\"WATCH\" tap=\"{{ tapAction }}\" />" in output
182+
183+
# remove("TNS_App/app/folder")
184+
# self.wait_for_text_in_output("app/folder/")
185+
#
186+
# output = cat_app_file_on_simulator("TNSApp", "app/folder/test.xml")
187+
# assert "No such file or directory" in output
188+
189+
def test_132_livesync_ios_simulator_watch_add_js_file_to_new_folder(self):
190+
shutil.copyfile("TNS_App/app/app.js", "TNS_App/app/folder/test.js")
191+
self.wait_for_text_in_output("app/folder/test.js to")
192+
time.sleep(2)
193+
194+
output = cat_app_file_on_simulator("TNSApp", "app/folder/test.js")
195+
assert "application.start();" in output
196+
197+
def test_133_livesync_ios_simulator_watch_add_css_file_to_new_folder(self):
198+
shutil.copyfile("TNS_App/app/app.css", "TNS_App/app/folder/test.css")
199+
self.wait_for_text_in_output("app/folder/test.css to")
200+
201+
output = cat_app_file_on_simulator("TNSApp", "app/folder/test.css")
202+
assert "color: green;" in output
203+
204+
177205
def test_301_livesync_ios_simulator_before_run(self):
178206
self.terminate_watcher()
179207
cleanup_folder('appTest')

0 commit comments

Comments
 (0)