From 9b22ceb9f8f7e7cbc5d5df9cdc8eb5c2646967ed Mon Sep 17 00:00:00 2001 From: Ben Patterson Date: Tue, 29 Jul 2014 08:05:35 -0400 Subject: [PATCH 1/2] Fix false positive test in cms acceptance This test was passing in Jenkins, but failing in our Solano runs (and locally on firefox). This is because it was attaching a file that was not there. This change fixes the test and makes the attachment method smarter so it will fail if it tries attaching a non-existent file. --- cms/djangoapps/contentstore/features/common.py | 1 + cms/djangoapps/contentstore/features/course-settings.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cms/djangoapps/contentstore/features/common.py b/cms/djangoapps/contentstore/features/common.py index 12924fba22..0370504de3 100644 --- a/cms/djangoapps/contentstore/features/common.py +++ b/cms/djangoapps/contentstore/features/common.py @@ -345,6 +345,7 @@ def get_codemirror_value(index=0, find_prefix="$"): def attach_file(filename, sub_path): path = os.path.join(TEST_ROOT, sub_path, filename) world.browser.execute_script("$('input.file-input').css('display', 'block')") + assert_true(os.path.exists(path)) world.browser.attach_file('file', os.path.abspath(path)) diff --git a/cms/djangoapps/contentstore/features/course-settings.py b/cms/djangoapps/contentstore/features/course-settings.py index e74237319c..07335460c1 100644 --- a/cms/djangoapps/contentstore/features/course-settings.py +++ b/cms/djangoapps/contentstore/features/course-settings.py @@ -141,7 +141,7 @@ def click_upload_button(_step): @step('I upload a new course image$') def upload_new_course_image(_step): - upload_file('image.jpg') + upload_file('image.jpg', sub_path="uploads") @step('I should see the new course image$') From 47b8d0722052a66c2282038b5586b00b06c8d149 Mon Sep 17 00:00:00 2001 From: Ben Patterson Date: Tue, 29 Jul 2014 09:27:19 -0400 Subject: [PATCH 2/2] Add test file used for format validation. --- common/test/data/uploads/uk_transcripts.sjson | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 common/test/data/uploads/uk_transcripts.sjson diff --git a/common/test/data/uploads/uk_transcripts.sjson b/common/test/data/uploads/uk_transcripts.sjson new file mode 100644 index 0000000000..a1b317c169 --- /dev/null +++ b/common/test/data/uploads/uk_transcripts.sjson @@ -0,0 +1,4 @@ +0 +00:00:00,100 --> 00:00:02,000 +Привіт, edX вітає вас. +