Skip to content

Commit

Permalink
Add tests for live sync new folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasil Chimev authored and Vasil Chimev committed Dec 11, 2015
1 parent 78bf227 commit 93fd283
Showing 1 changed file with 33 additions and 5 deletions.
38 changes: 33 additions & 5 deletions tests/livesync_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,6 @@ def test_001_full_livesync_ios_simulator_xml_js_css_tns_files(self):
assert "require(\"globals\"); // test" in output


# # Add a new folder
# def test_100_livesync_ios_simulator_watch_add_new_folder(self):
# create_folder("folder")


# Add new files
def test_101_livesync_ios_simulator_watch_add_xml_file(self):
shutil.copyfile("TNS_App/app/main-page.xml", "TNS_App/app/test/test.xml")
Expand Down Expand Up @@ -174,6 +169,39 @@ def test_123_livesync_ios_simulator_watch_delete_css_file(self):
assert "No such file or directory" in output


# Add files to a new folder
def test_131_livesync_ios_simulator_watch_add_xml_file_to_new_folder(self):
create_folder("TNS_App/app/folder")
self.wait_for_text_in_output("app/folder/ to")

shutil.copyfile("TNS_App/app/main-page.xml", "TNS_App/app/folder/test.xml")
self.wait_for_text_in_output("app/folder/test.xml to")

output = cat_app_file_on_simulator("TNSApp", "app/folder/test.xml")
assert "<Button text=\"WATCH\" tap=\"{{ tapAction }}\" />" in output

# remove("TNS_App/app/folder")
# self.wait_for_text_in_output("app/folder/")
#
# output = cat_app_file_on_simulator("TNSApp", "app/folder/test.xml")
# assert "No such file or directory" in output

def test_132_livesync_ios_simulator_watch_add_js_file_to_new_folder(self):
shutil.copyfile("TNS_App/app/app.js", "TNS_App/app/folder/test.js")
self.wait_for_text_in_output("app/folder/test.js to")
time.sleep(2)

output = cat_app_file_on_simulator("TNSApp", "app/folder/test.js")
assert "application.start();" in output

def test_133_livesync_ios_simulator_watch_add_css_file_to_new_folder(self):
shutil.copyfile("TNS_App/app/app.css", "TNS_App/app/folder/test.css")
self.wait_for_text_in_output("app/folder/test.css to")

output = cat_app_file_on_simulator("TNSApp", "app/folder/test.css")
assert "color: green;" in output


def test_301_livesync_ios_simulator_before_run(self):
self.terminate_watcher()
cleanup_folder('appTest')
Expand Down

0 comments on commit 93fd283

Please sign in to comment.