Commit 3789d962 by Eric Fischer Committed by GitHub

Merge pull request #1003 from edx/efischer/fix_tests

Fix file upload tests
parents cffda376 83a5da46
......@@ -178,7 +178,7 @@ class SubmissionPage(OpenAssessmentPage):
Returns:
bool
"""
return self.q(css="button.file__upload").attrs('disabled') == ['false']
return self.q(css="button.file__upload")[0].is_enabled()
@property
def upload_file_button_is_disabled(self):
......
......@@ -741,18 +741,12 @@ class FileUploadTest(OpenAssessmentTest):
self.assertTrue(self.submission_page.has_file_error)
# trying to upload a acceptable file
readme1 = os.path.dirname(os.path.realpath(__file__)) + '/README.rst'
readme2 = readme1.replace('test/acceptance/', '') # There's another README located at ../../
files = ', '.join([readme1, readme2])
self.submission_page.visit().select_file(files)
readme = os.path.dirname(os.path.realpath(__file__)) + '/README.rst'
self.submission_page.visit().select_file(readme)
self.assertFalse(self.submission_page.has_file_error)
self.assertTrue(self.submission_page.upload_file_button_is_disabled)
self.submission_page.add_file_description(0, 'file description 1')
self.assertTrue(self.submission_page.upload_file_button_is_disabled)
self.submission_page.add_file_description(1, 'file description 2')
self.assertTrue(self.submission_page.upload_file_button_is_enabled)
self.submission_page.upload_file()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment