From a11b917aed17913347969deab15702a9b838556e Mon Sep 17 00:00:00 2001 From: Jason Antman Date: Tue, 28 Mar 2017 14:21:07 -0400 Subject: [PATCH] issue #22 - updates for failing and timing out acceptance tests on Travis --- biweeklybudget/flaskapp/static/js/budgets.js | 4 +++- biweeklybudget/tests/conftest.py | 4 ++++ pytest.ini | 4 ++++ tox.ini | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/biweeklybudget/flaskapp/static/js/budgets.js b/biweeklybudget/flaskapp/static/js/budgets.js index 9cd9b22a..e9c994f5 100644 --- a/biweeklybudget/flaskapp/static/js/budgets.js +++ b/biweeklybudget/flaskapp/static/js/budgets.js @@ -54,7 +54,7 @@ function modalDivHandleType() { function modalDivForm() { var frm = '
'; // name - frm += '
'; + frm += '
\n'; // type frm += '
'; // description @@ -83,8 +83,10 @@ function modalDivFillAndShow(msg) { $('#modalLabel').text('Edit Budget ' + msg['id']); $('#budget_frm_name').val(msg['name']); if(msg['is_periodic'] === true) { + $('#budget_frm_type_standing').prop('checked', false); $('#budget_frm_type_periodic').prop('checked', true); } else { + $('#budget_frm_type_periodic').prop('checked', false); $('#budget_frm_type_standing').prop('checked', true); } modalDivHandleType(); diff --git a/biweeklybudget/tests/conftest.py b/biweeklybudget/tests/conftest.py index cff104e4..57a04853 100644 --- a/biweeklybudget/tests/conftest.py +++ b/biweeklybudget/tests/conftest.py @@ -161,4 +161,8 @@ def selenium(selenium): """ selenium.set_window_size(1200, 800) selenium.implicitly_wait(2) + # from http://stackoverflow.com/a/13853684/211734 + selenium.set_script_timeout(60) + # from http://stackoverflow.com/a/17536547/211734 + selenium.set_page_load_timeout(60) return selenium diff --git a/pytest.ini b/pytest.ini index 70a526d5..4ca6ff72 100644 --- a/pytest.ini +++ b/pytest.ini @@ -11,3 +11,7 @@ markers = integration: tests that connect to an actual database acceptance: tests that use the real Flask app over HTTP sensitive_url = example\.com +# timeout tests after 2 minutes +timeout = 360 +# use signal method to try to keep test session running +timeout_method = signal diff --git a/tox.ini b/tox.ini index 0d219621..98f4288b 100644 --- a/tox.ini +++ b/tox.ini @@ -17,6 +17,7 @@ deps = mock freezegun pytest-blockage + pytest-timeout passenv=CI TRAVIS* CONTINUOUS_INTEGRATION AWS* NO_REFRESH_DB DB_CONNSTRING setenv = @@ -97,6 +98,7 @@ deps = freezegun pytest-flask pytest-selenium + pytest-timeout passenv = {[testenv]passenv} setenv = {[testenv]setenv} basepython = python2.7