diff --git a/vasl_templates/webapp/static/help/index.html b/vasl_templates/webapp/static/help/index.html index 7b13a2c..7c7a1cb 100644 --- a/vasl_templates/webapp/static/help/index.html +++ b/vasl_templates/webapp/static/help/index.html @@ -15,7 +15,7 @@
Javascript is disabled. Please enable it, then reload this page.
- + diff --git a/vasl_templates/webapp/static/help/main.js b/vasl_templates/webapp/static/help/main.js index dfbbc3f..da0e099 100644 --- a/vasl_templates/webapp/static/help/main.js +++ b/vasl_templates/webapp/static/help/main.js @@ -3,6 +3,9 @@ $(document).ready( function() { + // initialize + $( "#loader" ).fadeIn( 250, function() { + // set the application name var $caption = $( "#app-name" ) ; var version = getUrlParam( "version" ) ; @@ -71,7 +74,10 @@ $(document).ready( function() { var anchor = window.location.hash.substring( 1 ) ; if ( anchor ) $( "a[name='" + anchor + "']" )[0].scrollIntoView() ; -} ) ; + +} ) ; // nb: this closes the fadeIn() callback + +} ) ; // nb: this closes the $(document).ready() handler // -------------------------------------------------------------------- diff --git a/vasl_templates/webapp/static/main.js b/vasl_templates/webapp/static/main.js index 9e3add5..2923531 100644 --- a/vasl_templates/webapp/static/main.js +++ b/vasl_templates/webapp/static/main.js @@ -40,6 +40,9 @@ EDIT_TEMPLATE_HINT = "Edit the template" ; $(document).ready( function () { + // initialize + $( "#loader" ).fadeIn( 250, function() { + // initialize the PyQt web channel if ( getUrlParam( "pyqt" ) ) { $.getScript( "qrc:///qtwebchannel/qwebchannel.js", function() { @@ -543,7 +546,10 @@ $(document).ready( function () { // flag that we've finished initialization update_page_load_status( "main" ) ; -} ) ; + +} ) ; // nb: this closes the fadeIn() callback + +} ) ; // nb: this closes the $(document).ready() handler function init_player_droplists() { diff --git a/vasl_templates/webapp/templates/index.html b/vasl_templates/webapp/templates/index.html index cb904af..c97cb26 100644 --- a/vasl_templates/webapp/templates/index.html +++ b/vasl_templates/webapp/templates/index.html @@ -56,7 +56,7 @@
Javascript is disabled. Please enable it, then reload this page.
- + diff --git a/vasl_templates/webapp/tests/test_turn_track.py b/vasl_templates/webapp/tests/test_turn_track.py index 0bc3d00..2f86e1e 100644 --- a/vasl_templates/webapp/tests/test_turn_track.py +++ b/vasl_templates/webapp/tests/test_turn_track.py @@ -7,7 +7,7 @@ from selenium.webdriver.support.ui import Select from selenium.webdriver.common.keys import Keys from vasl_templates.webapp.tests.utils import \ - init_webapp, get_turn_track_nturns, set_turn_track_nturns, select_droplist_val, get_droplist_vals, \ + init_webapp, refresh_webapp, get_turn_track_nturns, set_turn_track_nturns, select_droplist_val, get_droplist_vals, \ SwitchFrame, unload_table, wait_for, wait_for_elem, wait_for_clipboard, find_child from vasl_templates.webapp.tests.test_scenario_persistence import load_scenario, save_scenario @@ -229,7 +229,7 @@ def test_turn_track_persistence( webapp, webdriver ): assert _generate_turn_track_snippet( None ) == expected # reset the scenario - webdriver.refresh() + refresh_webapp() assert not find_child( "button.generate[data-id='turn_track']" ).is_displayed() # load the scenario and generate the snippet @@ -276,7 +276,7 @@ def test_turn_track_droplist( webapp, webdriver ): # save and reload the scenario find_child( ".ui-dialog.turn-track" ).send_keys( Keys.ESCAPE ) saved_scenario = save_scenario() - webdriver.refresh() + refresh_webapp() load_scenario( saved_scenario ) assert _unload_turn_track_droplist() == expected diff --git a/vasl_templates/webapp/tests/utils.py b/vasl_templates/webapp/tests/utils.py index f06729f..168651f 100644 --- a/vasl_templates/webapp/tests/utils.py +++ b/vasl_templates/webapp/tests/utils.py @@ -72,7 +72,10 @@ def init_webapp( webapp, webdriver, **options ): # reset the user settings webdriver.delete_all_cookies() -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +def refresh_webapp(): + """Refresh the webapp.""" + _webdriver.refresh() + _wait_for_webapp() def _wait_for_webapp(): """Wait for the webapp to finish initialization."""