diff --git a/cms/envs/jasmine.py b/cms/envs/jasmine.py deleted file mode 100644 index a4b8292d71..0000000000 --- a/cms/envs/jasmine.py +++ /dev/null @@ -1,53 +0,0 @@ -""" -This configuration is used for running jasmine tests -""" - -# We intentionally define lots of variables that aren't used, and -# want to import all variables from base settings files -# pylint: disable=W0401, W0614 - -from .test import * -from logsettings import get_logger_config - -ENABLE_JASMINE = True -DEBUG = True - -LOGGING = get_logger_config(TEST_ROOT / "log", - logging_env="dev", - tracking_filename="tracking.log", - dev_env=True, - debug=True, - local_loglevel='ERROR', - console_loglevel='ERROR') - -PIPELINE_JS['js-test-source'] = { - 'source_filenames': sum([ - pipeline_group['source_filenames'] - for group_name, pipeline_group - in sorted(PIPELINE_JS.items(), key=lambda item: item[1].get('test_order', 1e100)) - if group_name != 'spec' - ], []), - 'output_filename': 'js/cms-test-source.js' -} - -PIPELINE_JS['spec'] = { - 'source_filenames': sorted(rooted_glob(PROJECT_ROOT / 'static/', 'coffee/spec/**/*.js')), - 'output_filename': 'js/cms-spec.js' -} - -JASMINE_TEST_DIRECTORY = PROJECT_ROOT + '/static/coffee' -JASMINE_REPORT_DIR = os.environ.get('JASMINE_REPORT_DIR', 'reports/cms/jasmine') - -TEMPLATE_CONTEXT_PROCESSORS += ('settings_context_processor.context_processors.settings',) -TEMPLATE_VISIBLE_SETTINGS = ('JASMINE_REPORT_DIR', ) - -STATICFILES_DIRS.append(REPO_ROOT/'node_modules/phantom-jasmine/lib') -STATICFILES_DIRS.append(REPO_ROOT/'node_modules/jasmine-reporters/src') - -# Remove the localization middleware class because it requires the test database -# to be sync'd and migrated in order to run the jasmine tests interactively -# with a browser -MIDDLEWARE_CLASSES = tuple(e for e in MIDDLEWARE_CLASSES \ - if e != 'django.middleware.locale.LocaleMiddleware') - -INSTALLED_APPS += ('django_jasmine', 'settings_context_processor') diff --git a/cms/static/coffee/files.json b/cms/static/coffee/files.json deleted file mode 100644 index 3964bee455..0000000000 --- a/cms/static/coffee/files.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "static_files": [ - "../jsi18n/", - "js/vendor/RequireJS.js", - "js/vendor/jquery.min.js", - "js/vendor/jquery-ui.min.js", - "js/vendor/jquery.ui.draggable.js", - "js/vendor/jquery.cookie.js", - "js/vendor/json2.js", - "js/vendor/underscore-min.js", - "js/vendor/underscore.string.min.js", - "js/vendor/backbone-min.js", - "js/vendor/backbone-associations-min.js", - "js/vendor/jquery.leanModal.min.js", - "js/vendor/jquery.form.js", - "js/vendor/sinon-1.7.1.js", - "js/vendor/jasmine-stealth.js", - "js/test/i18n.js" - ] -} diff --git a/cms/static/coffee/spec/helpers.coffee b/cms/static/coffee/spec/helpers.coffee index 116983edf5..a03e2a0e56 100644 --- a/cms/static/coffee/spec/helpers.coffee +++ b/cms/static/coffee/spec/helpers.coffee @@ -1,4 +1,4 @@ -jasmine.getFixtures().fixturesPath = 'fixtures' +jasmine.getFixtures().fixturesPath += 'coffee/fixtures' # Stub jQuery.cookie @stubCookies = diff --git a/cms/static/js_test.yml b/cms/static/js_test.yml new file mode 100644 index 0000000000..cc4ee97d49 --- /dev/null +++ b/cms/static/js_test.yml @@ -0,0 +1,96 @@ +--- +# JavaScript test suite description +# +# +# To run all the tests and print results to the console: +# +# js-test-tool run TEST_SUITE --use-firefox +# +# where `TEST_SUITE` is this file. +# +# +# To run the tests in your default browser ("dev mode"): +# +# js-test-tool dev TEST_SUITE +# + +test_suite_name: cms + +test_runner: jasmine + +# Path prepended to source files in the coverage report (optional) +# For example, if the source path +# is "src/source.js" (relative to this YAML file) +# and the prepend path is "base/dir" +# then the coverage report will show +# "base/dir/src/source.js" +prepend_path: cms/static + +# Paths to library JavaScript files (optional) +lib_paths: + - xmodule_js/common_static/coffee/src/ajax_prefix.js + - xmodule_js/common_static/coffee/src/logger.js + - xmodule_js/common_static/js/vendor/RequireJS.js + - xmodule_js/common_static/js/vendor/json2.js + - xmodule_js/common_static/js/vendor/jquery.min.js + - xmodule_js/common_static/js/vendor/jquery-ui.min.js + - xmodule_js/common_static/js/vendor/jquery.cookie.js + - xmodule_js/common_static/js/vendor/jquery.qtip.min.js + - xmodule_js/common_static/js/vendor/swfobject/swfobject.js + - xmodule_js/common_static/js/vendor/jquery.ba-bbq.min.js + - xmodule_js/common_static/js/vendor/annotator.min.js + - xmodule_js/common_static/js/vendor/annotator.store.min.js + - xmodule_js/common_static/js/vendor/annotator.tags.min.js + - xmodule_js/common_static/js/vendor/underscore-min.js + - xmodule_js/common_static/js/vendor/underscore.string.min.js + - xmodule_js/common_static/js/vendor/backbone-min.js + - xmodule_js/common_static/js/vendor/backbone-associations-min.js + - xmodule_js/common_static/js/vendor/timepicker/jquery.timepicker.js + - xmodule_js/common_static/js/vendor/jquery.leanModal.min.js + - xmodule_js/common_static/js/vendor/jquery.form.js + - xmodule_js/common_static/js/vendor/sinon-1.7.1.js + - xmodule_js/common_static/js/vendor/jasmine-jquery.js + - xmodule_js/common_static/js/vendor/jasmine-stealth.js + - xmodule_js/src/xmodule.js + - xmodule_js/src + - xmodule_js/common_static/js/test/add_ajax_prefix.js + +# Paths to source JavaScript files +src_paths: + - coffee/src + - js + +# Paths to spec (test) JavaScript files +spec_paths: + - coffee/spec/helpers.js + - coffee/spec + +# Paths to fixture files (optional) +# The fixture path will be set automatically when using jasmine-jquery. +# (https://github.com/velesin/jasmine-jquery) +# +# You can then access fixtures using paths relative to +# the test suite description: +# +# loadFixtures('path/to/fixture/fixture.html'); +# +fixture_paths: + - coffee/fixtures + +# Regular expressions used to exclude *.js files from +# appearing in the test runner page. +# Files are included by default, which means that they +# are loaded using a